vkGetPhysicalDeviceSurfacePresentModesKHR(3)

# vkGetPhysicalDeviceSurfacePresentModesKHR(3) Manual Page

## Name

vkGetPhysicalDeviceSurfacePresentModesKHR - Query supported presentation modes

Loading… please wait.

## C Specification

To query the supported presentation modes for a surface, call:

    // Provided by VK_KHR_surface
    VkResult vkGetPhysicalDeviceSurfacePresentModesKHR(
        VkPhysicalDevice                            physicalDevice,
        VkSurfaceKHR                                surface,
        uint32_t*                                   pPresentModeCount,
        VkPresentModeKHR*                           pPresentModes);

## Parameters

- `physicalDevice` is the physical device that will be associated with the swapchain to be created, as described for vkCreateSwapchainKHR.

- `surface` is the surface that will be associated with the swapchain.

- `pPresentModeCount` is a pointer to an integer related to the number of presentation modes available or queried, as described below.

- `pPresentModes` is either `NULL` or a pointer to an array of VkPresentModeKHR values, indicating the supported presentation modes.

## Description

If `pPresentModes` is `NULL`, then the number of presentation modes supported for the given `surface` is returned in `pPresentModeCount`. Otherwise, `pPresentModeCount` must point to a variable set by the user to the number of elements in the `pPresentModes` array, and on return the variable is overwritten with the number of values actually written to `pPresentModes`. If the value of `pPresentModeCount` is less than the number of presentation modes supported, at most `pPresentModeCount` values will be written, and `VK_INCOMPLETE` will be returned instead of `VK_SUCCESS`, to indicate that not all the available modes were returned.

If the `VK_GOOGLE_surfaceless_query` extension is enabled and `surface` is VK_NULL_HANDLE, the values returned in `pPresentModes` will only indicate support for `VK_PRESENT_MODE_FIFO_KHR`, `VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR`, and `VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR`. To query support for any other present mode, a valid handle must be provided in `surface`.

Valid Usage

- VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-surface-06524
  If the `VK_GOOGLE_surfaceless_query` extension is not enabled, `surface` must be a valid VkSurfaceKHR handle

- VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-surface-06525
  If `surface` is not VK_NULL_HANDLE, `surface` must be supported by `physicalDevice`, as reported by vkGetPhysicalDeviceSurfaceSupportKHR or an equivalent platform-specific mechanism

Valid Usage (Implicit)

- VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-physicalDevice-parameter
  `physicalDevice` must be a valid VkPhysicalDevice handle

- VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-surface-parameter
  If `surface` is not VK_NULL_HANDLE, `surface` must be a valid VkSurfaceKHR handle

- VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-pPresentModeCount-parameter
  `pPresentModeCount` must be a valid pointer to a `uint32_t` value

- VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-pPresentModes-parameter
  If the value referenced by `pPresentModeCount` is not `0`, and `pPresentModes` is not `NULL`, `pPresentModes` must be a valid pointer to an array of `pPresentModeCount` VkPresentModeKHR values

- VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-commonparent
  Both of `physicalDevice`, and `surface` that are valid handles of non-ignored parameters must have been created, allocated, or retrieved from the same VkInstance

Return Codes

On success, this command returns

  - `VK_SUCCESS`

  - `VK_INCOMPLETE`

On failure, this command returns

  - `VK_ERROR_OUT_OF_HOST_MEMORY`

  - `VK_ERROR_OUT_OF_DEVICE_MEMORY`

  - `VK_ERROR_SURFACE_LOST_KHR`

## See Also

VK_KHR_surface, VkPhysicalDevice, VkPresentModeKHR, VkSurfaceKHR

## Document Notes

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.

## Copyright

Copyright 2014-2024 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0