summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-05-12 18:23:42 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-05-12 18:23:42 (GMT)
commitf474f0f900d48b41be1a3de1dffe48552ab23372 (patch)
treed8e1d15800612f1d07c3c120e9a0ddb3b3b5f98d
parent372df5569dbd114efbaacf349e0ae6cadc0138cc (diff)
parent7f1b5ae80535f7be95002ef947744828ad70be89 (diff)
downloadQt-f474f0f900d48b41be1a3de1dffe48552ab23372.zip
Qt-f474f0f900d48b41be1a3de1dffe48552ab23372.tar.gz
Qt-f474f0f900d48b41be1a3de1dffe48552ab23372.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Workaround for ATI driver bug when using QGraphicsEffect with GL.
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadermanager.cpp10
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadersource_p.h1
2 files changed, 6 insertions, 5 deletions
diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
index 8183f08..0c98e3b 100644
--- a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
+++ b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
@@ -265,10 +265,12 @@ QGLEngineShaderProg *QGLEngineSharedShaders::findProgramInCache(const QGLEngineS
do {
QByteArray source;
- source.append(qShaderSnippets[prog.mainFragShader]);
- source.append(qShaderSnippets[prog.srcPixelFragShader]);
+ // Insert the custom stage before the srcPixel shader to work around an ATI driver bug
+ // where you cannot forward declare a function that takes a sampler as argument.
if (prog.srcPixelFragShader == CustomImageSrcFragmentShader)
source.append(prog.customStageSource);
+ source.append(qShaderSnippets[prog.mainFragShader]);
+ source.append(qShaderSnippets[prog.srcPixelFragShader]);
if (prog.compositionFragShader)
source.append(qShaderSnippets[prog.compositionFragShader]);
if (prog.maskFragShader)
@@ -765,8 +767,8 @@ bool QGLEngineShaderManager::useCorrectShaderProg()
// doesn't use are disabled)
QGLContextPrivate* ctx_d = ctx->d_func();
ctx_d->setVertexAttribArrayEnabled(QT_VERTEX_COORDS_ATTR, true);
- ctx_d->setVertexAttribArrayEnabled(QT_TEXTURE_COORDS_ATTR, currentShaderProg->useTextureCoords);
- ctx_d->setVertexAttribArrayEnabled(QT_OPACITY_ATTR, currentShaderProg->useOpacityAttribute);
+ ctx_d->setVertexAttribArrayEnabled(QT_TEXTURE_COORDS_ATTR, currentShaderProg && currentShaderProg->useTextureCoords);
+ ctx_d->setVertexAttribArrayEnabled(QT_OPACITY_ATTR, currentShaderProg && currentShaderProg->useOpacityAttribute);
shaderProgNeedsChanging = false;
return true;
diff --git a/src/opengl/gl2paintengineex/qglengineshadersource_p.h b/src/opengl/gl2paintengineex/qglengineshadersource_p.h
index c88c041..c963265 100644
--- a/src/opengl/gl2paintengineex/qglengineshadersource_p.h
+++ b/src/opengl/gl2paintengineex/qglengineshadersource_p.h
@@ -343,7 +343,6 @@ static const char* const qglslImageSrcFragmentShader = "\n\
static const char* const qglslCustomSrcFragmentShader = "\n\
varying highp vec2 textureCoords; \n\
uniform lowp sampler2D imageTexture; \n\
- lowp vec4 customShader(lowp sampler2D texture, highp vec2 coords); \n\
lowp vec4 srcPixel() \n\
{ \n\
return customShader(imageTexture, textureCoords); \n\