C Specification

To copy an acceleration structure to host accessible memory, call:

// Provided by VK_KHR_acceleration_structure
VkResult vkCopyAccelerationStructureToMemoryKHR(
    VkDevice                                    device,
    VkDeferredOperationKHR                      deferredOperation,
    const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo);

Parameters

Description

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

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.

Valid Usage
  • VUID-vkCopyAccelerationStructureToMemoryKHR-deferredOperation-03678
    Any previous deferred operation that was associated with deferredOperation must be complete

  • VUID-vkCopyAccelerationStructureToMemoryKHR-buffer-03731
    The buffer used to create pInfo->src must be bound to host-visible device memory

  • VUID-vkCopyAccelerationStructureToMemoryKHR-pInfo-03732
    pInfo->dst.hostAddress must be a valid host pointer

  • VUID-vkCopyAccelerationStructureToMemoryKHR-pInfo-03751
    pInfo->dst.hostAddress must be aligned to 16 bytes

  • VUID-vkCopyAccelerationStructureToMemoryKHR-buffer-03783
    The buffer used to create pInfo->src must be bound to memory that was not allocated with multiple instances

Valid Usage (Implicit)
  • VUID-vkCopyAccelerationStructureToMemoryKHR-device-parameter
    device must be a valid VkDevice handle

  • VUID-vkCopyAccelerationStructureToMemoryKHR-deferredOperation-parameter
    If deferredOperation is not VK_NULL_HANDLE, deferredOperation must be a valid VkDeferredOperationKHR handle

  • VUID-vkCopyAccelerationStructureToMemoryKHR-pInfo-parameter
    pInfo must be a valid pointer to a valid VkCopyAccelerationStructureToMemoryInfoKHR structure

  • VUID-vkCopyAccelerationStructureToMemoryKHR-deferredOperation-parent
    If deferredOperation is a valid handle, it must have been created, allocated, or retrieved from device

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 2014-2024 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0