aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2020-06-17 14:09:48 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2020-06-17 17:42:05 +0200
commit0fbb073c032782b0e7da5c9d645c22d1a1407849 (patch)
treef3075655fee1c0fd578ea484c16db3820cc37ab4 /src/quick/scenegraph
parent66b4321cd13412b93f1f4e8a8f3e238ce99f9e63 (diff)
Simplify the software backend selection logic
Avoid relying on the (somewhat obsolete) capability flag. Instead, have a clean and straightforward check based on QT_CONFIG. In the CI, in particular for the QEMU configs that are both OpenGL and Vulkan capable (build-wise, yuck), the software backend will be requested explicitly in the future so this won't need to cater for that anymore. Change-Id: Ifa100efdae208b789f6ed2a7b57330262c13284f Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/quick/scenegraph')
-rw-r--r--src/quick/scenegraph/qsgcontextplugin.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/quick/scenegraph/qsgcontextplugin.cpp b/src/quick/scenegraph/qsgcontextplugin.cpp
index 45ecb2009b..025716c2a7 100644
--- a/src/quick/scenegraph/qsgcontextplugin.cpp
+++ b/src/quick/scenegraph/qsgcontextplugin.cpp
@@ -133,14 +133,15 @@ QSGAdaptationBackendData *contextFactory()
if (requestedBackend.isEmpty())
requestedBackend = qEnvironmentVariable("QT_QUICK_BACKEND");
- // If this platform does not support OpenGL, Vulkan, D3D11, or Metal, and no backend has been set
- // default to the software renderer
-#if !QT_CONFIG(vulkan) && !defined(Q_OS_WIN) && !defined(Q_OS_MACOS) && !defined(Q_OS_IOS)
- if (requestedBackend.isEmpty()
- && !QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::OpenGL))
- {
+ // If this platform does not support OpenGL, Vulkan, D3D11, or Metal, and no
+ // backend has been set, default to the software renderer. We rely on the
+ // static, build time flags only. This is to prevent the inevitable confusion
+ // caused by run time hocus pocus. If one wants to use the software backend
+ // in a GL or Vulkan capable Qt build (or on Windows or Apple platforms), it
+ // has to be requested explicitly.
+#if !QT_CONFIG(opengl) && !QT_CONFIG(vulkan) && !defined(Q_OS_WIN) && !defined(Q_OS_MACOS) && !defined(Q_OS_IOS)
+ if (requestedBackend.isEmpty())
requestedBackend = QLatin1String("software");
- }
#endif
// This is handy if some of the logic above goes wrong and we select