Some leftovers from constant folding
This commit is contained in:
parent
af82b1214e
commit
17a777fbae
2 changed files with 10 additions and 2 deletions
|
@ -8,7 +8,7 @@ namespace Ryujinx.Graphics.Shader.Translation.Optimizations
|
||||||
{
|
{
|
||||||
static class ConstantFolding
|
static class ConstantFolding
|
||||||
{
|
{
|
||||||
public static void FoldOperation(Operation operation)
|
public static void Fold(Operation operation)
|
||||||
{
|
{
|
||||||
if (!AreAllSourcesConstant(operation))
|
if (!AreAllSourcesConstant(operation))
|
||||||
{
|
{
|
||||||
|
@ -89,6 +89,10 @@ namespace Ryujinx.Graphics.Shader.Translation.Optimizations
|
||||||
EvaluateBinary(operation, (x, y) => (uint)x < (uint)y);
|
EvaluateBinary(operation, (x, y) => (uint)x < (uint)y);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case Instruction.CompareNotEqual:
|
||||||
|
EvaluateBinary(operation, (x, y) => x != y);
|
||||||
|
break;
|
||||||
|
|
||||||
case Instruction.Divide:
|
case Instruction.Divide:
|
||||||
EvaluateBinary(operation, (x, y) => y != 0 ? x / y : 0);
|
EvaluateBinary(operation, (x, y) => y != 0 ? x / y : 0);
|
||||||
break;
|
break;
|
||||||
|
@ -121,6 +125,10 @@ namespace Ryujinx.Graphics.Shader.Translation.Optimizations
|
||||||
EvaluateFPBinary(operation, (x, y) => x <= y);
|
EvaluateFPBinary(operation, (x, y) => x <= y);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case Instruction.FP | Instruction.CompareNotEqual:
|
||||||
|
EvaluateFPBinary(operation, (x, y) => x != y);
|
||||||
|
break;
|
||||||
|
|
||||||
case Instruction.FP | Instruction.Divide:
|
case Instruction.FP | Instruction.Divide:
|
||||||
EvaluateFPBinary(operation, (x, y) => x / y);
|
EvaluateFPBinary(operation, (x, y) => x / y);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -39,7 +39,7 @@ namespace Ryujinx.Graphics.Shader.Translation.Optimizations
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
ConstantFolding.FoldOperation(operation);
|
ConstantFolding.Fold(operation);
|
||||||
|
|
||||||
Simplification.Simplify(operation);
|
Simplification.Simplify(operation);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue