Declare precision also in vertex shaders in GLES renderer.

Some drivers complain that it was declared only in fragment shaders.
This commit is contained in:
deve 2016-08-26 10:35:48 +02:00
parent 084fa04012
commit 5abc047b0c
2 changed files with 20 additions and 14 deletions

View File

@ -1,5 +1,7 @@
#version 300 es
precision mediump float;
in vec3 Position;
in vec2 Texcoord;
out vec2 uv;

View File

@ -110,6 +110,10 @@ GLuint ShaderBase::loadShader(const std::string &file, unsigned type)
//shader compilation fails with some drivers if there is no precision qualifier
if (type == GL_FRAGMENT_SHADER)
code << "precision mediump float;\n";
#if defined(USE_GLES2)
else if (type == GL_VERTEX_SHADER)
code << "precision mediump float;\n";
#endif
code << getHeader();