From eece4e8a1c654b54a2ed41503207060200e4868a Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Thu, 26 Aug 2021 00:18:54 +0200 Subject: [PATCH] early-access version 2012 --- README.md | 2 +- .../frontend/maxwell/structured_control_flow.cpp | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c9f87905d..03bd1ba09 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 2011. +This is the source code for early-access 2012. ## Legal Notice diff --git a/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp b/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp index 0eb156034..a80db8cec 100755 --- a/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp +++ b/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp @@ -875,10 +875,21 @@ private: std::vector demote_blocks; std::vector demote_conds; u32 num_epilogues{}; + u32 branch_depth{}; for (const IR::AbstractSyntaxNode& node : syntax_list) { + if (node.type == Type::If) { + ++branch_depth; + } + if (node.type == Type::EndIf) { + --branch_depth; + } if (node.type != Type::Block) { continue; } + if (branch_depth > 1) { + // Skip reordering nested demote branches. + continue; + } for (const IR::Inst& inst : node.data.block->Instructions()) { const IR::Opcode op{inst.GetOpcode()}; if (op == IR::Opcode::DemoteToHelperInvocation) {