vkCmdCopyImage2(3)

# vkCmdCopyImage2(3) Manual Page

## Name

vkCmdCopyImage2 - Copy data between images

Loading… please wait.

## C Specification

To copy data between image objects, call:

    // Provided by VK_VERSION_1_3
    void vkCmdCopyImage2(
        VkCommandBuffer                             commandBuffer,
        const VkCopyImageInfo2*                     pCopyImageInfo);

or the equivalent command

    // Provided by VK_KHR_copy_commands2
    void vkCmdCopyImage2KHR(
        VkCommandBuffer                             commandBuffer,
        const VkCopyImageInfo2*                     pCopyImageInfo);

## Parameters

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

- `pCopyImageInfo` is a pointer to a VkCopyImageInfo2 structure describing the copy parameters.

## Description

This command is functionally identical to vkCmdCopyImage, but includes extensible sub-structures that include `sType` and `pNext` parameters, allowing them to be more easily extended.

Valid Usage

- VUID-vkCmdCopyImage2-commandBuffer-01825
  If `commandBuffer` is an unprotected command buffer and `protectedNoFault` is not supported, `srcImage` must not be a protected image

- VUID-vkCmdCopyImage2-commandBuffer-01826
  If `commandBuffer` is an unprotected command buffer and `protectedNoFault` is not supported, `dstImage` must not be a protected image

- VUID-vkCmdCopyImage2-commandBuffer-01827
  If `commandBuffer` is a protected command buffer and `protectedNoFault` is not supported, `dstImage` must not be an unprotected image

- VUID-vkCmdCopyImage2-commandBuffer-10217
  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 `pCopyImageInfo->pRegions`, where the `aspectMask` member of `srcSubresource` is `VK_IMAGE_ASPECT_COLOR_BIT`, the `aspectMask` of `dstSubresource` must not be `VK_IMAGE_ASPECT_DEPTH_BIT` or `VK_IMAGE_ASPECT_STENCIL_BIT`

- VUID-vkCmdCopyImage2-commandBuffer-10218
  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 `pCopyImageInfo->pRegions`, where the `aspectMask` member of `dstSubresource` is `VK_IMAGE_ASPECT_COLOR_BIT` then the `aspectMask` of `srcSubresource` must not be `VK_IMAGE_ASPECT_DEPTH_BIT` or `VK_IMAGE_ASPECT_STENCIL_BIT`

Valid Usage (Implicit)

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

- VUID-vkCmdCopyImage2-pCopyImageInfo-parameter
  `pCopyImageInfo` must be a valid pointer to a valid VkCopyImageInfo2 structure

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

- VUID-vkCmdCopyImage2-commandBuffer-cmdpool
  The `VkCommandPool` that `commandBuffer` was allocated from must support transfer, graphics, or compute operations

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

- VUID-vkCmdCopyImage2-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 | Transfer Graphics Compute | Action

## See Also

VK_KHR_copy_commands2, VK_VERSION_1_3, VkCommandBuffer, VkCopyImageInfo2

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

SPDX-License-Identifier: CC-BY-4.0