summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/frontend/maxwell/control_flow.cpp
diff options
context:
space:
mode:
authorGravatar FernandoS272021-04-06 02:01:01 +0200
committerGravatar ameerj2021-07-22 21:51:26 -0400
commit20ba0ea0a94fa915cad6392b3742d8e58e2fa0d9 (patch)
treee71f3fb568357d4c556ea0ee2ebf57f6fc3b3393 /src/shader_recompiler/frontend/maxwell/control_flow.cpp
parentvk_pipeline_cache: Fix num of pipeline workers on weird platforms (diff)
downloadyuzu-20ba0ea0a94fa915cad6392b3742d8e58e2fa0d9.tar.gz
yuzu-20ba0ea0a94fa915cad6392b3742d8e58e2fa0d9.tar.xz
yuzu-20ba0ea0a94fa915cad6392b3742d8e58e2fa0d9.zip
shader: Fix BRX tracking
Diffstat (limited to 'src/shader_recompiler/frontend/maxwell/control_flow.cpp')
-rw-r--r--src/shader_recompiler/frontend/maxwell/control_flow.cpp6
1 files changed, 3 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};