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: d944136f36 ("vulkan/wsi/wayland: don't expose surface formats not fully supported")

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14588>
(cherry picked from commit 4ae4e04e18)
This commit is contained in:
Georg Lehmann 2022-01-18 00:13:09 +01:00 committed by Eric Engestrom
parent 154ce77176
commit 6f916ec0c0
2 changed files with 17 additions and 5 deletions

View file

@ -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"
},

View file

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