mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-11-14 05:26:41 +00:00
Fix shader LOP3 predicate write condition (#1910)
* Fix LOP3 predicate write condition * Bump shader cache version
This commit is contained in:
parent
996e6905ba
commit
5be6ec6364
3 changed files with 7 additions and 11 deletions
|
@ -34,7 +34,7 @@ namespace Ryujinx.Graphics.Gpu.Shader
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Version of the codegen (to be changed when codegen or guest format change).
|
/// Version of the codegen (to be changed when codegen or guest format change).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private const ulong ShaderCodeGenVersion = 1901;
|
private const ulong ShaderCodeGenVersion = 1910;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new instance of the shader cache.
|
/// Creates a new instance of the shader cache.
|
||||||
|
|
|
@ -9,8 +9,6 @@ namespace Ryujinx.Graphics.Shader.Decoders
|
||||||
|
|
||||||
public LogicalOperation LogicalOp { get; }
|
public LogicalOperation LogicalOp { get; }
|
||||||
|
|
||||||
public ConditionalOperation CondOp { get; }
|
|
||||||
|
|
||||||
public Register Predicate48 { get; }
|
public Register Predicate48 { get; }
|
||||||
|
|
||||||
public new static OpCode Create(InstEmitter emitter, ulong address, long opCode) => new OpCodeLop(emitter, address, opCode);
|
public new static OpCode Create(InstEmitter emitter, ulong address, long opCode) => new OpCodeLop(emitter, address, opCode);
|
||||||
|
@ -22,8 +20,6 @@ namespace Ryujinx.Graphics.Shader.Decoders
|
||||||
|
|
||||||
LogicalOp = (LogicalOperation)opCode.Extract(41, 2);
|
LogicalOp = (LogicalOperation)opCode.Extract(41, 2);
|
||||||
|
|
||||||
CondOp = (ConditionalOperation)opCode.Extract(44, 2);
|
|
||||||
|
|
||||||
Predicate48 = new Register(opCode.Extract(48, 3), RegisterType.Predicate);
|
Predicate48 = new Register(opCode.Extract(48, 3), RegisterType.Predicate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -459,7 +459,7 @@ namespace Ryujinx.Graphics.Shader.Instructions
|
||||||
case LogicalOperation.ExclusiveOr: res = context.BitwiseExclusiveOr(srcA, srcB); break;
|
case LogicalOperation.ExclusiveOr: res = context.BitwiseExclusiveOr(srcA, srcB); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
EmitLopPredWrite(context, op, res);
|
EmitLopPredWrite(context, op, res, (ConditionalOperation)context.CurrOp.RawOpCode.Extract(44, 2));
|
||||||
|
|
||||||
Operand dest = GetDest(context);
|
Operand dest = GetDest(context);
|
||||||
|
|
||||||
|
@ -486,7 +486,7 @@ namespace Ryujinx.Graphics.Shader.Instructions
|
||||||
|
|
||||||
if (regVariant)
|
if (regVariant)
|
||||||
{
|
{
|
||||||
EmitLopPredWrite(context, op, res);
|
EmitLopPredWrite(context, op, res, (ConditionalOperation)context.CurrOp.RawOpCode.Extract(36, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
Operand dest = GetDest(context);
|
Operand dest = GetDest(context);
|
||||||
|
@ -917,21 +917,21 @@ namespace Ryujinx.Graphics.Shader.Instructions
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void EmitLopPredWrite(EmitterContext context, IOpCodeLop op, Operand result)
|
private static void EmitLopPredWrite(EmitterContext context, IOpCodeLop op, Operand result, ConditionalOperation condOp)
|
||||||
{
|
{
|
||||||
if (op is OpCodeLop opLop && !opLop.Predicate48.IsPT)
|
if (op is OpCodeLop opLop && !opLop.Predicate48.IsPT)
|
||||||
{
|
{
|
||||||
Operand pRes;
|
Operand pRes;
|
||||||
|
|
||||||
if (opLop.CondOp == ConditionalOperation.False)
|
if (condOp == ConditionalOperation.False)
|
||||||
{
|
{
|
||||||
pRes = Const(IrConsts.False);
|
pRes = Const(IrConsts.False);
|
||||||
}
|
}
|
||||||
else if (opLop.CondOp == ConditionalOperation.True)
|
else if (condOp == ConditionalOperation.True)
|
||||||
{
|
{
|
||||||
pRes = Const(IrConsts.True);
|
pRes = Const(IrConsts.True);
|
||||||
}
|
}
|
||||||
else if (opLop.CondOp == ConditionalOperation.Zero)
|
else if (condOp == ConditionalOperation.Zero)
|
||||||
{
|
{
|
||||||
pRes = context.ICompareEqual(result, Const(0));
|
pRes = context.ICompareEqual(result, Const(0));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue