zink: add VK_STRUCTURE_TYPE_WSI_MEMORY_ALLOCATE_INFO_MESA for WSI allocations
authorIago Toral Quiroga <itoral@igalia.com>
Fri, 30 Oct 2020 09:44:17 +0000 (10:44 +0100)
committerIago Toral Quiroga <itoral@igalia.com>
Tue, 3 Nov 2020 08:52:03 +0000 (09:52 +0100)
commit92022f2846e009527a898c8618864766e75d8e50
treef952bcc444b159174c37b28f6d597e5f2b084b6c
parent98ebffc9f305d6964649b8d8ec41e47c5458caa9
zink: add VK_STRUCTURE_TYPE_WSI_MEMORY_ALLOCATE_INFO_MESA for WSI allocations

Since Zink doesn't use swapchains to create presentable images, drivers
lose the capacity to identify memory allocations for them, which is a problem
when the underlying platform has special requirements for these, such as
needing to allocate them on a particular device. Including this struct in the
pNext chain, which is the same thing that the Mesa Vulkan WSI code does when
allocating memory for swapchain images, gives drivers a chance to identify
and handle these memory allocations properly.

v2: follow Zink's conventions for pNext chains (Mike)
v3: add scanout parameter for VkImage creation (Daniel)
v4: don't add a dependency on vulkan util (Erik)
v5: include vulkan directory for Zink builds

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> (v2)
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7378>
src/gallium/drivers/zink/meson.build
src/gallium/drivers/zink/zink_resource.c
src/meson.build
src/vulkan/meson.build