For resource transitions, you need to know the 'before' and 'after' VkImageLayout
of the resource (eg. in the VkImageMemoryBarrier
passed to vkCmdPipelineBarrier
). Vulkan does not guarantee any ordering of execution of command buffers, unless explicitly stated in the API documentation (from this answer). However, vkCmdPipelineBarrier
does explicitly say that it creates a dependency between commands in the command buffer, before and after the call. So it is possible to 'know' the layout of an image at any point when it is transitioned within a single command buffer.
However, vkQueueSumbit
does not enforce the execution order of command buffers. If there are two command buffers, each with vkCmdPipelineBarrier
calls transitioning the same image to different layouts, is there any dependency between these two operations, or is explicit synchronization required in this situation?