Fix negation of HADD2 constant buffer source (#1116)

This commit is contained in:
gdkchan 2020-04-14 20:01:26 -03:00 committed by GitHub
parent ad3d2fb5a9
commit 92cc37e365
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -203,7 +203,7 @@ namespace Ryujinx.Graphics.Shader.Instructions
bool saturate = op.RawOpCode.Extract(op is IOpCodeReg ? 32 : 52);
Operand[] srcA = GetHalfSrcA(context, isAdd);
Operand[] srcB = GetHalfSrcB(context);
Operand[] srcB = GetHalfSrcB(context, !isAdd);
Operand[] res = new Operand[2];

View File

@ -173,7 +173,7 @@ namespace Ryujinx.Graphics.Shader.Instructions
return FPAbsNeg(context, operands, absoluteA, negateA);
}
public static Operand[] GetHalfSrcB(EmitterContext context)
public static Operand[] GetHalfSrcB(EmitterContext context, bool isMul = false)
{
OpCode op = context.CurrOp;
@ -193,6 +193,11 @@ namespace Ryujinx.Graphics.Shader.Instructions
swizzle = FPHalfSwizzle.FP32;
absoluteB = op.RawOpCode.Extract(54);
if (!isMul)
{
negateB = op.RawOpCode.Extract(56);
}
}
Operand[] operands = GetHalfUnpacked(context, GetSrcB(context), swizzle);