Add workaround for bug in the Mesa glsl optimizer

Change-Id: I23251f5288b41f5b7f86406984fdd854127797a9
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
This commit is contained in:
Jorgen Lind 2014-03-13 11:51:03 +01:00 committed by The Qt Project
parent 9cd2dac348
commit fde6450b59

View File

@ -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[] = {