From: Mikko Rasa Date: Wed, 31 Mar 2021 18:01:02 +0000 (+0300) Subject: Move LegacyConverter invocation to the finalize stage X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=e3ebc204edbcce7b66dcf4c6e34f46a0c44b20f8 Move LegacyConverter invocation to the finalize stage --- 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)