diff options
Diffstat (limited to 'src/gui/vulkan')
-rw-r--r-- | src/gui/vulkan/qvulkaninstance.cpp | 7 | ||||
-rw-r--r-- | src/gui/vulkan/qvulkanwindow.cpp | 25 |
2 files changed, 31 insertions, 1 deletions
diff --git a/src/gui/vulkan/qvulkaninstance.cpp b/src/gui/vulkan/qvulkaninstance.cpp index 555dee3a9c..19a88074af 100644 --- a/src/gui/vulkan/qvulkaninstance.cpp +++ b/src/gui/vulkan/qvulkaninstance.cpp @@ -531,6 +531,13 @@ void QVulkanInstance::setExtensions(const QByteArrayList &extensions) \note This function can only be called before create() and has no effect if called afterwards. + + \note Be aware that Vulkan 1.1 changes the behavior with regards to the + Vulkan API version field. In Vulkan 1.0 specifying an unsupported \a + vulkanVersion led to failing create() with \c VK_ERROR_INCOMPATIBLE_DRIVER, + as was mandated by the specification. Starting with Vulkan 1.1, the + specification disallows this, the driver must accept any version without + failing the instance creation. */ void QVulkanInstance::setApiVersion(const QVersionNumber &vulkanVersion) { diff --git a/src/gui/vulkan/qvulkanwindow.cpp b/src/gui/vulkan/qvulkanwindow.cpp index cee1f2540f..14944d47f8 100644 --- a/src/gui/vulkan/qvulkanwindow.cpp +++ b/src/gui/vulkan/qvulkanwindow.cpp @@ -195,6 +195,23 @@ Q_LOGGING_CATEGORY(lcGuiVk, "qt.vulkan") \note QVulkanWindow does not expose device layers since this functionality has been deprecated since version 1.0.13 of the Vulkan API. + \section1 Layers, device features, and extensions + + To enable instance layers, call QVulkanInstance::setLayers() before creating + the QVulkanInstance. To query what instance layer are available, call + QVulkanInstance::supportedLayers(). + + To enable device extensions, call setDeviceExtensions() early on when setting + up the QVulkanWindow. To query what device extensions are available, call + supportedDeviceExtensions(). + + Specifying an unsupported layer or extension is handled gracefully: this will + not fail instance or device creation, but the layer or extension request is + rather ignored. + + When it comes to device features, QVulkanWindow enables all Vulkan 1.0 + features that are reported as supported from vkGetPhysicalDeviceFeatures(). + \sa QVulkanInstance, QWindow */ @@ -712,6 +729,12 @@ void QVulkanWindowPrivate::init() devInfo.enabledExtensionCount = devExts.count(); devInfo.ppEnabledExtensionNames = devExts.constData(); + // Enable all 1.0 features. + VkPhysicalDeviceFeatures features; + memset(&features, 0, sizeof(features)); + f->vkGetPhysicalDeviceFeatures(physDev, &features); + devInfo.pEnabledFeatures = &features; + // Device layers are not supported by QVulkanWindow since that's an already deprecated // API. However, have a workaround for systems with older API and layers (f.ex. L4T // 24.2 for the Jetson TX1 provides API 1.0.13 and crashes when the validation layer @@ -2020,7 +2043,7 @@ void QVulkanWindowPrivate::endFrame() // order to circumvent driver frame callbacks inst->presentAboutToBeQueued(q); - err = vkQueuePresentKHR(gfxQueue, &presInfo); + err = vkQueuePresentKHR(presQueue, &presInfo); if (err != VK_SUCCESS) { if (err == VK_ERROR_OUT_OF_DATE_KHR) { recreateSwapChain(); |