C Specification
To build acceleration structures with some parameters sourced on the device call:
// Provided by VK_KHR_acceleration_structure
void vkCmdBuildAccelerationStructuresIndirectKHR(
VkCommandBuffer commandBuffer,
uint32_t infoCount,
const VkAccelerationStructureBuildGeometryInfoKHR* pInfos,
const VkDeviceAddress* pIndirectDeviceAddresses,
const uint32_t* pIndirectStrides,
const uint32_t* const* ppMaxPrimitiveCounts);
Parameters
-
commandBuffer
is the command buffer into which the command will be recorded. -
infoCount
is the number of acceleration structures to build. -
pInfos
is a pointer to an array ofinfoCount
VkAccelerationStructureBuildGeometryInfoKHR structures defining the geometry used to build each acceleration structure. -
pIndirectDeviceAddresses
is a pointer to an array ofinfoCount
buffer device addresses which point topInfos
[i].geometryCount
VkAccelerationStructureBuildRangeInfoKHR structures defining dynamic offsets to the addresses where geometry data is stored, as defined bypInfos
[i]. -
pIndirectStrides
is a pointer to an array ofinfoCount
byte strides between elements ofpIndirectDeviceAddresses
. -
ppMaxPrimitiveCounts
is a pointer to an array ofinfoCount
pointers to arrays ofpInfos
[i].geometryCount
values indicating the maximum number of primitives that will be built by this command for each geometry.
Description
Accesses to acceleration structures, scratch buffers, vertex buffers, index buffers, and instance buffers must be synchronized as with vkCmdBuildAccelerationStructuresKHR.
Accesses to any element of pIndirectDeviceAddresses
must be
synchronized with the
VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR
pipeline stage and an
access type of
VK_ACCESS_INDIRECT_COMMAND_READ_BIT
.
-
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-accelerationStructureIndirectBuild-03650
TheVkPhysicalDeviceAccelerationStructureFeaturesKHR
::accelerationStructureIndirectBuild
feature must be enabled
-
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-mode-04628
Themode
member of each element ofpInfos
must be a valid VkBuildAccelerationStructureModeKHR value -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-srcAccelerationStructure-04629
If thesrcAccelerationStructure
member of any element ofpInfos
is not VK_NULL_HANDLE, thesrcAccelerationStructure
member must be a valid VkAccelerationStructureKHR handle -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-04630
For each element ofpInfos
, if itsmode
member isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR
, itssrcAccelerationStructure
member must not be VK_NULL_HANDLE -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03403
ThesrcAccelerationStructure
member of any element ofpInfos
must not be the same acceleration structure as thedstAccelerationStructure
member of any other element ofpInfos
-
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-dstAccelerationStructure-03698
ThedstAccelerationStructure
member of any element ofpInfos
must not be the same acceleration structure as thedstAccelerationStructure
member of any other element ofpInfos
-
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-dstAccelerationStructure-03800
ThedstAccelerationStructure
member of any element ofpInfos
must be a valid VkAccelerationStructureKHR handle -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03699
For each element ofpInfos
, if itstype
member isVK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR
, itsdstAccelerationStructure
member must have been created with a value of VkAccelerationStructureCreateInfoKHR::type
equal to eitherVK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR
orVK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR
-
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03700
For each element ofpInfos
, if itstype
member isVK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR
, itsdstAccelerationStructure
member must have been created with a value of VkAccelerationStructureCreateInfoKHR::type
equal to eitherVK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR
orVK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR
-
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03663
For each element ofpInfos
, if itsmode
member isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR
, inactive primitives in itssrcAccelerationStructure
member must not be made active -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03664
For each element ofpInfos
, if itsmode
member isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR
, active primitives in itssrcAccelerationStructure
member must not be made inactive -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-None-03407
ThedstAccelerationStructure
member of any element ofpInfos
must not be referenced by thegeometry.instances.data
member of any element ofpGeometries
orppGeometries
with ageometryType
ofVK_GEOMETRY_TYPE_INSTANCES_KHR
in any other element ofpInfos
-
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-dstAccelerationStructure-03701
The range of memory backing thedstAccelerationStructure
member of any element ofpInfos
that is accessed by this command must not overlap the memory backing thesrcAccelerationStructure
member of any other element ofpInfos
with amode
equal toVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR
, which is accessed by this command -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-dstAccelerationStructure-03702
The range of memory backing thedstAccelerationStructure
member of any element ofpInfos
that is accessed by this command must not overlap the memory backing thedstAccelerationStructure
member of any other element ofpInfos
, which is accessed by this command -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-dstAccelerationStructure-03703
The range of memory backing thedstAccelerationStructure
member of any element ofpInfos
that is accessed by this command must not overlap the memory backing thescratchData
member of any element ofpInfos
(including the same element), which is accessed by this command -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-scratchData-03704
The range of memory backing thescratchData
member of any element ofpInfos
that is accessed by this command must not overlap the memory backing thescratchData
member of any other element ofpInfos
, which is accessed by this command -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-scratchData-03705
The range of memory backing thescratchData
member of any element ofpInfos
that is accessed by this command must not overlap the memory backing thesrcAccelerationStructure
member of any element ofpInfos
with amode
equal toVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR
(including the same element), which is accessed by this command -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-dstAccelerationStructure-03706
The range of memory backing thedstAccelerationStructure
member of any element ofpInfos
that is accessed by this command must not overlap the memory backing any acceleration structure referenced by thegeometry.instances.data
member of any element ofpGeometries
orppGeometries
with ageometryType
ofVK_GEOMETRY_TYPE_INSTANCES_KHR
in any other element ofpInfos
, which is accessed by this command -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03667
For each element ofpInfos
, if itsmode
member isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR
, itssrcAccelerationStructure
member must have previously been constructed withVK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR
set in VkAccelerationStructureBuildGeometryInfoKHR::flags
in the build -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03668
For each element ofpInfos
, if itsmode
member isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR
, itssrcAccelerationStructure
anddstAccelerationStructure
members must either be the same VkAccelerationStructureKHR, or not have any memory aliasing -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03758
For each element ofpInfos
, if itsmode
member isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR
, itsgeometryCount
member must have the same value which was specified whensrcAccelerationStructure
was last built -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03759
For each element ofpInfos
, if itsmode
member isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR
, itsflags
member must have the same value which was specified whensrcAccelerationStructure
was last built -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03760
For each element ofpInfos
, if itsmode
member isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR
, itstype
member must have the same value which was specified whensrcAccelerationStructure
was last built -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03761
For each element ofpInfos
, if itsmode
member isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR
, then for eachVkAccelerationStructureGeometryKHR
structure referred to by itspGeometries
orppGeometries
members, itsgeometryType
member must have the same value which was specified whensrcAccelerationStructure
was last built -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03762
For each element ofpInfos
, if itsmode
member isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR
, then for eachVkAccelerationStructureGeometryKHR
structure referred to by itspGeometries
orppGeometries
members, itsflags
member must have the same value which was specified whensrcAccelerationStructure
was last built -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03763
For each element ofpInfos
, if itsmode
member isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR
, then for eachVkAccelerationStructureGeometryKHR
structure referred to by itspGeometries
orppGeometries
members, ifgeometryType
isVK_GEOMETRY_TYPE_TRIANGLES_KHR
, itsgeometry.triangles.vertexFormat
member must have the same value which was specified whensrcAccelerationStructure
was last built -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03764
For each element ofpInfos
, if itsmode
member isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR
, then for eachVkAccelerationStructureGeometryKHR
structure referred to by itspGeometries
orppGeometries
members, ifgeometryType
isVK_GEOMETRY_TYPE_TRIANGLES_KHR
, itsgeometry.triangles.maxVertex
member must have the same value which was specified whensrcAccelerationStructure
was last built -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03765
For each element ofpInfos
, if itsmode
member isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR
, then for eachVkAccelerationStructureGeometryKHR
structure referred to by itspGeometries
orppGeometries
members, ifgeometryType
isVK_GEOMETRY_TYPE_TRIANGLES_KHR
, itsgeometry.triangles.indexType
member must have the same value which was specified whensrcAccelerationStructure
was last built -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03766
For each element ofpInfos
, if itsmode
member isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR
, then for eachVkAccelerationStructureGeometryKHR
structure referred to by itspGeometries
orppGeometries
members, ifgeometryType
isVK_GEOMETRY_TYPE_TRIANGLES_KHR
, if itsgeometry.triangles.transformData
address wasNULL
whensrcAccelerationStructure
was last built, then it must beNULL
-
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03767
For each element ofpInfos
, if itsmode
member isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR
, then for eachVkAccelerationStructureGeometryKHR
structure referred to by itspGeometries
orppGeometries
members, ifgeometryType
isVK_GEOMETRY_TYPE_TRIANGLES_KHR
, if itsgeometry.triangles.transformData
address was notNULL
whensrcAccelerationStructure
was last built, then it must not beNULL
-
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03768
For each element ofpInfos
, if itsmode
member isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR
, then for eachVkAccelerationStructureGeometryKHR
structure referred to by itspGeometries
orppGeometries
members, ifgeometryType
isVK_GEOMETRY_TYPE_TRIANGLES_KHR
, andgeometry.triangles.indexType
is notVK_INDEX_TYPE_NONE_KHR
, then the value of each index referenced must be the same as the corresponding index value whensrcAccelerationStructure
was last built -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-primitiveCount-03769
For each element ofpInfos
, if itsmode
member isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR
, then for eachVkAccelerationStructureGeometryKHR
structure referred to by itspGeometries
orppGeometries
members, theprimitiveCount
member of its correspondingVkAccelerationStructureBuildRangeInfoKHR
structure must have the same value which was specified whensrcAccelerationStructure
was last built -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-firstVertex-03770
For each element ofpInfos
, if itsmode
member isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR
, then for eachVkAccelerationStructureGeometryKHR
structure referred to by itspGeometries
orppGeometries
members, if the geometry uses indices, thefirstVertex
member of its correspondingVkAccelerationStructureBuildRangeInfoKHR
structure must have the same value which was specified whensrcAccelerationStructure
was last built -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03801
For each element ofpInfos
[i].pGeometries
orpInfos
[i].ppGeometries
with ageometryType
ofVK_GEOMETRY_TYPE_INSTANCES_KHR
, the correspondingppMaxPrimitiveCounts
[i][j] must be less than or equal to VkPhysicalDeviceAccelerationStructurePropertiesKHR::maxInstanceCount
-
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03707
For each element ofpInfos
, thebuffer
used to create itsdstAccelerationStructure
member must be bound to device memory -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03708
For each element ofpInfos
, if itsmode
member isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR
thebuffer
used to create itssrcAccelerationStructure
member must be bound to device memory -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03709
For each element ofpInfos
, thebuffer
used to create each acceleration structure referenced by thegeometry.instances.data
member of any element ofpGeometries
orppGeometries
with ageometryType
ofVK_GEOMETRY_TYPE_INSTANCES_KHR
must be bound to device memory -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03671
IfpInfos
[i].mode
isVK_BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR
, all addresses betweenpInfos
[i].scratchData.deviceAddress
andpInfos
[i].scratchData.deviceAddress
+ N - 1 must be in the buffer device address range of the same buffer, where N is given by thebuildScratchSize
member of the VkAccelerationStructureBuildSizesInfoKHR structure returned from a call to vkGetAccelerationStructureBuildSizesKHR with an identical VkAccelerationStructureBuildGeometryInfoKHR structure and primitive count -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03672
IfpInfos
[i].mode
isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR
, all addresses betweenpInfos
[i].scratchData.deviceAddress
andpInfos
[i].scratchData.deviceAddress
+ N - 1 must be in the buffer device address range of the same buffer, where N is given by theupdateScratchSize
member of the VkAccelerationStructureBuildSizesInfoKHR structure returned from a call to vkGetAccelerationStructureBuildSizesKHR with an identical VkAccelerationStructureBuildGeometryInfoKHR structure and primitive count -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-geometry-03673
The buffers from which the buffer device addresses for all of thegeometry.triangles.vertexData
,geometry.triangles.indexData
,geometry.triangles.transformData
,geometry.aabbs.data
, andgeometry.instances.data
members of allpInfos
[i].pGeometries
andpInfos
[i].ppGeometries
are queried must have been created with theVK_BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR
usage flag -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03674
The buffer from which the buffer device addresspInfos
[i].scratchData.deviceAddress
is queried must have been created withVK_BUFFER_USAGE_STORAGE_BUFFER_BIT
usage flag -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03802
For each element ofpInfos
, itsscratchData.deviceAddress
member must be a valid device address obtained from vkGetBufferDeviceAddress -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03803
For each element ofpInfos
, ifscratchData.deviceAddress
is the address of a non-sparse buffer then it must be bound completely and contiguously to a single VkDeviceMemory object -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03710
For each element ofpInfos
, itsscratchData.deviceAddress
member must be a multiple of VkPhysicalDeviceAccelerationStructurePropertiesKHR::minAccelerationStructureScratchOffsetAlignment
-
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03804
For any element ofpInfos
[i].pGeometries
orpInfos
[i].ppGeometries
with ageometryType
ofVK_GEOMETRY_TYPE_TRIANGLES_KHR
,geometry.triangles.vertexData.deviceAddress
must be a valid device address obtained from vkGetBufferDeviceAddress -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03805
For any element ofpInfos
[i].pGeometries
orpInfos
[i].ppGeometries
with ageometryType
ofVK_GEOMETRY_TYPE_TRIANGLES_KHR
, ifgeometry.triangles.vertexData.deviceAddress
is the address of a non-sparse buffer then it must be bound completely and contiguously to a single VkDeviceMemory object -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03711
For any element ofpInfos
[i].pGeometries
orpInfos
[i].ppGeometries
with ageometryType
ofVK_GEOMETRY_TYPE_TRIANGLES_KHR
,geometry.triangles.vertexData.deviceAddress
must be aligned to the size in bytes of the smallest component of the format invertexFormat
-
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03806
For any element ofpInfos
[i].pGeometries
orpInfos
[i].ppGeometries
with ageometryType
ofVK_GEOMETRY_TYPE_TRIANGLES_KHR
, ifgeometry.triangles.indexType
is notVK_INDEX_TYPE_NONE_KHR
,geometry.triangles.indexData.deviceAddress
must be a valid device address obtained from vkGetBufferDeviceAddress -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03807
For any element ofpInfos
[i].pGeometries
orpInfos
[i].ppGeometries
with ageometryType
ofVK_GEOMETRY_TYPE_TRIANGLES_KHR
, ifgeometry.triangles.indexType
is notVK_INDEX_TYPE_NONE_KHR
, ifgeometry.triangles.indexData.deviceAddress
is the address of a non-sparse buffer then it must be bound completely and contiguously to a single VkDeviceMemory object -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03712
For any element ofpInfos
[i].pGeometries
orpInfos
[i].ppGeometries
with ageometryType
ofVK_GEOMETRY_TYPE_TRIANGLES_KHR
, and withgeometry.triangles.indexType
not equal toVK_INDEX_TYPE_NONE_KHR
,geometry.triangles.indexData.deviceAddress
must be aligned to the size in bytes of the type inindexType
-
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03808
For any element ofpInfos
[i].pGeometries
orpInfos
[i].ppGeometries
with ageometryType
ofVK_GEOMETRY_TYPE_TRIANGLES_KHR
, ifgeometry.triangles.transformData.deviceAddress
is not0
, it must be a valid device address obtained from vkGetBufferDeviceAddress -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03809
For any element ofpInfos
[i].pGeometries
orpInfos
[i].ppGeometries
with ageometryType
ofVK_GEOMETRY_TYPE_TRIANGLES_KHR
, ifgeometry.triangles.transformData.deviceAddress
is the address of a non-sparse buffer then it must be bound completely and contiguously to a single VkDeviceMemory object -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03810
For any element ofpInfos
[i].pGeometries
orpInfos
[i].ppGeometries
with ageometryType
ofVK_GEOMETRY_TYPE_TRIANGLES_KHR
, ifgeometry.triangles.transformData.deviceAddress
is not0
, it must be aligned to16
bytes -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03811
For any element ofpInfos
[i].pGeometries
orpInfos
[i].ppGeometries
with ageometryType
ofVK_GEOMETRY_TYPE_AABBS_KHR
,geometry.aabbs.data.deviceAddress
must be a valid device address obtained from vkGetBufferDeviceAddress -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03812
For any element ofpInfos
[i].pGeometries
orpInfos
[i].ppGeometries
with ageometryType
ofVK_GEOMETRY_TYPE_AABBS_KHR
, ifgeometry.aabbs.data.deviceAddress
is the address of a non-sparse buffer then it must be bound completely and contiguously to a single VkDeviceMemory object -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03714
For any element ofpInfos
[i].pGeometries
orpInfos
[i].ppGeometries
with ageometryType
ofVK_GEOMETRY_TYPE_AABBS_KHR
,geometry.aabbs.data.deviceAddress
must be aligned to8
bytes -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03715
For any element ofpInfos
[i].pGeometries
orpInfos
[i].ppGeometries
with ageometryType
ofVK_GEOMETRY_TYPE_INSTANCES_KHR
, ifgeometry.arrayOfPointers
isVK_FALSE
,geometry.instances.data.deviceAddress
must be aligned to16
bytes -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03716
For any element ofpInfos
[i].pGeometries
orpInfos
[i].ppGeometries
with ageometryType
ofVK_GEOMETRY_TYPE_INSTANCES_KHR
, ifgeometry.arrayOfPointers
isVK_TRUE
,geometry.instances.data.deviceAddress
must be aligned to8
bytes -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03717
For any element ofpInfos
[i].pGeometries
orpInfos
[i].ppGeometries
with ageometryType
ofVK_GEOMETRY_TYPE_INSTANCES_KHR
, ifgeometry.arrayOfPointers
isVK_TRUE
, each element ofgeometry.instances.data.deviceAddress
in device memory must be aligned to16
bytes -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03813
For any element ofpInfos
[i].pGeometries
orpInfos
[i].ppGeometries
with ageometryType
ofVK_GEOMETRY_TYPE_INSTANCES_KHR
,geometry.instances.data.deviceAddress
must be a valid device address obtained from vkGetBufferDeviceAddress -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03814
For any element ofpInfos
[i].pGeometries
orpInfos
[i].ppGeometries
with ageometryType
ofVK_GEOMETRY_TYPE_INSTANCES_KHR
, ifgeometry.instances.data.deviceAddress
is the address of a non-sparse buffer then it must be bound completely and contiguously to a single VkDeviceMemory object -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-06707
For any element ofpInfos
[i].pGeometries
orpInfos
[i].ppGeometries
with ageometryType
ofVK_GEOMETRY_TYPE_INSTANCES_KHR
, each VkAccelerationStructureInstanceKHR::accelerationStructureReference
value ingeometry.instances.data.deviceAddress
must be a valid device address containing a value obtained from vkGetAccelerationStructureDeviceAddressKHR or0
-
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectDeviceAddresses-03645
For any element ofpIndirectDeviceAddresses
, if the buffer from which it was queried is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectDeviceAddresses-03646
For any element ofpIndirectDeviceAddresses
[i], all device addresses betweenpIndirectDeviceAddresses
[i] andpIndirectDeviceAddresses
[i] + (pInfos
[i].geometryCount
×pIndirectStrides
[i]) - 1 must be in the buffer device address range of the same buffer -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectDeviceAddresses-03647
For any element ofpIndirectDeviceAddresses
, the buffer from which it was queried must have been created with theVK_BUFFER_USAGE_INDIRECT_BUFFER_BIT
bit set -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectDeviceAddresses-03648
Each element ofpIndirectDeviceAddresses
must be a multiple of4
-
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectStrides-03787
Each element ofpIndirectStrides
must be a multiple of4
-
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-commandBuffer-03649
commandBuffer
must not be a protected command buffer -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectDeviceAddresses-03651
Each VkAccelerationStructureBuildRangeInfoKHR structure referenced by any element ofpIndirectDeviceAddresses
must be a valid VkAccelerationStructureBuildRangeInfoKHR structure -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03652
pInfos
[i].dstAccelerationStructure
must have been created with a value of VkAccelerationStructureCreateInfoKHR::size
greater than or equal to the memory size required by the build operation, as returned by vkGetAccelerationStructureBuildSizesKHR withpBuildInfo
=pInfos
[i] andpMaxPrimitiveCounts
=ppMaxPrimitiveCounts
[i] -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-ppMaxPrimitiveCounts-03653
EachppMaxPrimitiveCounts
[i][j] must be greater than or equal to theprimitiveCount
value specified by the VkAccelerationStructureBuildRangeInfoKHR structure located atpIndirectDeviceAddresses
[i] + (j
×pIndirectStrides
[i])
-
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-commandBuffer-parameter
commandBuffer
must be a valid VkCommandBuffer handle -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-parameter
pInfos
must be a valid pointer to an array ofinfoCount
valid VkAccelerationStructureBuildGeometryInfoKHR structures -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectDeviceAddresses-parameter
pIndirectDeviceAddresses
must be a valid pointer to an array ofinfoCount
VkDeviceAddress values -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectStrides-parameter
pIndirectStrides
must be a valid pointer to an array ofinfoCount
uint32_t
values -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-ppMaxPrimitiveCounts-parameter
ppMaxPrimitiveCounts
must be a valid pointer to an array ofinfoCount
uint32_t
values -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-commandBuffer-recording
commandBuffer
must be in the recording state -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-commandBuffer-cmdpool
TheVkCommandPool
thatcommandBuffer
was allocated from must support compute operations -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-renderpass
This command must only be called outside of a render pass instance -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-videocoding
This command must only be called outside of a video coding scope -
VUID-vkCmdBuildAccelerationStructuresIndirectKHR-infoCount-arraylength
infoCount
must be greater than0
-
Host access to
commandBuffer
must be externally synchronized -
Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Buffer Levels | Render Pass Scope | Video Coding Scope | Supported Queue Types | Command Type |
---|---|---|---|---|
Primary |
Outside |
Outside |
Compute |
Action |
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.