From 6f916ec0c0d31361121f381129a03a9b6f3d583f 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: (cherry picked from commit 4ae4e04e18d7dc688aa94e52778c4959861bae0c) --- .pick_status.json | 2 +- src/vulkan/wsi/wsi_common_wayland.c | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 46c27f4b42e..322357200d6 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3118,7 +3118,7 @@ "description": "vulkan/wsi/wayland: Fix add_wl_shm_format alpha/opaqueness.", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "d944136f3635aeacd97e167176c968c5078d92d7" }, diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c index 09a4f67b226..eb17270539f 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,