C Specification
To build acceleration structures on the host, call:
// Provided by VK_KHR_ray_tracing
VkResult vkBuildAccelerationStructureKHR(
VkDevice device,
uint32_t infoCount,
const VkAccelerationStructureBuildGeometryInfoKHR* pInfos,
const VkAccelerationStructureBuildOffsetInfoKHR* const* ppOffsetInfos);
Parameters
This command fulfills the same task as vkCmdBuildAccelerationStructureKHR but executed by the host.
Description
-
device
is theVkDevice
for which the acceleration structures are being built. -
infoCount
is the number of acceleration structures to build. It specifies the number of thepInfos
structures andppOffsetInfos
pointers that must be provided. -
pInfos
is a pointer to 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].
The vkBuildAccelerationStructureKHR
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 vkBuildAccelerationStructureKHR 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. |
If the VkDeferredOperationInfoKHR structure is included in the
pNext
chain of any VkAccelerationStructureBuildGeometryInfoKHR
structure, the operation of this command is deferred, as defined in the
Deferred Host Operations chapter.
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.