]> git.tdb.fi Git - libs/gl.git/blobdiff - source/programbuilder.cpp
Precision must always be specified for OpenGL ES
[libs/gl.git] / source / programbuilder.cpp
index dc4bd19cacce0f146436bee57420946f6200321b..002e3a275f7ef7e1c7eaa05e08e277d9106da734 100644 (file)
@@ -385,7 +385,6 @@ string ProgramBuilder::create_source(const list<ShaderVariable *> &variables, Va
                {
                        if(use_blocks)
                                source += "#version 300 es\n";
-                       source += "precision mediump float;\n";
                }
                else
                {
@@ -395,6 +394,9 @@ string ProgramBuilder::create_source(const list<ShaderVariable *> &variables, Va
                }
        }
 
+       if(get_gl_api()==OPENGL_ES2)
+               source += "precision mediump float;\n";
+
        set<const VariableDefinition *> declared_types;
        set<string> uniform_blocks;
        for(list<ShaderVariable *>::const_iterator i=variables.begin(); i!=variables.end(); ++i)