vkCmdBuildAccelerationStructuresIndirectKHR(3)

# vkCmdBuildAccelerationStructuresIndirectKHR(3) Manual Page

## Name

vkCmdBuildAccelerationStructuresIndirectKHR - Build an acceleration structure with some parameters provided on the device

## 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 of `infoCount` VkAccelerationStructureBuildGeometryInfoKHR structures defining the geometry used to build each acceleration structure.

- `pIndirectDeviceAddresses` is a pointer to an array of `infoCount` buffer device addresses which point to `pInfos`[i].`geometryCount` VkAccelerationStructureBuildRangeInfoKHR structures defining dynamic offsets to the addresses where geometry data is stored, as defined by `pInfos`[i].

- `pIndirectStrides` is a pointer to an array of `infoCount` byte strides between elements of `pIndirectDeviceAddresses`.

- `ppMaxPrimitiveCounts` is a pointer to an array of `infoCount` pointers to arrays of `pInfos`[i].`geometryCount` values indicating the maximum number of primitives that will be built by this command for each geometry.

## Description

Accesses to any device memory referenced by this command 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.

Valid Usage

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-accelerationStructureIndirectBuild-03650
  The `VkPhysicalDeviceAccelerationStructureFeaturesKHR`::`accelerationStructureIndirectBuild` feature must be enabled

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-mode-04628
  The `mode` member of each element of `pInfos` must be a valid VkBuildAccelerationStructureModeKHR value

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-srcAccelerationStructure-04629
  If the `srcAccelerationStructure` member of any element of `pInfos` is not VK_NULL_HANDLE, the `srcAccelerationStructure` member must be a valid VkAccelerationStructureKHR handle

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-04630
  For each element of `pInfos`, if its `mode` member is VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, its `srcAccelerationStructure` member must not be VK_NULL_HANDLE

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03708
  For each element of `pInfos`, if its `mode` member is VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, `srcAccelerationStructure` must be fully backed by physical memory

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03403
  The `srcAccelerationStructure` member of any element of `pInfos` must not be the same acceleration structure as the `dstAccelerationStructure` member of any other element of `pInfos`

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-dstAccelerationStructure-03698
  The `dstAccelerationStructure` member of any element of `pInfos` must not be the same acceleration structure as the `dstAccelerationStructure` member of any other element of `pInfos`

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-dstAccelerationStructure-03800
  The `dstAccelerationStructure` member of any element of `pInfos` must be a valid VkAccelerationStructureKHR handle

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03707
  For each element of `pInfos`, its `dstAccelerationStructure` member must be fully backed by physical memory

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03699
  For each element of `pInfos`, if its `type` member is VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR, its `dstAccelerationStructure` member must have been created with a value of VkAccelerationStructureCreateInfoKHR::`type` equal to either VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR or VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03700
  For each element of `pInfos`, if its `type` member is VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR, its `dstAccelerationStructure` member must have been created with a value of VkAccelerationStructureCreateInfoKHR::`type` equal to either VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR or VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03663
  For each element of `pInfos`, if its `mode` member is VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, inactive primitives in its `srcAccelerationStructure` member must not be made active

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03664
  For each element of `pInfos`, if its `mode` member is VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, active primitives in its `srcAccelerationStructure` member must not be made inactive

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03709
  For each element of `pInfos`, if an acceleration structure is referenced by the `geometry.instances.data` member of any element of `pGeometries` or `ppGeometries` with a `geometryType` of VK_GEOMETRY_TYPE_INSTANCES_KHR, it must be fully backed by physical memory

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-None-03407
  The `dstAccelerationStructure` member of any element of `pInfos` must not be referenced by the `geometry.instances.data` member of any element of `pGeometries` or `ppGeometries` with a `geometryType` of VK_GEOMETRY_TYPE_INSTANCES_KHR in any other element of `pInfos`

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-dstAccelerationStructure-03701
  The range of memory backing the `dstAccelerationStructure` member of any element of `pInfos` that is accessed by this command must not overlap the memory backing the `srcAccelerationStructure` member of any other element of `pInfos` with a `mode` equal to VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, which is accessed by this command

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-dstAccelerationStructure-03702
  The range of memory backing the `dstAccelerationStructure` member of any element of `pInfos` that is accessed by this command must not overlap the memory backing the `dstAccelerationStructure` member of any other element of `pInfos`, which is accessed by this command

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-dstAccelerationStructure-03703
  The range of memory backing the `dstAccelerationStructure` member of any element of `pInfos` that is accessed by this command must not overlap the memory backing the `scratchData` member of any element of `pInfos` (including the same element), which is accessed by this command

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-scratchData-03704
  The range of memory backing the `scratchData` member of any element of `pInfos` that is accessed by this command must not overlap the memory backing the `scratchData` member of any other element of `pInfos`, which is accessed by this command

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-scratchData-03705
  The range of memory backing the `scratchData` member of any element of `pInfos` that is accessed by this command must not overlap the memory backing the `srcAccelerationStructure` member of any element of `pInfos` with a `mode` equal to VK_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 the `dstAccelerationStructure` member of any element of `pInfos` that is accessed by this command must not overlap the memory backing any acceleration structure referenced by the `geometry.instances.data` member of any element of `pGeometries` or `ppGeometries` with a `geometryType` of VK_GEOMETRY_TYPE_INSTANCES_KHR in any other element of `pInfos`, which is accessed by this command

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03667
  For each element of `pInfos`, if its `mode` member is VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, its `srcAccelerationStructure` member must have previously been constructed with VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR set in VkAccelerationStructureBuildGeometryInfoKHR::`flags` in the build

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03668
  For each element of `pInfos`, if its `mode` member is VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, its `srcAccelerationStructure` and `dstAccelerationStructure` members must either be the same VkAccelerationStructureKHR, or not have any memory aliasing

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03758
  For each element of `pInfos`, if its `mode` member is VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, its `geometryCount` member must have the same value which was specified when `srcAccelerationStructure` was last built

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03759
  For each element of `pInfos`, if its `mode` member is VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, its `flags` member must have the same value which was specified when `srcAccelerationStructure` was last built

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03760
  For each element of `pInfos`, if its `mode` member is VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, its `type` member must have the same value which was specified when `srcAccelerationStructure` was last built

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03761
  For each element of `pInfos`, if its `mode` member is VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, then for each `VkAccelerationStructureGeometryKHR` structure referred to by its `pGeometries` or `ppGeometries` members, its `geometryType` member must have the same value which was specified when `srcAccelerationStructure` was last built

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03762
  For each element of `pInfos`, if its `mode` member is VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, then for each `VkAccelerationStructureGeometryKHR` structure referred to by its `pGeometries` or `ppGeometries` members, its `flags` member must have the same value which was specified when `srcAccelerationStructure` was last built

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03763
  For each element of `pInfos`, if its `mode` member is VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, then for each `VkAccelerationStructureGeometryKHR` structure referred to by its `pGeometries` or `ppGeometries` members, if `geometryType` is VK_GEOMETRY_TYPE_TRIANGLES_KHR, its `geometry.triangles.vertexFormat` member must have the same value which was specified when `srcAccelerationStructure` was last built

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03764
  For each element of `pInfos`, if its `mode` member is VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, then for each `VkAccelerationStructureGeometryKHR` structure referred to by its `pGeometries` or `ppGeometries` members, if `geometryType` is VK_GEOMETRY_TYPE_TRIANGLES_KHR, its `geometry.triangles.maxVertex` member must have the same value which was specified when `srcAccelerationStructure` was last built

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03765
  For each element of `pInfos`, if its `mode` member is VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, then for each `VkAccelerationStructureGeometryKHR` structure referred to by its `pGeometries` or `ppGeometries` members, if `geometryType` is VK_GEOMETRY_TYPE_TRIANGLES_KHR, its `geometry.triangles.indexType` member must have the same value which was specified when `srcAccelerationStructure` was last built

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03766
  For each element of `pInfos`, if its `mode` member is VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, then for each `VkAccelerationStructureGeometryKHR` structure referred to by its `pGeometries` or `ppGeometries` members, if `geometryType` is VK_GEOMETRY_TYPE_TRIANGLES_KHR, if its `geometry.triangles.transformData` address was `NULL` when `srcAccelerationStructure` was last built, then it must be `NULL`

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03767
  For each element of `pInfos`, if its `mode` member is VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, then for each `VkAccelerationStructureGeometryKHR` structure referred to by its `pGeometries` or `ppGeometries` members, if `geometryType` is VK_GEOMETRY_TYPE_TRIANGLES_KHR, if its `geometry.triangles.transformData` address was not `NULL` when `srcAccelerationStructure` was last built, then it must not be `NULL`

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-10898
  For each element of `pInfos`, if its `mode` member is VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, then for each `VkAccelerationStructureGeometryKHR` structure referred to by its `pGeometries` or `ppGeometries` members, if `geometryType` is VK_GEOMETRY_TYPE_DENSE_GEOMETRY_FORMAT_TRIANGLES_AMDX, the `numTriangles` member of the `VkAccelerationStructureDenseGeometryFormatTrianglesDataAMDX` structure in the `pNext` chain must have the same value which was specified when `srcAccelerationStructure` was last built

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-10899
  For each element of `pInfos`, if its `mode` member is VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, then for each `VkAccelerationStructureGeometryKHR` structure referred to by its `pGeometries` or `ppGeometries` members, if `geometryType` is VK_GEOMETRY_TYPE_DENSE_GEOMETRY_FORMAT_TRIANGLES_AMDX, the `numVertices` member of the `VkAccelerationStructureDenseGeometryFormatTrianglesDataAMDX` structure in the `pNext` chain must have the same value which was specified when `srcAccelerationStructure` was last built

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-10900
  For each element of `pInfos`, if its `mode` member is VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, then for each `VkAccelerationStructureGeometryKHR` structure referred to by its `pGeometries` or `ppGeometries` members, if `geometryType` is VK_GEOMETRY_TYPE_DENSE_GEOMETRY_FORMAT_TRIANGLES_AMDX, the `maxPrimitiveIndex` member of the `VkAccelerationStructureDenseGeometryFormatTrianglesDataAMDX` structure in the `pNext` chain must have the same value which was specified when `srcAccelerationStructure` was last built

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-10901
  For each element of `pInfos`, if its `mode` member is VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, then for each `VkAccelerationStructureGeometryKHR` structure referred to by its `pGeometries` or `ppGeometries` members, if `geometryType` is VK_GEOMETRY_TYPE_DENSE_GEOMETRY_FORMAT_TRIANGLES_AMDX, the `maxGeometryIndex` member of the `VkAccelerationStructureDenseGeometryFormatTrianglesDataAMDX` structure in the `pNext` chain must have the same value which was specified when `srcAccelerationStructure` was last built

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-10902
  For each element of `pInfos`, if its `mode` member is VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, then for each `VkAccelerationStructureGeometryKHR` structure referred to by its `pGeometries` or `ppGeometries` members, if `geometryType` is VK_GEOMETRY_TYPE_DENSE_GEOMETRY_FORMAT_TRIANGLES_AMDX, the `format` member of the `VkAccelerationStructureDenseGeometryFormatTrianglesDataAMDX` structure in the `pNext` chain must have the same value which was specified when `srcAccelerationStructure` was last built

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-10903
  For each element of `pInfos`, if its `mode` member is VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, then for each `VkAccelerationStructureGeometryKHR` structure referred to by its `pGeometries` or `ppGeometries` members, if `geometryType` is VK_GEOMETRY_TYPE_DENSE_GEOMETRY_FORMAT_TRIANGLES_AMDX, the `dataSize` member of the `VkAccelerationStructureDenseGeometryFormatTrianglesDataAMDX` structure in the `pNext` chain must have the same value which was specified when `srcAccelerationStructure` was last built

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03768
  For each element of `pInfos`, if its `mode` member is VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, then for each `VkAccelerationStructureGeometryKHR` structure referred to by its `pGeometries` or `ppGeometries` members, if `geometryType` is VK_GEOMETRY_TYPE_TRIANGLES_KHR, and `geometry.triangles.indexType` is not VK_INDEX_TYPE_NONE_KHR, then the value of each index referenced must be the same as the corresponding index value when `srcAccelerationStructure` was last built

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-primitiveCount-03769
  For each element of `pInfos`, if its `mode` member is VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, then for each `VkAccelerationStructureGeometryKHR` structure referred to by its `pGeometries` or `ppGeometries` members, the `primitiveCount` member of its corresponding `VkAccelerationStructureBuildRangeInfoKHR` structure must have the same value which was specified when `srcAccelerationStructure` was last built

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03801
  For each element of `pInfos`[i].`pGeometries` or `pInfos`[i].`ppGeometries` with a `geometryType` of VK_GEOMETRY_TYPE_INSTANCES_KHR, the corresponding `ppMaxPrimitiveCounts`[i][j] must be less than or equal to VkPhysicalDeviceAccelerationStructurePropertiesKHR::`maxInstanceCount`

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-12258
  If `pInfos`[i].`mode` is VK_BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR, and N is not `0`, all addresses between `pInfos`[i].`scratchData.deviceAddress` and `pInfos`[i].`scratchData.deviceAddress` + N - 1 must be in the buffer device address range of the same buffer, where N is given by the `buildScratchSize` member of the VkAccelerationStructureBuildSizesInfoKHR structure returned from a call to vkGetAccelerationStructureBuildSizesKHR with an identical VkAccelerationStructureBuildGeometryInfoKHR structure and primitive count

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-12259
  If `pInfos`[i].`mode` is VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, and N is not `0`, all addresses between `pInfos`[i].`scratchData.deviceAddress` and `pInfos`[i].`scratchData.deviceAddress` + N - 1 must be in the buffer device address range of the same buffer, where N is given by the `updateScratchSize` 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 the `geometry.triangles.vertexData`, `geometry.triangles.indexData`, `geometry.triangles.transformData`, `geometry.aabbs.data`, and `geometry.instances.data` members of all `pInfos`[i].`pGeometries` and `pInfos`[i].`ppGeometries` are queried must have been created with the VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR usage flag set

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-12260
  If `pInfos`[i].`mode` is VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, and the size reported by `updateScratchSize` member of the VkAccelerationStructureBuildSizesInfoKHR structure returned from a call to vkGetAccelerationStructureBuildSizesKHR with an identical VkAccelerationStructureBuildGeometryInfoKHR structure and primitive count is non-zero, `pInfos`[i].`scratchData.deviceAddress` must be a device address allocated to the application from a buffer created with the VK_BUFFER_USAGE_STORAGE_BUFFER_BIT usage flag set

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-12261
  If `pInfos`[i].`mode` is VK_BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR, and the size reported by `buildScratchSize` member of the VkAccelerationStructureBuildSizesInfoKHR structure returned from a call to vkGetAccelerationStructureBuildSizesKHR with an identical VkAccelerationStructureBuildGeometryInfoKHR structure and primitive count is non-zero, `pInfos`[i].`scratchData.deviceAddress` must be a device address allocated to the application from a buffer created with the VK_BUFFER_USAGE_STORAGE_BUFFER_BIT usage flag set

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03710
  For each element of `pInfos`, its `scratchData.deviceAddress` member must be a multiple of VkPhysicalDeviceAccelerationStructurePropertiesKHR::`minAccelerationStructureScratchOffsetAlignment`

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03804
  For each element of `pInfos`[i].`pGeometries` or `pInfos`[i].`ppGeometries` with a `geometryType` of VK_GEOMETRY_TYPE_TRIANGLES_KHR, `geometry.triangles.vertexData.deviceAddress` must be a valid VkDeviceAddress

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03711
  For each element of `pInfos`[i].`pGeometries` or `pInfos`[i].`ppGeometries` with a `geometryType` of VK_GEOMETRY_TYPE_TRIANGLES_KHR, `geometry.triangles.vertexData.deviceAddress` must be aligned to:

  - the size of the format specified in `vertexFormat`, in bytes, if that format is a packed format

  - the component size of the format specified in `vertexFormat`, in bytes, if that format is not a packed format

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03806
  For each element of `pInfos`[i].`pGeometries` or `pInfos`[i].`ppGeometries` with a `geometryType` of VK_GEOMETRY_TYPE_TRIANGLES_KHR, if `geometry.triangles.indexType` is not VK_INDEX_TYPE_NONE_KHR, `geometry.triangles.indexData.deviceAddress` must be a valid VkDeviceAddress

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03712
  For each element of `pInfos`[i].`pGeometries` or `pInfos`[i].`ppGeometries` with a `geometryType` of VK_GEOMETRY_TYPE_TRIANGLES_KHR, and with `geometry.triangles.indexType` not equal to VK_INDEX_TYPE_NONE_KHR, `geometry.triangles.indexData.deviceAddress` must be aligned to the size in bytes of the type in `indexType`

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03808
  For each element of `pInfos`[i].`pGeometries` or `pInfos`[i].`ppGeometries` with a `geometryType` of VK_GEOMETRY_TYPE_TRIANGLES_KHR, if `geometry.triangles.transformData.deviceAddress` is not `0`, it must be a valid VkDeviceAddress

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03810
  For each element of `pInfos`[i].`pGeometries` or `pInfos`[i].`ppGeometries` with a `geometryType` of VK_GEOMETRY_TYPE_TRIANGLES_KHR, if `geometry.triangles.transformData.deviceAddress` is not `0`, it must be aligned to `16` bytes

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03811
  For each element of `pInfos`[i].`pGeometries` or `pInfos`[i].`ppGeometries` with a `geometryType` of VK_GEOMETRY_TYPE_AABBS_KHR, `geometry.aabbs.data.deviceAddress` must be a valid VkDeviceAddress

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03714
  For each element of `pInfos`[i].`pGeometries` or `pInfos`[i].`ppGeometries` with a `geometryType` of VK_GEOMETRY_TYPE_AABBS_KHR, `geometry.aabbs.data.deviceAddress` must be aligned to `8` bytes

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03715
  For each element of `pInfos`[i].`pGeometries` or `pInfos`[i].`ppGeometries` with a `geometryType` of VK_GEOMETRY_TYPE_INSTANCES_KHR, if `geometry.arrayOfPointers` is VK_FALSE, `geometry.instances.data.deviceAddress` must be aligned to `16` bytes

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03716
  For each element of `pInfos`[i].`pGeometries` or `pInfos`[i].`ppGeometries` with a `geometryType` of VK_GEOMETRY_TYPE_INSTANCES_KHR, if `geometry.arrayOfPointers` is VK_TRUE, `geometry.instances.data.deviceAddress` must be aligned to `8` bytes

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03717
  For each element of `pInfos`[i].`pGeometries` or `pInfos`[i].`ppGeometries` with a `geometryType` of VK_GEOMETRY_TYPE_INSTANCES_KHR, if `geometry.arrayOfPointers` is VK_TRUE, each element of `geometry.instances.data.deviceAddress` in device memory must be aligned to `16` bytes

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03813
  For each element of `pInfos`[i].`pGeometries` or `pInfos`[i].`ppGeometries` with a `geometryType` of VK_GEOMETRY_TYPE_INSTANCES_KHR, `geometry.instances.data.deviceAddress` must be a valid VkDeviceAddress

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-12281
  For each element of `pInfos`[i].`pGeometries` or `pInfos`[i].`ppGeometries` with a `geometryType` of VK_GEOMETRY_TYPE_INSTANCES_KHR, each VkAccelerationStructureInstanceKHR::`accelerationStructureReference` value in `geometry.instances.data.deviceAddress` must be `0` or a value obtained from vkGetAccelerationStructureDeviceAddressKHR for a valid bottom level acceleration structure

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-10607
  For each element of `pInfos`[i].`pGeometries` or `pInfos`[i].`ppGeometries` with a `geometryType` of VK_GEOMETRY_TYPE_INSTANCES_KHR, if VK_GEOMETRY_INSTANCE_DISABLE_OPACITY_MICROMAPS_BIT_KHR is set in VkAccelerationStructureInstanceKHR::`flags` then `geometry.instances.data.deviceAddress` must refer to an acceleration structure that was built with VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_DISABLE_OPACITY_MICROMAPS_BIT_KHR set in VkAccelerationStructureBuildGeometryInfoKHR::`flags`

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-commandBuffer-09547
  `commandBuffer` must not be a protected command buffer

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-micromap-11701
  For any element of `pInfos`[i].`pGeometries` or `pInfos`[i].`ppGeometries` with a `geometryType` of VK_GEOMETRY_TYPE_TRIANGLES_KHR, if there is an instance of VkAccelerationStructureTrianglesOpacityMicromapKHR in the `geometry.triangles.pNext` chain with a valid `micromap` member, then the `micromap` member must have been constructed prior to this command’s execution on the device

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-micromap-11624
  For any element of `pInfos`[i].`pGeometries` or `pInfos`[i].`ppGeometries` with a `geometryType` of VK_GEOMETRY_TYPE_TRIANGLES_KHR, if there is an instance of VkAccelerationStructureTrianglesOpacityMicromapKHR in the `geometry.triangles.pNext` chain with a valid `micromap` member, then the `micromap` member must have been built with a `type` of VK_ACCELERATION_STRUCTURE_TYPE_OPACITY_MICROMAP_KHR

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-micromap-11625
  For each element of `pInfos`, if its `mode` member is VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, then for each `VkAccelerationStructureGeometryKHR` structure referred to by its `pGeometries` or `ppGeometries` members, if `geometryType` is VK_GEOMETRY_TYPE_TRIANGLES_KHR, and the same geometry in the original build of `srcAccelerationStructure` was built with an instance of VkAccelerationStructureTrianglesOpacityMicromapKHR in its `geometry.triangles.pNext` chain with a valid `micromap` member, then an instance of VkAccelerationStructureTrianglesOpacityMicromapKHR must be included in the in the `geometry.triangles.pNext` chain with a valid `micromap` member

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-micromap-11626
  For each element of `pInfos`, if its `mode` member is VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, then for each `VkAccelerationStructureGeometryKHR` structure referred to by its `pGeometries` or `ppGeometries` members, if `geometryType` is VK_GEOMETRY_TYPE_TRIANGLES_KHR, and the same geometry in the original build of `srcAccelerationStructure` was built with an instance of VkAccelerationStructureTrianglesOpacityMicromapKHR in its `geometry.triangles.pNext` chain with its `micromap` member equal to `VK_NULL_HANDLE`, then an instance of VkAccelerationStructureTrianglesOpacityMicromapKHR must be included in the in the `geometry.triangles.pNext` chain with its `micromap` member equal to `VK_NULL_HANDLE`

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-micromap-11627
  For each element of `pInfos`, if its `mode` member is VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, then for each `VkAccelerationStructureGeometryKHR` structure referred to by its `pGeometries` or `ppGeometries` members, if `geometryType` is VK_GEOMETRY_TYPE_TRIANGLES_KHR, and the same geometry in the original build of `srcAccelerationStructure` was not built with an instance of VkAccelerationStructureTrianglesOpacityMicromapKHR in its `geometry.triangles.pNext` chain, then an instance of VkAccelerationStructureTrianglesOpacityMicromapKHR must not be included in the in the `geometry.triangles.pNext` chain

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-micromap-11628
  For each element of `pInfos`, if its `mode` member is VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, its `srcAccelerationStructure` was originally built without the VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_OPACITY_MICROMAP_UPDATE_BIT_KHR flag, and `srcAccelerationStructure` was constructed by deserialization with vkCmdCopyMemoryToAccelerationStructureKHR, then for each `VkAccelerationStructureGeometryKHR` structure referred to by its `pGeometries` or `ppGeometries` members, if `geometryType` is VK_GEOMETRY_TYPE_TRIANGLES_KHR, and the same geometry in the original build of `srcAccelerationStructure` was built with an instance of VkAccelerationStructureTrianglesOpacityMicromapKHR in its `geometry.triangles.pNext` chain with a valid `micromap` member, then an instance of VkAccelerationStructureTrianglesOpacityMicromapKHR must be included in the in the `geometry.triangles.pNext` chain with a `micromap` that was deserialized from the serialized data of the `micromap` in the original build of `srcAccelerationStructure`

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-micromap-11629
  For each element of `pInfos`, if its `mode` member is VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, its `srcAccelerationStructure` was originally built without either the VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_OPACITY_MICROMAP_DATA_UPDATE_BIT_EXT or the VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_OPACITY_MICROMAP_UPDATE_BIT_KHR flags, and `srcAccelerationStructure` was not constructed by deserialization with vkCmdCopyMemoryToAccelerationStructureKHR, then for each `VkAccelerationStructureGeometryKHR` structure referred to by its `pGeometries` or `ppGeometries` members, if `geometryType` is VK_GEOMETRY_TYPE_TRIANGLES_KHR, and the same geometry in the original build of `srcAccelerationStructure` was built with an instance of VkAccelerationStructureTrianglesOpacityMicromapKHR in its `geometry.triangles.pNext` chain with a valid `micromap` member, then an instance of VkAccelerationStructureTrianglesOpacityMicromapKHR must be included in the in the `geometry.triangles.pNext` chain with the same `micromap` handle as the original build

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-micromap-11632
  For any element of `pInfos`[i].`pGeometries` or `pInfos`[i].`ppGeometries` with a `geometryType` of VK_GEOMETRY_TYPE_TRIANGLES_KHR, if there is an instance of VkAccelerationStructureTrianglesOpacityMicromapEXT in the `geometry.triangles.pNext` chain, then its `micromap` member must have been constructed prior to this command’s execution on the device

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-10904
  For each element of `pInfos`[i].`pGeometries` or `pInfos`[i].`ppGeometries` with a `geometryType` of VK_GEOMETRY_TYPE_TRIANGLES_KHR, if there is an instance of VkAccelerationStructureTrianglesOpacityMicromapEXT in the `geometry.triangles.pNext` chain, and its `indexType` is VK_INDEX_TYPE_NONE_KHR, then its `indexBuffer.deviceAddress` must be 0

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-10905
  For each element of `pInfos`[i].`pGeometries` or `pInfos`[i].`ppGeometries` with a `geometryType` of VK_GEOMETRY_TYPE_TRIANGLES_KHR, if there is an instance of VkAccelerationStructureTrianglesOpacityMicromapEXT in the `geometry.triangles.pNext` chain, and its `indexType` is not VK_INDEX_TYPE_NONE_KHR, then its `indexBuffer.deviceAddress` must be a valid VkDeviceAddress

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-11846
  For each element of `pInfos`[i].`pGeometries` or `pInfos`[i].`ppGeometries` with a `geometryType` of VK_GEOMETRY_TYPE_SPHERES_NV, if VkAccelerationStructureGeometrySpheresDataNV::`indexType` is VK_INDEX_TYPE_NONE_KHR, then its `indexData.deviceAddress` must be 0

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-11847
  For each element of `pInfos`[i].`pGeometries` or `pInfos`[i].`ppGeometries` with a `geometryType` of VK_GEOMETRY_TYPE_SPHERES_NV, if VkAccelerationStructureGeometrySpheresDataNV::`indexType` is not VK_INDEX_TYPE_NONE_KHR, then its `indexData.deviceAddress` must be a valid VkDeviceAddress

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-11848
  For each element of `pInfos`[i].`pGeometries` or `pInfos`[i].`ppGeometries` with a `geometryType` of VK_GEOMETRY_TYPE_SPHERES_NV, VkAccelerationStructureGeometrySpheresDataNV::`vertexData.deviceAddress` must be a valid VkDeviceAddress

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-11849
  For each element of `pInfos`[i].`pGeometries` or `pInfos`[i].`ppGeometries` with a `geometryType` of VK_GEOMETRY_TYPE_SPHERES_NV, VkAccelerationStructureGeometrySpheresDataNV::`radiusData.deviceAddress` must be a valid VkDeviceAddress

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-11850
  For each element of `pInfos`[i].`pGeometries` or `pInfos`[i].`ppGeometries` with a `geometryType` of VK_GEOMETRY_TYPE_LINEAR_SWEPT_SPHERES_NV, if VkAccelerationStructureGeometryLinearSweptSpheresDataNV::`indexType` is VK_INDEX_TYPE_NONE_KHR, then its `indexData.deviceAddress` must be 0

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-11851
  For each element of `pInfos`[i].`pGeometries` or `pInfos`[i].`ppGeometries` with a `geometryType` of VK_GEOMETRY_TYPE_LINEAR_SWEPT_SPHERES_NV, if VkAccelerationStructureGeometryLinearSweptSpheresDataNV::`indexType` is not VK_INDEX_TYPE_NONE_KHR, then its `indexData.deviceAddress` must be a valid VkDeviceAddress

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-11852
  For each element of `pInfos`[i].`pGeometries` or `pInfos`[i].`ppGeometries` with a `geometryType` of VK_GEOMETRY_TYPE_LINEAR_SWEPT_SPHERES_NV, VkAccelerationStructureGeometryLinearSweptSpheresDataNV::`vertexData.deviceAddress` must be a valid VkDeviceAddress

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-11853
  For each element of `pInfos`[i].`pGeometries` or `pInfos`[i].`ppGeometries` with a `geometryType` of VK_GEOMETRY_TYPE_LINEAR_SWEPT_SPHERES_NV, VkAccelerationStructureGeometryLinearSweptSpheresDataNV::`radiusData.deviceAddress` must be a valid VkDeviceAddress

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectDeviceAddresses-03646
  For each element of `pIndirectDeviceAddresses`[i], all device addresses between `pIndirectDeviceAddresses`[i] and `pIndirectDeviceAddresses`[i] + (`pInfos`[i].`geometryCount` × `pIndirectStrides`[i]) - 1 must be in the buffer device address range of the same buffer

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectDeviceAddresses-03647
  For each element of `pIndirectDeviceAddresses`, the buffer from which it was queried must have been created with the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT usage flag set

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectDeviceAddresses-03648
  Each element of `pIndirectDeviceAddresses` must be a multiple of `4`

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectStrides-03787
  Each element of `pIndirectStrides` must be a multiple of `4`

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectDeviceAddresses-03651
  Each VkAccelerationStructureBuildRangeInfoKHR structure referenced by any element of `pIndirectDeviceAddresses` 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 with `pBuildInfo` = `pInfos`[i] and `pMaxPrimitiveCounts` = `ppMaxPrimitiveCounts`[i]

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-ppMaxPrimitiveCounts-03653
  Each `ppMaxPrimitiveCounts`[i][j] must be greater than or equal to the `primitiveCount` value specified by the VkAccelerationStructureBuildRangeInfoKHR structure located at `pIndirectDeviceAddresses`[i] + (`j` × `pIndirectStrides`[i])

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-type-11557
  For any element of `pInfos`, its `type` member must not be VK_ACCELERATION_STRUCTURE_TYPE_OPACITY_MICROMAP_KHR

Valid Usage (Implicit)

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-commandBuffer-parameter
  `commandBuffer` must be a valid VkCommandBuffer handle

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-parameter
  `pInfos` must be a valid pointer to an array of `infoCount` valid VkAccelerationStructureBuildGeometryInfoKHR structures

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectDeviceAddresses-parameter
  `pIndirectDeviceAddresses` must be a valid pointer to an array of `infoCount` VkDeviceAddress values

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectStrides-parameter
  `pIndirectStrides` must be a valid pointer to an array of `infoCount` `uint32_t` values

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-ppMaxPrimitiveCounts-parameter
  `ppMaxPrimitiveCounts` must be a valid pointer to an array of `infoCount` `uint32_t` values

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-commandBuffer-recording
  `commandBuffer` must be in the recording state

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-commandBuffer-cmdpool
  The `VkCommandPool` that `commandBuffer` was allocated from must support VK_QUEUE_COMPUTE_BIT operations

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-renderpass
  This command must only be called outside of a render pass instance

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-suspended
  This command must not be called between suspended render pass instances

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-videocoding
  This command must only be called outside of a video coding scope

- VUID-vkCmdBuildAccelerationStructuresIndirectKHR-infoCount-arraylength
  `infoCount` must be greater than `0`

Host Synchronization

- Host access to `commandBuffer` must be externally synchronized

- Host access to the `VkCommandPool` that `commandBuffer` was allocated from must be externally synchronized

Command Properties

Command Buffer Levels | Render Pass Scope | Video Coding Scope | Supported Queue Types | Command Type
--- | --- | --- | --- | ---
Primary Secondary | Outside | Outside | VK_QUEUE_COMPUTE_BIT | Action

Conditional Rendering

vkCmdBuildAccelerationStructuresIndirectKHR is not affected by conditional rendering

## See Also

VK_KHR_acceleration_structure, VkAccelerationStructureBuildGeometryInfoKHR, VkCommandBuffer, VkDeviceAddress

## 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.

## Copyright

Copyright 2014-2026 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0