forked from Mirror/Ryujinx
Fix negation of HADD2 constant buffer source (#1116)
This commit is contained in:
parent
ad3d2fb5a9
commit
92cc37e365
2 changed files with 7 additions and 2 deletions
|
@ -203,7 +203,7 @@ namespace Ryujinx.Graphics.Shader.Instructions
|
||||||
bool saturate = op.RawOpCode.Extract(op is IOpCodeReg ? 32 : 52);
|
bool saturate = op.RawOpCode.Extract(op is IOpCodeReg ? 32 : 52);
|
||||||
|
|
||||||
Operand[] srcA = GetHalfSrcA(context, isAdd);
|
Operand[] srcA = GetHalfSrcA(context, isAdd);
|
||||||
Operand[] srcB = GetHalfSrcB(context);
|
Operand[] srcB = GetHalfSrcB(context, !isAdd);
|
||||||
|
|
||||||
Operand[] res = new Operand[2];
|
Operand[] res = new Operand[2];
|
||||||
|
|
||||||
|
|
|
@ -173,7 +173,7 @@ namespace Ryujinx.Graphics.Shader.Instructions
|
||||||
return FPAbsNeg(context, operands, absoluteA, negateA);
|
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;
|
OpCode op = context.CurrOp;
|
||||||
|
|
||||||
|
@ -193,6 +193,11 @@ namespace Ryujinx.Graphics.Shader.Instructions
|
||||||
swizzle = FPHalfSwizzle.FP32;
|
swizzle = FPHalfSwizzle.FP32;
|
||||||
|
|
||||||
absoluteB = op.RawOpCode.Extract(54);
|
absoluteB = op.RawOpCode.Extract(54);
|
||||||
|
|
||||||
|
if (!isMul)
|
||||||
|
{
|
||||||
|
negateB = op.RawOpCode.Extract(56);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Operand[] operands = GetHalfUnpacked(context, GetSrcB(context), swizzle);
|
Operand[] operands = GetHalfUnpacked(context, GetSrcB(context), swizzle);
|
||||||
|
|
Loading…
Reference in a new issue