C Specification
To build an acceleration structure call:
// Provided by VK_NV_ray_tracing
void vkCmdBuildAccelerationStructureNV(
VkCommandBuffer commandBuffer,
const VkAccelerationStructureInfoNV* pInfo,
VkBuffer instanceData,
VkDeviceSize instanceOffset,
VkBool32 update,
VkAccelerationStructureNV dst,
VkAccelerationStructureNV src,
VkBuffer scratch,
VkDeviceSize scratchOffset);
Parameters
-
commandBuffer
is the command buffer into which the command will be recorded. -
pInfo
contains the shared information for the acceleration structure’s structure. -
instanceData
is the buffer containing an array of VkAccelerationStructureInstanceKHR structures defining acceleration structures. This parameter must beNULL
for bottom level acceleration structures. -
instanceOffset
is the offset in bytes (relative to the start ofinstanceData
) at which the instance data is located. -
update
specifies whether to update thedst
acceleration structure with the data insrc
. -
dst
is a pointer to the target acceleration structure for the build. -
src
is a pointer to an existing acceleration structure that is to be used to update thedst
acceleration structure. -
scratch
is the VkBuffer that will be used as scratch memory for the build. -
scratchOffset
is the offset in bytes relative to the start ofscratch
that will be used as a scratch memory.
Description
Accesses to dst
, src
, and scratch
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
.
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.