diff options
| author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-01-28 18:11:23 -0300 |
|---|---|---|
| committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-01-30 02:45:50 -0300 |
| commit | 477d616f7df3b609afcb67d69d9570098cc00029 (patch) | |
| tree | 4e4395842d44583d88abaacfb23e88073223bf5c /src/video_core/shader/decode/memory.cpp | |
| parent | 3c3d9afd61f7f8b699befc6c6c50e51a28a7a4de (diff) | |
shader_ir: Unify constant buffer offset values
Constant buffer values on the shader IR were using different offsets if
the access direct or indirect. cbuf34 has a non-multiplied offset while
cbuf36 does. On shader decoding this commit multiplies it by four on
cbuf34 queries.
Diffstat (limited to 'src/video_core/shader/decode/memory.cpp')
| -rw-r--r-- | src/video_core/shader/decode/memory.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/video_core/shader/decode/memory.cpp b/src/video_core/shader/decode/memory.cpp index 04cb386b7..4d075f088 100644 --- a/src/video_core/shader/decode/memory.cpp +++ b/src/video_core/shader/decode/memory.cpp @@ -80,7 +80,7 @@ u32 ShaderIR::DecodeMemory(BasicBlock& bb, const BasicBlock& code, u32 pc) { Node index = GetRegister(instr.gpr8); const Node op_a = - GetConstBufferIndirect(instr.cbuf36.index, instr.cbuf36.offset + 0, index); + GetConstBufferIndirect(instr.cbuf36.index, instr.cbuf36.GetOffset() + 0, index); switch (instr.ld_c.type.Value()) { case Tegra::Shader::UniformType::Single: @@ -89,7 +89,7 @@ u32 ShaderIR::DecodeMemory(BasicBlock& bb, const BasicBlock& code, u32 pc) { case Tegra::Shader::UniformType::Double: { const Node op_b = - GetConstBufferIndirect(instr.cbuf36.index, instr.cbuf36.offset + 4, index); + GetConstBufferIndirect(instr.cbuf36.index, instr.cbuf36.GetOffset() + 4, index); SetTemporal(bb, 0, op_a); SetTemporal(bb, 1, op_b); @@ -142,7 +142,7 @@ u32 ShaderIR::DecodeMemory(BasicBlock& bb, const BasicBlock& code, u32 pc) { ASSERT(cbuf != nullptr); const auto cbuf_offset_imm = std::get_if<ImmediateNode>(cbuf->GetOffset()); ASSERT(cbuf_offset_imm != nullptr); - const auto cbuf_offset = cbuf_offset_imm->GetValue() * 4; + const auto cbuf_offset = cbuf_offset_imm->GetValue(); bb.push_back(Comment( fmt::format("Base address is c[0x{:x}][0x{:x}]", cbuf->GetIndex(), cbuf_offset))); |
