From dc97457bf0121b9383054ca14d3c525b56b92634 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Tue, 3 Mar 2020 11:02:08 -0300 Subject: Initial support for double precision shader instructions. (#963) * Implement DADD, DFMA and DMUL shader instructions * Rename FP to FP32 * Correct double immediate * Classic mistake --- .../Translation/Optimizations/ConstantFolding.cs | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'Ryujinx.Graphics.Shader/Translation/Optimizations') diff --git a/Ryujinx.Graphics.Shader/Translation/Optimizations/ConstantFolding.cs b/Ryujinx.Graphics.Shader/Translation/Optimizations/ConstantFolding.cs index b6958929..856a5598 100644 --- a/Ryujinx.Graphics.Shader/Translation/Optimizations/ConstantFolding.cs +++ b/Ryujinx.Graphics.Shader/Translation/Optimizations/ConstantFolding.cs @@ -101,51 +101,51 @@ namespace Ryujinx.Graphics.Shader.Translation.Optimizations EvaluateBinary(operation, (x, y) => y != 0 ? x / y : 0); break; - case Instruction.FP | Instruction.Add: + case Instruction.FP32 | Instruction.Add: EvaluateFPBinary(operation, (x, y) => x + y); break; - case Instruction.FP | Instruction.Clamp: + case Instruction.FP32 | Instruction.Clamp: EvaluateFPTernary(operation, (x, y, z) => Math.Clamp(x, y, z)); break; - case Instruction.FP | Instruction.CompareEqual: + case Instruction.FP32 | Instruction.CompareEqual: EvaluateFPBinary(operation, (x, y) => x == y); break; - case Instruction.FP | Instruction.CompareGreater: + case Instruction.FP32 | Instruction.CompareGreater: EvaluateFPBinary(operation, (x, y) => x > y); break; - case Instruction.FP | Instruction.CompareGreaterOrEqual: + case Instruction.FP32 | Instruction.CompareGreaterOrEqual: EvaluateFPBinary(operation, (x, y) => x >= y); break; - case Instruction.FP | Instruction.CompareLess: + case Instruction.FP32 | Instruction.CompareLess: EvaluateFPBinary(operation, (x, y) => x < y); break; - case Instruction.FP | Instruction.CompareLessOrEqual: + case Instruction.FP32 | Instruction.CompareLessOrEqual: EvaluateFPBinary(operation, (x, y) => x <= y); break; - case Instruction.FP | Instruction.CompareNotEqual: + case Instruction.FP32 | Instruction.CompareNotEqual: EvaluateFPBinary(operation, (x, y) => x != y); break; - case Instruction.FP | Instruction.Divide: + case Instruction.FP32 | Instruction.Divide: EvaluateFPBinary(operation, (x, y) => x / y); break; - case Instruction.FP | Instruction.Multiply: + case Instruction.FP32 | Instruction.Multiply: EvaluateFPBinary(operation, (x, y) => x * y); break; - case Instruction.FP | Instruction.Negate: + case Instruction.FP32 | Instruction.Negate: EvaluateFPUnary(operation, (x) => -x); break; - case Instruction.FP | Instruction.Subtract: + case Instruction.FP32 | Instruction.Subtract: EvaluateFPBinary(operation, (x, y) => x - y); break; -- cgit v1.2.3