aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgrhisupport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/scenegraph/qsgrhisupport.cpp')
-rw-r--r--src/quick/scenegraph/qsgrhisupport.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/quick/scenegraph/qsgrhisupport.cpp b/src/quick/scenegraph/qsgrhisupport.cpp
index ffc07a2791..b86667a972 100644
--- a/src/quick/scenegraph/qsgrhisupport.cpp
+++ b/src/quick/scenegraph/qsgrhisupport.cpp
@@ -438,12 +438,13 @@ static const void *qsgrhi_mtl_rifResource(QSGRendererInterface::Resource res, co
const void *QSGRhiSupport::rifResource(QSGRendererInterface::Resource res,
const QSGDefaultRenderContext *rc)
{
+// ### This condition is a temporary workaround to allow compilation
+// with -no-opengl, but Vulkan or Metal enabled, to succeed. Full
+// support for RHI-capable -no-opengl builds will be available in
+// Qt 6 once the direct OpenGL code path gets removed.
#if QT_CONFIG(opengl)
+
QRhi *rhi = rc->rhi();
-#else
- Q_UNUSED(rc)
- QRhi *rhi = nullptr;
-#endif
if (res == QSGRendererInterface::RhiResource || !rhi)
return rhi;
@@ -480,6 +481,12 @@ const void *QSGRhiSupport::rifResource(QSGRendererInterface::Resource res,
default:
return nullptr;
}
+
+#else
+ Q_UNUSED(res);
+ Q_UNUSED(rc);
+ return nullptr;
+#endif
}
int QSGRhiSupport::chooseSampleCountForWindowWithRhi(QWindow *window, QRhi *rhi)