Module: Mesa Branch: staging/22.2 Commit: b70516a37aefd25cc72882566b49dea87c16a2df URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b70516a37aefd25cc72882566b49dea87c16a2df
Author: Emma Anholt <[email protected]> Date: Sun Aug 7 17:10:40 2022 -0700 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: 28ee911ad671 ("zink: handle mutable swapchain images with dmabuf") Reviewed-by: Mike Blumenkrantz <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17900> (cherry picked from commit 8dda0a01bb3ea5a618a73ea4e506cb61e68e6d0c) --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_resource.c | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index bfa652b8124..973445ef30c 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -292,7 +292,7 @@ "description": "zink: Make sure that we keep the existing ici pNext chain on inserts.", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "28ee911ad67192bc7a0683b6061b89e372482faf" }, diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c index e78ae73fb87..a1b4c9089a6 100644 --- a/src/gallium/drivers/zink/zink_resource.c +++ b/src/gallium/drivers/zink/zink_resource.c @@ -694,11 +694,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; @@ -730,8 +729,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; } }
