diff options
Diffstat (limited to 'Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs')
-rw-r--r-- | Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs b/Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs index 3e7be582..c7704c2b 100644 --- a/Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs +++ b/Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs @@ -41,6 +41,10 @@ namespace Ryujinx.Graphics.Shader.Translation private readonly TranslationCounts _counts; + public int UsedInputAttributes { get; private set; } + public int UsedOutputAttributes { get; private set; } + public int PassthroughAttributes { get; private set; } + private int _usedConstantBuffers; private int _usedStorageBuffers; private int _usedStorageBuffersWrite; @@ -170,6 +174,8 @@ namespace Ryujinx.Graphics.Shader.Translation TextureHandlesForCache.UnionWith(other.TextureHandlesForCache); + UsedInputAttributes |= other.UsedInputAttributes; + UsedOutputAttributes |= other.UsedOutputAttributes; _usedConstantBuffers |= other._usedConstantBuffers; _usedStorageBuffers |= other._usedStorageBuffers; _usedStorageBuffersWrite |= other._usedStorageBuffersWrite; @@ -191,6 +197,28 @@ namespace Ryujinx.Graphics.Shader.Translation } } + public void SetInputUserAttribute(int index) + { + UsedInputAttributes |= 1 << index; + } + + public void SetOutputUserAttribute(int index) + { + UsedOutputAttributes |= 1 << index; + } + + public void MergeOutputUserAttributes(int mask) + { + if (GpPassthrough) + { + PassthroughAttributes = mask & ~UsedOutputAttributes; + } + else + { + UsedOutputAttributes |= mask; + } + } + public void SetClipDistanceWritten(int index) { ClipDistancesWritten |= (byte)(1 << index); |