summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brüning <michael.bruning@qt.io>2018-10-16 18:17:56 +0200
committerMichael Brüning <michael.bruning@qt.io>2018-10-23 08:29:31 +0000
commit72bedd49bfb02ba7c7abf2a1a4c6cd165ebcd447 (patch)
tree5a1e7f01ace9530b842948b6e1e35ee1b6b28fe2
parent0cb44e2cfb11033cdb7e3b73a25f1ec394b08d6e (diff)
[cocoa] Disable offline renderers for dual AMD FirePro GPU
The AMD FirePro dual gpus on the Mac Pro have a problem with offline renderers in Chromium. Therefore, Chromium and thus Qt WebEngine disable this option via the pixel format attributes. The Qt Cocoa plugin on the other hand enables it in the recent versions, causing context creation in Qt WebEngine to fail when run on a Mac Pro with dual AMD FirePro gpus due to incompatible context options. This patch uses the environment variable QT_MAC_PRO_WEBENGINE_WORKAROUND which is set by Qt WebEngine upon application startup if the application is running on a late 2013 Mac Pro. It should typically not be set from anywhere else. [ChangeLog] Offline renderers will be disabled when the application is using Qt WebEngine and running on one of the late 2013 Mac Pro models. Fixes: QTBUG-70062 Change-Id: I0b0831efb6f4073ebd37672040aaed6370853fc0 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
-rw-r--r--src/plugins/platforms/cocoa/qcocoaglcontext.mm8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm
index 7ffe0003d3..76f8a7bb02 100644
--- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm
+++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm
@@ -456,7 +456,13 @@ NSOpenGLPixelFormat *QCocoaGLContext::createNSOpenGLPixelFormat(const QSurfaceFo
if (format.stereo())
attrs << NSOpenGLPFAStereo;
- attrs << NSOpenGLPFAAllowOfflineRenderers;
+ //Workaround for problems with Chromium and offline renderers on the lat 2013 MacPros.
+ //FIXME: Think if this could be solved via QSurfaceFormat in the future.
+ static bool offlineRenderersAllowed = qEnvironmentVariableIsEmpty("QT_MAC_PRO_WEBENGINE_WORKAROUND");
+ if (offlineRenderersAllowed) {
+ // Allow rendering on GPUs without a connected display
+ attrs << NSOpenGLPFAAllowOfflineRenderers;
+ }
QByteArray useLayer = qgetenv("QT_MAC_WANTS_LAYER");
if (!useLayer.isEmpty() && useLayer.toInt() > 0) {