Mesa (staging/21.3): vulkan/wsi/wayland: Fix add_drm_format_modifier aplha/opaqueness.
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Feb 2 21:21:48 UTC 2022
Module: Mesa
Branch: staging/21.3
Commit: 00f5462523b2ae37fc5032cbc7d9d316409c6a90
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=00f5462523b2ae37fc5032cbc7d9d316409c6a90
Author: Georg Lehmann <dadschoorse at gmail.com>
Date: Tue Jan 18 00:38:10 2022 +0100
vulkan/wsi/wayland: Fix add_drm_format_modifier aplha/opaqueness.
This had the opposite problem of the shm path. R8G8B8A8 was always support if
either DRM_FORMAT_XBGR8888 or DRM_FORMAT_ABGR8888 was supported, but we need
both.
Fixes: d944136f363 ("vulkan/wsi/wayland: don't expose surface formats not fully supported")
Signed-off-by: Georg Lehmann <dadschoorse at gmail.com>
Reviewed-by: Simon Ser <contact at emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14588>
(cherry picked from commit cbe4943ae949d6c46222bafacac573c7ea50caed)
---
.pick_status.json | 2 +-
src/vulkan/wsi/wsi_common_wayland.c | 25 +++++++++++++++++++------
2 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/.pick_status.json b/.pick_status.json
index 4e9d422e661..ce0e50b1ee4 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1291,7 +1291,7 @@
"description": "vulkan/wsi/wayland: Fix add_drm_format_modifier aplha/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 d6649a2e34f..56f56ec56ab 100644
--- a/src/vulkan/wsi/wsi_common_wayland.c
+++ b/src/vulkan/wsi/wsi_common_wayland.c
@@ -298,14 +298,21 @@ wsi_wl_display_add_drm_format_modifier(struct wsi_wl_display *display,
wsi_wl_format_add_modifier(format, modifier);
if (srgb_format)
wsi_wl_format_add_modifier(srgb_format, modifier);
- FALLTHROUGH;
+
+ srgb_format = wsi_wl_display_add_vk_format(display, formats,
+ VK_FORMAT_R8G8B8A8_SRGB,
+ false, true);
+ format = wsi_wl_display_add_vk_format(display, formats,
+ VK_FORMAT_R8G8B8A8_UNORM,
+ false, true);
+ break;
case DRM_FORMAT_ABGR8888:
srgb_format = wsi_wl_display_add_vk_format(display, formats,
VK_FORMAT_R8G8B8A8_SRGB,
- true, true);
+ true, false);
format = wsi_wl_display_add_vk_format(display, formats,
VK_FORMAT_R8G8B8A8_UNORM,
- true, true);
+ true, false);
break;
case DRM_FORMAT_XRGB8888:
srgb_format = wsi_wl_display_add_vk_format(display, formats,
@@ -319,14 +326,20 @@ wsi_wl_display_add_drm_format_modifier(struct wsi_wl_display *display,
if (srgb_format)
wsi_wl_format_add_modifier(srgb_format, modifier);
- FALLTHROUGH;
+ srgb_format = wsi_wl_display_add_vk_format(display, formats,
+ VK_FORMAT_B8G8R8A8_SRGB,
+ false, true);
+ format = wsi_wl_display_add_vk_format(display, formats,
+ VK_FORMAT_B8G8R8A8_UNORM,
+ false, true);
+ break;
case DRM_FORMAT_ARGB8888:
srgb_format = wsi_wl_display_add_vk_format(display, formats,
VK_FORMAT_B8G8R8A8_SRGB,
- true, true);
+ true, false);
format = wsi_wl_display_add_vk_format(display, formats,
VK_FORMAT_B8G8R8A8_UNORM,
- true, true);
+ true, false);
break;
}
More information about the mesa-commit
mailing list