31.4. Additional Image Capabilities

In addition to the minimum capabilities described in the previous sections (Limits and Formats), implementations may support additional capabilities for certain types of images. For example, larger dimensions or additional sample counts for certain image types, or additional capabilities for linear tiling format images.

To query additional capabilities specific to image types, call:

 

VkResult vkGetPhysicalDeviceImageFormatProperties(
    VkPhysicalDevice                            physicalDevice,
    VkFormat                                    format,
    VkImageType                                 type,
    VkImageTiling                               tiling,
    VkImageUsageFlags                           usage,
    VkImageCreateFlags                          flags,
    VkImageFormatProperties*                    pImageFormatProperties);

The format, type, tiling, usage, and flags parameters correspond to parameters that would be consumed by vkCreateImage.

The VkImageFormatProperties structure is defined as:

 

typedef struct VkImageFormatProperties {
    VkExtent3D            maxExtent;
    uint32_t              maxMipLevels;
    uint32_t              maxArrayLayers;
    VkSampleCountFlags    sampleCounts;
    VkDeviceSize          maxResourceSize;
} VkImageFormatProperties;

[Note]Note

There is no mechanism to query the size of an image before creating it, to compare that size against maxResourceSize. If an application attempts to create an image that exceeds this limit, the creation will fail or the image will be invalid. While the advertised limit must be at least 231, it may not be possible to create an image that approaches that size, particularly for VK_IMAGE_TYPE_1D.

If the combination of parameters to vkGetPhysicalDeviceImageFormatProperties is not supported by the implementation for use in vkCreateImage, then all members of VkImageFormatProperties will be filled with zero.

If format is not a supported image format, or if the combination of format, type, tiling, usage, and flags is not supported for images, then vkGetPhysicalDeviceImageFormatProperties returns VK_ERROR_FORMAT_NOT_SUPPORTED.

The limitations on an image format that are reported by vkGetPhysicalDeviceImageFormatProperties have the following property: if usage1 and usage2 of type VkImageUsageFlags are such that the bits set in usage1 are a subset of the bits set in usage2, and flags1 and flags2 of type VkImageCreateFlags are such that the bits set in flags1 are a subset of the bits set in flags2, then the limitations for usage1 and flags1 must be no more strict than the limitations for usage2 and flags2, for all values of format, type, and tiling.

31.4.1. Allowed Extent Values Based On Image Type

For VK_IMAGE_TYPE_1D:

  • $\mathit{maxExtent.width} \leq \mathit{VkPhysicalDeviceLimits.maxImageDimension1D}$
  • $\mathit{maxExtent.height} = 1$
  • $\mathit{maxExtent.depth} = 1$

For VK_IMAGE_TYPE_2D:

  • $\mathit{maxExtent.width} \leq \mathit{VkPhysicalDeviceLimits.maxImageDimension2D}$
  • $\mathit{maxExtent.height} \leq \mathit{VkPhysicalDeviceLimits.maxImageDimension2D}$
  • $\mathit{maxExtent.depth} = 1$

For VK_IMAGE_TYPE_3D:

  • $\mathit{maxExtent.width} \leq \mathit{VkPhysicalDeviceLimits.maxImageDimension3D}$
  • $\mathit{maxExtent.height} \leq \mathit{VkPhysicalDeviceLimits.maxImageDimension3D}$
  • $\mathit{maxExtent.depth} \leq \mathit{VkPhysicalDeviceLimits.maxImageDimension3D}$