VkDescriptorSetAndBindingMappingEXT - Structure specifying mappings from
a set of shader resources to a descriptor heap
Description
Resources specified in a shader with a
DescriptorSet decoration set to descriptorSet,
a Binding decoration greater than or equal to firstBinding and less
than the sum of firstBinding and bindingCount, and a resource type
matching one of the bits in resourceMask will be mapped according to
source and sourceData.
Applications are free to overspecify bindings that are not present;
allowing reuse of the same mapping structures with multiple shaders,
even when those shaders only partially reuse those mappings. This
includes things like setting binding counts higher than the number used
in the shader, specifying bindings that are not present in the shader,
and setting resourceMask to all possible resources that may be
encountered.
If source selects an element of sourceData defined by a structure,
the description of that structure defines how resources are mapped.
Source mappings using a single base type are defined here.
If source is
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_CONSTANT_OFFSET_EXT, the resource
will be backed by heap data as specified by
constantOffset.
If source is DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_PUSH_INDEX_EXT, the
resource will be backed by heap data as specified by
pushIndex.
If source is DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_INDIRECT_INDEX_EXT,
the resource will be backed by heap data as specified by
indirectIndex.
If source is
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_INDIRECT_INDEX_ARRAY_EXT, the
resource will be backed by heap data as specified by
indirectIndexArray.
If source is DESCRIPTOR_MAPPING_SOURCE_RESOURCE_HEAP_DATA_EXT, the
resource will be backed by heap data as specified by
heapData.
If source is DESCRIPTOR_MAPPING_SOURCE_PUSH_DATA_EXT, the resource
will be backed by push data at a range from pushDataOffset to the size
of the resource, allowing a uniform buffer to be backed by push data
access push data. Accessing data in the uniform buffer at an offset of
shaderOffset in the shader will access push data at an offset equal to
If source is DESCRIPTOR_MAPPING_SOURCE_PUSH_ADDRESS_EXT, the
resource will be backed by data pointed to by a device address in push
data at an offset of pushAddressOffset. Accessing data via the mapped
resource in the shader will access data backing the address specified in
push data:
where pPushData is the total set of push data specified by
cmdPushDataEXT. If the shader resource is an acceleration structure,
the address must be a valid acceleration structure address.
If source is DESCRIPTOR_MAPPING_SOURCE_INDIRECT_ADDRESS_EXT, the
resource will be backed by heap data as specified by
indirectAddress.
Accesses to resources using mappings to anything that is not a
descriptor in a heap are not subject to robustness guarantees; resources
for such mappings must not be accessed out of bounds.
If source is
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_SHADER_RECORD_INDEX_EXT, the
resource will be backed by heap data as specified by
shaderRecordIndex.
If source is DESCRIPTOR_MAPPING_SOURCE_SHADER_RECORD_DATA_EXT, the
resource will be backed by shader record data at a range from
shaderRecordDataOffset to the size of the resource, allowing a uniform
buffer to be used as a way to access shader record data. Accessing data
in the uniform buffer at an offset shaderOffset in the shader will
access shader record data at an offset equal to
If source is DESCRIPTOR_MAPPING_SOURCE_SHADER_RECORD_ADDRESS_EXT,
the resource will be backed by data pointed to by a device address in
the shader record at shaderRecordAddressOffset. Accessing data via the
mapped resource in the shader will access data backing the address
specified in shader record data:
where pShaderRecord is the memory associated with a given shader as its
shader record. If the shader resource is an acceleration structure, the
address must be a valid acceleration structure address.
Accesses to resources using
DESCRIPTOR_MAPPING_SOURCE_SHADER_RECORD_ADDRESS_EXT mappings are not
subject to robustness guarantees; data must not be accessed outside of
the allocated memory range.
Mappings must be declared for all variables with a
DescriptorSet and Binding in the
shader resource interface.
Valid Usage
If source
is DESCRIPTOR_MAPPING_SOURCE_PUSH_DATA_EXT,
sourceData.pushDataOffset must be a multiple of 4
If source
is DESCRIPTOR_MAPPING_SOURCE_PUSH_ADDRESS_EXT,
sourceData.pushAddressOffset must be a multiple of 8
If source
is DESCRIPTOR_MAPPING_SOURCE_SHADER_RECORD_DATA_EXT or
DESCRIPTOR_MAPPING_SOURCE_SHADER_RECORD_ADDRESS_EXT,
bindingCount must be 1
If source
is DESCRIPTOR_MAPPING_SOURCE_SHADER_RECORD_DATA_EXT,
sourceData.shaderRecordDataOffset must be a multiple of 4
If source
is DESCRIPTOR_MAPPING_SOURCE_SHADER_RECORD_ADDRESS_EXT,
sourceData.shaderRecordAddressOffset must be a multiple of 8
If source
is DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_CONSTANT_OFFSET_EXT,
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_PUSH_INDEX_EXT,
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_INDIRECT_INDEX_EXT,
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_INDIRECT_INDEX_ARRAY_EXT, or
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_SHADER_RECORD_INDEX_EXT, and
descriptorSet, firstBinding, and bindingCount identify any
OpTypeImage variables, any heapOffset, and heapArrayStride
members of the corresponding member of sourceData must be 0 or a
multiple of
imageDescriptorAlignment
If source
is DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_CONSTANT_OFFSET_EXT,
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_PUSH_INDEX_EXT,
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_INDIRECT_INDEX_EXT,
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_INDIRECT_INDEX_ARRAY_EXT, or
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_SHADER_RECORD_INDEX_EXT, and
descriptorSet, firstBinding, and bindingCount identify any
OpTypeStruct variables, any heapOffset, and heapArrayStride
members of the corresponding member of sourceData must be 0 or a
multiple of
bufferDescriptorAlignment
If source
is DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_CONSTANT_OFFSET_EXT,
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_PUSH_INDEX_EXT,
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_INDIRECT_INDEX_EXT,
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_INDIRECT_INDEX_ARRAY_EXT, or
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_SHADER_RECORD_INDEX_EXT, and
descriptorSet, firstBinding, and bindingCount identify any
OpTypeSampler variables, any heapOffset and heapArrayStride
members of the corresponding member of sourceData must be 0 or a
multiple of
samplerDescriptorAlignment
If source
is DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_CONSTANT_OFFSET_EXT,
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_PUSH_INDEX_EXT,
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_INDIRECT_INDEX_EXT,
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_INDIRECT_INDEX_ARRAY_EXT, or
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_SHADER_RECORD_INDEX_EXT, and
descriptorSet, firstBinding, and bindingCount identify any
OpTypeSampledImage variables, any samplerHeapOffset and
samplerHeapArrayStride members of the corresponding member of
sourceData must be 0 or a multiple of
samplerDescriptorAlignment
If source
is DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_CONSTANT_OFFSET_EXT,
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_PUSH_INDEX_EXT,
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_INDIRECT_INDEX_EXT,
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_INDIRECT_INDEX_ARRAY_EXT, or
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_SHADER_RECORD_INDEX_EXT, and
descriptorSet, firstBinding, and bindingCount identify any
OpTypeSampledImage variables, any heapOffset and
heapArrayStride members of the corresponding member of
sourceData must be 0 or a multiple of
imageDescriptorAlignment
If source
is DESCRIPTOR_MAPPING_SOURCE_RESOURCE_HEAP_DATA_EXT,
DESCRIPTOR_MAPPING_SOURCE_SHADER_RECORD_DATA_EXT, or
DESCRIPTOR_MAPPING_SOURCE_PUSH_DATA_EXT, resourceMask must
include SPIRV_RESOURCE_TYPE_UNIFORM_BUFFER_BIT_EXT
If source
is DESCRIPTOR_MAPPING_SOURCE_SHADER_RECORD_ADDRESS_EXT or
DESCRIPTOR_MAPPING_SOURCE_PUSH_ADDRESS_EXT, resourceMask must
include at least one of
SPIRV_RESOURCE_TYPE_UNIFORM_BUFFER_BIT_EXT,
SPIRV_RESOURCE_TYPE_READ_ONLY_STORAGE_BUFFER_BIT_EXT,
SPIRV_RESOURCE_TYPE_READ_WRITE_STORAGE_BUFFER_BIT_EXT, or
SPIRV_RESOURCE_TYPE_ACCELERATION_STRUCTURE_BIT_EXT
If source
is DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_SHADER_RECORD_INDEX_EXT,
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_PUSH_INDEX_EXT, or
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_INDIRECT_INDEX_EXT,
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_INDIRECT_INDEX_ARRAY_EXT, and
the mapping sets useCombinedImageSamplerIndex to
TRUE, resourceMask must include
at least one of
SPIRV_RESOURCE_TYPE_COMBINED_SAMPLED_IMAGE_BIT_EXT,
SPIRV_RESOURCE_TYPE_SAMPLED_IMAGE_BIT_EXT, or
SPIRV_RESOURCE_TYPE_SAMPLER_BIT_EXT
If source
is DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_CONSTANT_OFFSET_EXT,
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_PUSH_INDEX_EXT,
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_SHADER_RECORD_INDEX_EXT,
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_INDIRECT_INDEX_EXT, or
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_INDIRECT_INDEX_ARRAY_EXT, and
bindingCount is not 1, the pEmbeddedSampler member of the
corresponding mapping structure must be NULL
If source
is DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_CONSTANT_OFFSET_EXT,
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_PUSH_INDEX_EXT,
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_SHADER_RECORD_INDEX_EXT,
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_INDIRECT_INDEX_EXT, or
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_INDIRECT_INDEX_ARRAY_EXT, and
descriptorSet, firstBinding, and bindingCount identify any
OpTypeTensorARM variables, the heapOffset, and heapArrayStride
members of the corresponding member of sourceData must be 0 or a
multiple of
tensorDescriptorAlignment
Valid Usage (Implicit)
See Also
VK_EXT_descriptor_heap,
DescriptorMappingSourceDataEXT, DescriptorMappingSourceEXT,
ShaderDescriptorSetAndBindingMappingInfoEXT,
SpirvResourceTypeFlagsEXT,
StructureType