vkCmdCopyMemoryToImageKHR(3)

# vkCmdCopyMemoryToImageKHR(3) Manual Page

## Name

vkCmdCopyMemoryToImageKHR - Copy data from memory ranges to an image

## C Specification

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

    // Provided by VK_KHR_device_address_commands
    void vkCmdCopyMemoryToImageKHR(
        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-vkCmdCopyMemoryToImageKHR-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-vkCmdCopyMemoryToImageKHR-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-vkCmdCopyMemoryToImageKHR-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-vkCmdCopyMemoryToImageKHR-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-vkCmdCopyMemoryToImageKHR-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-vkCmdCopyMemoryToImageKHR-imageLayout-13019
  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_DST_OPTIMAL

- VUID-vkCmdCopyMemoryToImageKHR-pCopyMemoryInfo-13020
  `pCopyMemoryInfo->image` must have been created with VK_IMAGE_USAGE_TRANSFER_DST_BIT

- VUID-vkCmdCopyMemoryToImageKHR-commandBuffer-13021
  If `commandBuffer` is a protected command buffer and `protectedNoFault` is not supported, `pCopyMemoryInfo->image` must have been created with VK_IMAGE_CREATE_PROTECTED_BIT

- VUID-vkCmdCopyMemoryToImageKHR-None-13022
  If VK_EXT_depth_range_unrestricted is not enabled, for each element of `pCopyMemoryInfo->pRegions` whose `imageSubresource` contains a depth aspect, each data element in its `addressRange` must be in the range [0,1]

- VUID-vkCmdCopyMemoryToImageKHR-addressRange-13128
  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_SRC_BIT

Valid Usage (Implicit)

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

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

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

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

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

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

- VUID-vkCmdCopyMemoryToImageKHR-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

vkCmdCopyMemoryToImageKHR 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