waitForPresentKHR :: MonadIO io=> Devicedeviceis the device associated withswapchain.-> SwapchainKHRswapchainis the non-retired swapchain on which an image was queued for presentation.->"presentId"
::: Word64presentIdis the presentation presentId to wait for.->"timeout"
::: Word64timeoutis the timeout period in units of nanoseconds.timeoutis adjusted to the closest value allowed by the implementation-dependent timeout accuracy, which may be substantially longer than one nanosecond, and may be longer than the requested period.-> io Result
vkWaitForPresentKHR - Wait for presentation
Description
The call to waitForPresentKHR will block until either the presentId
associated with swapchain is greater than or equal to presentId, or
timeout nanoseconds passes. When the swapchain becomes OUT_OF_DATE,
the call will either return SUCCESS (if the
image was delivered to the presentation engine and may have been
presented to the user) or will return early with status
ERROR_OUT_OF_DATE_KHR (if the image could
not be presented to the user).
There is no requirement for any precise timing relationship between the presentation of the image to the user and the update of the presentId value, but implementations should make this as close as possible to the presentation of the first pixel in the next image being presented to the user.
For PRESENT_MODE_MAILBOX_KHR (or other present mode where images may be replaced in the presentation queue) any wait of this type associated with such an image must be signaled no later than a wait associated with the replacing image would be signaled.
As an exception to the normal rules for objects which are externally
synchronized, the swapchain passed to waitForPresentKHR 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
swapchainmust not be in the retired state
The presentWait feature must be enabled
Valid Usage (Implicit)
devicemust be a valid Device handle
swapchainmust be a valid SwapchainKHR handleswapchainmust have been created, allocated, or retrieved fromdevice
Host Synchronization
Host access to
swapchainmust be externally synchronized