]> git.tdb.fi Git - libs/gl.git/commitdiff
Precision must always be specified for OpenGL ES
authorMikko Rasa <tdb@tdb.fi>
Wed, 12 Nov 2014 00:01:25 +0000 (02:01 +0200)
committerMikko Rasa <tdb@tdb.fi>
Wed, 12 Nov 2014 00:01:25 +0000 (02:01 +0200)
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)