// Copyright 2019-2022 The Khronos Group Inc.
//
// SPDX-License-Identifier: CC-BY-4.0

[open,refpage='VkSwapchainPresentFenceInfoEXT',desc='Fences associated with a vkQueuePresentKHR operation',type='structs']
--
The sname:VkSwapchainPresentFenceInfoEXT structure is defined as:

include::{generated}/api/structs/VkSwapchainPresentFenceInfoEXT.adoc[]

  * pname:sType is the type of this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:swapchainCount is the number of swapchains being presented to by
    this command.
  * pname:pFences is a list of fences with pname:swapchainCount entries.
    Each entry must: be dlink:VK_NULL_HANDLE or the handle of a fence to
    signal when the relevant operations on the associated swapchain have
    completed.

The set of _queue operations_ defined by queuing an image for presentation,
as well as operations performed by the presentation engine access the
payloads of objects associated with the presentation operation.
The associated objects include:

  * The swapchain image, its implicitly bound memory, and any other
    resources bound to that memory.
  * The wait semaphores specified when queuing the image for presentation.

The application can: provide a fence that the implementation will signal
when all such queue operations have completed and the presentation engine
has taken a reference to the payload of any objects it accesses as part of
the present operation.
For all
ifdef::VK_KHR_timeline_semaphore[binary]
wait semaphores imported by the presentation engine using the equivalent of
reference transference, as described in
<<synchronization-semaphores-importing,Importing Semaphore Payloads>>, this
fence must: not signal until all such semaphore payloads have been reset by
the presentation engine.

The application can: destroy the wait semaphores associated with a given
presentation operation when the associated fence is signaled, and can:
destroy the swapchain when the fences associated with all past presentation
requests have signaled.

Fences associated with presentations to the same swapchain on the same
slink:VkQueue must: be signaled in the same order as the present operations.

To specify a fence for each swapchain in a present operation, include the
sname:VkSwapchainPresentFenceInfoEXT structure in the pname:pNext chain of
the slink:VkPresentInfoKHR structure.

.Valid Usage
****
  * [[VUID-VkSwapchainPresentFenceInfoEXT-swapchainCount-07757]]
    pname:swapchainCount must: be equal to
    slink:VkPresentInfoKHR::pname:swapchainCount
  * [[VUID-VkSwapchainPresentFenceInfoEXT-pFences-07758]]
    Each element of pname:pFences must: be unsignaled
  * [[VUID-VkSwapchainPresentFenceInfoEXT-pFences-07759]]
    Each element of pname:pFences must: not be associated with any other
    queue command that has not yet completed execution on that queue
****

include::{generated}/validity/structs/VkSwapchainPresentFenceInfoEXT.adoc[]
--
