diff options
author | Mike Krus <mike.krus@kdab.com> | 2021-03-16 09:47:38 +0000 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2021-03-22 10:00:22 +0100 |
commit | 9a473a3c9b246f4895ae73d7060745b8b199a6c5 (patch) | |
tree | 0ab43b532afdea78f1f8e25223d80711d01508f2 /src/render | |
parent | a536039d102f911677e5efec03cc6f3d701aceac (diff) | |
download | qt3d-9a473a3c9b246f4895ae73d7060745b8b199a6c5.tar.gz |
Fix detection of Vulkan
When Qt is built to enable Vulkan support, it is given the path to
the Vulkan header source. This then enables the vulkan feature.
Qt3D used this feature to decide if it could use Vulkan directly or
not, however, since it is now built separately, it has no idea where
to find the headers, so QVulkanInstance is not properly defined.
This caused an issue when using official installers of Qt since
those are configured to support Vulkan.
So we now do a separate config check to find Vulkan for Qt3D.
When building Qt3D, you need to make sure if can find Vulkan (the same
way you configure Qt itself)
Pick-to: 6.1
Task-number: QTBUG-90243
Change-Id: Ia05381597b4974d7b0914706ea2f607341dccacc
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/configure.cmake | 10 | ||||
-rw-r--r-- | src/render/surfaces/vulkaninstance.cpp | 2 | ||||
-rw-r--r-- | src/render/surfaces/vulkaninstance_p.h | 3 |
3 files changed, 11 insertions, 4 deletions
diff --git a/src/render/configure.cmake b/src/render/configure.cmake index 35d733808..b1f604d22 100644 --- a/src/render/configure.cmake +++ b/src/render/configure.cmake @@ -6,7 +6,7 @@ #### Libraries - +find_package(Vulkan) #### Tests @@ -23,8 +23,14 @@ qt_feature("qt3d-rhi-renderer" PRIVATE SECTION "Qt 3D Renderers" LABEL "RHI Renderer" PURPOSE "Use the RHI renderer" - AUTODETECT OFF ) +qt_feature("qt3d-vulkan" PUBLIC + LABEL "Vulkan" + CONDITION Vulkan_FOUND AND QT_FEATURE_qt3d_rhi_renderer +) +qt_configure_add_summary_section(NAME "Qt 3D APIs") +qt_configure_add_summary_entry(ARGS "qt3d-vulkan") +qt_configure_end_summary_section() # end of "Qt 3D APIs" section qt_configure_add_summary_section(NAME "Qt 3D Renderers") qt_configure_add_summary_entry(ARGS "qt3d-opengl-renderer") qt_configure_add_summary_entry(ARGS "qt3d-rhi-renderer") diff --git a/src/render/surfaces/vulkaninstance.cpp b/src/render/surfaces/vulkaninstance.cpp index a8de2fce8..24b1d55fa 100644 --- a/src/render/surfaces/vulkaninstance.cpp +++ b/src/render/surfaces/vulkaninstance.cpp @@ -39,7 +39,7 @@ #include "vulkaninstance_p.h" -#if QT_CONFIG(vulkan) +#if QT_CONFIG(qt3d_vulkan) #include <QVulkanInstance> diff --git a/src/render/surfaces/vulkaninstance_p.h b/src/render/surfaces/vulkaninstance_p.h index 67f52af6a..5d6203cfd 100644 --- a/src/render/surfaces/vulkaninstance_p.h +++ b/src/render/surfaces/vulkaninstance_p.h @@ -52,11 +52,12 @@ // #include <QtGui/qtguiglobal.h> +#include <Qt3DRender/qt3drender-config.h> #include <Qt3DRender/private/qt3drender_global_p.h> QT_BEGIN_NAMESPACE -#if QT_CONFIG(vulkan) +#if QT_CONFIG(qt3d_vulkan) class QVulkanInstance; namespace Qt3DRender { Q_3DRENDERSHARED_PRIVATE_EXPORT |