]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/compiler.cpp
Resolve variables after eliminating constant conditions
[libs/gl.git] / source / glsl / compiler.cpp
index e676fcc87233764cc529fe98203bc5d8b666df0f..a447c9c9adbb5c07550bfb090b0923552a1d916a 100644 (file)
@@ -75,6 +75,7 @@ void Compiler::compile(Mode mode)
        for(Stage &s: module->stages)
                generate(s);
        ConstantIdAssigner().apply(*module, features);
+       LocationAllocator().apply(*module, features, false);
 
        for(Stage &s: module->stages)
                validate(s);
@@ -363,7 +364,8 @@ Compiler::OptimizeResult Compiler::optimize(Stage &stage)
 {
        if(ConstantFolder().apply(stage))
                resolve(stage, RESOLVE_EXPRESSIONS);
-       ConstantConditionEliminator().apply(stage);
+       if(ConstantConditionEliminator().apply(stage))
+               resolve(stage, RESOLVE_VARIABLES);
 
        bool any_inlined = false;
        if(FunctionInliner().apply(stage))