From fde6450b598a047ec22e495837cf892049ed7add Mon Sep 17 00:00:00 2001 From: Jorgen Lind Date: Thu, 13 Mar 2014 11:51:03 +0100 Subject: Add workaround for bug in the Mesa glsl optimizer Change-Id: I23251f5288b41f5b7f86406984fdd854127797a9 Reviewed-by: Laszlo Agocs --- src/gui/opengl/qopengltextureblitter.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/gui/opengl') diff --git a/src/gui/opengl/qopengltextureblitter.cpp b/src/gui/opengl/qopengltextureblitter.cpp index d52517add2..9710f1677c 100644 --- a/src/gui/opengl/qopengltextureblitter.cpp +++ b/src/gui/opengl/qopengltextureblitter.cpp @@ -68,11 +68,8 @@ static const char fragment_shader150[] = "uniform sampler2D textureSampler;" "uniform bool swizzle;" "void main() {" - " if (swizzle) {" - " fragcolor = texture(textureSampler, uv).bgra;" - " } else {" - " fragcolor = texture(textureSampler,uv);" - " }" + " vec4 tmpFragColor = texture(textureSampler, uv);" + " fragcolor = swizzle ? tmpFragColor.bgra : tmpFragColor;" "}"; static const char vertex_shader[] = @@ -91,11 +88,8 @@ static const char fragment_shader[] = "uniform sampler2D textureSampler;" "uniform bool swizzle;" "void main() {" - " if (swizzle) {" - " gl_FragColor = texture2D(textureSampler, uv).bgra;" - " } else {" - " gl_FragColor = texture2D(textureSampler,uv);" - " }" + " highp vec4 tmpFragColor = texture2D(textureSampler,uv);" + " gl_FragColor = swizzle ? tmpFragColor.bgra : tmpFragColor;" "}"; static const GLfloat vertex_buffer_data[] = { -- cgit v1.2.3