A presentable image starts out in VK_IMAGE_LAYOUT_UNDEFINED
but will be VK_IMAGE_LAYOUT_PRESENT_SRC_KHR
after they have been presented once.
A lot of examples do a transition of all vkImages
to VK_IMAGE_LAYOUT_PRESENT_SRC_KHR
immediately after creating the vkSwapchain
. Which allows them to use an VK_IMAGE_LAYOUT_PRESENT_SRC_KHR
for oldLayout
. But doing the transition right after creation of the swapchain is not allowed.
Use of a presentable image must occur only after the image is returned by
vkAcquireNextImageKHR
, and before it is presented byvkQueuePresentKHR
. This includes transitioning the image layout and rendering commands.
What are my options to deal with the swapchain image layouts correctly?