]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/compiler.cpp
Combine the precision handling visitors and rewrite the logic
[libs/gl.git] / source / glsl / compiler.cpp
index 03bde487075d3d67f37d1a0f52b9095eae36f4fd..d8b060ea4e3873285980373e45974ee1b6b84950 100644 (file)
@@ -2,10 +2,10 @@
 #include <msp/strings/format.h>
 #include <msp/strings/utils.h>
 #include "builtin.h"
-#include "compatibility.h"
 #include "compiler.h"
 #include "debug.h"
 #include "error.h"
+#include "finalize.h"
 #include "generate.h"
 #include "glsl_error.h"
 #include "optimize.h"
@@ -357,12 +357,8 @@ void Compiler::finalize(Stage &stage, Mode mode)
        {
                LegacyConverter().apply(stage, features);
                resolve(stage, RESOLVE_VARIABLES|RESOLVE_FUNCTIONS);
+               PrecisionConverter().apply(stage);
        }
-
-       if(get_gl_api()==OPENGL_ES2 && mode==PROGRAM)
-               DefaultPrecisionGenerator().apply(stage);
-       else if(mode==MODULE)
-               PrecisionRemover().apply(stage);
 }
 
 void Compiler::inject_block(Block &target, const Block &source)