## C Specification

The VkCopyImageInfo2KHR structure is defined as:

// Provided by VK_KHR_copy_commands2
typedef struct VkCopyImageInfo2KHR {
VkStructureType           sType;
const void*               pNext;
VkImage                   srcImage;
VkImageLayout             srcImageLayout;
VkImage                   dstImage;
VkImageLayout             dstImageLayout;
uint32_t                  regionCount;
const VkImageCopy2KHR*    pRegions;
} VkCopyImageInfo2KHR;

## Members

• sType is the type of this structure.

• pNext is NULL or a pointer to a structure extending this structure.

• srcImage is the source image.

• srcImageLayout is the current layout of the source image subresource.

• dstImage is the destination image.

• dstImageLayout is the current layout of the destination image subresource.

• regionCount is the number of regions to copy.

• pRegions is a pointer to an array of VkImageCopy2KHR structures specifying the regions to copy.

## Description

Valid Usage
• VUID-VkCopyImageInfo2KHR-pRegions-00124
The union of all source regions, and the union of all destination regions, specified by the elements of pRegions, must not overlap in memory

• VUID-VkCopyImageInfo2KHR-srcImage-01995
The format features of srcImage must contain VK_FORMAT_FEATURE_TRANSFER_SRC_BIT

• VUID-VkCopyImageInfo2KHR-srcImage-00126
srcImage must have been created with VK_IMAGE_USAGE_TRANSFER_SRC_BIT usage flag

• VUID-VkCopyImageInfo2KHR-srcImage-01546
If srcImage is non-sparse then the image or disjoint plane to be copied must be bound completely and contiguously to a single VkDeviceMemory object

• VUID-VkCopyImageInfo2KHR-srcImageLayout-00128
srcImageLayout must specify the layout of the image subresources of srcImage specified in pRegions at the time this command is executed on a VkDevice

• VUID-VkCopyImageInfo2KHR-srcImageLayout-01917
srcImageLayout must be VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, VK_IMAGE_LAYOUT_GENERAL, or VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR

• VUID-VkCopyImageInfo2KHR-dstImage-01996
The format features of dstImage must contain VK_FORMAT_FEATURE_TRANSFER_DST_BIT

• VUID-VkCopyImageInfo2KHR-dstImage-00131
dstImage must have been created with VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag

• VUID-VkCopyImageInfo2KHR-dstImage-01547
If dstImage is non-sparse then the image or disjoint plane that is the destination of the copy must be bound completely and contiguously to a single VkDeviceMemory object

• VUID-VkCopyImageInfo2KHR-dstImageLayout-00133
dstImageLayout must specify the layout of the image subresources of dstImage specified in pRegions at the time this command is executed on a VkDevice

• VUID-VkCopyImageInfo2KHR-dstImageLayout-01395
dstImageLayout must be VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_GENERAL, or VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR

• VUID-VkCopyImageInfo2KHR-srcImage-01548
If the VkFormat of each of srcImage and dstImage is not a multi-planar format, the VkFormat of each of srcImage and dstImage must be compatible, as defined above

• VUID-VkCopyImageInfo2KHR-None-01549
In a copy to or from a plane of a multi-planar image, the VkFormat of the image and plane must be compatible according to the description of compatible planes for the plane being copied

• VUID-VkCopyImageInfo2KHR-srcImage-00136
The sample count of srcImage and dstImage must match

• VUID-VkCopyImageInfo2KHR-srcSubresource-01696
The srcSubresource.mipLevel member of each element of pRegions must be less than the mipLevels specified in VkImageCreateInfo when srcImage was created

• VUID-VkCopyImageInfo2KHR-dstSubresource-01697
The dstSubresource.mipLevel member of each element of pRegions must be less than the mipLevels specified in VkImageCreateInfo when dstImage was created

• VUID-VkCopyImageInfo2KHR-srcSubresource-01698
The srcSubresource.baseArrayLayer + srcSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when srcImage was created

• VUID-VkCopyImageInfo2KHR-dstSubresource-01699
The dstSubresource.baseArrayLayer + dstSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when dstImage was created

• VUID-VkCopyImageInfo2KHR-srcOffset-01783
The srcOffset and extent members of each element of pRegions must respect the image transfer granularity requirements of commandBuffer’s command pool’s queue family, as described in VkQueueFamilyProperties

• VUID-VkCopyImageInfo2KHR-dstOffset-01784
The dstOffset and extent members of each element of pRegions must respect the image transfer granularity requirements of commandBuffer’s command pool’s queue family, as described in VkQueueFamilyProperties

• VUID-VkCopyImageInfo2KHR-dstImage-02542
dstImage and srcImage must not have been created with flags containing VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT

• VUID-VkCopyImageInfo2KHR-srcImage-01551
If neither srcImage nor dstImage has a multi-planar image format then for each element of pRegions, srcSubresource.aspectMask and dstSubresource.aspectMask must match

• VUID-VkCopyImageInfo2KHR-srcImage-01552
If srcImage has a VkFormat with two planes then for each element of pRegions, srcSubresource.aspectMask must be VK_IMAGE_ASPECT_PLANE_0_BIT or VK_IMAGE_ASPECT_PLANE_1_BIT

• VUID-VkCopyImageInfo2KHR-srcImage-01553
If srcImage has a VkFormat with three planes then for each element of pRegions, srcSubresource.aspectMask must be VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT, or VK_IMAGE_ASPECT_PLANE_2_BIT

• VUID-VkCopyImageInfo2KHR-dstImage-01554
If dstImage has a VkFormat with two planes then for each element of pRegions, dstSubresource.aspectMask must be VK_IMAGE_ASPECT_PLANE_0_BIT or VK_IMAGE_ASPECT_PLANE_1_BIT

• VUID-VkCopyImageInfo2KHR-dstImage-01555
If dstImage has a VkFormat with three planes then for each element of pRegions, dstSubresource.aspectMask must be VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT, or VK_IMAGE_ASPECT_PLANE_2_BIT

• VUID-VkCopyImageInfo2KHR-srcImage-01556
If srcImage has a multi-planar image format and the dstImage does not have a multi-planar image format, then for each element of pRegions, dstSubresource.aspectMask must be VK_IMAGE_ASPECT_COLOR_BIT

• VUID-VkCopyImageInfo2KHR-dstImage-01557
If dstImage has a multi-planar image format and the srcImage does not have a multi-planar image format, then for each element of pRegions, srcSubresource.aspectMask must be VK_IMAGE_ASPECT_COLOR_BIT

• VUID-VkCopyImageInfo2KHR-srcImage-04443
If srcImage is of type VK_IMAGE_TYPE_3D, then for each element of pRegions, srcSubresource.baseArrayLayer must be 0 and srcSubresource.layerCount must be 1

• VUID-VkCopyImageInfo2KHR-dstImage-04444
If dstImage is of type VK_IMAGE_TYPE_3D, then for each element of pRegions, dstSubresource.baseArrayLayer must be 0 and dstSubresource.layerCount must be 1

For each element of pRegions, srcSubresource.aspectMask must specify aspects present in srcImage

For each element of pRegions, dstSubresource.aspectMask must specify aspects present in dstImage

• VUID-VkCopyImageInfo2KHR-srcOffset-00144
For each element of pRegions, srcOffset.x and (extent.width + srcOffset.x) must both be greater than or equal to 0 and less than or equal to the width of the specified srcSubresource of srcImage

• VUID-VkCopyImageInfo2KHR-srcOffset-00145
For each element of pRegions, srcOffset.y and (extent.height + srcOffset.y) must both be greater than or equal to 0 and less than or equal to the height of the specified srcSubresource of srcImage

• VUID-VkCopyImageInfo2KHR-srcImage-00146
If srcImage is of type VK_IMAGE_TYPE_1D, then for each element of pRegions, srcOffset.y must be 0 and extent.height must be 1

• VUID-VkCopyImageInfo2KHR-srcOffset-00147
For each element of pRegions, srcOffset.z and (extent.depth + srcOffset.z) must both be greater than or equal to 0 and less than or equal to the depth of the specified srcSubresource of srcImage

• VUID-VkCopyImageInfo2KHR-srcImage-01785
If srcImage is of type VK_IMAGE_TYPE_1D, then for each element of pRegions, srcOffset.z must be 0 and extent.depth must be 1

• VUID-VkCopyImageInfo2KHR-dstImage-01786
If dstImage is of type VK_IMAGE_TYPE_1D, then for each element of pRegions, dstOffset.z must be 0 and extent.depth must be 1

• VUID-VkCopyImageInfo2KHR-srcImage-01787
If srcImage is of type VK_IMAGE_TYPE_2D, then for each element of pRegions, srcOffset.z must be 0

• VUID-VkCopyImageInfo2KHR-dstImage-01788
If dstImage is of type VK_IMAGE_TYPE_2D, then for each element of pRegions, dstOffset.z must be 0

• VUID-VkCopyImageInfo2KHR-srcImage-01790
If srcImage and dstImage are both of type VK_IMAGE_TYPE_2D, then for each element of pRegions, extent.depth must be 1

• VUID-VkCopyImageInfo2KHR-srcImage-01791
If srcImage is of type VK_IMAGE_TYPE_2D, and dstImage is of type VK_IMAGE_TYPE_3D, then for each element of pRegions, extent.depth must equal srcSubresource.layerCount

• VUID-VkCopyImageInfo2KHR-dstImage-01792
If dstImage is of type VK_IMAGE_TYPE_2D, and srcImage is of type VK_IMAGE_TYPE_3D, then for each element of pRegions, extent.depth must equal dstSubresource.layerCount

• VUID-VkCopyImageInfo2KHR-dstOffset-00150
For each element of pRegions, dstOffset.x and (extent.width + dstOffset.x) must both be greater than or equal to 0 and less than or equal to the width of the specified dstSubresource of dstImage

• VUID-VkCopyImageInfo2KHR-dstOffset-00151
For each element of pRegions, dstOffset.y and (extent.height + dstOffset.y) must both be greater than or equal to 0 and less than or equal to the height of the specified dstSubresource of dstImage

• VUID-VkCopyImageInfo2KHR-dstImage-00152
If dstImage is of type VK_IMAGE_TYPE_1D, then for each element of pRegions, dstOffset.y must be 0 and extent.height must be 1

• VUID-VkCopyImageInfo2KHR-dstOffset-00153
For each element of pRegions, dstOffset.z and (extent.depth + dstOffset.z) must both be greater than or equal to 0 and less than or equal to the depth of the specified dstSubresource of dstImage

• VUID-VkCopyImageInfo2KHR-srcImage-01727
If srcImage is a blocked image, then for each element of pRegions, all members of srcOffset must be a multiple of the corresponding dimensions of the compressed texel block

• VUID-VkCopyImageInfo2KHR-srcImage-01728
If srcImage is a blocked image, then for each element of pRegions, extent.width must be a multiple of the compressed texel block width or (extent.width + srcOffset.x) must equal the width of the specified srcSubresource of srcImage

• VUID-VkCopyImageInfo2KHR-srcImage-01729
If srcImage is a blocked image, then for each element of pRegions, extent.height must be a multiple of the compressed texel block height or (extent.height + srcOffset.y) must equal the height of the specified srcSubresource of srcImage

• VUID-VkCopyImageInfo2KHR-srcImage-01730
If srcImage is a blocked image, then for each element of pRegions, extent.depth must be a multiple of the compressed texel block depth or (extent.depth + srcOffset.z) must equal the depth of the specified srcSubresource of srcImage

• VUID-VkCopyImageInfo2KHR-dstImage-01731
If dstImage is a blocked image, then for each element of pRegions, all members of dstOffset must be a multiple of the corresponding dimensions of the compressed texel block

• VUID-VkCopyImageInfo2KHR-dstImage-01732
If dstImage is a blocked image, then for each element of pRegions, extent.width must be a multiple of the compressed texel block width or (extent.width + dstOffset.x) must equal the width of the specified dstSubresource of dstImage

• VUID-VkCopyImageInfo2KHR-dstImage-01733
If dstImage is a blocked image, then for each element of pRegions, extent.height must be a multiple of the compressed texel block height or (extent.height + dstOffset.y) must equal the height of the specified dstSubresource of dstImage

• VUID-VkCopyImageInfo2KHR-dstImage-01734
If dstImage is a blocked image, then for each element of pRegions, extent.depth must be a multiple of the compressed texel block depth or (extent.depth + dstOffset.z) must equal the depth of the specified dstSubresource of dstImage

Valid Usage (Implicit)
• VUID-VkCopyImageInfo2KHR-sType-sType
sType must be VK_STRUCTURE_TYPE_COPY_IMAGE_INFO_2_KHR

• VUID-VkCopyImageInfo2KHR-pNext-pNext
pNext must be NULL

• VUID-VkCopyImageInfo2KHR-srcImage-parameter
srcImage must be a valid VkImage handle

• VUID-VkCopyImageInfo2KHR-srcImageLayout-parameter
srcImageLayout must be a valid VkImageLayout value

• VUID-VkCopyImageInfo2KHR-dstImage-parameter
dstImage must be a valid VkImage handle

• VUID-VkCopyImageInfo2KHR-dstImageLayout-parameter
dstImageLayout must be a valid VkImageLayout value

• VUID-VkCopyImageInfo2KHR-pRegions-parameter
pRegions must be a valid pointer to an array of regionCount valid VkImageCopy2KHR structures

• VUID-VkCopyImageInfo2KHR-regionCount-arraylength
regionCount must be greater than 0

• VUID-VkCopyImageInfo2KHR-commonparent
Both of dstImage, and srcImage must have been created, allocated, or retrieved from the same VkDevice