Function Prototype

vkCmdBuildPartitionedAccelerationStructuresNV

Command for building a PTLAS

To build a partitioned top level acceleration structure, call:

void vkCmdBuildPartitionedAccelerationStructuresNV(
    VkCommandBuffer                     commandBuffer,
    const VkBuildPartitionedAccelerationStructureInfoNV*  pBuildInfo);

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::dstAccelerationStructureDatamust 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::srcInfosCountmust 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-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

If the source and destination acceleration structures are not the same, the memory regions containing the acceleration structures at addresses pBuildInfo→srcAccelerationStructureData and pBuildInfo→dstAccelerationStructureData must not overlap with each other

VUID-vkCmdBuildPartitionedAccelerationStructuresNV-pBuildInfo-10550

pBuildInfo→scratchData 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-vkCmdBuildPartitionedAccelerationStructuresNV-pBuildInfo-10551

pBuildInfo→srcInfos and pBuildInfo→srcInfosCount must be device addresses allocated to the application from buffers created with the VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR usage flag set

VUID-vkCmdBuildPartitionedAccelerationStructuresNV-pBuildInfo-10552

pBuildInfo→srcAccelerationStructureData and pBuildInfo→dstAccelerationStructureData must be a device addresses allocated to the application from buffers created with the VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR usage flag set

Valid Usage (Implicit)

VUID-vkCmdBuildPartitionedAccelerationStructuresNV-commandBuffer-cmdpool

The VkCommandPool that commandBuffer was allocated from must support VK_QUEUE_COMPUTE_BIT operations

VUID-vkCmdBuildPartitionedAccelerationStructuresNV-renderpass

This command must only be called outside of a render pass instance

VUID-vkCmdBuildPartitionedAccelerationStructuresNV-suspended

This command must not be called between suspended render pass instances

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