After queueing all rendering commands and transitioning the image to the correct layout, to queue an image for presentation, call:
// Provided by VK_KHR_swapchain VkResult vkQueuePresentKHR( VkQueue queue, const VkPresentInfoKHR* pPresentInfo);
queueis a queue that is capable of presentation to the target surface’s platform on the same device as the image’s swapchain.
pPresentInfois a pointer to a VkPresentInfoKHR structure specifying parameters of the presentation.
There is no requirement for an application to present images in the same order that they were acquired - applications can arbitrarily present any image that is currently acquired.
Any writes to memory backing the images referenced by the
pSwapchains members of
that are available before vkQueuePresentKHR is executed, are
automatically made visible to the read access performed by the presentation
This automatic visibility operation for an image happens-after the semaphore
signal operation, and happens-before the presentation engine accesses the
Queueing an image for presentation defines a set of queue operations, including waiting on the semaphores and submitting a presentation request to the presentation engine. However, the scope of this set of queue operations does not include the actual processing of the image by the presentation engine.
The origin of the native orientation of the surface coordinate system is not
specified in the Vulkan specification; it depends on the platform.
For most platforms the origin is by default upper-left, meaning the pixel of
the presented VkImage at coordinates (0,0) would appear at the
upper left pixel of the platform surface (assuming
vkQueuePresentKHR fails to enqueue the corresponding set of queue
operations, it may return
If it does, the implementation must ensure that the state and contents of
any resources or synchronization primitives referenced is unaffected by the
call or its failure.
vkQueuePresentKHR fails in such a way that the implementation is
unable to make that guarantee, the implementation must return
However, if the presentation request is rejected by the presentation engine
with an error
VK_ERROR_SURFACE_LOST_KHR, the set of queue operations are still
considered to be enqueued and thus any semaphore wait operation specified in
VkPresentInfoKHR will execute when the corresponding queue operation
swapchain member of
pPresentInfo was created with
VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT will be returned if that
swapchain does not have exclusive full-screen access, possibly for
implementation-specific reasons outside of the application’s control.
For more information, see the Vulkan Specification
This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.