vkGetPhysicalDeviceVideoFormatPropertiesKHR(3)

# vkGetPhysicalDeviceVideoFormatPropertiesKHR(3) Manual Page

## Name

vkGetPhysicalDeviceVideoFormatPropertiesKHR - query supported Video Decode and Encode image formats

Loading… please wait.

## C Specification

To enumerate the supported output, input and Dpb image formats for a specific codec operation and video profile, call:

    // Provided by VK_KHR_video_queue
    VkResult vkGetPhysicalDeviceVideoFormatPropertiesKHR(
        VkPhysicalDevice                            physicalDevice,
        const VkPhysicalDeviceVideoFormatInfoKHR*   pVideoFormatInfo,
        uint32_t*                                   pVideoFormatPropertyCount,
        VkVideoFormatPropertiesKHR*                 pVideoFormatProperties);

## Parameters

- `physicalDevice` is the physical device being queried.

- `pVideoFormatInfo` is a pointer to an instance of VkPhysicalDeviceVideoFormatInfoKHR, the input structure.

- `pVideoFormatPropertyCount` is a pointer to an integer related to the number of video format properties available or queried, as described below.

- `pVideoFormatProperties` is a pointer to an array of VkVideoFormatPropertiesKHR, where the implementation would populate the supported formats.

## Description

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

Valid Usage

- VUID-vkGetPhysicalDeviceVideoFormatPropertiesKHR-imageUsage-04844
  The `imageUsage` enum of VkPhysicalDeviceVideoFormatInfoKHR must contain at least one of the following video image usage bit(s): `VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR`, `VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR`, `VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR`, or `VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR`.

| Note: For most use cases, only decode or encode related usage flags are going to be specified. For a use case such as transcode, if the image were to be shared between decode and encode session(s), then both decode and encode related usage flags can be set.

Valid Usage (Implicit)

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

- VUID-vkGetPhysicalDeviceVideoFormatPropertiesKHR-pVideoFormatInfo-parameter
  `pVideoFormatInfo` must be a valid pointer to a valid VkPhysicalDeviceVideoFormatInfoKHR structure

- VUID-vkGetPhysicalDeviceVideoFormatPropertiesKHR-pVideoFormatPropertyCount-parameter
  `pVideoFormatPropertyCount` must be a valid pointer to a `uint32_t` value

- VUID-vkGetPhysicalDeviceVideoFormatPropertiesKHR-pVideoFormatProperties-parameter
  If `pVideoFormatProperties` is not `NULL`, `pVideoFormatProperties` must be a valid pointer to an array of `pVideoFormatPropertyCount` VkVideoFormatPropertiesKHR structures

- VUID-vkGetPhysicalDeviceVideoFormatPropertiesKHR-pVideoFormatPropertyCount-arraylength
  If `pVideoFormatProperties` is not `NULL`, the value referenced by `pVideoFormatPropertyCount` must be greater than `0`

Return Codes

On success, this command returns

  - `VK_SUCCESS`

  - `VK_INCOMPLETE`

On failure, this command returns

  - `VK_ERROR_EXTENSION_NOT_PRESENT`

  - `VK_ERROR_INITIALIZATION_FAILED`

  - `VK_ERROR_FORMAT_NOT_SUPPORTED`

## See Also

VkPhysicalDevice, VkPhysicalDeviceVideoFormatInfoKHR, VkVideoFormatPropertiesKHR

## 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-2021 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0