aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader/Translation/Translator.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2021-11-08 13:18:46 -0300
committerGitHub <noreply@github.com>2021-11-08 13:18:46 -0300
commit911ea38e939459c652c6e27a28599340a61267dc (patch)
treee0e22a504b67f51625a7c23dd8157bada6841f77 /Ryujinx.Graphics.Shader/Translation/Translator.cs
parent3dee712164e635fd3a0d2e9d359a7d11a80bf675 (diff)
Support shader gl_Color, gl_SecondaryColor and gl_TexCoord built-ins (#2817)
* Support shader gl_Color, gl_SecondaryColor and gl_TexCoord built-ins * Shader cache version bump * Fix back color value on fragment shader * Disable IPA multiplication for fixed function attributes and back color selection
Diffstat (limited to 'Ryujinx.Graphics.Shader/Translation/Translator.cs')
-rw-r--r--Ryujinx.Graphics.Shader/Translation/Translator.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Shader/Translation/Translator.cs b/Ryujinx.Graphics.Shader/Translation/Translator.cs
index a658697b..cef25350 100644
--- a/Ryujinx.Graphics.Shader/Translation/Translator.cs
+++ b/Ryujinx.Graphics.Shader/Translation/Translator.cs
@@ -232,6 +232,22 @@ namespace Ryujinx.Graphics.Shader.Translation
usedAttributesPerPatch &= ~(1 << index);
}
+
+ if (config.NextUsesFixedFuncAttributes)
+ {
+ for (int i = 0; i < 4 + AttributeConsts.TexCoordCount; i++)
+ {
+ int index = config.GetFreeUserAttribute(isOutput: true, i);
+ if (index < 0)
+ {
+ break;
+ }
+
+ InitializeOutput(context, AttributeConsts.UserAttributeBase + index * 16, perPatch: false);
+
+ config.SetOutputUserAttributeFixedFunc(index);
+ }
+ }
}
private static void InitializeOutput(EmitterContext context, int baseAttr, bool perPatch)