|
@@ -104,12 +104,23 @@ namespace Ryujinx.Graphics.Shader.Instructions
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // TODO: Figure out how this is supposed to work in the
|
|
|
|
|
- // presence of other condition codes.
|
|
|
|
|
if (op.Ccc == Ccc.T)
|
|
if (op.Ccc == Ccc.T)
|
|
|
{
|
|
{
|
|
|
context.Return();
|
|
context.Return();
|
|
|
}
|
|
}
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ Operand cond = GetCondition(context, op.Ccc, IrConsts.False);
|
|
|
|
|
+
|
|
|
|
|
+ // If the condition is always false, we don't need to do anything.
|
|
|
|
|
+ if (cond.Type != OperandType.Constant || cond.Value != IrConsts.False)
|
|
|
|
|
+ {
|
|
|
|
|
+ Operand lblSkip = Label();
|
|
|
|
|
+ context.BranchIfFalse(lblSkip, cond);
|
|
|
|
|
+ context.Return();
|
|
|
|
|
+ context.MarkLabel(lblSkip);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static void Kil(EmitterContext context)
|
|
public static void Kil(EmitterContext context)
|
|
@@ -250,7 +261,7 @@ namespace Ryujinx.Graphics.Shader.Instructions
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private static Operand GetCondition(EmitterContext context, Ccc cond)
|
|
|
|
|
|
|
+ private static Operand GetCondition(EmitterContext context, Ccc cond, int defaultCond = IrConsts.True)
|
|
|
{
|
|
{
|
|
|
// TODO: More condition codes, figure out how they work.
|
|
// TODO: More condition codes, figure out how they work.
|
|
|
switch (cond)
|
|
switch (cond)
|
|
@@ -263,7 +274,7 @@ namespace Ryujinx.Graphics.Shader.Instructions
|
|
|
return context.BitwiseNot(GetZF());
|
|
return context.BitwiseNot(GetZF());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return Const(IrConsts.True);
|
|
|
|
|
|
|
+ return Const(defaultCond);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|