Hi,
The problem, is every time I call vkQueuePresentKHR(presentQueue, &presentInfo)
- I take a validation error:
[ VUID-VkPresentInfoKHR-pImageIndices-01296 ] Object 0: handle = 0x555555c5c518, type = VK_OBJECT_TYPE_QUEUE; | MessageID = 0xc7aabc16 | vkQueuePresentKHR(): pSwapchains[0] images passed to present must be in layout VK_IMAGE_LAYOUT_PRESENT_SRC_KHR or VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR but is in VK_IMAGE_LAYOUT_UNDEFINED.
As I can see people often meets this problem, but I can not see any reasons in my code.
- I make myself sure I do not forget to get swapchain images:
2.I make myself sure I wait on before presentation can happen:
and this this the same semaphore I pass to submit info.
- attachment descriptions look right as well:
final layout is VK_IMAGE_LAYOUT_PRESENT_SRC_KH as necessary.
I don’t know what I missed else.
What other possible reasons can prevent image layout transition?