diff options
author | Gunnar Sletta <gunnar@trolltech.com> | 2009-10-13 08:18:59 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2009-10-13 15:18:57 (GMT) |
commit | bd94c6df873ab196e537f5a49b57c86ccd66ad90 (patch) | |
tree | 0a103a65559a01502221f891f7e835fee9f53a87 /src | |
parent | 1ac2f104b7ab97f99a2b249b14bc5129588dbe46 (diff) | |
download | Qt-bd94c6df873ab196e537f5a49b57c86ccd66ad90.zip Qt-bd94c6df873ab196e537f5a49b57c86ccd66ad90.tar.gz Qt-bd94c6df873ab196e537f5a49b57c86ccd66ad90.tar.bz2 |
Work around broken ATI X1600 drivers on Mac OS X
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)
Diffstat (limited to 'src')
-rw-r--r-- | src/opengl/qgl.cpp | 20 |
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) |