# vkGetPhysicalDeviceSurfaceCapabilities2EXT(3) Manual Page

## Name

vkGetPhysicalDeviceSurfaceCapabilities2EXT - Query surface capabilities

Loading… please wait.

## C Specification

To query the basic capabilities of a surface, needed in order to create a swapchain, call:

    // Provided by VK_EXT_display_surface_counter
    VkResult vkGetPhysicalDeviceSurfaceCapabilities2EXT(
        VkPhysicalDevice                            physicalDevice,
        VkSurfaceKHR                                surface,
        VkSurfaceCapabilities2EXT*                  pSurfaceCapabilities);

## 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.

- `pSurfaceCapabilities` is a pointer to a VkSurfaceCapabilities2EXT structure in which the capabilities are returned.

## Description

`vkGetPhysicalDeviceSurfaceCapabilities2EXT` behaves similarly to vkGetPhysicalDeviceSurfaceCapabilitiesKHR, with the ability to return extended information by adding extending structures to the `pNext` chain of its `pSurfaceCapabilities` parameter.

Valid Usage

- VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-surface-06523
  `surface` must be a valid VkSurfaceKHR handle

- VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-surface-06211
  `surface` must be supported by `physicalDevice`, as reported by vkGetPhysicalDeviceSurfaceSupportKHR or an equivalent platform-specific mechanism

Valid Usage (Implicit)

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

- VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-surface-parameter
  `surface` must be a valid VkSurfaceKHR handle

- VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-pSurfaceCapabilities-parameter
  `pSurfaceCapabilities` must be a valid pointer to a VkSurfaceCapabilities2EXT structure

- VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-commonparent
  Both of `physicalDevice`, and `surface` must have been created, allocated, or retrieved from the same VkInstance

Return Codes

On success, this command returns

  - `VK_SUCCESS`

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_EXT_display_surface_counter, VkPhysicalDevice, VkSurfaceCapabilities2EXT, 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