C Specification
To build acceleration structures call:
// Provided by VK_KHR_ray_tracing
void vkCmdBuildAccelerationStructureKHR(
VkCommandBuffer commandBuffer,
uint32_t infoCount,
const VkAccelerationStructureBuildGeometryInfoKHR* pInfos,
const VkAccelerationStructureBuildOffsetInfoKHR* const* ppOffsetInfos);
Parameters
-
commandBuffer
is the command buffer into which the command will be recorded. -
infoCount
is the number of acceleration structures to build. It specifies the number of thepInfos
structures andppOffsetInfos
pointers that must be provided. -
pInfos
is an array ofinfoCount
VkAccelerationStructureBuildGeometryInfoKHR structures defining the geometry used to build each acceleration structure. -
ppOffsetInfos
is an array ofinfoCount
pointers to arrays of VkAccelerationStructureBuildOffsetInfoKHR structures. EachppOffsetInfos
[i] is an array ofpInfos
[i].geometryCount
VkAccelerationStructureBuildOffsetInfoKHR structures defining dynamic offsets to the addresses where geometry data is stored, as defined bypInfos
[i].
Description
The vkCmdBuildAccelerationStructureKHR
command provides the ability to
initiate multiple acceleration structures builds, however there is no
ordering or synchronization implied between any of the individual
acceleration structure builds.
Note
This means that an application cannot build a top-level acceleration structure in the same vkCmdBuildAccelerationStructureKHR call as the associated bottom-level or instance acceleration structures are being built. There also cannot be any memory aliasing between any acceleration structure memories or scratch memories being used by any of the builds. |
Accesses to the acceleration structure scratch buffers as identified by the
VkAccelerationStructureBuildGeometryInfoKHR→scratchData
buffer
device addresses 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.