aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgrhisupport.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2020-05-08 16:27:24 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2020-05-11 08:43:46 +0200
commit8c9b7de4c6dd7532e99a068083d0eb6c70aa49a3 (patch)
tree448605ba3889986c53174232260d61db185dda68 /src/quick/scenegraph/qsgrhisupport.cpp
parentc9f0fe6b8b8b523c5759189a1422c3b2d02c06eb (diff)
Only alter rhi backend on Win7 and Metalless-macOS when not explicitly requested
When forcing a given backend from the C++ API or QSG_RHI_BACKEND, the user/application's request must be honored. Otherwise confusing situations arise. If the requested backend fails, let's just fail. It is the "just pick a platform specific default" case where we have the flexibility of choosing between the backends. Change-Id: If30c329bc7ce8ec26abee0ae2d4bcaef53df4718 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/quick/scenegraph/qsgrhisupport.cpp')
-rw-r--r--src/quick/scenegraph/qsgrhisupport.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/quick/scenegraph/qsgrhisupport.cpp b/src/quick/scenegraph/qsgrhisupport.cpp
index fe3b626077..22a1827f72 100644
--- a/src/quick/scenegraph/qsgrhisupport.cpp
+++ b/src/quick/scenegraph/qsgrhisupport.cpp
@@ -177,14 +177,17 @@ void QSGRhiSupport::applySettings()
m_rhiBackend = QRhi::OpenGLES2;
#endif
// Vulkan has to be requested explicitly
+
+ // Now that we established our initial choice, we may want to opt
+ // for another backend under certain special circumstances.
+ if (m_enableRhi) // guard because this may do actual graphics calls on some platforms
+ adjustToPlatformQuirks();
}
}
if (!m_enableRhi)
return;
- adjustToPlatformQuirks();
-
// At this point the RHI backend is fixed, it cannot be changed once we
// return from this function. This is because things like the QWindow
// (QQuickWindow) may depend on the graphics API as well (surfaceType