Function Prototype

vkCmdCopyMemoryToAccelerationStructureKHR

Copy device memory to an acceleration structure
primary / secondary
outside
compute
action

To copy device memory to an acceleration structure call:

void vkCmdCopyMemoryToAccelerationStructureKHR(
    VkCommandBuffer commandBuffer,
    const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo);

Accesses to pInfo→dst must be synchronized with the VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_COPY_BIT_KHR

pipeline stage or the VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR

pipeline stage, and an access type of VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR. Accesses to the buffer indicated by pInfo→src.deviceAddress must be synchronized with the VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_COPY_BIT_KHR

pipeline stage or the VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR

pipeline stage, and an access type of VK_ACCESS_TRANSFER_READ_BIT.

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

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-pInfo-03742

pInfo→src.deviceAddress must be a valid device address for a buffer bound to device memory

VUID-vkCmdCopyMemoryToAccelerationStructureKHR-pInfo-03743

pInfo→src.deviceAddress must be aligned to 256 bytes

VUID-vkCmdCopyMemoryToAccelerationStructureKHR-pInfo-03744

If the buffer pointed to by pInfo→src.deviceAddress is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object

VUID-vkCmdCopyMemoryToAccelerationStructureKHR-buffer-03745

The buffer used to create pInfo→dst must be bound to device memory

Valid Usage (Implicit)

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

VUID-vkCmdCopyMemoryToAccelerationStructureKHR-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 ::