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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19795>
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;
}