C Specification

The VkCopyBufferToImageInfo2KHR structure is defined as:

// Provided by VK_KHR_copy_commands2
typedef struct VkCopyBufferToImageInfo2KHR {
    VkStructureType                 sType;
    const void*                     pNext;
    VkBuffer                        srcBuffer;
    VkImage                         dstImage;
    VkImageLayout                   dstImageLayout;
    uint32_t                        regionCount;
    const VkBufferImageCopy2KHR*    pRegions;
} VkCopyBufferToImageInfo2KHR;

Members

  • sType is the type of this structure.

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

  • srcBuffer is the source buffer.

  • dstImage is the destination image.

  • dstImageLayout is the layout of the destination image subresources for the copy.

  • regionCount is the number of regions to copy.

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

Description

Valid Usage
  • VUID-VkCopyBufferToImageInfo2KHR-pRegions-00171
    srcBuffer must be large enough to contain all buffer locations that are accessed according to Buffer and Image Addressing, for each element of pRegions

  • VUID-VkCopyBufferToImageInfo2KHR-pRegions-00173
    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-VkCopyBufferToImageInfo2KHR-srcBuffer-00174
    srcBuffer must have been created with VK_BUFFER_USAGE_TRANSFER_SRC_BIT usage flag

  • VUID-VkCopyBufferToImageInfo2KHR-dstImage-01997
    The format features of dstImage must contain VK_FORMAT_FEATURE_TRANSFER_DST_BIT

  • VUID-VkCopyBufferToImageInfo2KHR-srcBuffer-00176
    If srcBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object

  • VUID-VkCopyBufferToImageInfo2KHR-dstImage-00177
    dstImage must have been created with VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag

  • VUID-VkCopyBufferToImageInfo2KHR-dstImage-00178
    If dstImage is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object

  • VUID-VkCopyBufferToImageInfo2KHR-dstImage-00179
    dstImage must have a sample count equal to VK_SAMPLE_COUNT_1_BIT

  • VUID-VkCopyBufferToImageInfo2KHR-dstImageLayout-00180
    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-VkCopyBufferToImageInfo2KHR-dstImageLayout-01396
    dstImageLayout must be VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_GENERAL, or VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR

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

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

  • VUID-VkCopyBufferToImageInfo2KHR-imageOffset-01793
    The imageOffset and imageExtent 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-VkCopyBufferToImageInfo2KHR-dstImage-02543
    dstImage must not have been created with flags containing VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT

  • VUID-VkCopyBufferToImageInfo2KHR-commandBuffer-04477
    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 pRegions, the aspectMask member of imageSubresource must not be VK_IMAGE_ASPECT_DEPTH_BIT or VK_IMAGE_ASPECT_STENCIL_BIT.

  • VUID-VkCopyBufferToImageInfo2KHR-imageOffset-00197
    For each element of pRegions not containing VkCopyCommandTransformInfoQCOM in its pNext chain, , imageOffset.x and (imageExtent.width + imageOffset.x) must both be greater than or equal to 0 and less than or equal to the width of the specified imageSubresource of dstImage where this refers to the width of the plane of the image involved in the copy in the case of a multi-planar format

  • VUID-VkCopyBufferToImageInfo2KHR-imageOffset-00198
    For each element of pRegions not containing VkCopyCommandTransformInfoQCOM in its pNext chain, , imageOffset.y and (imageExtent.height + imageOffset.y) must both be greater than or equal to 0 and less than or equal to the height of the specified imageSubresource of dstImage where this refers to the height of the plane of the image involved in the copy in the case of a multi-planar format

  • VUID-VkCopyBufferToImageInfo2KHR-bufferOffset-01558
    If dstImage does not have either a depth/stencil or a multi-planar format, then for each element of pRegions, bufferOffset must be a multiple of the format’s texel block size

  • VUID-VkCopyBufferToImageInfo2KHR-bufferOffset-01559
    If dstImage has a multi-planar format, then for each element of pRegions, bufferOffset must be a multiple of the element size of the compatible format for the format and the aspectMask of the imageSubresource as defined in [formats-compatible-planes]

  • VUID-VkCopyBufferToImageInfo2KHR-srcImage-00199
    If dstImage is of type VK_IMAGE_TYPE_1D, then for each element of pRegions, imageOffset.y must be 0 and imageExtent.height must be 1

  • VUID-VkCopyBufferToImageInfo2KHR-imageOffset-00200
    For each element of pRegions, imageOffset.z and (imageExtent.depth + imageOffset.z) must both be greater than or equal to 0 and less than or equal to the depth of the specified imageSubresource of dstImage

  • VUID-VkCopyBufferToImageInfo2KHR-srcImage-00201
    If dstImage is of type VK_IMAGE_TYPE_1D or VK_IMAGE_TYPE_2D, then for each element of pRegions, imageOffset.z must be 0 and imageExtent.depth must be 1

  • VUID-VkCopyBufferToImageInfo2KHR-bufferRowLength-00203
    If dstImage is a blocked image, for each element of pRegions, bufferRowLength must be a multiple of the compressed texel block width

  • VUID-VkCopyBufferToImageInfo2KHR-bufferImageHeight-00204
    If dstImage is a blocked image, for each element of pRegions, bufferImageHeight must be a multiple of the compressed texel block height

  • VUID-VkCopyBufferToImageInfo2KHR-imageOffset-00205
    If dstImage is a blocked image, for each element of pRegions, all members of imageOffset must be a multiple of the corresponding dimensions of the compressed texel block

  • VUID-VkCopyBufferToImageInfo2KHR-bufferOffset-00206
    If dstImage is a blocked image, for each element of pRegions, bufferOffset must be a multiple of the compressed texel block size in bytes

  • VUID-VkCopyBufferToImageInfo2KHR-imageExtent-00207
    If dstImage is a blocked image, for each element of pRegions, imageExtent.width must be a multiple of the compressed texel block width or (imageExtent.width + imageOffset.x) must equal the width of the specified imageSubresource of dstImage

  • VUID-VkCopyBufferToImageInfo2KHR-imageExtent-00208
    If dstImage is a blocked image, for each element of pRegions, imageExtent.height must be a multiple of the compressed texel block height or (imageExtent.height + imageOffset.y) must equal the height of the specified imageSubresource of dstImage

  • VUID-VkCopyBufferToImageInfo2KHR-imageExtent-00209
    If dstImage is a blocked image, for each element of pRegions, imageExtent.depth must be a multiple of the compressed texel block depth or (imageExtent.depth + imageOffset.z) must equal the depth of the specified imageSubresource of dstImage

  • VUID-VkCopyBufferToImageInfo2KHR-aspectMask-00211
    For each element of pRegions, imageSubresource.aspectMask must specify aspects present in dstImage

  • VUID-VkCopyBufferToImageInfo2KHR-aspectMask-01560
    If dstImage has a multi-planar format, then for each element of pRegions, imageSubresource.aspectMask must be VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT, or VK_IMAGE_ASPECT_PLANE_2_BIT (with VK_IMAGE_ASPECT_PLANE_2_BIT valid only for image formats with three planes)

  • VUID-VkCopyBufferToImageInfo2KHR-baseArrayLayer-00213
    If dstImage is of type VK_IMAGE_TYPE_3D, for each element of pRegions, imageSubresource.baseArrayLayer must be 0 and imageSubresource.layerCount must be 1

  • VUID-VkCopyBufferToImageInfo2KHR-pRegions-04725
    If dstImage is not a blocked image, for each element of pRegions, bufferRowLength multiplied by the texel block size of dstImage must be less than or equal to 231-1

  • VUID-VkCopyBufferToImageInfo2KHR-pRegions-04726
    If dstImage is a blocked image, for each element of pRegions, bufferRowLength divided by the compressed texel block width and then multiplied by the texel block size of dstImage must be less than or equal to 231-1

  • VUID-VkCopyBufferToImageInfo2KHR-commandBuffer-04052
    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 bufferOffset member of any element of pRegions must be a multiple of 4

  • VUID-VkCopyBufferToImageInfo2KHR-srcImage-04053
    If dstImage has a depth/stencil format, the bufferOffset member of any element of pRegions must be a multiple of 4

Valid Usage (Implicit)
  • VUID-VkCopyBufferToImageInfo2KHR-sType-sType
    sType must be VK_STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2_KHR

  • VUID-VkCopyBufferToImageInfo2KHR-pNext-pNext
    pNext must be NULL

  • VUID-VkCopyBufferToImageInfo2KHR-srcBuffer-parameter
    srcBuffer must be a valid VkBuffer handle

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

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

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

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

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

See Also

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 2014-2021 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0