diff options
Diffstat (limited to 'src/shader_recompiler/frontend/maxwell/control_flow.cpp')
| -rw-r--r-- | src/shader_recompiler/frontend/maxwell/control_flow.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/control_flow.cpp b/src/shader_recompiler/frontend/maxwell/control_flow.cpp index 298faa03e..e7abea82f 100644 --- a/src/shader_recompiler/frontend/maxwell/control_flow.cpp +++ b/src/shader_recompiler/frontend/maxwell/control_flow.cpp | |||
| @@ -209,9 +209,9 @@ CFG::CFG(Environment& env_, ObjectPool<Block>& block_pool_, Location start_addre | |||
| 209 | } | 209 | } |
| 210 | } | 210 | } |
| 211 | if (exits_to_dispatcher) { | 211 | if (exits_to_dispatcher) { |
| 212 | const auto it = functions[0].blocks.rbegin(); | 212 | const auto last_block{functions[0].blocks.rbegin()}; |
| 213 | dispatch_block->begin = it->end + 1; | 213 | dispatch_block->begin = last_block->end + 1; |
| 214 | dispatch_block->end = it->end + 1; | 214 | dispatch_block->end = last_block->end + 1; |
| 215 | functions[0].blocks.insert(*dispatch_block); | 215 | functions[0].blocks.insert(*dispatch_block); |
| 216 | } | 216 | } |
| 217 | } | 217 | } |
| @@ -481,7 +481,7 @@ CFG::AnalysisState CFG::AnalyzeEXIT(Block* block, FunctionId function_id, Locati | |||
| 481 | return AnalysisState::Continue; | 481 | return AnalysisState::Continue; |
| 482 | } | 482 | } |
| 483 | if (exits_to_dispatcher && function_id != 0) { | 483 | if (exits_to_dispatcher && function_id != 0) { |
| 484 | throw NotImplementedException("Dispatch EXIT on external function."); | 484 | throw NotImplementedException("Dispatch EXIT on external function"); |
| 485 | } | 485 | } |
| 486 | if (pred != Predicate{true} || flow_test != IR::FlowTest::T) { | 486 | if (pred != Predicate{true} || flow_test != IR::FlowTest::T) { |
| 487 | if (block->stack.Peek(Token::PEXIT).has_value()) { | 487 | if (block->stack.Peek(Token::PEXIT).has_value()) { |
| @@ -490,9 +490,9 @@ CFG::AnalysisState CFG::AnalyzeEXIT(Block* block, FunctionId function_id, Locati | |||
| 490 | const IR::Condition cond{flow_test, static_cast<IR::Pred>(pred.index), pred.negated}; | 490 | const IR::Condition cond{flow_test, static_cast<IR::Pred>(pred.index), pred.negated}; |
| 491 | if (exits_to_dispatcher) { | 491 | if (exits_to_dispatcher) { |
| 492 | block->end = pc; | 492 | block->end = pc; |
| 493 | block->branch_true = dispatch_block; | ||
| 494 | block->end_class = EndClass::Branch; | 493 | block->end_class = EndClass::Branch; |
| 495 | block->cond = cond; | 494 | block->cond = cond; |
| 495 | block->branch_true = dispatch_block; | ||
| 496 | block->branch_false = AddLabel(block, block->stack, pc + 1, function_id); | 496 | block->branch_false = AddLabel(block, block->stack, pc + 1, function_id); |
| 497 | return AnalysisState::Branch; | 497 | return AnalysisState::Branch; |
| 498 | } | 498 | } |