From 9c2500de5ffa76d74e1761be9e6a1e50b36af7c5 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Sat, 1 Oct 2022 02:35:52 -0300 Subject: Fix incorrect tessellation inputs/outputs (#3728) * Fix incorrect tessellation inputs/outputs * Shader cache version bump --- Ryujinx.Graphics.Shader/Instructions/InstEmitAttribute.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Ryujinx.Graphics.Shader/Instructions') diff --git a/Ryujinx.Graphics.Shader/Instructions/InstEmitAttribute.cs b/Ryujinx.Graphics.Shader/Instructions/InstEmitAttribute.cs index 6ce2e537..7edf5deb 100644 --- a/Ryujinx.Graphics.Shader/Instructions/InstEmitAttribute.cs +++ b/Ryujinx.Graphics.Shader/Instructions/InstEmitAttribute.cs @@ -46,7 +46,7 @@ namespace Ryujinx.Graphics.Shader.Instructions context.FlagAttributeRead(offset); - if (op.O) + if (op.O && CanLoadOutput(offset)) { offset |= AttributeConsts.LoadOutputMask; } @@ -61,7 +61,7 @@ namespace Ryujinx.Graphics.Shader.Instructions context.FlagAttributeRead(offset); - if (op.O) + if (op.O && CanLoadOutput(offset)) { offset |= AttributeConsts.LoadOutputMask; } @@ -241,6 +241,11 @@ namespace Ryujinx.Graphics.Shader.Instructions } } + private static bool CanLoadOutput(int attr) + { + return attr != AttributeConsts.TessCoordX && attr != AttributeConsts.TessCoordY; + } + private static bool TryFixedFuncToUserAttributeIpa(EmitterContext context, int attr, out Operand selectedAttr) { if (attr >= AttributeConsts.FrontColorDiffuseR && attr < AttributeConsts.BackColorDiffuseR) -- cgit v1.2.3