diff options
author | gdkchan <gab.dark.100@gmail.com> | 2023-06-08 17:09:14 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-08 17:09:14 -0300 |
commit | fe30c03cac9d1f09270a4156aceab273dbac81fb (patch) | |
tree | b6107578e87f11fbd9a50dde002f190e2e091615 /src/Ryujinx.Graphics.Shader/IntermediateRepresentation/Operation.cs | |
parent | 5813b2e354e072d43eb30c51083e737cf6bc1ee2 (diff) |
Implement soft float64 conversion on shaders when host has no support (#5159)1.1.870
* Implement soft float64 conversion on shaders when host has no support
* Shader cache version bump
* Fix rebase error
Diffstat (limited to 'src/Ryujinx.Graphics.Shader/IntermediateRepresentation/Operation.cs')
-rw-r--r-- | src/Ryujinx.Graphics.Shader/IntermediateRepresentation/Operation.cs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/Ryujinx.Graphics.Shader/IntermediateRepresentation/Operation.cs b/src/Ryujinx.Graphics.Shader/IntermediateRepresentation/Operation.cs index d502a9b6..425cfd90 100644 --- a/src/Ryujinx.Graphics.Shader/IntermediateRepresentation/Operation.cs +++ b/src/Ryujinx.Graphics.Shader/IntermediateRepresentation/Operation.cs @@ -255,5 +255,35 @@ namespace Ryujinx.Graphics.Shader.IntermediateRepresentation _sources = new Operand[] { source }; } + + public void TurnDoubleIntoFloat() + { + if ((Inst & ~Instruction.Mask) == Instruction.FP64) + { + Inst = (Inst & Instruction.Mask) | Instruction.FP32; + } + else + { + switch (Inst) + { + case Instruction.ConvertFP32ToFP64: + case Instruction.ConvertFP64ToFP32: + Inst = Instruction.Copy; + break; + case Instruction.ConvertFP64ToS32: + Inst = Instruction.ConvertFP32ToS32; + break; + case Instruction.ConvertFP64ToU32: + Inst = Instruction.ConvertFP32ToU32; + break; + case Instruction.ConvertS32ToFP64: + Inst = Instruction.ConvertS32ToFP32; + break; + case Instruction.ConvertU32ToFP64: + Inst = Instruction.ConvertU32ToFP32; + break; + } + } + } } }
\ No newline at end of file |