Initial support for double precision shader instructions. (#963)

* Implement DADD, DFMA and DMUL shader instructions

* Rename FP to FP32

* Correct double immediate

* Classic mistake
This commit is contained in:
gdkchan 2020-03-03 11:02:08 -03:00 committed by GitHub
parent 3045c1a186
commit dc97457bf0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 428 additions and 184 deletions

View file

@ -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;