Loading... please wait.

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 the VkDevice for which the acceleration structures are being built.

  • infoCount is the number of acceleration structures to build. It specifies the number of the pInfos structures and ppOffsetInfos pointers that must be provided.

  • pInfos is a pointer to an array of infoCount VkAccelerationStructureBuildGeometryInfoKHR structures defining the geometry used to build each acceleration structure.

  • ppOffsetInfos is an array of infoCount pointers to arrays of VkAccelerationStructureBuildOffsetInfoKHR structures. Each ppOffsetInfos[i] is an array of pInfos[i].geometryCount VkAccelerationStructureBuildOffsetInfoKHR structures defining dynamic offsets to the addresses where geometry data is stored, as defined by pInfos[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.

Valid Usage
Valid Usage (Implicit)
Return Codes
On success, this command returns
  • VK_SUCCESS

  • VK_OPERATION_DEFERRED_KHR

  • VK_OPERATION_NOT_DEFERRED_KHR

On failure, this command returns
  • VK_ERROR_OUT_OF_HOST_MEMORY

  • VK_ERROR_OUT_OF_DEVICE_MEMORY

See Also

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 (c) 2014-2020 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.