]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/compiler.cpp
Further improve inlining of GLSL functions
[libs/gl.git] / source / glsl / compiler.cpp
index 55a69f0df38ecaf1b681f9a698e6bbc2abed02da..1eeb36252ba899a8f8851798f2a393a1223cc05d 100644 (file)
@@ -244,8 +244,11 @@ Compiler::OptimizeResult Compiler::optimize(Stage &stage)
        ConstantConditionEliminator().apply(stage);
 
        bool any_inlined = FunctionInliner().apply(stage);
-       BlockHierarchyResolver().apply(stage);
-       VariableResolver().apply(stage);
+       if(any_inlined)
+       {
+               VariableResolver().apply(stage);
+               FunctionResolver().apply(stage);
+       }
 
        /* Removing variables or functions may cause things from the previous stage
        to become unused. */