diff options
| -rw-r--r-- | src/video_core/shader/decode/memory.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/video_core/shader/decode/memory.cpp b/src/video_core/shader/decode/memory.cpp index 4d075f088..63965525c 100644 --- a/src/video_core/shader/decode/memory.cpp +++ b/src/video_core/shader/decode/memory.cpp | |||
| @@ -104,16 +104,27 @@ u32 ShaderIR::DecodeMemory(BasicBlock& bb, const BasicBlock& code, u32 pc) { | |||
| 104 | } | 104 | } |
| 105 | case OpCode::Id::LD_L: { | 105 | case OpCode::Id::LD_L: { |
| 106 | UNIMPLEMENTED_IF_MSG(instr.ld_l.unknown == 1, "LD_L Unhandled mode: {}", | 106 | UNIMPLEMENTED_IF_MSG(instr.ld_l.unknown == 1, "LD_L Unhandled mode: {}", |
| 107 | static_cast<unsigned>(instr.ld_l.unknown.Value())); | 107 | static_cast<u32>(instr.ld_l.unknown.Value())); |
| 108 | 108 | ||
| 109 | const Node index = Operation(OperationCode::IAdd, GetRegister(instr.gpr8), | 109 | const auto GetLmem = [&](s32 offset) { |
| 110 | Immediate(static_cast<s32>(instr.smem_imm))); | 110 | ASSERT(offset % 4 == 0); |
| 111 | const Node lmem = GetLocalMemory(index); | 111 | const Node immediate_offset = Immediate(static_cast<s32>(instr.smem_imm) + offset); |
| 112 | const Node address = Operation(OperationCode::IAdd, NO_PRECISE, GetRegister(instr.gpr8), | ||
| 113 | immediate_offset); | ||
| 114 | return GetLocalMemory(address); | ||
| 115 | }; | ||
| 112 | 116 | ||
| 113 | switch (instr.ldst_sl.type.Value()) { | 117 | switch (instr.ldst_sl.type.Value()) { |
| 114 | case Tegra::Shader::StoreType::Bytes32: | 118 | case Tegra::Shader::StoreType::Bytes32: |
| 115 | SetRegister(bb, instr.gpr0, lmem); | 119 | SetRegister(bb, instr.gpr0, GetLmem(0)); |
| 116 | break; | 120 | break; |
| 121 | case Tegra::Shader::StoreType::Bytes64: { | ||
| 122 | SetTemporal(bb, 0, GetLmem(0)); | ||
| 123 | SetTemporal(bb, 1, GetLmem(4)); | ||
| 124 | SetRegister(bb, instr.gpr0, GetTemporal(0)); | ||
| 125 | SetRegister(bb, instr.gpr0.Value() + 1, GetTemporal(1)); | ||
| 126 | break; | ||
| 127 | } | ||
| 117 | default: | 128 | default: |
| 118 | UNIMPLEMENTED_MSG("LD_L Unhandled type: {}", | 129 | UNIMPLEMENTED_MSG("LD_L Unhandled type: {}", |
| 119 | static_cast<unsigned>(instr.ldst_sl.type.Value())); | 130 | static_cast<unsigned>(instr.ldst_sl.type.Value())); |