C Specification
To get descriptor data to place in a buffer, call:
// Provided by VK_EXT_descriptor_buffer
void vkGetDescriptorEXT(
VkDevice device,
const VkDescriptorGetInfoEXT* pDescriptorInfo,
size_t dataSize,
void* pDescriptor);
Parameters
-
device
is the logical device that gets the descriptor. -
pDescriptorInfo
is a pointer to a VkDescriptorGetInfoEXT structure specifying the parameters of the descriptor to get. -
dataSize
is the amount of the descriptor data to get in bytes. -
pDescriptor
is a pointer to a user-allocated buffer where the descriptor will be written.
Description
The size of the data for each descriptor type is determined by the value in VkPhysicalDeviceDescriptorBufferPropertiesEXT. This value also defines the stride in bytes for arrays of that descriptor type.
If the
VkPhysicalDeviceDescriptorBufferPropertiesEXT::combinedImageSamplerDescriptorSingleArray
property is VK_FALSE
the implementation requires an array of
VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER
descriptors to be written
into a descriptor buffer as an array of image descriptors, immediately
followed by an array of sampler descriptors.
Applications must write the first
VkPhysicalDeviceDescriptorBufferPropertiesEXT::sampledImageDescriptorSize
bytes of the data returned through pDescriptor
to the first array, and
the remaining
VkPhysicalDeviceDescriptorBufferPropertiesEXT::samplerDescriptorSize
bytes of the data to the second array.
For variable-sized descriptor bindings of
VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER
descriptors, the two arrays
each have a size equal to the upper bound descriptorCount
of that
binding.
A descriptor obtained by this command references the underlying VkImageView or VkSampler, and these objects must not be destroyed before the last time a descriptor is dynamically accessed. For descriptor types which consume an address instead of an object, the underlying VkBuffer is referenced instead.
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.