aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader/Translation/Translator.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2022-03-14 19:35:41 -0300
committerGitHub <noreply@github.com>2022-03-14 19:35:41 -0300
commit1f93fd52d9878b98b75e69dfcf41360f3bc16fe0 (patch)
treed7810aa3cededff591c50eac9c30fa445b0dcc12 /Ryujinx.Graphics.Shader/Translation/Translator.cs
parentaac7bbd378418791823e338d8bc174856aabfae6 (diff)
Do not initialize geometry shader passthrough attributes (#3196)1.1.70
Diffstat (limited to 'Ryujinx.Graphics.Shader/Translation/Translator.cs')
-rw-r--r--Ryujinx.Graphics.Shader/Translation/Translator.cs11
1 files changed, 9 insertions, 2 deletions
diff --git a/Ryujinx.Graphics.Shader/Translation/Translator.cs b/Ryujinx.Graphics.Shader/Translation/Translator.cs
index e594c818..5119dfb6 100644
--- a/Ryujinx.Graphics.Shader/Translation/Translator.cs
+++ b/Ryujinx.Graphics.Shader/Translation/Translator.cs
@@ -218,10 +218,17 @@ namespace Ryujinx.Graphics.Shader.Translation
while (usedAttributes != UInt128.Zero)
{
int index = usedAttributes.TrailingZeroCount();
-
- InitializeOutputComponent(context, AttributeConsts.UserAttributeBase + index * 4, perPatch: false);
+ int vecIndex = index / 4;
usedAttributes &= ~UInt128.Pow2(index);
+
+ // We don't need to initialize passthrough attributes.
+ if ((context.Config.PassthroughAttributes & (1 << vecIndex)) != 0)
+ {
+ continue;
+ }
+
+ InitializeOutputComponent(context, AttributeConsts.UserAttributeBase + index * 4, perPatch: false);
}
UInt128 usedAttributesPerPatch = context.Config.NextInputAttributesPerPatchComponents;