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
|
||||
{
|
||||
public static void FoldOperation(Operation operation)
|
||||
public static void Fold(Operation operation)
|
||||
{
|
||||
if (!AreAllSourcesConstant(operation))
|
||||
{
|
||||
|
@ -89,6 +89,10 @@ namespace Ryujinx.Graphics.Shader.Translation.Optimizations
|
|||
EvaluateBinary(operation, (x, y) => (uint)x < (uint)y);
|
||||
break;
|
||||
|
||||
case Instruction.CompareNotEqual:
|
||||
EvaluateBinary(operation, (x, y) => x != y);
|
||||
break;
|
||||
|
||||
case Instruction.Divide:
|
||||
EvaluateBinary(operation, (x, y) => y != 0 ? x / y : 0);
|
||||
break;
|
||||
|
@ -121,6 +125,10 @@ namespace Ryujinx.Graphics.Shader.Translation.Optimizations
|
|||
EvaluateFPBinary(operation, (x, y) => x <= y);
|
||||
break;
|
||||
|
||||
case Instruction.FP | Instruction.CompareNotEqual:
|
||||
EvaluateFPBinary(operation, (x, y) => x != y);
|
||||
break;
|
||||
|
||||
case Instruction.FP | Instruction.Divide:
|
||||
EvaluateFPBinary(operation, (x, y) => x / y);
|
||||
break;
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace Ryujinx.Graphics.Shader.Translation.Optimizations
|
|||
continue;
|
||||
}
|
||||
|
||||
ConstantFolding.FoldOperation(operation);
|
||||
ConstantFolding.Fold(operation);
|
||||
|
||||
Simplification.Simplify(operation);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue