waitForPresent2KHR :: MonadIO io=> Devicedeviceis the device associated withswapchain.-> SwapchainKHRswapchainis the non-retired swapchain on which an image was queued for presentation.-> PresentWait2InfoKHRpPresentWait2Infois a pointer to a PresentWait2InfoKHR structure specifying the parameters of the wait.-> io Result
vkWaitForPresent2KHR - Wait for presentation
Description
waitForPresent2KHR waits for the presentation engine to have begun
presentation of the presentation request associated with the
PresentWait2InfoKHR::presentId on swapchain, or for
PresentWait2InfoKHR::timeout to have expired.
The wait request will complete when the timeout expires, or after the corresponding presentation request has either taken effect within the presentation engine or has been replaced without presentation.
The timing relationship between the presentation of the image to the user and the wait request completing is implementation-dependent due to variations in window system implementations.
If the swapchain becomes
ERROR_OUT_OF_DATE_KHR either before or
during this call, the call may either return
SUCCESS (if the image was delivered to the
presentation engine and may have been presented to the user) or return
early with status ERROR_OUT_OF_DATE_KHR (if
the image could not be presented to the user).
As an exception to the normal rules for objects which are externally
synchronized, the swapchain passed to waitForPresent2KHR may be
simultaneously used by other threads in calls to functions other than
destroySwapchainKHR. Access to the
swapchain data associated with this extension must be atomic within
the implementation.
Valid Usage
The presentWait2 feature must be enabled
The SurfaceCapabilitiesPresentWait2KHR surface capability must be present for the underlying surface
The swapchain must have been created with SWAPCHAIN_CREATE_PRESENT_WAIT_2_BIT_KHR bit set in the SwapchainCreateFlagBitsKHR field
The
presentIdvalue must have been associated with a queuePresentKHR request on theswapchainwhich returned a non-error value
Valid Usage (Implicit)
devicemust be a valid Device handle
swapchainmust be a valid SwapchainKHR handlepPresentWait2Infomust be a valid pointer to a valid PresentWait2InfoKHR structureswapchainmust have been created, allocated, or retrieved fromdevice
Host Synchronization
Host access to
swapchainmust be externally synchronized
Return Codes
See Also
VK_KHR_present_wait2, Device, PresentWait2InfoKHR, SwapchainKHR