aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgrhisupport.cpp
diff options
context:
space:
mode:
authorSamuli Piippo <samuli.piippo@qt.io>2020-06-01 15:44:10 +0300
committerSamuli Piippo <samuli.piippo@qt.io>2020-06-02 12:15:51 +0300
commit768b0f2adefffced84aadd4f44b07e8dedbb8f72 (patch)
tree0992fd08750119529f177f545773bfbbd47763b0 /src/quick/scenegraph/qsgrhisupport.cpp
parent2ca7f113588666c936ab7b5f818b6de6932f24bf (diff)
Fix build without opengl
ifdef code that is not available without opengl. Change-Id: I200e95e4bcf1ee361e84819454eade0bbcbd6669 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/quick/scenegraph/qsgrhisupport.cpp')
-rw-r--r--src/quick/scenegraph/qsgrhisupport.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/quick/scenegraph/qsgrhisupport.cpp b/src/quick/scenegraph/qsgrhisupport.cpp
index 44ba2c54c1..c8aa9ef24f 100644
--- a/src/quick/scenegraph/qsgrhisupport.cpp
+++ b/src/quick/scenegraph/qsgrhisupport.cpp
@@ -701,13 +701,18 @@ QImage QSGRhiSupport::grabOffscreen(QQuickWindow *window)
wd->rhi = rhi.data();
+// ### 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)
QSGDefaultRenderContext::InitParams params;
params.rhi = rhi.data();
params.sampleCount = 1;
params.initialSurfacePixelSize = pixelSize;
params.maybeSurface = window;
wd->context->initialize(&params);
-
+#endif
// There was no rendercontrol which means a custom render target
// should not be set either. Set our own, temporarily.
window->setRenderTarget(QQuickRenderTarget::fromRhiRenderTarget(rt.data()));