To copy data between image objects, call:
// Provided by VK_VERSION_1_0 void vkCmdCopyImage( VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy* pRegions);
commandBufferis the command buffer into which the command will be recorded.
srcImageis the source image.
srcImageLayoutis the current layout of the source image subresource.
dstImageis the destination image.
dstImageLayoutis the current layout of the destination image subresource.
regionCountis the number of regions to copy.
pRegionsis a pointer to an array of VkImageCopy structures specifying the regions to copy.
Each source region specified by
pRegions is copied from the source
image to the destination region of the destination image.
If any of the specified regions in
srcImage overlaps in memory with
any of the specified regions in
dstImage, values read from those
overlapping regions are undefined.
Multi-planar images can only be copied on a per-plane basis, and the subresources used in each region when copying to or from such images must specify only one plane, though different regions can specify different planes. When copying planes of multi-planar images, the format considered is the compatible format for that plane, rather than the format of the multi-planar image.
If the format of the destination image has a different block extent than the source image (e.g. one is a compressed format), the offset and extent for each of the regions specified is scaled according to the block extents of each format to match in size. Copy regions for each image must be aligned to a multiple of the texel block extent in each dimension, except at the edges of the image, where region extents must match the edge of the image.
Image data can be copied between images with different image types.
If one image is
VK_IMAGE_TYPE_3D and the other image is
VK_IMAGE_TYPE_2D with multiple layers, then each slice is copied to or
from a different layer;
depth slices in the 3D image correspond to
layerCount layers in the 2D image, with an effective
1 used for the 2D image.
maintenance5 is enabled, all other
combinations are allowed and function as if 1D images are 2D images with a
height of 1.
Otherwise, other combinations of image types are disallowed.
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.