Mesa (main): vulkan/wsi/wayland: ensure added formats have flags

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Feb 15 12:18:03 UTC 2022


Module: Mesa
Branch: main
Commit: ffdac8bfa78303abc2be5242f50e229ae20042d7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ffdac8bfa78303abc2be5242f50e229ae20042d7

Author: Simon Ser <contact at emersion.fr>
Date:   Fri Feb  4 12:17:54 2022 +0100

vulkan/wsi/wayland: ensure added formats have flags

A format needs to be either alpha or opaque, but can't be neither.

Signed-off-by: Simon Ser <contact at emersion.fr>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Reviewed-by: Georg Lehmann <dadschoorse at gmail.com>
Acked-by: Daniel Stone <daniels at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14874>

---

 src/vulkan/wsi/wsi_common_wayland.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c
index 84355b049c9..e0af6076eba 100644
--- a/src/vulkan/wsi/wsi_common_wayland.c
+++ b/src/vulkan/wsi/wsi_common_wayland.c
@@ -108,6 +108,8 @@ wsi_wl_display_add_vk_format(struct wsi_wl_display *display,
                              struct u_vector *formats,
                              VkFormat format, uint32_t flags)
 {
+   assert(flags & (WSI_WL_FMT_ALPHA | WSI_WL_FMT_OPAQUE));
+
    /* Don't add a format that's already in the list */
    struct wsi_wl_format *f = find_format(formats, format);
    if (f) {



More information about the mesa-commit mailing list