diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2021-08-11 17:27:00 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-11 22:27:00 +0200 |
| commit | ed754af8d5046d2fd7218c742521e38ab17cbcfe (patch) | |
| tree | d47eda40349a7b4b3fc34d9db9ddeea8f2d0676a /Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs | |
| parent | 10d649e6d3ad3e4af32d2b41e718bb0a2924da67 (diff) | |
Make sure attributes used on subsequent shader stages are initialized (#2538)
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); |
