diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2020-03-03 11:02:08 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-03 15:02:08 +0100 |
| commit | dc97457bf0121b9383054ca14d3c525b56b92634 (patch) | |
| tree | ecd78f76805b16bb01ec8d81f99f1cb3a2a43895 /Ryujinx.Graphics.Shader/Decoders/DecoderHelper.cs | |
| parent | 3045c1a18644e50fd843dfce07d809e46d923ada (diff) | |
Initial support for double precision shader instructions. (#963)
* Implement DADD, DFMA and DMUL shader instructions
* Rename FP to FP32
* Correct double immediate
* Classic mistake
Diffstat (limited to 'Ryujinx.Graphics.Shader/Decoders/DecoderHelper.cs')
| -rw-r--r-- | Ryujinx.Graphics.Shader/Decoders/DecoderHelper.cs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Shader/Decoders/DecoderHelper.cs b/Ryujinx.Graphics.Shader/Decoders/DecoderHelper.cs index 77cd1bf7..3585c35f 100644 --- a/Ryujinx.Graphics.Shader/Decoders/DecoderHelper.cs +++ b/Ryujinx.Graphics.Shader/Decoders/DecoderHelper.cs @@ -54,5 +54,21 @@ namespace Ryujinx.Graphics.Shader.Decoders return BitConverter.Int32BitsToSingle(imm); } + + public static float DecodeD20Immediate(long opCode) + { + long imm = opCode.Extract(20, 19); + + bool negate = opCode.Extract(56); + + imm <<= 44; + + if (negate) + { + imm |= 1L << 63; + } + + return (float)BitConverter.Int64BitsToDouble(imm); + } } }
\ No newline at end of file |
