summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_core/shader/decode/memory.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/video_core/shader/decode/memory.cpp b/src/video_core/shader/decode/memory.cpp
index 6eb36b1e7..bff40071b 100644
--- a/src/video_core/shader/decode/memory.cpp
+++ b/src/video_core/shader/decode/memory.cpp
@@ -225,12 +225,20 @@ u32 ShaderIR::DecodeMemory(BasicBlock& bb, const BasicBlock& code, u32 pc) {
225 UNIMPLEMENTED_IF_MSG(instr.st_l.unknown == 0, "ST_L Unhandled mode: {}", 225 UNIMPLEMENTED_IF_MSG(instr.st_l.unknown == 0, "ST_L Unhandled mode: {}",
226 static_cast<u32>(instr.st_l.unknown.Value())); 226 static_cast<u32>(instr.st_l.unknown.Value()));
227 227
228 const Node index = Operation(OperationCode::IAdd, NO_PRECISE, GetRegister(instr.gpr8), 228 const auto GetLmemAddr = [&](s32 offset) {
229 Immediate(static_cast<s32>(instr.smem_imm))); 229 ASSERT(offset % 4 == 0);
230 const Node immediate = Immediate(static_cast<s32>(instr.smem_imm) + offset);
231 return Operation(OperationCode::IAdd, NO_PRECISE, GetRegister(instr.gpr8), immediate);
232 };
230 233
231 switch (instr.ldst_sl.type.Value()) { 234 switch (instr.ldst_sl.type.Value()) {
235 case Tegra::Shader::StoreType::Bits128:
236 SetLocalMemory(bb, GetLmemAddr(12), GetRegister(instr.gpr0.Value() + 3));
237 SetLocalMemory(bb, GetLmemAddr(8), GetRegister(instr.gpr0.Value() + 2));
238 case Tegra::Shader::StoreType::Bits64:
239 SetLocalMemory(bb, GetLmemAddr(4), GetRegister(instr.gpr0.Value() + 1));
232 case Tegra::Shader::StoreType::Bits32: 240 case Tegra::Shader::StoreType::Bits32:
233 SetLocalMemory(bb, index, GetRegister(instr.gpr0)); 241 SetLocalMemory(bb, GetLmemAddr(0), GetRegister(instr.gpr0));
234 break; 242 break;
235 default: 243 default:
236 UNIMPLEMENTED_MSG("ST_L Unhandled type: {}", 244 UNIMPLEMENTED_MSG("ST_L Unhandled type: {}",