Merge pull request #2373 from Elderme/issue_2369

Fix issue 2369
This commit is contained in:
auriamg 2015-11-04 18:24:03 -05:00
commit c2d863888b

View File

@ -65,6 +65,7 @@ GLuint ShaderBase::loadShader(const std::string &file, unsigned type)
std::ostringstream code;
code << "#version " << CVS->getGLSLVersion()<<"\n";
if (CVS->isAMDVertexShaderLayerUsable())
code << "#extension GL_AMD_vertex_shader_layer : enable\n";
if (CVS->isAZDOEnabled())
@ -79,6 +80,11 @@ GLuint ShaderBase::loadShader(const std::string &file, unsigned type)
code << "#define VSLayer\n";
if (CVS->needsRGBBindlessWorkaround())
code << "#define SRGBBindlessFix\n";
//shader compilation fails with some drivers if there is no precision qualifier
if (type == GL_FRAGMENT_SHADER)
code << "precision mediump float;\n";
code << getHeader();
std::ifstream stream(file_manager->getShader(file), std::ios::in);