vkCmdBuildAccelerationStructureIndirectKHR(3)

# vkCmdBuildAccelerationStructureIndirectKHR(3) Manual Page

## Name

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

Loading… please wait.

## C Specification

To build an acceleration structure with some parameters sourced on the device call:

    // Provided by VK_KHR_ray_tracing
    void vkCmdBuildAccelerationStructureIndirectKHR(
        VkCommandBuffer                             commandBuffer,
        const VkAccelerationStructureBuildGeometryInfoKHR* pInfo,
        VkBuffer                                    indirectBuffer,
        VkDeviceSize                                indirectOffset,
        uint32_t                                    indirectStride);

## Parameters

- `commandBuffer` is the command buffer into which the command will be recorded.

- `pInfo` is a pointer to a VkAccelerationStructureBuildGeometryInfoKHR structure defining the geometry used to build the acceleration structure.

- `indirectBuffer` is the VkBuffer containing `pInfo->geometryCount` VkAccelerationStructureBuildOffsetInfoKHR structures defining dynamic offsets to the addresses where geometry data is stored, as defined by `pInfo`.

- `indirectOffset` is the byte offset into `indirectBuffer` where offset parameters begin.

- `stride` is the byte stride between successive sets of offset parameters.

## Description

Valid Usage

- VUID-vkCmdBuildAccelerationStructureIndirectKHR-None-04047
  All VkDeviceOrHostAddressKHR or VkDeviceOrHostAddressConstKHR referenced by this command must contain valid device addresses for a buffer bound to device memory. If the buffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object

- VUID-vkCmdBuildAccelerationStructureIndirectKHR-None-03534
  All `VkAccelerationStructureKHR` objects referenced by this command must be bound to device memory

- VUID-vkCmdBuildAccelerationStructureIndirectKHR-rayTracingIndirectAccelerationStructureBuild-03535
  The `VkPhysicalDeviceRayTracingFeaturesKHR`::`rayTracingIndirectAccelerationStructureBuild` feature must be enabled

- VUID-vkCmdBuildAccelerationStructureIndirectKHR-pNext-03536
  The VkDeferredOperationInfoKHR structure must not be included in the `pNext` chain of any of the provided VkAccelerationStructureBuildGeometryInfoKHR structures

Valid Usage (Implicit)

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

- VUID-vkCmdBuildAccelerationStructureIndirectKHR-pInfo-parameter
  `pInfo` must be a valid pointer to a valid VkAccelerationStructureBuildGeometryInfoKHR structure

- VUID-vkCmdBuildAccelerationStructureIndirectKHR-indirectBuffer-parameter
  `indirectBuffer` must be a valid VkBuffer handle

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

- VUID-vkCmdBuildAccelerationStructureIndirectKHR-commandBuffer-cmdpool
  The `VkCommandPool` that `commandBuffer` was allocated from must support compute operations

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

- VUID-vkCmdBuildAccelerationStructureIndirectKHR-commonparent
  Both of `commandBuffer`, and `indirectBuffer` must have been created, allocated, or retrieved from the same VkDevice

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 | Supported Queue Types | Pipeline Type
--- | --- | --- | ---
Primary Secondary | Outside | Compute |

## See Also

VkAccelerationStructureBuildGeometryInfoKHR, VkBuffer, VkCommandBuffer, `VkDeviceSize`

## 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 (c) 2014-2020 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0