Fix incorrect tessellation inputs/outputs (#3728)

* Fix incorrect tessellation inputs/outputs

* Shader cache version bump
This commit is contained in:
gdkchan 2022-10-01 02:35:52 -03:00 committed by GitHub
parent dbe43c1719
commit 9c2500de5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 284 additions and 164 deletions

View file

@ -204,14 +204,12 @@ namespace Ryujinx.Graphics.Shader.Translation
InitializeOutputComponent(context, AttributeConsts.UserAttributeBase + index * 4, perPatch: false);
}
UInt128 usedAttributesPerPatch = context.Config.NextInputAttributesPerPatchComponents;
while (usedAttributesPerPatch != UInt128.Zero)
if (context.Config.NextUsedInputAttributesPerPatch != null)
{
int index = usedAttributesPerPatch.TrailingZeroCount();
InitializeOutputComponent(context, AttributeConsts.UserAttributeBase + index * 4, perPatch: true);
usedAttributesPerPatch &= ~UInt128.Pow2(index);
foreach (int vecIndex in context.Config.NextUsedInputAttributesPerPatch.OrderBy(x => x))
{
InitializeOutput(context, AttributeConsts.UserAttributePerPatchBase + vecIndex * 16, perPatch: true);
}
}
if (config.NextUsesFixedFuncAttributes)
@ -236,7 +234,7 @@ namespace Ryujinx.Graphics.Shader.Translation
for (int c = 0; c < 4; c++)
{
int attrOffset = baseAttr + c * 4;
context.Copy(perPatch ? AttributePerPatch(attrOffset) : Attribute(attrOffset), ConstF(c == 3 ? 1f : 0f));
InitializeOutputComponent(context, attrOffset, perPatch);
}
}