diff --git a/src/plugins/minimal_scene/MinimalScene.cc b/src/plugins/minimal_scene/MinimalScene.cc index 0ef8895dc..17c0b9417 100644 --- a/src/plugins/minimal_scene/MinimalScene.cc +++ b/src/plugins/minimal_scene/MinimalScene.cc @@ -37,10 +37,10 @@ #include #include #include +#include #include #include #include -#include #include #include #include @@ -52,8 +52,10 @@ #include "gz/gui/Helpers.hh" #include "gz/gui/MainWindow.hh" -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 2) && QT_CONFIG(vulkan) +#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 2) && QT_CONFIG(vulkan) && \ + defined(GZ_RENDERING_HAVE_VULKAN) # include +# include #endif Q_DECLARE_METATYPE(gz::gui::plugins::RenderSync*) @@ -584,7 +586,8 @@ rendering::CameraPtr GzRenderer::Camera() return this->dataPtr->camera; } -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 2) && QT_CONFIG(vulkan) +#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 2) && QT_CONFIG(vulkan) && \ + defined(GZ_RENDERING_HAVE_VULKAN) ///////////////////////////////////////////////// /// \brief fillQtInstanceExtensionsToOgre /// Extract Vulkan Instance extension information to be sent to OgreNext @@ -677,7 +680,8 @@ std::string GzRenderer::Initialize(RenderThreadRhi &_rhi) this->dataPtr->rhiParams["winID"] = std::to_string(quickWindow->winId()); -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 2) && QT_CONFIG(vulkan) +#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 2) && QT_CONFIG(vulkan) && \ + defined(GZ_RENDERING_HAVE_VULKAN) // externalInstance & externalDevice MUST be declared at this scope // because we save their stack addresses into this->dataPtr->rhiParams // and must be alive until rendering::engine() returns. @@ -805,7 +809,8 @@ void GzRenderer::SetGraphicsAPI(const rendering::GraphicsAPI &_graphicsAPI) { gzdbg << "Creating gz-rendering interface for Vulkan" << std::endl; this->dataPtr->rhiParams["vulkan"] = "1"; -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 2) && QT_CONFIG(vulkan) +#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 2) && QT_CONFIG(vulkan) && \ + defined(GZ_RENDERING_HAVE_VULKAN) this->dataPtr->rhi = std::make_unique(); #else this->dataPtr->rhi = std::make_unique(); @@ -973,7 +978,8 @@ void RenderThread::SetGraphicsAPI(const rendering::GraphicsAPI &_graphicsAPI) // Create the render interface if (_graphicsAPI == rendering::GraphicsAPI::OPENGL -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 2) && QT_CONFIG(vulkan) +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 2) && QT_CONFIG(vulkan) && \ + defined(GZ_RENDERING_HAVE_VULKAN) // Use fallback (GPU -> CPU -> GPU) || _graphicsAPI == rendering::GraphicsAPI::VULKAN #endif @@ -982,7 +988,8 @@ void RenderThread::SetGraphicsAPI(const rendering::GraphicsAPI &_graphicsAPI) gzdbg << "Creating render thread interface for OpenGL" << std::endl; this->rhi = std::make_unique(&this->gzRenderer); } -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 2) && QT_CONFIG(vulkan) +#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 2) && QT_CONFIG(vulkan) && \ + defined(GZ_RENDERING_HAVE_VULKAN) else if (_graphicsAPI == rendering::GraphicsAPI::VULKAN) { gzdbg << "Creating render thread interface for Vulkan" << std::endl; @@ -1013,7 +1020,8 @@ std::string RenderThread::Initialize() TextureNode::TextureNode(QQuickWindow *_window, RenderSync &_renderSync, const rendering::GraphicsAPI &_graphicsAPI, rendering::CameraPtr & -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 2) && QT_CONFIG(vulkan) +#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 2) && QT_CONFIG(vulkan) && \ + defined(GZ_RENDERING_HAVE_VULKAN) _camera #endif ) : @@ -1021,7 +1029,8 @@ TextureNode::TextureNode(QQuickWindow *_window, RenderSync &_renderSync, window(_window) { if (_graphicsAPI == rendering::GraphicsAPI::OPENGL -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 2) && QT_CONFIG(vulkan) +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 2) && QT_CONFIG(vulkan) && \ + defined(GZ_RENDERING_HAVE_VULKAN) // Use fallback (GPU -> CPU -> GPU) || _graphicsAPI == rendering::GraphicsAPI::VULKAN #endif @@ -1030,7 +1039,8 @@ TextureNode::TextureNode(QQuickWindow *_window, RenderSync &_renderSync, gzdbg << "Creating texture node render interface for OpenGL" << std::endl; this->rhi = std::make_unique(_window); } -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 2) && QT_CONFIG(vulkan) +#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 2) && QT_CONFIG(vulkan) && \ + defined(GZ_RENDERING_HAVE_VULKAN) else if (_graphicsAPI == rendering::GraphicsAPI::VULKAN) { gzdbg << "Creating texture node render interface for Vulkan" << std::endl; @@ -1137,7 +1147,8 @@ void RenderWindowItem::StopRendering() void RenderWindowItem::Ready() { if (this->dataPtr->graphicsAPI == rendering::GraphicsAPI::OPENGL -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 2) && QT_CONFIG(vulkan) +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 2) && QT_CONFIG(vulkan) && \ + defined(GZ_RENDERING_HAVE_VULKAN) // Use fallback (GPU -> CPU -> GPU) || this->dataPtr->graphicsAPI == rendering::GraphicsAPI::VULKAN #endif @@ -1156,7 +1167,8 @@ void RenderWindowItem::Ready() } if (this->dataPtr->graphicsAPI == rendering::GraphicsAPI::OPENGL -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 2) && QT_CONFIG(vulkan) +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 2) && QT_CONFIG(vulkan) && \ + defined(GZ_RENDERING_HAVE_VULKAN) // Use fallback (GPU -> CPU -> GPU) || this->dataPtr->graphicsAPI == rendering::GraphicsAPI::VULKAN #endif @@ -1204,7 +1216,8 @@ QSGNode *RenderWindowItem::updatePaintNode(QSGNode *_node, this->dataPtr->graphicsAPI); if (this->dataPtr->graphicsAPI == rendering::GraphicsAPI::OPENGL -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 2) && QT_CONFIG(vulkan) +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 2) && QT_CONFIG(vulkan) && \ + defined(GZ_RENDERING_HAVE_VULKAN) // Use fallback (GPU -> CPU -> GPU) || this->dataPtr->graphicsAPI == rendering::GraphicsAPI::VULKAN #endif