From 406d533d0afa239b0229741b7857d3ceb01fa4c2 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 3 Apr 2023 16:13:52 +0300 Subject: [PATCH] Resolve blocks after applying constant condition elimination If the body of the conditional scope had any nested blocks, their parent pointers need to be updated. --- source/glsl/compiler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/glsl/compiler.cpp b/source/glsl/compiler.cpp index a717a927..b746bb66 100644 --- a/source/glsl/compiler.cpp +++ b/source/glsl/compiler.cpp @@ -384,7 +384,7 @@ Compiler::OptimizeResult Compiler::optimize(Stage &stage) if(ConstantFolder().apply(stage)) resolve(stage, RESOLVE_EXPRESSIONS); if(ConstantConditionEliminator().apply(stage)) - resolve(stage, RESOLVE_VARIABLES); + resolve(stage, RESOLVE_BLOCKS|RESOLVE_VARIABLES); bool any_inlined = false; if(FunctionInliner().apply(stage)) -- 2.45.2