From e3ebc204edbcce7b66dcf4c6e34f46a0c44b20f8 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 31 Mar 2021 21:01:02 +0300 Subject: [PATCH] Move LegacyConverter invocation to the finalize stage --- source/glsl/compiler.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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) -- 2.43.0