zink: add a VkExternalMemoryImageCreateInfo for PIPE_BIND_SHARED images

required by spec

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8273>
This commit is contained in:
Mike Blumenkrantz
2020-09-09 15:16:42 -04:00
committed by Marge Bot
parent 7f1ad0538f
commit b415211ce9
+7
View File
@@ -171,6 +171,7 @@ resource_create(struct pipe_screen *pscreen,
res->format = zink_get_format(screen, templ->format);
VkImageCreateInfo ici = {};
VkExternalMemoryImageCreateInfo emici = {};
ici.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO;
ici.flags = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
@@ -221,6 +222,12 @@ resource_create(struct pipe_screen *pscreen,
ici.tiling = VK_IMAGE_TILING_LINEAR;
}
if (templ->bind & PIPE_BIND_SHARED) {
emici.sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO;
emici.handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT;
ici.pNext = &emici;
}
if (templ->usage == PIPE_USAGE_STAGING)
ici.tiling = VK_IMAGE_TILING_LINEAR;