C Specification

To copy an acceleration structure to device memory call:

// Provided by VK_KHR_acceleration_structure
void vkCmdCopyAccelerationStructureToMemoryKHR(
    VkCommandBuffer                             commandBuffer,
    const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo);

Parameters

Description

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

The defined header structure for the serialized data consists of:

The corresponding handles matching the values returned by vkGetAccelerationStructureDeviceAddressKHR or vkGetAccelerationStructureHandleNV are tightly packed in the buffer following the count. The application is expected to store a mapping between those handles and the original application-generated bottom-level acceleration structures to provide when deserializing. The serialized data is written to the buffer (or read from the buffer) according to the host endianness.

Valid Usage
  • VUID-vkCmdCopyAccelerationStructureToMemoryKHR-accelerationStructure-08926
    The VkPhysicalDeviceAccelerationStructureFeaturesKHR::accelerationStructure feature must be enabled

  • VUID-vkCmdCopyAccelerationStructureToMemoryKHR-pInfo-03739
    pInfo->dst.deviceAddress must be a valid VkDeviceAddress

  • VUID-vkCmdCopyAccelerationStructureToMemoryKHR-pInfo-03740
    pInfo->dst.deviceAddress must be aligned to 256 bytes

  • VUID-vkCmdCopyAccelerationStructureToMemoryKHR-None-03559
    The buffer used to create pInfo->src must be bound to device memory

Valid Usage (Implicit)
  • VUID-vkCmdCopyAccelerationStructureToMemoryKHR-commandBuffer-parameter
    commandBuffer must be a valid VkCommandBuffer handle

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

  • VUID-vkCmdCopyAccelerationStructureToMemoryKHR-commandBuffer-recording
    commandBuffer must be in the recording state

  • VUID-vkCmdCopyAccelerationStructureToMemoryKHR-commandBuffer-cmdpool
    The VkCommandPool that commandBuffer was allocated from must support VK_QUEUE_COMPUTE_BIT operations

  • VUID-vkCmdCopyAccelerationStructureToMemoryKHR-renderpass
    This command must only be called outside of a render pass instance

  • VUID-vkCmdCopyAccelerationStructureToMemoryKHR-suspended
    This command must not be called between suspended render pass instances

  • VUID-vkCmdCopyAccelerationStructureToMemoryKHR-videocoding
    This command must only be called outside of a video coding scope

Host Synchronization
  • Host access to commandBuffer must be externally synchronized

  • Host access to the VkCommandPool that commandBuffer was allocated from must be externally synchronized

Command Properties
Command Buffer Levels Render Pass Scope Video Coding Scope Supported Queue Types Command Type

Primary
Secondary

Outside

Outside

VK_QUEUE_COMPUTE_BIT

Action

Conditional Rendering

vkCmdCopyAccelerationStructureToMemoryKHR is not affected by conditional rendering

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

SPDX-License-Identifier: CC-BY-4.0