C Specification

To copy device memory to an acceleration structure call:

// Provided by VK_KHR_ray_tracing
void vkCmdCopyMemoryToAccelerationStructureKHR(
    VkCommandBuffer                             commandBuffer,
    const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo);

Parameters

This command can accept acceleration structures produced by either vkCmdCopyAccelerationStructureToMemoryKHR or vkCopyAccelerationStructureToMemoryKHR.

Description

The structure provided as input to deserialize is as described in vkCmdCopyAccelerationStructureToMemoryKHR, with any acceleration structure handles filled in with the newly-queried handles to bottom level acceleration structures created before deserialization. These do not need to be built at deserialize time, but must be created.

Valid Usage
  • VUID-vkCmdCopyMemoryToAccelerationStructureKHR-None-04049
    All VkDeviceOrHostAddressKHR referenced by this command must contain valid device addresses for a buffer bound to device memory. If the buffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object

  • VUID-vkCmdCopyMemoryToAccelerationStructureKHR-None-03563
    All VkAccelerationStructureKHR objects referenced by this command must be bound to device memory

  • VUID-vkCmdCopyMemoryToAccelerationStructureKHR-pNext-03564
    The VkDeferredOperationInfoKHR structure must not be included in the pNext chain of the VkCopyMemoryToAccelerationStructureInfoKHR structure

  • VUID-vkCmdCopyMemoryToAccelerationStructureKHR-mode-03413
    mode must be VK_COPY_ACCELERATION_STRUCTURE_MODE_DESERIALIZE_KHR

  • VUID-vkCmdCopyMemoryToAccelerationStructureKHR-pInfo-03414
    The data in pInfo->src must have a format compatible with the destination physical device as returned by vkGetDeviceAccelerationStructureCompatibilityKHR

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

  • VUID-vkCmdCopyMemoryToAccelerationStructureKHR-pInfo-parameter
    pInfo must be a valid pointer to a valid VkCopyMemoryToAccelerationStructureInfoKHR structure

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

  • VUID-vkCmdCopyMemoryToAccelerationStructureKHR-commandBuffer-cmdpool
    The VkCommandPool that commandBuffer was allocated from must support compute operations

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

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 Supported Queue Types Pipeline Type

Primary
Secondary

Outside

Compute

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 (c) 2014-2020 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0