summaryrefslogtreecommitdiffstats
path: root/src/opengl/gl2paintengineex/qglengineshadersource_p.h
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2010-03-10 15:13:25 +0100
committerSamuel Rødal <sroedal@trolltech.com>2010-03-10 15:46:25 +0100
commit7dc470fd96f50eff923208cdc6e273161062e2a7 (patch)
tree0f26342dcd5545175342a9d338a137b2e0a6f2b9 /src/opengl/gl2paintengineex/qglengineshadersource_p.h
parentfdf85116102ed03a56dae3947f4251bf0f889f33 (diff)
Worked around driver bug causing clipping errors on N900.
Apparently the driver does some optimization which causes it to behave erratically when stencil testing is enabled. Multiplying the return value from the texture lookup by 1.0 disables the optimization. Task-number: QTBUG-8753 Reviewed-by: Trond
Diffstat (limited to 'src/opengl/gl2paintengineex/qglengineshadersource_p.h')
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadersource_p.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/opengl/gl2paintengineex/qglengineshadersource_p.h b/src/opengl/gl2paintengineex/qglengineshadersource_p.h
index ee0416685a..c88c0417f1 100644
--- a/src/opengl/gl2paintengineex/qglengineshadersource_p.h
+++ b/src/opengl/gl2paintengineex/qglengineshadersource_p.h
@@ -331,9 +331,14 @@ static const char* const qglslImageSrcFragmentShader = "\n\
varying highp vec2 textureCoords; \n\
uniform lowp sampler2D imageTexture; \n\
lowp vec4 srcPixel() \n\
- { \n\
- return texture2D(imageTexture, textureCoords); \n\
- }\n";
+ { \n"
+#ifdef QT_OPENGL_ES_2
+ // work-around for driver bug
+ "return 1.0 * texture2D(imageTexture, textureCoords); \n"
+#else
+ "return texture2D(imageTexture, textureCoords); \n"
+#endif
+ "}\n";
static const char* const qglslCustomSrcFragmentShader = "\n\
varying highp vec2 textureCoords; \n\