]> git.tdb.fi Git - libs/gl.git/commitdiff
Resolve blocks after applying constant condition elimination
authorMikko Rasa <tdb@tdb.fi>
Mon, 3 Apr 2023 13:13:52 +0000 (16:13 +0300)
committerMikko Rasa <tdb@tdb.fi>
Mon, 3 Apr 2023 13:13:52 +0000 (16:13 +0300)
If the body of the conditional scope had any nested blocks, their parent
pointers need to be updated.

source/glsl/compiler.cpp

index a717a9278be25be85066603bab71c9fd52422d49..b746bb668406f2dcd371b177c962e003162d05a8 100644 (file)
@@ -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))