Disable threaded GL for nouveau drivers.

Task-number: QTCREATORBUG-10875
Change-Id: I25f3abc6ef15bba78fa9ec27de2c1e5e0bcc7fae
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
Gunnar Sletta 2013-11-22 07:38:26 +01:00 committed by The Qt Project
parent 3f97e38440
commit 7879fbe4b8

View File

@ -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<QSurface> 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;
}