Function Prototype

vkGetPhysicalDeviceDescriptorSizeEXT

Report specific descriptor sizes for each descriptor type

To query the size of heap descriptor for a specific VkDescriptorType, call:

VkDeviceSize vkGetPhysicalDeviceDescriptorSizeEXT(
    VkPhysicalDevice                                    physicalDevice,
    VkDescriptorType                                    descriptorType);
  • physicalDevice is the physical device from which to query the descriptor sizes.
  • descriptorType is a VkDescriptorType specifying the type of heap descriptor to query the size for.

The return value of this function will be a VkDeviceSize indicating the size in bytes (N) of a heap descriptor with a type equal to descriptorType. When a descriptor of this type is written by vkWriteResourceDescriptorsEXT or vkWriteSamplerDescriptorsEXT, only the first N bytes are written; the rest will not be accessed and can be safely discarded when copying descriptors around. Additionally, those first N bytes are the only bytes that will be accessed when the descriptor is accessed in the shader. N will never be larger than the applicable limits in VkPhysicalDeviceDescriptorHeapTensorPropertiesARM or VkPhysicalDeviceDescriptorHeapPropertiesEXT.

Values returned by this function have other requirements, so for example may not be power-of-two values.
This command is not intended for general use, and is for tools that already take advantage of tighter packing with other similar features (e.g. VK_EXT_descriptor_buffer) to optimize accesses in some cases. Applications can safely ignore this function and are advised to do so, to avoid depending on non-portable packing.

Valid Usage

VUID-vkGetPhysicalDeviceDescriptorSizeEXT-type-11362

type must be one of VK_DESCRIPTOR_TYPE_SAMPLER, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, VK_DESCRIPTOR_TYPE_SAMPLE_WEIGHT_IMAGE_QCOM, VK_DESCRIPTOR_TYPE_BLOCK_MATCH_IMAGE_QCOM, VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR, VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV, VK_DESCRIPTOR_TYPE_PARTITIONED_ACCELERATION_STRUCTURE_NV, VK_DESCRIPTOR_TYPE_TENSOR_ARM, or VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT