diff options
Diffstat (limited to 'src/shader_recompiler/frontend/maxwell/translate/impl/impl.cpp')
| -rw-r--r-- | src/shader_recompiler/frontend/maxwell/translate/impl/impl.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/impl.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/impl.cpp index 548c7f611..3c9eaddd9 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/impl.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/impl.cpp | |||
| @@ -12,10 +12,18 @@ IR::U32 TranslatorVisitor::X(IR::Reg reg) { | |||
| 12 | return ir.GetReg(reg); | 12 | return ir.GetReg(reg); |
| 13 | } | 13 | } |
| 14 | 14 | ||
| 15 | IR::F32 TranslatorVisitor::F(IR::Reg reg) { | ||
| 16 | return ir.BitCast<IR::F32>(X(reg)); | ||
| 17 | } | ||
| 18 | |||
| 15 | void TranslatorVisitor::X(IR::Reg dest_reg, const IR::U32& value) { | 19 | void TranslatorVisitor::X(IR::Reg dest_reg, const IR::U32& value) { |
| 16 | ir.SetReg(dest_reg, value); | 20 | ir.SetReg(dest_reg, value); |
| 17 | } | 21 | } |
| 18 | 22 | ||
| 23 | void TranslatorVisitor::F(IR::Reg dest_reg, const IR::F32& value) { | ||
| 24 | X(dest_reg, ir.BitCast<IR::U32>(value)); | ||
| 25 | } | ||
| 26 | |||
| 19 | IR::U32 TranslatorVisitor::GetReg20(u64 insn) { | 27 | IR::U32 TranslatorVisitor::GetReg20(u64 insn) { |
| 20 | union { | 28 | union { |
| 21 | u64 raw; | 29 | u64 raw; |
| @@ -32,6 +40,14 @@ IR::U32 TranslatorVisitor::GetReg39(u64 insn) { | |||
| 32 | return X(reg.index); | 40 | return X(reg.index); |
| 33 | } | 41 | } |
| 34 | 42 | ||
| 43 | IR::F32 TranslatorVisitor::GetReg20F(u64 insn) { | ||
| 44 | return ir.BitCast<IR::F32>(GetReg20(insn)); | ||
| 45 | } | ||
| 46 | |||
| 47 | IR::F32 TranslatorVisitor::GetReg39F(u64 insn) { | ||
| 48 | return ir.BitCast<IR::F32>(GetReg39(insn)); | ||
| 49 | } | ||
| 50 | |||
| 35 | IR::U32 TranslatorVisitor::GetCbuf(u64 insn) { | 51 | IR::U32 TranslatorVisitor::GetCbuf(u64 insn) { |
| 36 | union { | 52 | union { |
| 37 | u64 raw; | 53 | u64 raw; |
| @@ -49,6 +65,10 @@ IR::U32 TranslatorVisitor::GetCbuf(u64 insn) { | |||
| 49 | return ir.GetCbuf(binding, byte_offset); | 65 | return ir.GetCbuf(binding, byte_offset); |
| 50 | } | 66 | } |
| 51 | 67 | ||
| 68 | IR::F32 TranslatorVisitor::GetCbufF(u64 insn) { | ||
| 69 | return ir.BitCast<IR::F32>(GetCbuf(insn)); | ||
| 70 | } | ||
| 71 | |||
| 52 | IR::U32 TranslatorVisitor::GetImm20(u64 insn) { | 72 | IR::U32 TranslatorVisitor::GetImm20(u64 insn) { |
| 53 | union { | 73 | union { |
| 54 | u64 raw; | 74 | u64 raw; |