C Specification
The VkWriteDescriptorSet structure is defined as:
// Provided by VK_VERSION_1_0
typedef struct VkWriteDescriptorSet {
VkStructureType sType;
const void* pNext;
VkDescriptorSet dstSet;
uint32_t dstBinding;
uint32_t dstArrayElement;
uint32_t descriptorCount;
VkDescriptorType descriptorType;
const VkDescriptorImageInfo* pImageInfo;
const VkDescriptorBufferInfo* pBufferInfo;
const VkBufferView* pTexelBufferView;
} VkWriteDescriptorSet;
Members
-
sTypeis a VkStructureType value identifying this structure. -
pNextisNULLor a pointer to a structure extending this structure. -
dstSetis the destination descriptor set to update. -
dstBindingis the descriptor binding within that set. -
dstArrayElementis the starting element in that array. If the descriptor binding identified bydstSetanddstBindinghas a descriptor type of VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK thendstArrayElementspecifies the starting byte offset within the binding. -
descriptorCountis the number of descriptors to update. If the descriptor binding identified bydstSetanddstBindinghas a descriptor type of VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK, thendescriptorCountspecifies the number of bytes to update. Otherwise,descriptorCountis one of-
the number of elements in
pImageInfo -
the number of elements in
pBufferInfo -
the number of elements in
pTexelBufferView -
a value matching the
dataSizemember of a VkWriteDescriptorSetInlineUniformBlock structure in thepNextchain -
a value matching the
accelerationStructureCountof a VkWriteDescriptorSetAccelerationStructureKHR or VkWriteDescriptorSetAccelerationStructureNV structure in thepNextchain -
a value matching the
descriptorCountof a VkWriteDescriptorSetTensorARM structure in thepNextchain
-
-
descriptorTypeis a VkDescriptorType specifying the type of each descriptor inpImageInfo,pBufferInfo, orpTexelBufferView, as described below. IfVkDescriptorSetLayoutBindingfordstSetatdstBindingis not equal to VK_DESCRIPTOR_TYPE_MUTABLE_EXT,descriptorTypemust be the same type as thedescriptorTypespecified inVkDescriptorSetLayoutBindingfordstSetatdstBinding. The type of the descriptor also controls which array the descriptors are taken from. -
pImageInfois a pointer to an array of VkDescriptorImageInfo structures or is ignored, as described below. -
pBufferInfois a pointer to an array of VkDescriptorBufferInfo structures or is ignored, as described below. -
pTexelBufferViewis a pointer to an array of VkBufferView handles as described in the Buffer Views section or is ignored, as described below.
Description
Members of pImageInfo, pBufferInfo and pTexelBufferView
are only accessed by the implementation when they correspond to a descriptor
type being defined - otherwise they are ignored.
The members accessed are as follows for each descriptor type:
-
For VK_DESCRIPTOR_TYPE_SAMPLER, only the
samplermember of each element of VkWriteDescriptorSet::pImageInfois accessed. -
For VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, or VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, only the
imageViewandimageLayoutmembers of each element of VkWriteDescriptorSet::pImageInfoare accessed. -
For VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, all members of each element of VkWriteDescriptorSet::
pImageInfoare accessed. -
For VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, all members of each element of VkWriteDescriptorSet::
pBufferInfoare accessed. -
For VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER or VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, each element of VkWriteDescriptorSet::
pTexelBufferViewis accessed.
When updating descriptor sets with a descriptorType of
VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK, none of the pImageInfo,
pBufferInfo, or pTexelBufferView members are accessed, instead
the source data of the descriptor update operation is taken from the
VkWriteDescriptorSetInlineUniformBlock structure in the pNext
chain of VkWriteDescriptorSet.
When updating descriptor sets with a descriptorType of
VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR, none of the
pImageInfo, pBufferInfo, or pTexelBufferView members are
accessed, instead the source data of the descriptor update operation is
taken from the VkWriteDescriptorSetAccelerationStructureKHR structure
in the pNext chain of VkWriteDescriptorSet.
When updating descriptor sets with a descriptorType of
VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV, none of the
pImageInfo, pBufferInfo, or pTexelBufferView members are
accessed, instead the source data of the descriptor update operation is
taken from the VkWriteDescriptorSetAccelerationStructureNV structure
in the pNext chain of VkWriteDescriptorSet.
When updating descriptor sets with a descriptorType of
VK_DESCRIPTOR_TYPE_TENSOR_ARM, none of the pImageInfo,
pBufferInfo, or pTexelBufferView members are accessed, instead
the source data of the descriptor update operation is taken from the
instance of VkWriteDescriptorSetTensorARM in the pNext chain of
VkWriteDescriptorSet.
If the nullDescriptor feature is enabled,
the buffer,
acceleration structure,
tensor,
imageView, or bufferView can be VK_NULL_HANDLE.
Loads from a null descriptor return zero values and stores and atomics to a
null descriptor are discarded.
A null acceleration structure descriptor results in the miss shader being
invoked.
If the destination descriptor is a mutable descriptor, the active descriptor
type for the destination descriptor becomes descriptorType.
If the dstBinding has fewer than descriptorCount array elements
remaining starting from dstArrayElement, then the remainder will be
used to update the subsequent binding - dstBinding+1 starting at
array element zero.
If a binding has a descriptorCount of zero, it is skipped.
This behavior applies recursively, with the update affecting consecutive
bindings as needed to update all descriptorCount descriptors.
Consecutive bindings must have identical VkDescriptorType,
VkShaderStageFlags,
VkDescriptorBindingFlagBits,
and immutable samplers references.
In addition, if the VkDescriptorType is
VK_DESCRIPTOR_TYPE_MUTABLE_EXT, the supported descriptor types in
VkMutableDescriptorTypeCreateInfoEXT must be equally defined.
|
Note
|
The same behavior applies to bindings with a descriptor type of
VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK where |
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.