From 3e0355014edda23d94605c77dd8c1582b91f9c18 Mon Sep 17 00:00:00 2001 From: Jeremy Katz Date: Mon, 13 Mar 2017 14:47:56 -0700 Subject: warn of blacklisted GLX OpenGL renderers and vendors Notify users when multithreaded OpenGL is disabled due to the renderer or vendor blacklist. Change-Id: I16a80568afe87b227575102ca839f18050613e90 Reviewed-by: Ulf Hermann --- .../xcb/gl_integrations/xcb_glx/qglxintegration.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp') diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp index 4e0c73450e..caa4b7361a 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp @@ -56,6 +56,8 @@ #include #include +#include "qxcbglintegration.h" + #if !defined(QT_STATIC) && QT_CONFIG(dlopen) #include #endif @@ -691,6 +693,10 @@ void QGLXContext::queryDummyContext() if (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) { + qCInfo(lcQpaGl).nospace() << "Multithreaded OpenGL disabled: " + "blacklisted renderer \"" + << qglx_threadedgl_blacklist_renderer[i] + << "\""; m_supportsThreading = false; break; } @@ -700,6 +706,11 @@ void QGLXContext::queryDummyContext() if (glxvendor) { for (int i = 0; qglx_threadedgl_blacklist_vendor[i]; ++i) { if (strstr(glxvendor, qglx_threadedgl_blacklist_vendor[i]) != 0) { + qCInfo(lcQpaGl).nospace() << "Multithreaded OpenGL disabled: " + "blacklisted vendor \"" + << qglx_threadedgl_blacklist_vendor[i] + << "\""; + m_supportsThreading = false; break; } @@ -709,6 +720,11 @@ void QGLXContext::queryDummyContext() context.doneCurrent(); if (oldContext && oldSurface) oldContext->makeCurrent(oldSurface); + + if (!m_supportsThreading) { + qCInfo(lcQpaGl) << "Force-enable multithreaded OpenGL by setting " + "environment variable QT_OPENGL_NO_SANITY_CHECK"; + } } bool QGLXContext::supportsThreading() -- cgit v1.2.3