diff options
Diffstat (limited to 'src/shader_recompiler')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/ir_emitter.cpp | 1 | ||||
| -rw-r--r-- | src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp | 9 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.cpp b/src/shader_recompiler/frontend/ir/ir_emitter.cpp index f281c023f..82613f607 100644 --- a/src/shader_recompiler/frontend/ir/ir_emitter.cpp +++ b/src/shader_recompiler/frontend/ir/ir_emitter.cpp | |||
| @@ -83,6 +83,7 @@ void IREmitter::SelectionMerge(Block* merge_block) { | |||
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | void IREmitter::Return() { | 85 | void IREmitter::Return() { |
| 86 | block->SetReturn(); | ||
| 86 | Inst(Opcode::Return); | 87 | Inst(Opcode::Return); |
| 87 | } | 88 | } |
| 88 | 89 | ||
diff --git a/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp b/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp index 79e344986..9d4688390 100644 --- a/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp +++ b/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp | |||
| @@ -152,7 +152,9 @@ std::string DumpTree(const Tree& tree, u32 indentation = 0) { | |||
| 152 | for (auto stmt = tree.begin(); stmt != tree.end(); ++stmt) { | 152 | for (auto stmt = tree.begin(); stmt != tree.end(); ++stmt) { |
| 153 | switch (stmt->type) { | 153 | switch (stmt->type) { |
| 154 | case StatementType::Code: | 154 | case StatementType::Code: |
| 155 | ret += fmt::format("{} Block {:04x};\n", indent, stmt->code->LocationBegin()); | 155 | ret += fmt::format("{} Block {:04x} -> {:04x} (0x{:016x});\n", indent, |
| 156 | stmt->code->LocationBegin(), stmt->code->LocationEnd(), | ||
| 157 | reinterpret_cast<uintptr_t>(stmt->code)); | ||
| 156 | break; | 158 | break; |
| 157 | case StatementType::Goto: | 159 | case StatementType::Goto: |
| 158 | ret += fmt::format("{} if ({}) goto L{};\n", indent, DumpExpr(stmt->cond), | 160 | ret += fmt::format("{} if ({}) goto L{};\n", indent, DumpExpr(stmt->cond), |
| @@ -749,8 +751,9 @@ private: | |||
| 749 | current_block = block_pool.Create(inst_pool); | 751 | current_block = block_pool.Create(inst_pool); |
| 750 | block_list.push_back(current_block); | 752 | block_list.push_back(current_block); |
| 751 | } | 753 | } |
| 752 | IR::IREmitter{*current_block}.DemoteToHelperInvocation(continue_block); | 754 | IR::Block* demote_block{MergeBlock(parent, stmt)}; |
| 753 | current_block = nullptr; | 755 | IR::IREmitter{*current_block}.DemoteToHelperInvocation(demote_block); |
| 756 | current_block = demote_block; | ||
| 754 | break; | 757 | break; |
| 755 | } | 758 | } |
| 756 | default: | 759 | default: |