From 0b930884f1a64b2531ef8cbf1a077ed2955bf4ae Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 25 Mar 2021 19:26:03 +0100 Subject: 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 (cherry picked from commit 4b83ae6472b30626c3492442a91125830ce28ebe) Reviewed-by: Qt Cherry-pick Bot --- src/quick/scenegraph/qsgrhisupport.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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 } #else Q_UNUSED(offscreenSurface); + if (backend == QRhi::OpenGLES2) + qWarning("OpenGL was requested for Qt Quick, but this build of Qt has no OpenGL support."); #endif #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); } } +#else + if (backend == QRhi::Vulkan) + qWarning("Vulkan was requested for Qt Quick, but this build of Qt has no Vulkan support."); #endif #ifdef Q_OS_WIN if (backend == QRhi::D3D11) { -- cgit v1.2.3