Define default precision in fragment shaders after #extension
This commit is contained in:
parent
08e3a9ea13
commit
b70fa22d23
@ -66,10 +66,6 @@ GLuint ShaderBase::loadShader(const std::string &file, unsigned type)
|
|||||||
std::ostringstream code;
|
std::ostringstream code;
|
||||||
code << "#version " << CVS->getGLSLVersion()<<"\n";
|
code << "#version " << CVS->getGLSLVersion()<<"\n";
|
||||||
|
|
||||||
//shader compilation fails with some drivers if there is no precision qualifier
|
|
||||||
if (type == GL_FRAGMENT_SHADER)
|
|
||||||
code << "precision mediump float;\n";
|
|
||||||
|
|
||||||
if (CVS->isAMDVertexShaderLayerUsable())
|
if (CVS->isAMDVertexShaderLayerUsable())
|
||||||
code << "#extension GL_AMD_vertex_shader_layer : enable\n";
|
code << "#extension GL_AMD_vertex_shader_layer : enable\n";
|
||||||
if (CVS->isAZDOEnabled())
|
if (CVS->isAZDOEnabled())
|
||||||
@ -84,6 +80,11 @@ GLuint ShaderBase::loadShader(const std::string &file, unsigned type)
|
|||||||
code << "#define VSLayer\n";
|
code << "#define VSLayer\n";
|
||||||
if (CVS->needsRGBBindlessWorkaround())
|
if (CVS->needsRGBBindlessWorkaround())
|
||||||
code << "#define SRGBBindlessFix\n";
|
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();
|
code << getHeader();
|
||||||
|
|
||||||
std::ifstream stream(file_manager->getShader(file), std::ios::in);
|
std::ifstream stream(file_manager->getShader(file), std::ios::in);
|
||||||
|
Loading…
Reference in New Issue
Block a user