From 9c9dff2291bf2caa3e4090b1265b2cb8c47c0fab Mon Sep 17 00:00:00 2001 From: Iason Paraskevopoulos Date: Tue, 16 Dec 2025 14:26:53 +0000 Subject: [PATCH] Add surfaces the layer supports in unsupported_surfaces Extends the unsupported_surfaces_ext_array to contain surfaces supported by the layer, when the layer is built without supporting them. Also handles the presentWait2 feature similar to presentWait. Signed-off-by: Iason Paraskevopoulos Change-Id: I2e61d56425ff657de949797be86436c9675d1b1f --- layer/layer.cpp | 14 +++++++++++--- wsi/unsupported_surfaces.hpp | 16 +++++++++++++--- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/layer/layer.cpp b/layer/layer.cpp index 4f6d1fe..ee466e7 100644 --- a/layer/layer.cpp +++ b/layer/layer.cpp @@ -553,7 +553,7 @@ wsi_layer_vkGetPhysicalDeviceFeatures2(VkPhysicalDevice physical_device, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_2_FEATURES_KHR, pFeatures->pNext); if (present_wait2_features != nullptr) { - present_wait2_features->presentWait2 = VK_TRUE; + present_wait2_features->presentWait2 = VK_FALSE; } auto *image_compression_control_swapchain_features = @@ -578,18 +578,26 @@ wsi_layer_vkGetPhysicalDeviceFeatures2(VkPhysicalDevice physical_device, { present_id2_features->presentId2 = VK_TRUE; } - wsi::set_swapchain_maintenance1_state(physical_device, swapchain_maintenance1_features); if (present_wait_features != nullptr) { - /* If there is an surface extension in use that is unsupported by the layer, defer to the ICD */ + /* If there is a surface extension in use that is unsupported by the layer, defer to the ICD */ if (!instance.is_unsupported_surface_extension_enabled()) { present_wait_features->presentWait = VK_TRUE; } } + if (present_wait2_features != nullptr) + { + /* If there is a surface extension in use that is unsupported by the layer, defer to the ICD */ + if (!instance.is_unsupported_surface_extension_enabled()) + { + present_wait2_features->presentWait2 = VK_TRUE; + } + } + #if VULKAN_WSI_LAYER_EXPERIMENTAL auto *present_timing_features = util::find_extension( VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_TIMING_FEATURES_EXT, pFeatures->pNext); diff --git a/wsi/unsupported_surfaces.hpp b/wsi/unsupported_surfaces.hpp index 01c74d0..2318926 100644 --- a/wsi/unsupported_surfaces.hpp +++ b/wsi/unsupported_surfaces.hpp @@ -49,8 +49,18 @@ namespace wsi { /* A list of platform-specific unsupported surface extensions Not using the extension macros and symbols due to missing definitions for native platform symbols. */ -static constexpr std::array unsupported_surfaces_ext_array = { "VK_KHR_win32_surface", "VK_KHR_xlib_surface", - "VK_KHR_xcb_surface", "VK_EXT_metal_surface", - "VK_KHR_android_surface" }; +static constexpr std::array unsupported_surfaces_ext_array = { + "VK_KHR_win32_surface", "VK_KHR_xlib_surface", "VK_KHR_xcb_surface", + "VK_EXT_metal_surface", "VK_KHR_android_surface", +#if !BUILD_WSI_HEADLESS + "VK_EXT_headless_surface", +#endif +#if !BUILD_WSI_WAYLAND + "VK_KHR_wayland_surface", +#endif +#if !BUILD_WSI_DISPLAY + "VK_KHR_display", +#endif +}; } // namespace wsi