diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-02-03 23:08:10 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-02-03 23:08:10 +0100 |
commit | dfa7be5ddf658622eb77ada4974ce9dfe4c6eda7 (patch) | |
tree | 31ef889faaae1933d468aa1a73caf32103224c1b /src/video_core/shader | |
parent | shader_ir/memory: Add LD_L 128 bits loads (diff) | |
download | yuzu-dfa7be5ddf658622eb77ada4974ce9dfe4c6eda7.tar yuzu-dfa7be5ddf658622eb77ada4974ce9dfe4c6eda7.tar.gz yuzu-dfa7be5ddf658622eb77ada4974ce9dfe4c6eda7.tar.bz2 yuzu-dfa7be5ddf658622eb77ada4974ce9dfe4c6eda7.tar.lz yuzu-dfa7be5ddf658622eb77ada4974ce9dfe4c6eda7.tar.xz yuzu-dfa7be5ddf658622eb77ada4974ce9dfe4c6eda7.tar.zst yuzu-dfa7be5ddf658622eb77ada4974ce9dfe4c6eda7.zip |
Diffstat (limited to 'src/video_core/shader')
-rw-r--r-- | src/video_core/shader/decode/memory.cpp | 14 |
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) { UNIMPLEMENTED_IF_MSG(instr.st_l.unknown == 0, "ST_L Unhandled mode: {}", static_cast<u32>(instr.st_l.unknown.Value())); - const Node index = Operation(OperationCode::IAdd, NO_PRECISE, GetRegister(instr.gpr8), - Immediate(static_cast<s32>(instr.smem_imm))); + const auto GetLmemAddr = [&](s32 offset) { + ASSERT(offset % 4 == 0); + const Node immediate = Immediate(static_cast<s32>(instr.smem_imm) + offset); + return Operation(OperationCode::IAdd, NO_PRECISE, GetRegister(instr.gpr8), immediate); + }; switch (instr.ldst_sl.type.Value()) { + case Tegra::Shader::StoreType::Bits128: + SetLocalMemory(bb, GetLmemAddr(12), GetRegister(instr.gpr0.Value() + 3)); + SetLocalMemory(bb, GetLmemAddr(8), GetRegister(instr.gpr0.Value() + 2)); + case Tegra::Shader::StoreType::Bits64: + SetLocalMemory(bb, GetLmemAddr(4), GetRegister(instr.gpr0.Value() + 1)); case Tegra::Shader::StoreType::Bits32: - SetLocalMemory(bb, index, GetRegister(instr.gpr0)); + SetLocalMemory(bb, GetLmemAddr(0), GetRegister(instr.gpr0)); break; default: UNIMPLEMENTED_MSG("ST_L Unhandled type: {}", |