From b0d5572abfe1f14e02d8219f0a4d7dd09ff36fd1 Mon Sep 17 00:00:00 2001
From: ReinUsesLisp <reinuseslisp@airmail.cc>
Date: Mon, 29 Mar 2021 22:13:37 -0300
Subject: shader: Fix indirect branches to scheduler instructions

---
 src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp')

diff --git a/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp b/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp
index a6e55f61ed..c804c2a8e9 100644
--- a/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp
+++ b/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp
@@ -446,9 +446,9 @@ private:
             case Flow::EndClass::IndirectBranch:
                 root.insert(ip, *pool.Create(SetIndirectBranchVariable{}, block.branch_reg,
                                              block.branch_offset));
-                for (Flow::Block* const branch : block.indirect_branches) {
-                    const Node indirect_label{local_labels.at(branch)};
-                    Statement* cond{pool.Create(IndirectBranchCond{}, branch->begin.Offset())};
+                for (const Flow::IndirectBranch& indirect : block.indirect_branches) {
+                    const Node indirect_label{local_labels.at(indirect.block)};
+                    Statement* cond{pool.Create(IndirectBranchCond{}, indirect.address)};
                     Statement* goto_stmt{pool.Create(Goto{}, cond, indirect_label, &root_stmt)};
                     gotos.push_back(root.insert(ip, *goto_stmt));
                 }
-- 
cgit v1.2.3-70-g09d2