From 750273942533daf27ceca1ca3ac964792690f744 Mon Sep 17 00:00:00 2001 From: TheTurtle Date: Wed, 23 Jul 2025 06:09:14 +0300 Subject: [PATCH] control_flow_graph: Treat empty conditional branch as noop (#3296) --- src/shader_recompiler/frontend/control_flow_graph.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/shader_recompiler/frontend/control_flow_graph.cpp b/src/shader_recompiler/frontend/control_flow_graph.cpp index 805fdb108..8b5136c17 100644 --- a/src/shader_recompiler/frontend/control_flow_graph.cpp +++ b/src/shader_recompiler/frontend/control_flow_graph.cpp @@ -141,8 +141,10 @@ void CFG::EmitLabels() { } else if (inst.IsConditionalBranch()) { const u32 true_label = inst.BranchTarget(pc); const u32 false_label = pc + inst.length; - AddLabel(true_label); - AddLabel(false_label); + if (true_label != false_label) { + AddLabel(true_label); + AddLabel(false_label); + } } else if (inst.opcode == Opcode::S_ENDPGM) { const u32 next_label = pc + inst.length; AddLabel(next_label);