refactor(shader): short-circuit terminal reachability checks

This commit is contained in:
Rengundom committed 2026-10-29 05:41:02 -05:00
1 parent 578b8311ac
commit 0f63ef9da0
1 file changed
+2
@@ -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<std::uint32_t> pending = {start};
std::vector<bool> visited(graph.blocks.size(), false);
while (!pending.empty()) {