diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-07-16 20:58:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-16 20:58:35 +0200 |
commit | b56e7f870add41d0300745342d24315e8fa3f881 (patch) | |
tree | 13f920af2c14ab8ae89bb3d9751c885c60789c03 /src/video_core/shader/decode/memory.cpp | |
parent | Merge pull request #2695 from ReinUsesLisp/layer-viewport (diff) | |
parent | shader: Allow tracking of indirect buffers without variable offset (diff) | |
download | yuzu-b56e7f870add41d0300745342d24315e8fa3f881.tar yuzu-b56e7f870add41d0300745342d24315e8fa3f881.tar.gz yuzu-b56e7f870add41d0300745342d24315e8fa3f881.tar.bz2 yuzu-b56e7f870add41d0300745342d24315e8fa3f881.tar.lz yuzu-b56e7f870add41d0300745342d24315e8fa3f881.tar.xz yuzu-b56e7f870add41d0300745342d24315e8fa3f881.tar.zst yuzu-b56e7f870add41d0300745342d24315e8fa3f881.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/shader/decode/memory.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/video_core/shader/decode/memory.cpp b/src/video_core/shader/decode/memory.cpp index 80fc0ccfc..ab207a33b 100644 --- a/src/video_core/shader/decode/memory.cpp +++ b/src/video_core/shader/decode/memory.cpp @@ -297,18 +297,13 @@ std::tuple<Node, Node, GlobalMemoryBase> ShaderIR::TrackAndGetGlobalMemory(NodeB const auto addr_register{GetRegister(instr.gmem.gpr)}; const auto immediate_offset{static_cast<u32>(instr.gmem.offset)}; - const Node base_address{ - TrackCbuf(addr_register, global_code, static_cast<s64>(global_code.size()))}; - const auto cbuf = std::get_if<CbufNode>(&*base_address); - 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(); - - bb.push_back( - Comment(fmt::format("Base address is c[0x{:x}][0x{:x}]", cbuf->GetIndex(), cbuf_offset))); - - const GlobalMemoryBase descriptor{cbuf->GetIndex(), cbuf_offset}; + const auto [base_address, index, offset] = + TrackCbuf(addr_register, global_code, static_cast<s64>(global_code.size())); + ASSERT(base_address != nullptr); + + bb.push_back(Comment(fmt::format("Base address is c[0x{:x}][0x{:x}]", index, offset))); + + const GlobalMemoryBase descriptor{index, offset}; const auto& [entry, is_new] = used_global_memory.try_emplace(descriptor); auto& usage = entry->second; if (is_write) { |