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
This commit is contained in:
gdkchan 2022-03-06 16:42:13 -03:00 committed by GitHub
parent b97ff4da5e
commit 0bcbe32367
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 104 additions and 14 deletions

View file

@ -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);
}
}