VKFORMATPROPERTIES(3)

NAME
VkFormatProperties - Structure specifying image format properties

C SPECIFICATION

The VkPhysicalDeviceLimits structure is defined as:

    typedef struct VkFormatProperties {
        VkFormatFeatureFlags    linearTilingFeatures;
        VkFormatFeatureFlags    optimalTilingFeatures;
        VkFormatFeatureFlags    bufferFeatures;
    } VkFormatProperties;

MEMBERS

    • linearTilingFeatures describes the features supported by VK_IMAGE_TILING_LINEAR.

    • optimalTilingFeatures describes the features supported by VK_IMAGE_TILING_OPTIMAL.

    • bufferFeatures describes the features supported by buffers.

DESCRIPTION

Supported features are described as a set of VkFormatFeatureFlagBits:

    typedef enum VkFormatFeatureFlagBits {
        VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001,
        VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002,
        VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004,
        VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008,
        VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010,
        VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020,
        VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040,
        VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080,
        VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100,
        VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200,
        VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400,
        VK_FORMAT_FEATURE_BLIT_DST_BIT = 0x00000800,
        VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000,
    } VkFormatFeatureFlagBits;

The linearTilingFeatures and optimalTilingFeatures members of the VkFormatProperties structure describe what features are supported by VK_IMAGE_TILING_LINEAR and VK_IMAGE_TILING_OPTIMAL images, respectively.

The following bits may be set in linearTilingFeatures and optimalTilingFeatures, indicating they are supported by images or image views created with the queried vkGetPhysicalDeviceFormatProperties::format:

VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT
    VkImageView can be sampled from. See sampled images section.

VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT
    VkImageView can be used as storage image. See storage images section.

VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT
    VkImageView can be used as storage image that supports atomic operations.

VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT
    VkImageView can be used as a framebuffer color attachment and as an input attachment.

VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT
    VkImageView can be used as a framebuffer color attachment that supports blending and as an input attachment.

VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT
    VkImageView can be used as a framebuffer depth/stencil attachment and as an input attachment.

VK_FORMAT_FEATURE_BLIT_SRC_BIT
    VkImage can be used as srcImage for the vkCmdBlitImage command.

VK_FORMAT_FEATURE_BLIT_DST_BIT
    VkImage can be used as dstImage for the vkCmdBlitImage command.

VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
    If VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT is also set, VkImageView can be used with a sampler that has either of magFilter or minFilter set to VK_FILTER_LINEAR, or mipmapMode set to VK_SAMPLER_MIPMAP_MODE_LINEAR. If VK_FORMAT_FEATURE_BLIT_SRC_BIT is also set, VkImage can be used as the srcImage to vkCmdBlitImage with a filter of VK_FILTER_LINEAR. This bit must only be exposed for formats that also support the VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT or VK_FORMAT_FEATURE_BLIT_SRC_BIT.

    If the format being queried is a depth/stencil format, this bit only indicates that the depth aspect (not the stencil aspect) of an image of this format supports linear filtering, and that linear filtering of the depth aspect is supported whether depth compare is enabled in the sampler or not. If this bit is not present, linear filtering with depth compare disabled is unsupported and linear filtering with depth compare enabled is supported, but may compute the filtered value in an implementation-dependent manner which differs from the normal rules of linear filtering. The resulting value must be in the range [ $[0,1]$ ] and should be proportional to, or a weighted average of, the number of comparison passes or failures.

The following features may appear in bufferFeatures, indicating they are supported by buffers or buffer views created with the queried vkGetPhysicalDeviceFormatProperties::format:

VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT
    Format can be used to create a VkBufferView that can be bound to a VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER descriptor.

VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT
    Format can be used to create a VkBufferView that can be bound to a VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER descriptor.

VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT
    Atomic operations are supported on VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER with this format.

VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT
    Format can be used as a vertex attribute format (VkVertexInputAttributeDescription::format).

    Note

    If no format feature flags are supported, then the only possible use would be image transfers - which alone are not useful. As such, if no format feature flags are supported, the format itself is not supported, and images of that format cannot be created.

If format is a block-compression format, then buffers must not support any features for the format.

SEE ALSO

VkFormatFeatureFlags, vkGetPhysicalDeviceFormatProperties

DOCUMENT NOTES

For more information, see the Vulkan Specification at URL

https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkFormatProperties

This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification,not directly.

COPYRIGHT

Copyright (c) 2014-2016 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.

AUTHOR

Khronos Group
    Author.