VKWRITEDESCRIPTORSET(3)

NAME
VkWriteDescriptorSet - Structure specifying the parameters of a descriptor set write operation.

C SPECIFICATION

    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;

FIELDS

sType
    Structure type. Must be VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET.

pNext
    Pointer to next structure in the structure chain when applicable.

dstSet
    Destination descriptor set to write the descriptor data to.

dstBinding
    Binding within the descriptor set to start the update from.

dstArrayElement
    Array element of the binding to start the update from.

descriptorCount
    Number of descriptors to write to the descriptor set.

descriptorType
    Type of descriptors to write to the descriptor set.

pImageInfo
    A pointer to an array of descriptorCount VkDescriptorImageInfo structures specifying the source of the descriptor data to write to the descriptor set for images.

pBufferInfo
    A pointer to an array of descriptorCount VkDescriptorBufferInfo structures specifying the source of the descriptor data to write to the descriptor set for buffers.

pTexelBufferView
    A pointer to an array of VkBufferView handles used when binding texel buffers into a the descriptor set.

DESCRIPTION

This structure specifies information about the descriptors to be written to a descriptor set using the vkUpdateDescriptorSets command.

When writing data to descriptor sets, the pImageInfo, pBufferInfo or pTexelBufferView parameters of vkUpdateDescriptorSets point to descriptorCount instances of data structures, each instance specifying the source of the descriptor data to be written. Which of these parameters is used depends on the value of descriptorType.

Each instance of the selected array allows writing descriptorCount descriptors of type descriptorType to the destination descriptor set specified by dstSet starting from the array element index dstArrayElement of the dstBinding binding.

If descriptorCount is greater than the number of descriptors in the specified binding starting from the specified array element index then subsequent descriptors are written to the next binding starting from its first array element. This allows updating multiple subsequent bindings with a single instance of this structure as long as the descriptor type of those bindings match.

Attempting to write descriptors of incompatible type to any binding of a descriptor set may result in undefined behavior.

VALID USAGE

    • sType must be VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET

    • pNext must be NULL

    • dstSet must be a valid VkDescriptorSet handle

    • descriptorType must be a valid VkDescriptorType value

    • descriptorCount must be greater than 0

    • Each of dstSet and the elements of pTexelBufferView that are valid handles must have been created, allocated or retrieved from the same VkDevice

    • dstBinding must be a valid binding point within dstSet

    • descriptorType must match the type of dstBinding within dstSet

    • The sum of dstArrayElement and descriptorCount must be less than or equal to the number of array elements in the descriptor set binding specified by dstBinding, and all applicable consecutive bindings, as described by ???

    • If descriptorType is VK_DESCRIPTOR_TYPE_SAMPLER, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE or VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, pImageInfo must be a pointer to an array of descriptorCount valid VkDescriptorImageInfo structures

    • If descriptorType is VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER or VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, pTexelBufferView must be a pointer to an array of descriptorCount valid VkBufferView handles

    • If descriptorType is VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, pBufferInfo must be a pointer to an array of descriptorCount valid VkDescriptorBufferInfo structures

    • If descriptorType is VK_DESCRIPTOR_TYPE_SAMPLER or VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, and dstSet was not created with a layout that included immutable samplers for dstBinding with descriptorType, the sampler member of any given element of pImageInfo must be a valid VkSampler object

    • If descriptorType is VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE or VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, the imageView and imageLayout members of any given element of pImageInfo must be a valid VkImageView and VkImageLayout, respectively

    • If descriptorType is VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER or VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, the offset member of any given element of pBufferInfo must be a multiple of VkPhysicalDeviceLimits::minUniformBufferOffsetAlignment

    • If descriptorType is VK_DESCRIPTOR_TYPE_STORAGE_BUFFER or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, the offset member of any given element of pBufferInfo must be a multiple of VkPhysicalDeviceLimits::minStorageBufferOffsetAlignment

    • If descriptorType is VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER or VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, the buffer member of any given element of pBufferInfo must have been created with VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT set

    • If descriptorType is VK_DESCRIPTOR_TYPE_STORAGE_BUFFER or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, the buffer member of any given element of pBufferInfo must have been created with VK_BUFFER_USAGE_STORAGE_BUFFER_BIT set

    • If descriptorType is VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER or VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, the range member of any given element of pBufferInfo must be less than or equal to VkPhysicalDeviceLimits::maxUniformBufferRange

    • If descriptorType is VK_DESCRIPTOR_TYPE_STORAGE_BUFFER or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, the range member of any given element of pBufferInfo must be less than or equal to VkPhysicalDeviceLimits::maxStorageBufferRange

    • If descriptorType is VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, the VkBuffer that any given element of pTexelBufferView was created from must have been created with VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT set

    • If descriptorType is VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, the VkBuffer that any given element of pTexelBufferView was created from must have been created with VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT set

    • If descriptorType is VK_DESCRIPTOR_TYPE_STORAGE_IMAGE or VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, the imageView member of any given element of pImageInfo must have been created with the identity swizzle

SEE ALSO

vkUpdateDescriptorSets, VkDescriptorImageInfo, VkDescriptorBufferInfo, VkDescriptorType

COPYRIGHT

Copyright © 2014-2016 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.

AUTHOR

Khronos Group
    Author.