C Specification
To build acceleration structures call:
// Provided by VK_KHR_acceleration_structure
void vkCmdBuildAccelerationStructuresKHR(
VkCommandBuffer commandBuffer,
uint32_t infoCount,
const VkAccelerationStructureBuildGeometryInfoKHR* pInfos,
const VkAccelerationStructureBuildRangeInfoKHR* const* ppBuildRangeInfos);
Parameters
-
commandBufferis the command buffer into which the command will be recorded. -
infoCountis the number of acceleration structures to build. It specifies the number of thepInfosstructures andppBuildRangeInfospointers that must be provided. -
pInfosis a pointer to an array ofinfoCountVkAccelerationStructureBuildGeometryInfoKHR structures defining the geometry used to build each acceleration structure. -
ppBuildRangeInfosis a pointer to an array ofinfoCountpointers to arrays of VkAccelerationStructureBuildRangeInfoKHR structures. EachppBuildRangeInfos[i] is a pointer to an array ofpInfos[i].geometryCountVkAccelerationStructureBuildRangeInfoKHR structures defining dynamic offsets to the addresses where geometry data is stored, as defined bypInfos[i].
Description
The vkCmdBuildAccelerationStructuresKHR command provides the ability
to initiate multiple acceleration structures builds, however there is no
ordering or synchronization implied between any of the individual
acceleration structure builds.
|
Note
|
This means that an application cannot build a top-level acceleration structure in the same vkCmdBuildAccelerationStructuresKHR call as the associated bottom-level or instance acceleration structures are being built. There also cannot be any memory aliasing between any acceleration structure memories or scratch memories being used by any of the builds. |
Accesses to the acceleration structure scratch buffers as identified by the
VkAccelerationStructureBuildGeometryInfoKHR::scratchData buffer
device addresses must be synchronized with
the VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR
pipeline stage and an
access type of
(VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR |
VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR).
Accesses to each
VkAccelerationStructureBuildGeometryInfoKHR::srcAccelerationStructure
and
VkAccelerationStructureBuildGeometryInfoKHR::dstAccelerationStructure
must be synchronized with the
VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR
pipeline stage and an
access type of
VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR or
VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR, as appropriate.
Accesses to other input buffers as identified by any used values of
VkAccelerationStructureGeometryMotionTrianglesDataNV::vertexData,
VkAccelerationStructureGeometryTrianglesDataKHR::vertexData,
VkAccelerationStructureGeometryTrianglesDataKHR::indexData,
VkAccelerationStructureGeometryTrianglesDataKHR::transformData,
VkAccelerationStructureGeometryAabbsDataKHR::data, and
VkAccelerationStructureGeometryInstancesDataKHR::data must be
synchronized with the
VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR
pipeline stage and an
access type of
VK_ACCESS_SHADER_READ_BIT.
-
VUID-vkCmdBuildAccelerationStructuresKHR-accelerationStructure-08923
TheVkPhysicalDeviceAccelerationStructureFeaturesKHR::accelerationStructurefeature must be enabled
-
VUID-vkCmdBuildAccelerationStructuresKHR-mode-04628
Themodemember of each element ofpInfosmust be a valid VkBuildAccelerationStructureModeKHR value -
VUID-vkCmdBuildAccelerationStructuresKHR-srcAccelerationStructure-04629
If thesrcAccelerationStructuremember of any element ofpInfosis not VK_NULL_HANDLE, thesrcAccelerationStructuremember must be a valid VkAccelerationStructureKHR handle -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-04630
For each element ofpInfos, if itsmodemember isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, itssrcAccelerationStructuremember must not be VK_NULL_HANDLE -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03403
ThesrcAccelerationStructuremember of any element ofpInfosmust not be the same acceleration structure as thedstAccelerationStructuremember of any other element ofpInfos -
VUID-vkCmdBuildAccelerationStructuresKHR-dstAccelerationStructure-03698
ThedstAccelerationStructuremember of any element ofpInfosmust not be the same acceleration structure as thedstAccelerationStructuremember of any other element ofpInfos -
VUID-vkCmdBuildAccelerationStructuresKHR-dstAccelerationStructure-03800
ThedstAccelerationStructuremember of any element ofpInfosmust be a valid VkAccelerationStructureKHR handle -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03699
For each element ofpInfos, if itstypemember isVK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR, itsdstAccelerationStructuremember must have been created with a value of VkAccelerationStructureCreateInfoKHR::typeequal to eitherVK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHRorVK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03700
For each element ofpInfos, if itstypemember isVK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR, itsdstAccelerationStructuremember must have been created with a value of VkAccelerationStructureCreateInfoKHR::typeequal to eitherVK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHRorVK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03663
For each element ofpInfos, if itsmodemember isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, inactive primitives in itssrcAccelerationStructuremember must not be made active -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03664
For each element ofpInfos, if itsmodemember isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, active primitives in itssrcAccelerationStructuremember must not be made inactive -
VUID-vkCmdBuildAccelerationStructuresKHR-None-03407
ThedstAccelerationStructuremember of any element ofpInfosmust not be referenced by thegeometry.instances.datamember of any element ofpGeometriesorppGeometrieswith ageometryTypeofVK_GEOMETRY_TYPE_INSTANCES_KHRin any other element ofpInfos -
VUID-vkCmdBuildAccelerationStructuresKHR-dstAccelerationStructure-03701
The range of memory backing thedstAccelerationStructuremember of any element ofpInfosthat is accessed by this command must not overlap the memory backing thesrcAccelerationStructuremember of any other element ofpInfoswith amodeequal toVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, which is accessed by this command -
VUID-vkCmdBuildAccelerationStructuresKHR-dstAccelerationStructure-03702
The range of memory backing thedstAccelerationStructuremember of any element ofpInfosthat is accessed by this command must not overlap the memory backing thedstAccelerationStructuremember of any other element ofpInfos, which is accessed by this command -
VUID-vkCmdBuildAccelerationStructuresKHR-dstAccelerationStructure-03703
The range of memory backing thedstAccelerationStructuremember of any element ofpInfosthat is accessed by this command must not overlap the memory backing thescratchDatamember of any element ofpInfos(including the same element), which is accessed by this command -
VUID-vkCmdBuildAccelerationStructuresKHR-scratchData-03704
The range of memory backing thescratchDatamember of any element ofpInfosthat is accessed by this command must not overlap the memory backing thescratchDatamember of any other element ofpInfos, which is accessed by this command -
VUID-vkCmdBuildAccelerationStructuresKHR-scratchData-03705
The range of memory backing thescratchDatamember of any element ofpInfosthat is accessed by this command must not overlap the memory backing thesrcAccelerationStructuremember of any element ofpInfoswith amodeequal toVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR(including the same element), which is accessed by this command -
VUID-vkCmdBuildAccelerationStructuresKHR-dstAccelerationStructure-03706
The range of memory backing thedstAccelerationStructuremember of any element ofpInfosthat is accessed by this command must not overlap the memory backing any acceleration structure referenced by thegeometry.instances.datamember of any element ofpGeometriesorppGeometrieswith ageometryTypeofVK_GEOMETRY_TYPE_INSTANCES_KHRin any other element ofpInfos, which is accessed by this command -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03667
For each element ofpInfos, if itsmodemember isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, itssrcAccelerationStructuremember must have previously been constructed withVK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHRset in VkAccelerationStructureBuildGeometryInfoKHR::flagsin the build -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03668
For each element ofpInfos, if itsmodemember isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, itssrcAccelerationStructureanddstAccelerationStructuremembers must either be the same VkAccelerationStructureKHR, or not have any memory aliasing -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03758
For each element ofpInfos, if itsmodemember isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, itsgeometryCountmember must have the same value which was specified whensrcAccelerationStructurewas last built -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03759
For each element ofpInfos, if itsmodemember isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, itsflagsmember must have the same value which was specified whensrcAccelerationStructurewas last built -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03760
For each element ofpInfos, if itsmodemember isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, itstypemember must have the same value which was specified whensrcAccelerationStructurewas last built -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03761
For each element ofpInfos, if itsmodemember isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, then for eachVkAccelerationStructureGeometryKHRstructure referred to by itspGeometriesorppGeometriesmembers, itsgeometryTypemember must have the same value which was specified whensrcAccelerationStructurewas last built -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03762
For each element ofpInfos, if itsmodemember isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, then for eachVkAccelerationStructureGeometryKHRstructure referred to by itspGeometriesorppGeometriesmembers, itsflagsmember must have the same value which was specified whensrcAccelerationStructurewas last built -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03763
For each element ofpInfos, if itsmodemember isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, then for eachVkAccelerationStructureGeometryKHRstructure referred to by itspGeometriesorppGeometriesmembers, ifgeometryTypeisVK_GEOMETRY_TYPE_TRIANGLES_KHR, itsgeometry.triangles.vertexFormatmember must have the same value which was specified whensrcAccelerationStructurewas last built -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03764
For each element ofpInfos, if itsmodemember isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, then for eachVkAccelerationStructureGeometryKHRstructure referred to by itspGeometriesorppGeometriesmembers, ifgeometryTypeisVK_GEOMETRY_TYPE_TRIANGLES_KHR, itsgeometry.triangles.maxVertexmember must have the same value which was specified whensrcAccelerationStructurewas last built -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03765
For each element ofpInfos, if itsmodemember isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, then for eachVkAccelerationStructureGeometryKHRstructure referred to by itspGeometriesorppGeometriesmembers, ifgeometryTypeisVK_GEOMETRY_TYPE_TRIANGLES_KHR, itsgeometry.triangles.indexTypemember must have the same value which was specified whensrcAccelerationStructurewas last built -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03766
For each element ofpInfos, if itsmodemember isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, then for eachVkAccelerationStructureGeometryKHRstructure referred to by itspGeometriesorppGeometriesmembers, ifgeometryTypeisVK_GEOMETRY_TYPE_TRIANGLES_KHR, if itsgeometry.triangles.transformDataaddress wasNULLwhensrcAccelerationStructurewas last built, then it must beNULL -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03767
For each element ofpInfos, if itsmodemember isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, then for eachVkAccelerationStructureGeometryKHRstructure referred to by itspGeometriesorppGeometriesmembers, ifgeometryTypeisVK_GEOMETRY_TYPE_TRIANGLES_KHR, if itsgeometry.triangles.transformDataaddress was notNULLwhensrcAccelerationStructurewas last built, then it must not beNULL -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03768
For each element ofpInfos, if itsmodemember isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, then for eachVkAccelerationStructureGeometryKHRstructure referred to by itspGeometriesorppGeometriesmembers, ifgeometryTypeisVK_GEOMETRY_TYPE_TRIANGLES_KHR, andgeometry.triangles.indexTypeis notVK_INDEX_TYPE_NONE_KHR, then the value of each index referenced must be the same as the corresponding index value whensrcAccelerationStructurewas last built -
VUID-vkCmdBuildAccelerationStructuresKHR-primitiveCount-03769
For each element ofpInfos, if itsmodemember isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, then for eachVkAccelerationStructureGeometryKHRstructure referred to by itspGeometriesorppGeometriesmembers, theprimitiveCountmember of its correspondingVkAccelerationStructureBuildRangeInfoKHRstructure must have the same value which was specified whensrcAccelerationStructurewas last built -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03801
For each element ofpInfos[i].pGeometriesorpInfos[i].ppGeometrieswith ageometryTypeofVK_GEOMETRY_TYPE_INSTANCES_KHR, the correspondingppBuildRangeInfos[i][j].primitiveCountmust be less than or equal to VkPhysicalDeviceAccelerationStructurePropertiesKHR::maxInstanceCount
-
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03707
For each element ofpInfos, thebufferused to create itsdstAccelerationStructuremember must be bound to device memory -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03708
For each element ofpInfos, if itsmodemember isVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHRthebufferused to create itssrcAccelerationStructuremember must be bound to device memory -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03709
For each element ofpInfos, thebufferused to create each acceleration structure referenced by thegeometry.instances.datamember of any element ofpGeometriesorppGeometrieswith ageometryTypeofVK_GEOMETRY_TYPE_INSTANCES_KHRmust be bound to device memory -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03671
IfpInfos[i].modeisVK_BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR, all addresses betweenpInfos[i].scratchData.deviceAddressandpInfos[i].scratchData.deviceAddress+ N - 1 must be in the buffer device address range of the same buffer, where N is given by thebuildScratchSizemember of the VkAccelerationStructureBuildSizesInfoKHR structure returned from a call to vkGetAccelerationStructureBuildSizesKHR with an identical VkAccelerationStructureBuildGeometryInfoKHR structure and primitive count -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03672
IfpInfos[i].modeisVK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, all addresses betweenpInfos[i].scratchData.deviceAddressandpInfos[i].scratchData.deviceAddress+ N - 1 must be in the buffer device address range of the same buffer, where N is given by theupdateScratchSizemember of the VkAccelerationStructureBuildSizesInfoKHR structure returned from a call to vkGetAccelerationStructureBuildSizesKHR with an identical VkAccelerationStructureBuildGeometryInfoKHR structure and primitive count -
VUID-vkCmdBuildAccelerationStructuresKHR-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.datamembers of allpInfos[i].pGeometriesandpInfos[i].ppGeometriesare queried must have been created with theVK_BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHRusage flag -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03674
The buffer from which the buffer device addresspInfos[i].scratchData.deviceAddressis queried must have been created withVK_BUFFER_USAGE_STORAGE_BUFFER_BITusage flag -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03802
For each element ofpInfos, itsscratchData.deviceAddressmember must be a valid device address obtained from vkGetBufferDeviceAddress -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03803
For each element ofpInfos, ifscratchData.deviceAddressis the address of a non-sparse buffer then it must be bound completely and contiguously to a single VkDeviceMemory object -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03710
For each element ofpInfos, itsscratchData.deviceAddressmember must be a multiple of VkPhysicalDeviceAccelerationStructurePropertiesKHR::minAccelerationStructureScratchOffsetAlignment -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03804
For any element ofpInfos[i].pGeometriesorpInfos[i].ppGeometrieswith ageometryTypeofVK_GEOMETRY_TYPE_TRIANGLES_KHR,geometry.triangles.vertexData.deviceAddressmust be a valid device address obtained from vkGetBufferDeviceAddress -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03805
For any element ofpInfos[i].pGeometriesorpInfos[i].ppGeometrieswith ageometryTypeofVK_GEOMETRY_TYPE_TRIANGLES_KHR, ifgeometry.triangles.vertexData.deviceAddressis the address of a non-sparse buffer then it must be bound completely and contiguously to a single VkDeviceMemory object -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03711
For any element ofpInfos[i].pGeometriesorpInfos[i].ppGeometrieswith ageometryTypeofVK_GEOMETRY_TYPE_TRIANGLES_KHR,geometry.triangles.vertexData.deviceAddressmust be aligned to the size in bytes of the smallest component of the format invertexFormat -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03806
For any element ofpInfos[i].pGeometriesorpInfos[i].ppGeometrieswith ageometryTypeofVK_GEOMETRY_TYPE_TRIANGLES_KHR, ifgeometry.triangles.indexTypeis notVK_INDEX_TYPE_NONE_KHR,geometry.triangles.indexData.deviceAddressmust be a valid device address obtained from vkGetBufferDeviceAddress -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03807
For any element ofpInfos[i].pGeometriesorpInfos[i].ppGeometrieswith ageometryTypeofVK_GEOMETRY_TYPE_TRIANGLES_KHR, ifgeometry.triangles.indexTypeis notVK_INDEX_TYPE_NONE_KHR, ifgeometry.triangles.indexData.deviceAddressis the address of a non-sparse buffer then it must be bound completely and contiguously to a single VkDeviceMemory object -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03712
For any element ofpInfos[i].pGeometriesorpInfos[i].ppGeometrieswith ageometryTypeofVK_GEOMETRY_TYPE_TRIANGLES_KHR, and withgeometry.triangles.indexTypenot equal toVK_INDEX_TYPE_NONE_KHR,geometry.triangles.indexData.deviceAddressmust be aligned to the size in bytes of the type inindexType -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03808
For any element ofpInfos[i].pGeometriesorpInfos[i].ppGeometrieswith ageometryTypeofVK_GEOMETRY_TYPE_TRIANGLES_KHR, ifgeometry.triangles.transformData.deviceAddressis not0, it must be a valid device address obtained from vkGetBufferDeviceAddress -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03809
For any element ofpInfos[i].pGeometriesorpInfos[i].ppGeometrieswith ageometryTypeofVK_GEOMETRY_TYPE_TRIANGLES_KHR, ifgeometry.triangles.transformData.deviceAddressis the address of a non-sparse buffer then it must be bound completely and contiguously to a single VkDeviceMemory object -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03810
For any element ofpInfos[i].pGeometriesorpInfos[i].ppGeometrieswith ageometryTypeofVK_GEOMETRY_TYPE_TRIANGLES_KHR, ifgeometry.triangles.transformData.deviceAddressis not0, it must be aligned to16bytes -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03811
For any element ofpInfos[i].pGeometriesorpInfos[i].ppGeometrieswith ageometryTypeofVK_GEOMETRY_TYPE_AABBS_KHR,geometry.aabbs.data.deviceAddressmust be a valid device address obtained from vkGetBufferDeviceAddress -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03812
For any element ofpInfos[i].pGeometriesorpInfos[i].ppGeometrieswith ageometryTypeofVK_GEOMETRY_TYPE_AABBS_KHR, ifgeometry.aabbs.data.deviceAddressis the address of a non-sparse buffer then it must be bound completely and contiguously to a single VkDeviceMemory object -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03714
For any element ofpInfos[i].pGeometriesorpInfos[i].ppGeometrieswith ageometryTypeofVK_GEOMETRY_TYPE_AABBS_KHR,geometry.aabbs.data.deviceAddressmust be aligned to8bytes -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03715
For any element ofpInfos[i].pGeometriesorpInfos[i].ppGeometrieswith ageometryTypeofVK_GEOMETRY_TYPE_INSTANCES_KHR, ifgeometry.arrayOfPointersisVK_FALSE,geometry.instances.data.deviceAddressmust be aligned to16bytes -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03716
For any element ofpInfos[i].pGeometriesorpInfos[i].ppGeometrieswith ageometryTypeofVK_GEOMETRY_TYPE_INSTANCES_KHR, ifgeometry.arrayOfPointersisVK_TRUE,geometry.instances.data.deviceAddressmust be aligned to8bytes -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03717
For any element ofpInfos[i].pGeometriesorpInfos[i].ppGeometrieswith ageometryTypeofVK_GEOMETRY_TYPE_INSTANCES_KHR, ifgeometry.arrayOfPointersisVK_TRUE, each element ofgeometry.instances.data.deviceAddressin device memory must be aligned to16bytes -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03813
For any element ofpInfos[i].pGeometriesorpInfos[i].ppGeometrieswith ageometryTypeofVK_GEOMETRY_TYPE_INSTANCES_KHR,geometry.instances.data.deviceAddressmust be a valid device address obtained from vkGetBufferDeviceAddress -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03814
For any element ofpInfos[i].pGeometriesorpInfos[i].ppGeometrieswith ageometryTypeofVK_GEOMETRY_TYPE_INSTANCES_KHR, ifgeometry.instances.data.deviceAddressis the address of a non-sparse buffer then it must be bound completely and contiguously to a single VkDeviceMemory object -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-06707
For any element ofpInfos[i].pGeometriesorpInfos[i].ppGeometrieswith ageometryTypeofVK_GEOMETRY_TYPE_INSTANCES_KHR, each VkAccelerationStructureInstanceKHR::accelerationStructureReferencevalue ingeometry.instances.data.deviceAddressmust be a valid device address containing a value obtained from vkGetAccelerationStructureDeviceAddressKHR or0 -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-10607
For any element ofpInfos[i].pGeometriesorpInfos[i].ppGeometrieswith ageometryTypeofVK_GEOMETRY_TYPE_INSTANCES_KHR, ifVK_GEOMETRY_INSTANCE_DISABLE_OPACITY_MICROMAPS_EXTis set in VkAccelerationStructureInstanceKHR::flagsthengeometry.instances.data.deviceAddressmust refer to an acceleration structure that was built withVK_BUILD_ACCELERATION_STRUCTURE_ALLOW_DISABLE_OPACITY_MICROMAPS_EXTset in VkAccelerationStructureBuildGeometryInfoKHR::flags -
VUID-vkCmdBuildAccelerationStructuresKHR-commandBuffer-09547
commandBuffermust not be a protected command buffer
-
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-10126
For eachpInfos[i],dstAccelerationStructuremust have been created with a value of VkAccelerationStructureCreateInfoKHR::sizegreater than or equal to either:-
the memory size required by the build operation, as returned by vkGetAccelerationStructureBuildSizesKHR with
pBuildInfo=pInfos[i] and with each element of thepMaxPrimitiveCountsarray greater than or equal to the equivalentppBuildRangeInfos[i][j].primitiveCountvalues forjin [0,pInfos[i].geometryCount) or, -
the result of querying the corresponding
VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR, if updating a compacted acceleration structure
-
-
VUID-vkCmdBuildAccelerationStructuresKHR-ppBuildRangeInfos-03676
Each element ofppBuildRangeInfos[i] must be a valid pointer to an array ofpInfos[i].geometryCountVkAccelerationStructureBuildRangeInfoKHRstructures
-
VUID-vkCmdBuildAccelerationStructuresKHR-commandBuffer-parameter
commandBuffermust be a valid VkCommandBuffer handle -
VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-parameter
pInfosmust be a valid pointer to an array ofinfoCountvalid VkAccelerationStructureBuildGeometryInfoKHR structures -
VUID-vkCmdBuildAccelerationStructuresKHR-ppBuildRangeInfos-parameter
ppBuildRangeInfosmust be a valid pointer to an array ofinfoCountVkAccelerationStructureBuildRangeInfoKHR structures -
VUID-vkCmdBuildAccelerationStructuresKHR-commandBuffer-recording
commandBuffermust be in the recording state -
VUID-vkCmdBuildAccelerationStructuresKHR-commandBuffer-cmdpool
TheVkCommandPoolthatcommandBufferwas allocated from must support compute operations -
VUID-vkCmdBuildAccelerationStructuresKHR-renderpass
This command must only be called outside of a render pass instance -
VUID-vkCmdBuildAccelerationStructuresKHR-videocoding
This command must only be called outside of a video coding scope -
VUID-vkCmdBuildAccelerationStructuresKHR-infoCount-arraylength
infoCountmust be greater than0
-
Host access to
commandBuffermust be externally synchronized -
Host access to the
VkCommandPoolthatcommandBufferwas 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.