diff options
author | gdkchan <gab.dark.100@gmail.com> | 2022-12-08 14:08:07 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-08 14:08:07 -0300 |
commit | 8428bb6541d300d82522fd19c2ef3e6f2ba52ece (patch) | |
tree | 35dbb4f92c572601a28281d08e8de8858360a609 /Ryujinx.Graphics.Shader/CodeGen/Spirv/Instructions.cs | |
parent | 9a0330f7f8d6c45de3b88afbe3e86e5fa3878e8e (diff) |
Fix shader FSWZADD instruction (#4069)1.1.451
* Fix shader FSWZADD instruction
* Shader cache version bump
Diffstat (limited to 'Ryujinx.Graphics.Shader/CodeGen/Spirv/Instructions.cs')
-rw-r--r-- | Ryujinx.Graphics.Shader/CodeGen/Spirv/Instructions.cs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Ryujinx.Graphics.Shader/CodeGen/Spirv/Instructions.cs b/Ryujinx.Graphics.Shader/CodeGen/Spirv/Instructions.cs index d4a3102e..ae280377 100644 --- a/Ryujinx.Graphics.Shader/CodeGen/Spirv/Instructions.cs +++ b/Ryujinx.Graphics.Shader/CodeGen/Spirv/Instructions.cs @@ -1449,10 +1449,13 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv var xLut = context.ConstantComposite(v4float, one, minusOne, one, zero); var yLut = context.ConstantComposite(v4float, one, one, minusOne, one); + var three = context.Constant(context.TypeU32(), 3); + var threadId = context.GetAttribute(AggregateType.U32, AttributeConsts.LaneId, false); - var shift = context.BitwiseAnd(context.TypeU32(), threadId, context.Constant(context.TypeU32(), 3)); + var shift = context.BitwiseAnd(context.TypeU32(), threadId, three); shift = context.ShiftLeftLogical(context.TypeU32(), shift, context.Constant(context.TypeU32(), 1)); var lutIdx = context.ShiftRightLogical(context.TypeU32(), mask, shift); + lutIdx = context.BitwiseAnd(context.TypeU32(), lutIdx, three); var xLutValue = context.VectorExtractDynamic(context.TypeFP32(), xLut, lutIdx); var yLutValue = context.VectorExtractDynamic(context.TypeFP32(), yLut, lutIdx); |