From 0f63ef9da0b2846817bf892df6f7bb28cb243dcc Mon Sep 17 00:00:00 2001 From: Rengundom <180709295+Rengundom@users.noreply.github.com> Date: Thu, 29 Oct 2026 05:41:02 -0500 Subject: [PATCH] refactor(shader): short-circuit terminal reachability checks --- core/shader/recompiler/ControlFlow/src/Structurizer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/shader/recompiler/ControlFlow/src/Structurizer.cpp b/core/shader/recompiler/ControlFlow/src/Structurizer.cpp index 19da8b5235..419d0ab69a 100644 --- a/core/shader/recompiler/ControlFlow/src/Structurizer.cpp +++ b/core/shader/recompiler/ControlFlow/src/Structurizer.cpp @@ -482,6 +482,8 @@ bool canReachBefore(const ControlFlowGraph& graph, std::uint32_t start, std::uin } bool reachesWithinIteration(const ControlFlowGraph& graph, const NaturalLoop& loop, std::uint32_t start, std::uint32_t target) { + if (start == target) return true; + if (start == loop.continueBlock || start == loop.mergeBlock) return false; std::vector pending = {start}; std::vector visited(graph.blocks.size(), false); while (!pending.empty()) {