vulkan/wsi/wayland: create swapchain using vk_zalloc()
authorLeandro Ribeiro <leandro.ribeiro@collabora.com>
Tue, 6 Jul 2021 19:00:12 +0000 (16:00 -0300)
committerMarge Bot <eric+marge@anholt.net>
Fri, 20 Aug 2021 18:51:36 +0000 (18:51 +0000)
commit4cd187e71e784f3d08dedd82f658c5897d45b53a
tree51a3d878300743974f1c3c416ad2133a9c400f19
parent03e457bb1aaf6a0962f7bf5903366ba65428025a
vulkan/wsi/wayland: create swapchain using vk_zalloc()

In wsi_wl_surface_create_swapchain() we have a piece of code to init
some members of the chain to 0, in order to allow us to call
wsi_wl_swapchain_destroy() for cleanup.

Instead, we can use vk_zalloc() to allocate the chain, as it initializes
all members of the struct to zero. This help us to avoid problems when
people add new members to the struct and forget to initialize them.
Also, it makes the code look better.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12451>
src/vulkan/wsi/wsi_common_wayland.c