From 4ae4e04e18d7dc688aa94e52778c4959861bae0c Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Tue, 18 Jan 2022 00:13:09 +0100 Subject: [PATCH] vulkan/wsi/wayland: Fix add_wl_shm_format alpha/opaqueness. We need both the SHM format with alpha and the opaque format to fully support a vulkan format with alpha. Previously no surface format was reported because the vulkan formats with aplha were never added as opaque. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5879 Fixes: d944136f363 ("vulkan/wsi/wayland: don't expose surface formats not fully supported") Signed-off-by: Georg Lehmann Reviewed-by: Lionel Landwerlin Reviewed-by: Simon Ser Part-of: --- src/vulkan/wsi/wsi_common_wayland.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c index 7ba5731aaf7..8e47e1cf68f 100644 --- a/src/vulkan/wsi/wsi_common_wayland.c +++ b/src/vulkan/wsi/wsi_common_wayland.c @@ -336,11 +336,17 @@ wsi_wl_display_add_wl_shm_format(struct wsi_wl_display *display, case WL_SHM_FORMAT_XBGR8888: wsi_wl_display_add_vk_format(display, formats, VK_FORMAT_R8G8B8_SRGB, - false, true); + true, true); wsi_wl_display_add_vk_format(display, formats, VK_FORMAT_R8G8B8_UNORM, + true, true); + wsi_wl_display_add_vk_format(display, formats, + VK_FORMAT_R8G8B8A8_SRGB, false, true); - FALLTHROUGH; + wsi_wl_display_add_vk_format(display, formats, + VK_FORMAT_R8G8B8A8_UNORM, + false, true); + break; case WL_SHM_FORMAT_ABGR8888: wsi_wl_display_add_vk_format(display, formats, VK_FORMAT_R8G8B8A8_SRGB, @@ -352,11 +358,17 @@ wsi_wl_display_add_wl_shm_format(struct wsi_wl_display *display, case WL_SHM_FORMAT_XRGB8888: wsi_wl_display_add_vk_format(display, formats, VK_FORMAT_B8G8R8_SRGB, - false, true); + true, true); wsi_wl_display_add_vk_format(display, formats, VK_FORMAT_B8G8R8_UNORM, + true, true); + wsi_wl_display_add_vk_format(display, formats, + VK_FORMAT_B8G8R8A8_SRGB, false, true); - FALLTHROUGH; + wsi_wl_display_add_vk_format(display, formats, + VK_FORMAT_B8G8R8A8_UNORM, + false, true); + break; case WL_SHM_FORMAT_ARGB8888: wsi_wl_display_add_vk_format(display, formats, VK_FORMAT_B8G8R8A8_SRGB,