From 8d7aa4279aa26e1a24b76b707caf423ecde1d597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Thu, 17 Nov 2022 10:12:59 +0100 Subject: [PATCH] vulkan/wsi/wayland: Set num_modifier_lists = 0 if num_drm_modifiers == 0 This case was missed in https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18826 , resulting in native Wayland apps failing with ../src/vulkan/wsi/wsi_common_drm.c:452: wsi_configure_native_image: Assertion `!"Failed to find a supported modifier! This should never " "happen because LINEAR should always be available"' failed. if the Wayland compositor advertises only the INVALID modifier. Fixes: c315e20d6198 ("vulkan/wsi/wayland: Configure images via params passed to wsi_swapchain_init()") Part-of: --- src/vulkan/wsi/wsi_common_wayland.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c index e4de881bf40..dc5a3836315 100644 --- a/src/vulkan/wsi/wsi_common_wayland.c +++ b/src/vulkan/wsi/wsi_common_wayland.c @@ -1835,7 +1835,10 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, if (f != NULL) { num_drm_modifiers = u_vector_length(&f->modifiers); drm_modifiers = u_vector_tail(&f->modifiers); - drm_image_params.num_modifier_lists = 1; + if (num_drm_modifiers > 0) + drm_image_params.num_modifier_lists = 1; + else + drm_image_params.num_modifier_lists = 0; drm_image_params.num_modifiers = &num_drm_modifiers; drm_image_params.modifiers = &drm_modifiers; }