]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/compiler.cpp
Move LegacyConverter invocation to the finalize stage
[libs/gl.git] / source / glsl / compiler.cpp
index 8a18fdf48df64d6224f9fc3f8d0b00d6a749be7e..03bde487075d3d67f37d1a0f52b9095eae36f4fd 100644 (file)
@@ -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<typename T>
@@ -300,8 +295,8 @@ 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)