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 region in
pRegions is copied from the source image to the same
region of the destination image.
dstImage can be the same image or alias the same
dstImage has a
regions of each plane to be copied must be specified separately using the
dstSubresource members of the
In this case, the
aspectMask of the
dstSubresource that refers to the multi-planar image must be
For the purposes of
vkCmdCopyImage, each plane of a multi-planar image
is treated as having the format listed in https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#formats-compatible-planes for
the plane identified by the
aspectMask of the corresponding
This applies both to VkFormat and to coordinates used in the copy,
which correspond to texels in the plane rather than how these texels map
to coordinates in the image as a whole.
For example, the
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.
vkCmdCopyImage can be used to copy image data between multisample
images, but both images must have the same number of samples.
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.