aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickgraphicsconfiguration.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2021-01-15 18:38:06 +0100
committerLaszlo Agocs <laszlo.agocs@qt.io>2021-01-21 10:19:01 +0100
commit3fadfb2c3fa7d4b22d0d0269c645c1086fa56619 (patch)
treea5bf744b7a54a20fb793b25479648e3f94bf1137 /src/quick/items/qquickgraphicsconfiguration.cpp
parent6a156540004c9e6260490bacb6544322d22d9d32 (diff)
Expose the list of preferred instance extensions to rendercontrol users
As all QRhi stuff is private, it needs to have a public counterpart in Qt Quick in order to fully support the case of Vulkan-based QQuickRenderControl usage. Change-Id: Iaf9a7aa56022acd31af6ebf16de6b83a04966ff4 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/quick/items/qquickgraphicsconfiguration.cpp')
-rw-r--r--src/quick/items/qquickgraphicsconfiguration.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/quick/items/qquickgraphicsconfiguration.cpp b/src/quick/items/qquickgraphicsconfiguration.cpp
index dcdd069d03..4d64cf0827 100644
--- a/src/quick/items/qquickgraphicsconfiguration.cpp
+++ b/src/quick/items/qquickgraphicsconfiguration.cpp
@@ -39,6 +39,10 @@
#include "qquickgraphicsconfiguration_p.h"
+#if QT_CONFIG(vulkan)
+#include <QtGui/private/qrhivulkan_p.h>
+#endif
+
QT_BEGIN_NAMESPACE
/*!
@@ -139,6 +143,30 @@ QQuickGraphicsConfiguration::~QQuickGraphicsConfiguration()
}
/*!
+ \return the list of Vulkan instance extensions Qt Quick prefers to
+ have enabled on the VkInstance.
+
+ In most cases Qt Quick is responsible for creating a QVulkanInstance. This
+ function is not relevant then. On the other hand, when using
+ QQuickRenderControl in combination with Vulkan-based rendering, it is the
+ application's responsibility to create a QVulkanInstance and associate it
+ with the (offscreen) QQuickWindow. In this case, it is expected that the
+ application queries the list of instance extensions to enable, and passes
+ them to QVulkanInstance::setExtensions() before calling
+ QVulkanInstance::create().
+
+ \since 6.1
+ */
+QByteArrayList QQuickGraphicsConfiguration::preferredInstanceExtensions()
+{
+#if QT_CONFIG(vulkan)
+ return QRhiVulkanInitParams::preferredInstanceExtensions();
+#else
+ return {};
+#endif
+}
+
+/*!
Sets the list of additional \a extensions to enable on the graphics device
(such as, the \c VkDevice).