Image Layout transition does not happen

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.

  1. 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.

  1. 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?

I found a reason and now I feel a shame about my question )

I checked commands I write into the command buffer several times and everything looks fine and It was fine, but I just forget to put pointer to the command buffer into the SubmitInfo

So, I just send SubmitInfo with no any commands into the queue and could see the error
VUID-VkPresentInfoKHR-pImageIndices-01296 - which was actually faraway from the real issue.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.