From 3c50119625fec9c0a1e6d056f6f7e9f59e730c36 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 18 Feb 2014 14:11:34 +0100 Subject: [PATCH] Avoid using GLX Pbuffers on Catalyst Trigger QOffscreenSurface's fallback mode (hidden QWindow and a regular window surface) instead. queryDummyContext() already works like this but the same must be done for any QOffscreenSurface. Task-number: QTBUG-36900 Change-Id: I64176ac6704e9d6ed768fa3d456c40c8818be6dc Reviewed-by: Gunnar Sletta Reviewed-by: Shawn Rutledge --- src/plugins/platforms/xcb/qxcbintegration.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index 768a591ab5a..aaa2e81c40f 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -253,7 +253,18 @@ QPlatformBackingStore *QXcbIntegration::createPlatformBackingStore(QWindow *wind QPlatformOffscreenSurface *QXcbIntegration::createPlatformOffscreenSurface(QOffscreenSurface *surface) const { #if defined(XCB_USE_GLX) - return new QGLXPbuffer(surface); + static bool vendorChecked = false; + static bool glxPbufferUsable = true; + if (!vendorChecked) { + vendorChecked = true; + const char *glxvendor = glXGetClientString(glXGetCurrentDisplay(), GLX_VENDOR); + if (glxvendor && !strcmp(glxvendor, "ATI")) + glxPbufferUsable = false; + } + if (glxPbufferUsable) + return new QGLXPbuffer(surface); + else + return 0; // trigger fallback to hidden QWindow #elif defined(XCB_USE_EGL) QXcbScreen *screen = static_cast(surface->screen()->handle()); return new QEGLPbuffer(screen->connection()->egl_display(), surface->requestedFormat(), surface);