From: Mikko Rasa Date: Mon, 3 Apr 2023 13:13:52 +0000 (+0300) Subject: Resolve blocks after applying constant condition elimination X-Git-Url: https://git.tdb.fi/?a=commitdiff_plain;h=406d533d0afa239b0229741b7857d3ceb01fa4c2;p=libs%2Fgl.git 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. --- 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))