Fix shader FSWZADD instruction (#4069)

* Fix shader FSWZADD instruction

* Shader cache version bump
This commit is contained in:
gdkchan 2022-12-08 14:08:07 -03:00 committed by GitHub
parent 9a0330f7f8
commit 8428bb6541
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View file

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