To set descriptor buffer offsets in a command buffer, call:
// Provided by VK_EXT_descriptor_buffer void vkCmdSetDescriptorBufferOffsetsEXT( VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t setCount, const uint32_t* pBufferIndices, const VkDeviceSize* pOffsets);
commandBufferis the command buffer in which the descriptor buffer offsets will be set.
pipelineBindPointis a VkPipelineBindPoint indicating the type of the pipeline that will use the descriptors.
layoutis a VkPipelineLayout object used to program the bindings.
firstSetis the number of the first set to be bound.
setCountis the number of elements in the
pBufferIndicesis a pointer to an array of indices into the descriptor buffer binding points set by vkCmdBindDescriptorBuffersEXT.
pOffsetsis a pointer to an array of VkDeviceSize offsets to apply to the bound descriptor buffers.
setCount pairs of
descriptor buffers, specified by indices into the binding points bound using
vkCmdBindDescriptorBuffersEXT, and buffer offsets to set numbers
descriptorSetCount-1] for subsequent
bound pipeline commands set by
firstSet + i] is bound to the descriptor buffer at binding
pBufferIndices[i] at an offset of
Any bindings that were previously applied via these sets, or calls to
vkCmdBindDescriptorSets, are no longer valid.
Other sets will also be invalidated upon calling this command if
layout differs from the pipeline layout used to bind those other sets,
as described in Pipeline Layout
After binding descriptors, applications can modify descriptor memory either
by performing writes on the host or with device commands.
When descriptor memory is updated with device commands, visibility for the
shader stage accessing a descriptor is ensured with the
VK_ACCESS_2_DESCRIPTOR_BUFFER_READ_BIT_EXT access flag.
Implementations must not access resources referenced by these descriptors
unless they are dynamically accessed by shaders.
Descriptors bound with this call can be undefined if they are not
dynamically accessed by shaders.
Implementations may read descriptor data for any statically accessed
descriptor if the
layout is not declared with the
layout is declared with
must not read descriptor data that is not dynamically accessed.
Applications must ensure that any descriptor which the implementation may read must be in-bounds of the underlying descriptor buffer binding.
Applications can freely decide how large a variable descriptor buffer binding is, so it may not be safe to read such descriptor payloads statically. The intention of these rules is to allow implementations to speculatively prefetch descriptor payloads where feasible.
Dynamically accessing a resource through descriptor data from an unbound region of a sparse partially-resident buffer will result in invalid descriptor data being read, and therefore undefined behavior.
For descriptors written by the host, visibility is implied through the
automatic visibility operation on queue submit, and there is no need to
The requirements above imply that all descriptor bindings have been defined
with the equivalent of
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.