Module: Mesa Branch: main Commit: 81afd1e118e96451ec4adce145ab57d1c9c94c67 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=81afd1e118e96451ec4adce145ab57d1c9c94c67
Author: Dave Airlie <[email protected]> Date: Thu Mar 24 16:43:57 2022 +1000 zink: update resource layout in copy_scanout This transitions the resource to TRANSFER_SRC_OPTIMAL, but never updates the res->layout field, so subsequent transitions are wrong and throw validation errors. UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout(ERROR / SPEC): msgNum: 1303270965 - Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout ] Object 0: handle = 0x6660f60, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x4dae5635 | vkQueueSubmit(): pSubmits[0].pCommandBuffers[0] command buffer VkCommandBuffer 0x6660f60[] expects VkImage 0x2f000000002f[] (subresource: aspectMask 0x1 array layer 0, mip level 0) to be in layout VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL--instead, current layout is VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL. Reviewed-by: Mike Blumenkrantz <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15545> --- src/gallium/drivers/zink/zink_batch.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/drivers/zink/zink_batch.c b/src/gallium/drivers/zink/zink_batch.c index af57faa8adf..9ac9404e8aa 100644 --- a/src/gallium/drivers/zink/zink_batch.c +++ b/src/gallium/drivers/zink/zink_batch.c @@ -524,6 +524,7 @@ copy_scanout(struct zink_batch_state *bs, struct zink_resource *res) 0, NULL, 1, &imb1 ); + res->layout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL; VkImageSubresourceRange isr = { res->aspect,
