# vkCmdBuildPartitionedAccelerationStructuresNV(3) Manual Page

## Name

vkCmdBuildPartitionedAccelerationStructuresNV - Command for building a PTLAS

Loading… please wait.

## C Specification

To build a partitioned top level acceleration structure, call:

    // Provided by VK_NV_partitioned_acceleration_structure
    void vkCmdBuildPartitionedAccelerationStructuresNV(
        VkCommandBuffer                             commandBuffer,
        const VkBuildPartitionedAccelerationStructureInfoNV* pBuildInfo);

## Parameters

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

- `pBuildInfo` is a pointer to a VkBuildPartitionedAccelerationStructureInfoNV structure containing parameters required for building a PTLAS.

## Description

Accesses to the acceleration structure scratch memory as identified by the VkBuildPartitionedAccelerationStructureInfoNV::`scratchData` 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 VkBuildPartitionedAccelerationStructureInfoNV::`srcAccelerationStructureData` and VkBuildPartitionedAccelerationStructureInfoNV::`dstAccelerationStructureData` 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 memory with input data as identified by any used values of VkBuildPartitionedAccelerationStructureInfoNV::`srcInfos` and VkBuildPartitionedAccelerationStructureInfoNV::`srcInfosCount` 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-vkCmdBuildPartitionedAccelerationStructuresNV-partitionedAccelerationStructure-10536
  The `VkPhysicalDevicePartitionedAccelerationStructureFeaturesNV`::`partitionedAccelerationStructure` feature must be enabled

- VUID-vkCmdBuildPartitionedAccelerationStructuresNV-pBuildInfo-10537
  The count specified in `pBuildInfo->input`::`instanceCount` for the build operation must not exceed the value provided in `pInfo->instanceCount` when calling vkGetPartitionedAccelerationStructuresBuildSizesNV to determine the memory size

- VUID-vkCmdBuildPartitionedAccelerationStructuresNV-pBuildInfo-10538
  The count specified in `pBuildInfo->input`::`maxInstancePerPartitionCount` for the build operation must not exceed the value provided in `pInfo->maxInstancePerPartitionCount` when calling vkGetPartitionedAccelerationStructuresBuildSizesNV to determine the memory size

- VUID-vkCmdBuildPartitionedAccelerationStructuresNV-pBuildInfo-10539
  The count specified in `pBuildInfo->input`::`partitionCount` for the build operation must not exceed the value provided in `pInfo->partitionCount` when calling vkGetPartitionedAccelerationStructuresBuildSizesNV to determine the memory size

- VUID-vkCmdBuildPartitionedAccelerationStructuresNV-pBuildInfo-10540
  The count specified in `pBuildInfo->input`::`maxInstanceInGlobalPartitionCount` for the build operation must not exceed the value provided in `pInfo->maxInstanceInGlobalPartitionCount` when calling vkGetPartitionedAccelerationStructuresBuildSizesNV to determine the memory size

- VUID-vkCmdBuildPartitionedAccelerationStructuresNV-pBuildInfo-10541
  The scratch memory for the partitioned acceleration structure build specified in `pBuildInfo->scratchData` must be larger than or equal to the scratch size queried with vkGetPartitionedAccelerationStructuresBuildSizesNV

- VUID-vkCmdBuildPartitionedAccelerationStructuresNV-pBuildInfo-10542
  `pBuildInfo->scratchData` must be aligned to `256` bytes

- VUID-vkCmdBuildPartitionedAccelerationStructuresNV-pBuildInfo-10543
  The destination memory of the partitioned acceleration structure build specified in `pBuildInfo->dstAccelerationStructureData` must be larger than or equal to the size queried with vkGetPartitionedAccelerationStructuresBuildSizesNV

- VUID-vkCmdBuildPartitionedAccelerationStructuresNV-pBuildInfo-10544
  `pBuildInfo->srcAccelerationStructureData` must be aligned to `256` bytes

- VUID-vkCmdBuildPartitionedAccelerationStructuresNV-pBuildInfo-10545
  `pBuildInfo->dstAccelerationStructureData` must be aligned to `256` bytes

- VUID-vkCmdBuildPartitionedAccelerationStructuresNV-pBuildInfo-10546
  The number of inputs specified in `pBuildInfo->srcInfos` must be greater than or equal to `pBuildInfo->srcInfosCount`

- VUID-vkCmdBuildPartitionedAccelerationStructuresNV-pBuildInfo-10547
  The memory region containing the acceleration structure at address `pBuildInfo->srcAccelerationStructureData` must not overlap with scratch memory region at address `pBuildInfo->scratchData`

- VUID-vkCmdBuildPartitionedAccelerationStructuresNV-pBuildInfo-10548
  The memory region containing the acceleration structure at address `pBuildInfo->dstAccelerationStructureData` must not overlap with scratch memory region at address `pBuildInfo->scratchData`

- VUID-vkCmdBuildPartitionedAccelerationStructuresNV-pBuildInfo-10549
  The memory regions containing the acceleration structures at addresses `pBuildInfo->srcAccelerationStructureData` and `pBuildInfo->dstAccelerationStructureData` must not overlap with each other

- VUID-vkCmdBuildPartitionedAccelerationStructuresNV-pBuildInfo-10550
  The buffer from which the buffer device address for `pBuildInfo->scratchData` is queried must have been created with the `VK_BUFFER_USAGE_STORAGE_BUFFER_BIT` usage flag

- VUID-vkCmdBuildPartitionedAccelerationStructuresNV-pBuildInfo-10551
  The buffers from which the buffer device addresses for `pBuildInfo->srcInfos` and `pBuildInfo->srcInfosCount` are queried must have been created with the `VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR` usage flag

- VUID-vkCmdBuildPartitionedAccelerationStructuresNV-pBuildInfo-10552
  The buffers from which the buffer device addresses for `pBuildInfo->srcAccelerationStructureData` and `pBuildInfo->dstAccelerationStructureData` are queried must have been created with the `VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR` usage flag

- VUID-vkCmdBuildPartitionedAccelerationStructuresNV-pBuildInfo-10553
  If `pBuildInfo->srcAccelerationStructureData` is the address of a non-sparse buffer then it must be bound completely and contiguously to a single VkDeviceMemory object

- VUID-vkCmdBuildPartitionedAccelerationStructuresNV-pBuildInfo-10554
  If `pBuildInfo->dstAccelerationStructureData` is the address of a non-sparse buffer then it must be bound completely and contiguously to a single VkDeviceMemory object

- VUID-vkCmdBuildPartitionedAccelerationStructuresNV-pBuildInfo-10555
  If `pBuildInfo->scratchData` is the address of a non-sparse buffer then it must be bound completely and contiguously to a single VkDeviceMemory object

- VUID-vkCmdBuildPartitionedAccelerationStructuresNV-pBuildInfo-10556
  If `pBuildInfo->srcInfos` is the address of a non-sparse buffer then it must be bound completely and contiguously to a single VkDeviceMemory object

- VUID-vkCmdBuildPartitionedAccelerationStructuresNV-pBuildInfo-10557
  If `pBuildInfo->srcInfosCount` is the address of a non-sparse buffer then it must be bound completely and contiguously to a single VkDeviceMemory object

Valid Usage (Implicit)

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

- VUID-vkCmdBuildPartitionedAccelerationStructuresNV-pBuildInfo-parameter
  `pBuildInfo` must be a valid pointer to a valid VkBuildPartitionedAccelerationStructureInfoNV structure

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

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

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

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

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 | Compute | Action

## See Also

VK_NV_partitioned_acceleration_structure, VkBuildPartitionedAccelerationStructureInfoNV, VkCommandBuffer

## 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-2025 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0