summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-10-13 08:18:59 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2009-10-13 15:23:05 (GMT)
commitca5b49a2ec0ee9d7030b8d03b561717addd3441f (patch)
tree36f556b836179d7967107cdc0075aedc8e0a4308
parentc59eff45ef16cae014e71a9a22b88a65bf0f343c (diff)
downloadQt-ca5b49a2ec0ee9d7030b8d03b561717addd3441f.zip
Qt-ca5b49a2ec0ee9d7030b8d03b561717addd3441f.tar.gz
Qt-ca5b49a2ec0ee9d7030b8d03b561717addd3441f.tar.bz2
Work around broken ATI X1600 drivers on Mac OS Xv4.6.0-beta1
The GLSL implementation messes up return values from functions so that all our srcPixel()'s become black and several matrices are off. We don't want to rewrite the shader code to fit an "ancient" graphics card, so we simply fall back to the GL 1 engine. Reviewed-by: Trond (cherry picked from commit 33ed3d0bacddce214a43be60eb6481903e753a88) (cherry picked from commit bd94c6df873ab196e537f5a49b57c86ccd66ad90)
-rw-r--r--src/opengl/qgl.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 3f96d1c..8aef8b4 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -150,7 +150,25 @@ QGLSignalProxy *QGLSignalProxy::instance()
class QGLEngineSelector
{
public:
- QGLEngineSelector() : engineType(QPaintEngine::MaxUser) { }
+ QGLEngineSelector() : engineType(QPaintEngine::MaxUser)
+ {
+#ifdef Q_WS_MAC
+ // The ATI X1600 driver for Mac OS X does not support return
+ // values from functions in GLSL. Since working around this in
+ // the GL2 engine would require a big, ugly rewrite, we're
+ // falling back to the GL 1 engine..
+ QGLWidget *tmp = 0;
+ if (!QGLContext::currentContext()) {
+ tmp = new QGLWidget();
+ tmp->makeCurrent();
+ }
+ if (strstr((char *) glGetString(GL_RENDERER), "X1600"))
+ setPreferredPaintEngine(QPaintEngine::OpenGL);
+ if (tmp)
+ delete tmp;
+#endif
+
+ }
void setPreferredPaintEngine(QPaintEngine::Type type) {
if (type == QPaintEngine::OpenGL || type == QPaintEngine::OpenGL2)