From 0bcbe32367eeada2a5aa7e6bb2edccc22cababa3 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Sun, 6 Mar 2022 16:42:13 -0300 Subject: Only initialize shader outputs that are actually used on the next stage (#3054) * Only initialize shader outputs that are actually used on the next stage * Shader cache version bump --- Ryujinx.Graphics.Shader/Decoders/Decoder.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Ryujinx.Graphics.Shader/Decoders/Decoder.cs') diff --git a/Ryujinx.Graphics.Shader/Decoders/Decoder.cs b/Ryujinx.Graphics.Shader/Decoders/Decoder.cs index 8820527f..6fa4055a 100644 --- a/Ryujinx.Graphics.Shader/Decoders/Decoder.cs +++ b/Ryujinx.Graphics.Shader/Decoders/Decoder.cs @@ -308,7 +308,8 @@ namespace Ryujinx.Graphics.Shader.Decoders int attr = offset + elemIndex * 4; if (attr >= AttributeConsts.UserAttributeBase && attr < AttributeConsts.UserAttributeEnd) { - int index = (attr - AttributeConsts.UserAttributeBase) / 16; + int userAttr = attr - AttributeConsts.UserAttributeBase; + int index = userAttr / 16; if (isStore) { @@ -316,7 +317,7 @@ namespace Ryujinx.Graphics.Shader.Decoders } else { - config.SetInputUserAttribute(index, perPatch); + config.SetInputUserAttribute(index, (userAttr >> 2) & 3, perPatch); } } -- cgit v1.2.3