summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2019-08-09 20:35:28 +0200
committerReinUsesLisp <reinuseslisp@airmail.cc>2019-09-05 06:38:37 +0200
commit4de04eba39351cec23d8cb413e0395482860d540 (patch)
tree1bb179899e97b111a85d72fd4a7059bc5db08bd8 /src/video_core
parentshader_ir: Implement ST_S (diff)
downloadyuzu-4de04eba39351cec23d8cb413e0395482860d540.tar
yuzu-4de04eba39351cec23d8cb413e0395482860d540.tar.gz
yuzu-4de04eba39351cec23d8cb413e0395482860d540.tar.bz2
yuzu-4de04eba39351cec23d8cb413e0395482860d540.tar.lz
yuzu-4de04eba39351cec23d8cb413e0395482860d540.tar.xz
yuzu-4de04eba39351cec23d8cb413e0395482860d540.tar.zst
yuzu-4de04eba39351cec23d8cb413e0395482860d540.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/shader/decode/memory.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/video_core/shader/decode/memory.cpp b/src/video_core/shader/decode/memory.cpp
index 8f74fa7d8..7923d4d69 100644
--- a/src/video_core/shader/decode/memory.cpp
+++ b/src/video_core/shader/decode/memory.cpp
@@ -106,16 +106,17 @@ u32 ShaderIR::DecodeMemory(NodeBlock& bb, u32 pc) {
}
break;
}
- case OpCode::Id::LD_L: {
- LOG_DEBUG(HW_GPU, "LD_L cache management mode: {}",
- static_cast<u64>(instr.ld_l.unknown.Value()));
-
- const auto GetLmem = [&](s32 offset) {
+ case OpCode::Id::LD_L:
+ LOG_DEBUG(HW_GPU, "LD_L cache management mode: {}", static_cast<u64>(instr.ld_l.unknown));
+ [[fallthrough]];
+ case OpCode::Id::LD_S: {
+ const auto GetMemory = [&](s32 offset) {
ASSERT(offset % 4 == 0);
const Node immediate_offset = Immediate(static_cast<s32>(instr.smem_imm) + offset);
const Node address = Operation(OperationCode::IAdd, NO_PRECISE, GetRegister(instr.gpr8),
immediate_offset);
- return GetLocalMemory(address);
+ return opcode->get().GetId() == OpCode::Id::LD_S ? GetSharedMemory(address)
+ : GetLocalMemory(address);
};
switch (instr.ldst_sl.type.Value()) {
@@ -135,14 +136,16 @@ u32 ShaderIR::DecodeMemory(NodeBlock& bb, u32 pc) {
return 0;
}
}();
- for (u32 i = 0; i < count; ++i)
- SetTemporary(bb, i, GetLmem(i * 4));
- for (u32 i = 0; i < count; ++i)
+ for (u32 i = 0; i < count; ++i) {
+ SetTemporary(bb, i, GetMemory(i * 4));
+ }
+ for (u32 i = 0; i < count; ++i) {
SetRegister(bb, instr.gpr0.Value() + i, GetTemporary(i));
+ }
break;
}
default:
- UNIMPLEMENTED_MSG("LD_L Unhandled type: {}",
+ UNIMPLEMENTED_MSG("{} Unhandled type: {}", opcode->get().GetName(),
static_cast<u32>(instr.ldst_sl.type.Value()));
}
break;