From 6a6fabea58bb12e70feded1354570f259c9f9a6d Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Wed, 30 Jan 2019 01:56:33 -0300 Subject: shader_ir: Pass decoded nodes as a whole instead of per basic blocks Some games call LDG at the top of a basic block, making the tracking heuristic to fail. This commit lets the heuristic the decoded nodes as a whole instead of per basic blocks. This may lead to some false positives but allows it the heuristic to track cases it previously couldn't. --- src/video_core/shader/decode/memory.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/video_core/shader/decode/memory.cpp') diff --git a/src/video_core/shader/decode/memory.cpp b/src/video_core/shader/decode/memory.cpp index 4d075f088..bdfb609d0 100644 --- a/src/video_core/shader/decode/memory.cpp +++ b/src/video_core/shader/decode/memory.cpp @@ -36,7 +36,7 @@ static std::size_t GetCoordCount(TextureType texture_type) { } } -u32 ShaderIR::DecodeMemory(BasicBlock& bb, const BasicBlock& code, u32 pc) { +u32 ShaderIR::DecodeMemory(BasicBlock& bb, u32 pc) { const Instruction instr = {program_code[pc]}; const auto opcode = OpCode::Decode(instr); @@ -137,7 +137,8 @@ u32 ShaderIR::DecodeMemory(BasicBlock& bb, const BasicBlock& code, u32 pc) { }(); const Node addr_register = GetRegister(instr.gpr8); - const Node base_address = TrackCbuf(addr_register, code, static_cast(code.size())); + const Node base_address = + TrackCbuf(addr_register, global_code, static_cast(global_code.size())); const auto cbuf = std::get_if(base_address); ASSERT(cbuf != nullptr); const auto cbuf_offset_imm = std::get_if(cbuf->GetOffset()); -- cgit v1.2.3