From 7879fbe4b8e6396fff199476494c1e05fb4c16e9 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Fri, 22 Nov 2013 07:38:26 +0100 Subject: [PATCH] Disable threaded GL for nouveau drivers. Task-number: QTCREATORBUG-10875 Change-Id: I25f3abc6ef15bba78fa9ec27de2c1e5e0bcc7fae Reviewed-by: Lars Knoll Reviewed-by: Kai Koehne --- src/plugins/platforms/xcb/qglxintegration.cpp | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/src/plugins/platforms/xcb/qglxintegration.cpp b/src/plugins/platforms/xcb/qglxintegration.cpp index e6fa8fc898..e504d93fba 100644 --- a/src/plugins/platforms/xcb/qglxintegration.cpp +++ b/src/plugins/platforms/xcb/qglxintegration.cpp @@ -415,12 +415,17 @@ bool QGLXContext::m_supportsThreading = true; // If this list grows to any significant size, change it a // proper string table and make the implementation below use // binary search. -static const char *qglx_threadedgl_blacklist[] = { +static const char *qglx_threadedgl_blacklist_renderer[] = { "Chromium", // QTBUG-32225 (initialization fails) "Mesa DRI Intel(R) Sandybridge Mobile", // QTBUG-34492 (flickering in fullscreen) 0 }; +static const char *qglx_threadedgl_blacklist_vendor[] = { + "nouveau", // QTCREATORBUG-10875 (crash in creator) + 0 +}; + void QGLXContext::queryDummyContext() { if (m_queriedDummyContext) @@ -437,8 +442,8 @@ void QGLXContext::queryDummyContext() oldSurface = oldContext->surface(); QScopedPointer surface; - const char *vendor = glXGetClientString(glXGetCurrentDisplay(), GLX_VENDOR); - if (vendor && !strcmp(vendor, "ATI")) { + const char *glxvendor = glXGetClientString(glXGetCurrentDisplay(), GLX_VENDOR); + if (glxvendor && !strcmp(glxvendor, "ATI")) { QWindow *window = new QWindow; window->resize(64, 64); window->setSurfaceType(QSurface::OpenGLSurface); @@ -454,11 +459,19 @@ void QGLXContext::queryDummyContext() context.create(); context.makeCurrent(surface.data()); - const char *renderer = (const char *) glGetString(GL_RENDERER); - m_supportsThreading = true; - for (int i = 0; qglx_threadedgl_blacklist[i]; ++i) { - if (strstr(renderer, qglx_threadedgl_blacklist[i]) != 0) { + + const char *renderer = (const char *) glGetString(GL_RENDERER); + for (int i = 0; qglx_threadedgl_blacklist_renderer[i]; ++i) { + if (strstr(renderer, qglx_threadedgl_blacklist_renderer[i]) != 0) { + m_supportsThreading = false; + break; + } + } + + const char *vendor = (const char *) glGetString(GL_VENDOR); + for (int i = 0; qglx_threadedgl_blacklist_vendor[i]; ++i) { + if (strstr(vendor, qglx_threadedgl_blacklist_vendor[i]) != 0) { m_supportsThreading = false; break; }