zink: update resource layout in copy_scanout
authorDave Airlie <airlied@redhat.com>
Thu, 24 Mar 2022 06:43:57 +0000 (16:43 +1000)
committerMarge Bot <emma+marge@anholt.net>
Thu, 24 Mar 2022 21:42:43 +0000 (21:42 +0000)
commit81afd1e118e96451ec4adce145ab57d1c9c94c67
tree214bea455d628ab8bd376626cf74c980262bc8c3
parent6646624fb9c3808baee2f23bb2907b89616e78a0
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 <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15545>
src/gallium/drivers/zink/zink_batch.c