zink: Make sure that we keep the existing ici pNext chain on inserts.

For external image imports, we'd lose the mutable image format list,
causing turnip to get angry that we try to do UBWC despite not having a
UBWC-compatible format list.

Cc: mesa-stable
Fixes: 28ee911ad6 ("zink: handle mutable swapchain images with dmabuf")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17900>
This commit is contained in:
Emma Anholt 2022-08-07 17:10:40 -07:00 committed by Marge Bot
parent 6a933b7f53
commit 8dda0a01bb

View file

@ -690,11 +690,10 @@ resource_object_create(struct zink_screen *screen, const struct pipe_resource *t
goto fail1;
obj->render_target = (ici.usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) != 0;
const void *pNext = ici.pNext;
if (shared || external) {
emici.sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO;
emici.pNext = NULL;
emici.pNext = ici.pNext;
emici.handleTypes = export_types;
ici.pNext = &emici;
@ -726,8 +725,6 @@ resource_object_create(struct zink_screen *screen, const struct pipe_resource *t
idfmlci.pDrmFormatModifiers = modifiers;
ici.pNext = &idfmlci;
} else if (ici.tiling == VK_IMAGE_TILING_OPTIMAL) {
if (!external)
ici.pNext = pNext;
shared = false;
}
}