From 5931e20f8bb32e6712c7111ee73a4da96a13f396 Mon Sep 17 00:00:00 2001 From: Deve Date: Fri, 24 Mar 2017 22:18:30 +0100 Subject: [PATCH] Use highp precision qualifier. For OpenGL 3.x renderer it only matters for some buggy drivers (i.e old AMD driver that complains about missing precision qualifier). Based on specification is should have no effect and was added for compatibility with GL ES. In our case vertex and fragment must have the same precision because we use common header for both shader types and the precision for uniform variables must match. Also "precision highp float;" is defined by default for both vertex and fragment shaders, so it seems to be more proper. This will hopefully solve the problem with nvidia driver that tries to use f16vec4 instead of just vec4, see: https://forum.freegamedev.net/viewtopic.php?f=17&t=7397&sid=06682ddb05ee9fbf48a2984d0bd48d5b --- src/graphics/shader_files_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/graphics/shader_files_manager.cpp b/src/graphics/shader_files_manager.cpp index 044183dbb..2a69220db 100644 --- a/src/graphics/shader_files_manager.cpp +++ b/src/graphics/shader_files_manager.cpp @@ -169,7 +169,7 @@ GLuint ShaderFilesManager::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"; + code << "precision highp float;\n"; #else int range[2], precision; glGetShaderPrecisionFormat(GL_FRAGMENT_SHADER, GL_HIGH_FLOAT, range,