diff options
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Shader/Cache/Definition/HostShaderCacheEntryHeader.cs')
| -rw-r--r-- | Ryujinx.Graphics.Gpu/Shader/Cache/Definition/HostShaderCacheEntryHeader.cs | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/Ryujinx.Graphics.Gpu/Shader/Cache/Definition/HostShaderCacheEntryHeader.cs b/Ryujinx.Graphics.Gpu/Shader/Cache/Definition/HostShaderCacheEntryHeader.cs index 7f27124f..4b8b15bc 100644 --- a/Ryujinx.Graphics.Gpu/Shader/Cache/Definition/HostShaderCacheEntryHeader.cs +++ b/Ryujinx.Graphics.Gpu/Shader/Cache/Definition/HostShaderCacheEntryHeader.cs @@ -1,9 +1,29 @@ using System.Runtime.InteropServices; -using Ryujinx.Graphics.Shader; namespace Ryujinx.Graphics.Gpu.Shader.Cache.Definition { /// <summary> + /// Flags indicating if the shader accesses certain built-ins, such as the instance ID. + /// </summary> + enum UseFlags : byte + { + /// <summary> + /// None of the built-ins are used. + /// </summary> + None = 0, + + /// <summary> + /// Indicates whenever the vertex shader reads the gl_InstanceID built-in. + /// </summary> + InstanceId = 1 << 0, + + /// <summary> + /// Indicates whenever any of the VTG stages writes to the gl_Layer built-in. + /// </summary> + RtLayer = 1 << 1 + } + + /// <summary> /// Host shader entry header used for binding information. /// </summary> [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 0x14)] @@ -30,10 +50,9 @@ namespace Ryujinx.Graphics.Gpu.Shader.Cache.Definition public int ImagesCount; /// <summary> - /// Set to true if the shader uses instance id. + /// Flags indicating if the shader accesses certain built-ins, such as the instance ID. /// </summary> - [MarshalAs(UnmanagedType.I1)] - public bool UsesInstanceId; + public UseFlags UseFlags; /// <summary> /// Set to true if this entry is in use. @@ -65,15 +84,22 @@ namespace Ryujinx.Graphics.Gpu.Shader.Cache.Definition int texturesCount, int imagesCount, bool usesInstanceId, + bool usesRtLayer, byte clipDistancesWritten) : this() { CBuffersCount = cBuffersCount; SBuffersCount = sBuffersCount; TexturesCount = texturesCount; ImagesCount = imagesCount; - UsesInstanceId = usesInstanceId; ClipDistancesWritten = clipDistancesWritten; InUse = true; + + UseFlags = usesInstanceId ? UseFlags.InstanceId : UseFlags.None; + + if (usesRtLayer) + { + UseFlags |= UseFlags.RtLayer; + } } } } |
