Fallback to XRender if scene-graph uses GUI thread for OpenGL rendering

This is a workaround fo QTBUG-34898 and affects the VirtualBox driver
and SandyBridge Mobile. OpenGL compositing is just not possible and
crashes as soon as there is anything rendered with QtQuick. This change
should be reverted once the Qt bug is fixed.

To nevertheless use OpenGL one can as always use the KWIN_COMPOSE env
variable, though this will result in crashes. An alternative is to set
QT_OPENGL_NO_SANITY_CHECK which forces Qt into using the threaded
rendering. At least for Sandybridge this seems to be a workable solution
as it's only causing flickering in fullscreen and KWin doesn't use any
fullscreen QtQuick elements.
This commit is contained in:
Martin Gräßlin 2013-11-22 15:44:37 +01:00
parent b7be3cb621
commit 2e3eb5402b

View file

@ -753,6 +753,11 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface)
m_driverVersion = parseVersionString(versionTokens.at(index + 1)); m_driverVersion = parseVersionString(versionTokens.at(index + 1));
else else
m_driverVersion = 0; m_driverVersion = 0;
if (qgetenv("QT_OPENGL_NO_SANITY_CHECK").isNull()) {
// workaround for QTBUG-34898
m_recommendedCompositor = XRenderCompositing;
}
} }
@ -825,6 +830,10 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface)
} else { } else {
m_recommendedCompositor = OpenGL2Compositing; m_recommendedCompositor = OpenGL2Compositing;
} }
if (m_chipClass == SandyBridge && m_renderer.contains("Mobile") && qgetenv("QT_OPENGL_NO_SANITY_CHECK").isNull()) {
// workaround for QTBUG-34898
m_recommendedCompositor = XRenderCompositing;
}
} }
if (isMesaDriver() && platformInterface == EglPlatformInterface) { if (isMesaDriver() && platformInterface == EglPlatformInterface) {