[open,refpage='VkSwapchainCounterCreateInfoEXT',desc='Specify the surface counters desired',type='structs']
--

To enable surface counters when creating a swapchain, add
sname:VkSwapchainCounterCreateInfoEXT to the pname:pNext chain of
slink:VkSwapchainCreateInfoKHR.
sname:VkSwapchainCounterCreateInfoEXT is defined as:

include::../../api/structs/VkSwapchainCounterCreateInfoEXT.txt[]

  * pname:sType is the type of this structure.
  * pname:pNext is `NULL` or a pointer to an extension-specific structure.
  * pname:surfaceCounters is a bitmask of elink:VkSurfaceCounterFlagBitsEXT
    specifying surface counters to enable for the swapchain.

.Valid Usage
****
  * [[VUID-VkSwapchainCounterCreateInfoEXT-surfaceCounters-01244]]
    The bits in pname:surfaceCounters must: be supported by
    slink:VkSwapchainCreateInfoKHR::pname:surface, as reported by
    flink:vkGetPhysicalDeviceSurfaceCapabilities2EXT.
****

include::../../validity/structs/VkSwapchainCounterCreateInfoEXT.txt[]
--

[open,refpage='vkGetSwapchainCounterEXT',desc='Query the current value of a surface counter',type='protos']
--

The requested counters become active when the first presentation command for
the associated swapchain is processed by the presentation engine.
To query the value of an active counter, use:

include::../../api/protos/vkGetSwapchainCounterEXT.txt[]

  * pname:device is the slink:VkDevice associated with pname:swapchain.
  * pname:swapchain is the swapchain from which to query the counter value.
  * pname:counter is the counter to query.
  * pname:pCounterValue will return the current value of the counter.

If a counter is not available because the swapchain is out of date, the
implementation may: return ename:VK_ERROR_OUT_OF_DATE_KHR.

.Valid Usage
****
  * [[VUID-vkGetSwapchainCounterEXT-swapchain-01245]]
    One or more present commands on pname:swapchain must: have been
    processed by the presentation engine.
****

include::../../validity/protos/vkGetSwapchainCounterEXT.txt[]
--
