summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-10-13 08:18:59 (GMT)
committerGunnar Sletta <gunnar@trolltech.com>2009-10-13 08:23:54 (GMT)
commit33ed3d0bacddce214a43be60eb6481903e753a88 (patch)
tree56a2bb81af5aced6a751a7b8638d98f4f44d93c4
parente5954bba5bb1f88a847570d4790d0cef64f92209 (diff)
downloadQt-33ed3d0bacddce214a43be60eb6481903e753a88.zip
Qt-33ed3d0bacddce214a43be60eb6481903e753a88.tar.gz
Qt-33ed3d0bacddce214a43be60eb6481903e753a88.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
-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)