diff --git a/src/gui/vulkan/qvulkanwindow.cpp b/src/gui/vulkan/qvulkanwindow.cpp index 5d2f1cf964..b57046844b 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