diff options
| author | 2021-06-15 17:00:07 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:35 -0400 | |
| commit | 7ac55c2a750f00b41582a86eba5a44dcd781ae98 (patch) | |
| tree | b0f904e02d8b910bf96525f202a051afae0a45eb /src/shader_recompiler | |
| parent | vk_rasterizer: Exit render passes on fragment barriers (diff) | |
| download | yuzu-7ac55c2a750f00b41582a86eba5a44dcd781ae98.tar.gz yuzu-7ac55c2a750f00b41582a86eba5a44dcd781ae98.tar.xz yuzu-7ac55c2a750f00b41582a86eba5a44dcd781ae98.zip | |
shader: Fix loop safety to SSA pass
Diffstat (limited to 'src/shader_recompiler')
| -rw-r--r-- | src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp | 4 | ||||
| -rw-r--r-- | src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp b/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp index b2b8c492a..605ec38e1 100644 --- a/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp +++ b/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp | |||
| @@ -750,7 +750,9 @@ private: | |||
| 750 | } else { | 750 | } else { |
| 751 | IR::Block* const init_block{block_pool.Create(inst_pool)}; | 751 | IR::Block* const init_block{block_pool.Create(inst_pool)}; |
| 752 | IR::IREmitter ir{*init_block}; | 752 | IR::IREmitter ir{*init_block}; |
| 753 | ir.SetLoopSafetyVariable(this_loop_id, ir.Imm32(0x2000)); | 753 | |
| 754 | static constexpr u32 SAFETY_THRESHOLD = 0x2000; | ||
| 755 | ir.SetLoopSafetyVariable(this_loop_id, ir.Imm32(SAFETY_THRESHOLD)); | ||
| 754 | 756 | ||
| 755 | if (current_block) { | 757 | if (current_block) { |
| 756 | current_block->AddBranch(init_block); | 758 | current_block->AddBranch(init_block); |
diff --git a/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp b/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp index a4ba393ef..fff25c4a2 100644 --- a/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp +++ b/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp | |||
| @@ -338,7 +338,7 @@ void VisitInst(Pass& pass, IR::Block* block, IR::Inst& inst) { | |||
| 338 | pass.WriteVariable(GotoVariable{inst.Arg(0).U32()}, block, inst.Arg(1)); | 338 | pass.WriteVariable(GotoVariable{inst.Arg(0).U32()}, block, inst.Arg(1)); |
| 339 | break; | 339 | break; |
| 340 | case IR::Opcode::SetLoopSafetyVariable: | 340 | case IR::Opcode::SetLoopSafetyVariable: |
| 341 | pass.WriteVariable(LoopSafetyVariable{inst.Arg(0).U32()}, block, inst.Arg(0)); | 341 | pass.WriteVariable(LoopSafetyVariable{inst.Arg(0).U32()}, block, inst.Arg(1)); |
| 342 | break; | 342 | break; |
| 343 | case IR::Opcode::SetIndirectBranchVariable: | 343 | case IR::Opcode::SetIndirectBranchVariable: |
| 344 | pass.WriteVariable(IndirectBranchVariable{}, block, inst.Arg(0)); | 344 | pass.WriteVariable(IndirectBranchVariable{}, block, inst.Arg(0)); |