## C Specification

To create an acceleration structure, call:

VkResult vkCreateAccelerationStructureKHR(
VkDevice                                    device,
const VkAccelerationStructureCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks*                pAllocator,
VkAccelerationStructureKHR*                 pAccelerationStructure);

## Parameters

• device is the logical device that creates the buffer object.

• pCreateInfo is a pointer to a VkAccelerationStructureCreateInfoKHR structure containing parameters affecting creation of the acceleration structure.

• pAllocator controls host memory allocation as described in the Memory Allocation chapter.

• pAccelerationStructure is a pointer to a VkAccelerationStructureKHR handle in which the resulting acceleration structure object is returned.

## Description

Similar to other objects in Vulkan, the acceleration structure creation merely creates an object with a specific “shape”. The type and quantity of geometry that can be built into an acceleration structure is determined by the parameters of VkAccelerationStructureCreateInfoKHR.

Populating the data in the object after allocating and binding memory is done with commands such as vkCmdBuildAccelerationStructureKHR, vkBuildAccelerationStructureKHR, vkCmdCopyAccelerationStructureKHR, and vkCopyAccelerationStructureKHR.

The input buffers passed to acceleration structure build commands will be referenced by the implementation for the duration of the command. After the command completes, the acceleration structure may hold a reference to any acceleration structure specified by an active instance contained therein. Apart from this referencing, acceleration structures must be fully self-contained. The application may re-use or free any memory which was used by the command as an input or as scratch without affecting the results of ray traversal.

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

On failure, this command returns
• VK_ERROR_OUT_OF_HOST_MEMORY

• VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR

## Document Notes

This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.