X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fcompiler.cpp;h=e8b06c865dece84b471efff19f1608bed56916aa;hb=c8de66203565f07f10898a74dbd55072432790fc;hp=9c37787c32e20424681403939357a740318856ad;hpb=f2ad2730858046b08e8147297fa01bf3499b86a3;p=libs%2Fgl.git diff --git a/source/glsl/compiler.cpp b/source/glsl/compiler.cpp index 9c37787c..e8b06c86 100644 --- a/source/glsl/compiler.cpp +++ b/source/glsl/compiler.cpp @@ -2,10 +2,10 @@ #include #include #include "builtin.h" -#include "compatibility.h" #include "compiler.h" #include "debug.h" #include "error.h" +#include "finalize.h" #include "generate.h" #include "glsl_error.h" #include "optimize.h" @@ -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)