X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fcompiler.cpp;h=03bde487075d3d67f37d1a0f52b9095eae36f4fd;hb=e3ebc204edbcce7b66dcf4c6e34f46a0c44b20f8;hp=40dfede3a68688e5ec9ef7a9fb23576af28d393e;hpb=7a62eb7f7550df161656616f2ece5a094b754392;p=libs%2Fgl.git diff --git a/source/glsl/compiler.cpp b/source/glsl/compiler.cpp index 40dfede3..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 @@ -300,7 +295,7 @@ void Compiler::resolve(Stage &stage, unsigned flags) bool Compiler::validate(Stage &stage) { - TypeValidator().apply(stage); + DeclarationValidator().apply(stage); IdentifierValidator().apply(stage); ReferenceValidator().apply(stage); ExpressionValidator().apply(stage); @@ -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)