diff options
author | Jorgen Lind <jorgen.lind@digia.com> | 2014-03-13 11:51:03 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-14 22:39:15 +0100 |
commit | fde6450b598a047ec22e495837cf892049ed7add (patch) | |
tree | 4627a376c11e99f3ef5b5d62b936e1c4d76159ac /src/gui/opengl/qopengltextureblitter.cpp | |
parent | 9cd2dac348f45c4b93f74f8ebe20d7528821f003 (diff) |
Add workaround for bug in the Mesa glsl optimizer
Change-Id: I23251f5288b41f5b7f86406984fdd854127797a9
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/gui/opengl/qopengltextureblitter.cpp')
-rw-r--r-- | src/gui/opengl/qopengltextureblitter.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
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[] = { |