Mesa (staging/21.3): vulkan/wsi/wayland: Fix add_wl_shm_format alpha/opaqueness.
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Feb 2 21:21:47 UTC 2022
Module: Mesa
Branch: staging/21.3
Commit: a8fe66f3ef6d3fc9123e315cc479161db7af2719
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a8fe66f3ef6d3fc9123e315cc479161db7af2719
Author: Georg Lehmann <dadschoorse at gmail.com>
Date: Tue Jan 18 00:13:09 2022 +0100
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 <dadschoorse at gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Reviewed-by: Simon Ser <contact at emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14588>
(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 a7346a2cccd..f10a5da6ecc 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1318,7 +1318,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,
More information about the mesa-commit
mailing list