vulkan/wsi/wayland: memset members of image to zero
struct wsi_wl_image is only used as member of the swapchain, and during the swapchain creation the image is already initialized to zero. So we have no problems with members of the image being used uninitialized. But for consistency, memset the members of this struct to zero in wsi_wl_image_init(). This can help to avoid problems in the future. 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>
This commit is contained in:
parent
4cd187e71e
commit
8107f67171
|
@ -1010,6 +1010,8 @@ wsi_wl_image_init(struct wsi_wl_swapchain *chain,
|
|||
struct wsi_wl_display *display = chain->display;
|
||||
VkResult result;
|
||||
|
||||
memset(image, 0, sizeof(*image));
|
||||
|
||||
result = wsi_create_native_image(&chain->base, pCreateInfo,
|
||||
chain->num_drm_modifiers > 0 ? 1 : 0,
|
||||
&chain->num_drm_modifiers,
|
||||
|
|
Loading…
Reference in New Issue