X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fglsl%2Fcompiler.cpp;h=03bde487075d3d67f37d1a0f52b9095eae36f4fd;hp=9c37787c32e20424681403939357a740318856ad;hb=e3ebc204edbcce7b66dcf4c6e34f46a0c44b20f8;hpb=7af200475facc657a0bbffaa17520d3ec9d809af diff --git a/source/glsl/compiler.cpp b/source/glsl/compiler.cpp index 9c37787c..03bde487 100644 --- a/source/glsl/compiler.cpp +++ b/source/glsl/compiler.cpp @@ -264,11 +264,6 @@ void Compiler::generate(Stage &stage, Mode mode) resolve(stage, RESOLVE_BLOCKS|RESOLVE_TYPES|RESOLVE_VARIABLES); ConstantSpecializer().apply(stage, (mode==PROGRAM && specialized ? &spec_values : 0)); - if(mode==PROGRAM) - { - LegacyConverter().apply(stage, features); - resolve(stage, RESOLVE_VARIABLES|RESOLVE_FUNCTIONS); - } } template @@ -358,6 +353,12 @@ Compiler::OptimizeResult Compiler::optimize(Stage &stage) void Compiler::finalize(Stage &stage, Mode mode) { + if(mode==PROGRAM) + { + LegacyConverter().apply(stage, features); + resolve(stage, RESOLVE_VARIABLES|RESOLVE_FUNCTIONS); + } + if(get_gl_api()==OPENGL_ES2 && mode==PROGRAM) DefaultPrecisionGenerator().apply(stage); else if(mode==MODULE)