diff options
authorLaszlo Agocs <laszlo.agocs@qt.io>2021-03-25 19:26:03 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-03-26 12:08:49 +0000
commit0b930884f1a64b2531ef8cbf1a077ed2955bf4ae (patch)
parent2a62754d98ee54bb987cb367aa647f74e5249089 (diff)
Warn when requesting GL/Vulkan but Qt is not configured for those
On embedded and mobile it can happen that the Qt build has no Vulkan support (because it is not there or not detected in the sysroot), and while this is visible in the configure output, it is best to make it also clear at run time. Change-Id: I316671a04aba80d38d2f8514695f55b05fb94dbd Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 4b83ae6472b30626c3492442a91125830ce28ebe) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
1 files changed, 5 insertions, 0 deletions
diff --git a/src/quick/scenegraph/qsgrhisupport.cpp b/src/quick/scenegraph/qsgrhisupport.cpp
index 1ccca23596..6ffefe9042 100644
--- a/src/quick/scenegraph/qsgrhisupport.cpp
+++ b/src/quick/scenegraph/qsgrhisupport.cpp
@@ -600,6 +600,8 @@ QRhi *QSGRhiSupport::createRhi(QQuickWindow *window, QOffscreenSurface *offscree
+ if (backend == QRhi::OpenGLES2)
+ qWarning("OpenGL was requested for Qt Quick, but this build of Qt has no OpenGL support.");
#if QT_CONFIG(vulkan)
if (backend == QRhi::Vulkan) {
@@ -631,6 +633,9 @@ QRhi *QSGRhiSupport::createRhi(QQuickWindow *window, QOffscreenSurface *offscree
rhi = QRhi::create(backend, &rhiParams, flags);
+ if (backend == QRhi::Vulkan)
+ qWarning("Vulkan was requested for Qt Quick, but this build of Qt has no Vulkan support.");
#ifdef Q_OS_WIN
if (backend == QRhi::D3D11) {