# vkCopyAccelerationStructureToMemoryKHR(3) Manual Page

## Name

vkCopyAccelerationStructureToMemoryKHR - Serialize an acceleration structure on the host

## C Specification

    VkResult vkCopyAccelerationStructureToMemoryKHR(
        VkDevice                                    device,
        const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo);

## Parameters

This command fulfills the same task as vkCmdCopyAccelerationStructureToMemoryKHR but executed by the host.

## Description

This command produces the same results as vkCmdCopyAccelerationStructureToMemoryKHR, but writes its result directly to a host pointer, and is executed on the host rather than the device. The output may not necessarily be bit-for-bit identical, but it can be equally used by either vkCmdCopyMemoryToAccelerationStructureKHR or vkCopyMemoryToAccelerationStructureKHR.

- `device` is the device which owns `pInfo->pname`:src.

- `pInfo` is a pointer to a VkCopyAccelerationStructureToMemoryInfoKHR structure defining the copy operation.

If the VkDeferredOperationInfoKHR structure is included in the `pNext` chain of the VkCopyAccelerationStructureToMemoryInfoKHR structure, the operation of this command is deferred, as defined in the https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#deferred-host-operations chapter.

Valid Usage

- All `VkAccelerationStructureKHR` objects referenced by this command must be bound to host-visible memory.

- All `VkDeviceOrHostAddressKHR` referenced by this command must contain valid host pointers.

- the `VkPhysicalDeviceRayTracingFeaturesKHR`→`rayTracingHostAccelerationStructureCommands` feature must be enabled

Valid Usage (Implicit)

- `device` must be a valid VkDevice handle

- `pInfo` must be a valid pointer to a valid VkCopyAccelerationStructureToMemoryInfoKHR structure

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

VkCopyAccelerationStructureToMemoryInfoKHR, 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.