From ca5b49a2ec0ee9d7030b8d03b561717addd3441f Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Tue, 13 Oct 2009 10:18:59 +0200 Subject: 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) (cherry picked from commit bd94c6df873ab196e537f5a49b57c86ccd66ad90) --- src/opengl/qgl.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) 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) -- cgit v0.12