Merge 'Add surfaces the layer supports in unsupported_surfaces' into 'main'

See merge request mesa/vulkan-wsi-layer!222
This commit is contained in:
Iason Paraskevopoulos 2025-12-16 14:26:53 +00:00
commit 6d98a178ba
2 changed files with 24 additions and 6 deletions

View file

@ -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<VkPhysicalDevicePresentTimingFeaturesEXT>(
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_TIMING_FEATURES_EXT, pFeatures->pNext);

View file

@ -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