# vkCreateAccelerationStructureKHR(3) Manual Page

## Name

vkCreateAccelerationStructureKHR - Create a new acceleration structure object

## 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.

Valid Usage

- The `rayTracing` or `rayQuery` feature must be enabled

- If VkAccelerationStructureCreateInfoKHR::`deviceAddress` is not zero, the `rayTracingAccelerationStructureCaptureReplay` feature must be enabled

- If `device` was created with multiple physical devices, then the bufferDeviceAddressMultiDevice feature must be enabled

Valid Usage (Implicit)

- `device` must be a valid VkDevice handle

- `pCreateInfo` must be a valid pointer to a valid VkAccelerationStructureCreateInfoKHR structure

- If `pAllocator` is not `NULL`, `pAllocator` must be a valid pointer to a valid VkAllocationCallbacks structure

- `pAccelerationStructure` must be a valid pointer to a VkAccelerationStructureKHR handle

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`

## See Also

VkAccelerationStructureCreateInfoKHR, VkAccelerationStructureKHR, VkAllocationCallbacks, VkDevice

## 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

Copyright (c) 2014-2020 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.