vkCmdCopyImageToMemoryKHR(3)

# vkCmdCopyImageToMemoryKHR(3) Manual Page

## Name

vkCmdCopyImageToMemoryKHR - Copy data from an image to memory ranges

## C Specification

To copy data from an image to memory ranges, call:

    // Provided by VK_KHR_device_address_commands
    void vkCmdCopyImageToMemoryKHR(
        VkCommandBuffer                             commandBuffer,
        const VkCopyDeviceMemoryImageInfoKHR*       pCopyMemoryInfo);

## Parameters

- `commandBuffer` is the command buffer into which the command will be recorded.

- `pCopyMemoryInfo` a pointer to a VkCopyDeviceMemoryImageInfoKHR structure describing the copies to perform.

## Description

Valid Usage

- VUID-vkCmdCopyImageToMemoryKHR-commandBuffer-13102
  If `commandBuffer` is an unprotected command buffer and `protectedNoFault` is not supported, the `addressCopyFlags` member of all elements of `pCopyMemoryInfo->pRegions` must not include VK_ADDRESS_COMMAND_PROTECTED_BIT_KHR

- VUID-vkCmdCopyImageToMemoryKHR-commandBuffer-13103
  If `commandBuffer` is an unprotected command buffer and `protectedNoFault` is not supported, `pCopyMemoryInfo->image` must not have been created with VK_IMAGE_CREATE_PROTECTED_BIT

- VUID-vkCmdCopyImageToMemoryKHR-commandBuffer-13104
  If the queue family used to create the VkCommandPool which `commandBuffer` was allocated from does not support VK_QUEUE_GRAPHICS_BIT or VK_QUEUE_COMPUTE_BIT, the `addressRange.pname`:address member of any element of `pCopyMemoryInfo->pRegions` must be a multiple of 4

- VUID-vkCmdCopyImageToMemoryKHR-imageOffset-13105
  The `imageOffset` and `imageExtent` members of each element of `pCopyMemoryInfo->pRegions` must respect the image transfer granularity requirements of `commandBuffer`’s command pool’s queue family, as described in VkQueueFamilyProperties

- VUID-vkCmdCopyImageToMemoryKHR-commandBuffer-13106
  If the queue family used to create the VkCommandPool which `commandBuffer` was allocated from does not support VK_QUEUE_GRAPHICS_BIT, for each element of `pCopyMemoryInfo->pRegions`, the `aspectMask` member of `imageSubresource` must not be VK_IMAGE_ASPECT_DEPTH_BIT or VK_IMAGE_ASPECT_STENCIL_BIT

- VUID-vkCmdCopyImageToMemoryKHR-imageLayout-13023
  The `imageLayout` member of each element of `pCopyMemoryInfo->pRegions` must be VK_IMAGE_LAYOUT_GENERAL, VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR, or VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL

- VUID-vkCmdCopyImageToMemoryKHR-pCopyMemoryInfo-13024
  `pCopyMemoryInfo->image` must have been created with VK_IMAGE_USAGE_TRANSFER_SRC_BIT

- VUID-vkCmdCopyImageToMemoryKHR-commandBuffer-13025
  If `commandBuffer` is a protected command buffer and `protectedNoFault` is not supported, the `addressCopyFlags` member of all elements of `pCopyMemoryInfo->pRegions` must include VK_ADDRESS_COMMAND_PROTECTED_BIT_KHR

- VUID-vkCmdCopyImageToMemoryKHR-addressRange-13129
  At least one buffer containing the total address range specified by the `addressRange` member of each element of `pCopyMemoryInfo->pRegions` must have been created with VK_BUFFER_USAGE_TRANSFER_DST_BIT

Valid Usage (Implicit)

- VUID-vkCmdCopyImageToMemoryKHR-commandBuffer-parameter
  `commandBuffer` must be a valid VkCommandBuffer handle

- VUID-vkCmdCopyImageToMemoryKHR-pCopyMemoryInfo-parameter
  If `pCopyMemoryInfo` is not `NULL`, `pCopyMemoryInfo` must be a valid pointer to a valid VkCopyDeviceMemoryImageInfoKHR structure

- VUID-vkCmdCopyImageToMemoryKHR-commandBuffer-recording
  `commandBuffer` must be in the recording state

- VUID-vkCmdCopyImageToMemoryKHR-commandBuffer-cmdpool
  The `VkCommandPool` that `commandBuffer` was allocated from must support VK_QUEUE_TRANSFER_BIT operations

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

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

- VUID-vkCmdCopyImageToMemoryKHR-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_TRANSFER_BIT | Action

Conditional Rendering

vkCmdCopyImageToMemoryKHR is not affected by conditional rendering

## See Also

VK_KHR_device_address_commands, VkCommandBuffer, VkCopyDeviceMemoryImageInfoKHR

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

SPDX-License-Identifier: CC-BY-4.0