summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/shader_recompiler/frontend/maxwell/control_flow.cpp6
-rw-r--r--src/shader_recompiler/frontend/maxwell/control_flow.h1
2 files changed, 4 insertions, 3 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/control_flow.cpp b/src/shader_recompiler/frontend/maxwell/control_flow.cpp
index eb0f7c8d1..1a4ee4f6c 100644
--- a/src/shader_recompiler/frontend/maxwell/control_flow.cpp
+++ b/src/shader_recompiler/frontend/maxwell/control_flow.cpp
@@ -197,7 +197,7 @@ Function::Function(ObjectPool<Block>& block_pool, Location start_address)
197 }} {} 197 }} {}
198 198
199CFG::CFG(Environment& env_, ObjectPool<Block>& block_pool_, Location start_address) 199CFG::CFG(Environment& env_, ObjectPool<Block>& block_pool_, Location start_address)
200 : env{env_}, block_pool{block_pool_} { 200 : env{env_}, block_pool{block_pool_}, program_start{start_address} {
201 functions.emplace_back(block_pool, start_address); 201 functions.emplace_back(block_pool, start_address);
202 for (FunctionId function_id = 0; function_id < functions.size(); ++function_id) { 202 for (FunctionId function_id = 0; function_id < functions.size(); ++function_id) {
203 while (!functions[function_id].labels.empty()) { 203 while (!functions[function_id].labels.empty()) {
@@ -427,9 +427,9 @@ void CFG::AnalyzeBRA(Block* block, FunctionId function_id, Location pc, Instruct
427 427
428CFG::AnalysisState CFG::AnalyzeBRX(Block* block, Location pc, Instruction inst, bool is_absolute, 428CFG::AnalysisState CFG::AnalyzeBRX(Block* block, Location pc, Instruction inst, bool is_absolute,
429 FunctionId function_id) { 429 FunctionId function_id) {
430 const std::optional brx_table{TrackIndirectBranchTable(env, pc, block->begin)}; 430 const std::optional brx_table{TrackIndirectBranchTable(env, pc, program_start)};
431 if (!brx_table) { 431 if (!brx_table) {
432 TrackIndirectBranchTable(env, pc, block->begin); 432 TrackIndirectBranchTable(env, pc, program_start);
433 throw NotImplementedException("Failed to track indirect branch"); 433 throw NotImplementedException("Failed to track indirect branch");
434 } 434 }
435 const IR::FlowTest flow_test{inst.branch.flow_test}; 435 const IR::FlowTest flow_test{inst.branch.flow_test};
diff --git a/src/shader_recompiler/frontend/maxwell/control_flow.h b/src/shader_recompiler/frontend/maxwell/control_flow.h
index 466b14198..9f570fbb5 100644
--- a/src/shader_recompiler/frontend/maxwell/control_flow.h
+++ b/src/shader_recompiler/frontend/maxwell/control_flow.h
@@ -157,6 +157,7 @@ private:
157 ObjectPool<Block>& block_pool; 157 ObjectPool<Block>& block_pool;
158 boost::container::small_vector<Function, 1> functions; 158 boost::container::small_vector<Function, 1> functions;
159 FunctionId current_function_id{0}; 159 FunctionId current_function_id{0};
160 Location program_start;
160}; 161};
161 162
162} // namespace Shader::Maxwell::Flow 163} // namespace Shader::Maxwell::Flow