]> git.tdb.fi Git - libs/gl.git/commitdiff
Move LegacyConverter invocation to the finalize stage
authorMikko Rasa <tdb@tdb.fi>
Wed, 31 Mar 2021 18:01:02 +0000 (21:01 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 31 Mar 2021 18:01:02 +0000 (21:01 +0300)
source/glsl/compiler.cpp

index 9c37787c32e20424681403939357a740318856ad..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>
@@ -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)