X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fglsl%2Fcompiler.cpp;h=1eeb36252ba899a8f8851798f2a393a1223cc05d;hp=55a69f0df38ecaf1b681f9a698e6bbc2abed02da;hb=d5c7c7f0b15c407b3da2184936e6deed18554c6a;hpb=2d79e7d495480251ada1bd6478339537b9799e7f diff --git a/source/glsl/compiler.cpp b/source/glsl/compiler.cpp index 55a69f0d..1eeb3625 100644 --- a/source/glsl/compiler.cpp +++ b/source/glsl/compiler.cpp @@ -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. */