From c68a0922074fcb38f1de0f00d9a445374d6d3a4c Mon Sep 17 00:00:00 2001 From: Francisco Zurita Date: Mon, 20 Feb 2017 01:29:10 -0500 Subject: [PATCH] Fix GLSL compilation error with PowerVR devices. --- .../GLSL/glsl_CombinerProgramBuilder.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramBuilder.cpp b/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramBuilder.cpp index 284998c1..917cf2f9 100644 --- a/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramBuilder.cpp +++ b/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramBuilder.cpp @@ -275,12 +275,13 @@ public: " vNumLights = 0.0; \n" " } \n" " if (uFogUsage == 1) { \n" - " lowp float fp; \n" + " lowp vec4 shadeColor = aColor; \n" " if (aPosition.z < -aPosition.w && aModify[1] == 0.0) \n" - " fp = -uFogScale.s + uFogScale.t; \n" + " shadeColor.a = -uFogScale.s + uFogScale.t; \n" " else \n" - " fp = aPosition.z/aPosition.w*uFogScale.s + uFogScale.t; \n" - " vShadeColor.a = clamp(fp, 0.0, 1.0); \n" + " shadeColor.a = aPosition.z/aPosition.w*uFogScale.s + uFogScale.t; \n" + " shadeColor.a = clamp(shadeColor.a, 0.0, 1.0); \n" + " vShadeColor = shadeColor; \n" " } \n" ; if (!_glinfo.isGLESX) { @@ -1926,7 +1927,8 @@ GLuint _createVertexShader(ShaderPart * _header, ShaderPart * _body) GLuint shader_object = glCreateShader(GL_VERTEX_SHADER); glShaderSource(shader_object, 1, &strShaderData, nullptr); glCompileShader(shader_object); - assert(Utils::checkShaderCompileStatus(shader_object)); + if (!Utils::checkShaderCompileStatus(shader_object)) + Utils::logErrorShader(GL_VERTEX_SHADER, strShaderData); return shader_object; }