C Specification
The VkCopyImageToBufferInfo2KHR
structure is defined as:
// Provided by VK_KHR_copy_commands2
typedef struct VkCopyImageToBufferInfo2KHR {
VkStructureType sType;
const void* pNext;
VkImage srcImage;
VkImageLayout srcImageLayout;
VkBuffer dstBuffer;
uint32_t regionCount;
const VkBufferImageCopy2KHR* pRegions;
} VkCopyImageToBufferInfo2KHR;
Members
-
sType
is the type of this structure. -
pNext
isNULL
or a pointer to a structure extending this structure. -
srcImage
is the source image. -
srcImageLayout
is the layout of the source image subresources for the copy. -
dstBuffer
is the destination buffer. -
regionCount
is the number of regions to copy. -
pRegions
is a pointer to an array of VkBufferImageCopy2KHR structures specifying the regions to copy.
Description
-
VUID-VkCopyImageToBufferInfo2KHR-pRegions-04566
If the image region specified by each element ofpRegions
does not contain VkCopyCommandTransformInfoQCOM in itspNext
chain, it must be a region that is contained withinsrcImage
if thesrcImage
’s VkFormat is not a multi-planar format, and must be a region that is contained within the plane being copied if thesrcImage
’s VkFormat is a multi-planar format -
VUID-VkCopyImageToBufferInfo2KHR-pRegions-04557
If the image region specified by each element ofpRegions
does contain VkCopyCommandTransformInfoQCOM in itspNext
chain, the rotated source region as described in https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#copies-buffers-images-rotation-addressing must be contained withinsrcImage
. -
VUID-VkCopyImageToBufferInfo2KHR-pRegions-04558
If any element ofpRegions
contains VkCopyCommandTransformInfoQCOM in itspNext
chain, then thesrcImage
must not be a blocked image -
VUID-VkCopyImageToBufferInfo2KHR-pRegions-04559
If any element ofpRegions
contains VkCopyCommandTransformInfoQCOM in itspNext
chain, then thesrcImage
must be of typeVK_IMAGE_TYPE_2D
, and must not be a multi-planar format.
-
VUID-VkCopyImageToBufferInfo2KHR-pRegions-00183
dstBuffer
must be large enough to contain all buffer locations that are accessed according to Buffer and Image Addressing, for each element ofpRegions
-
VUID-VkCopyImageToBufferInfo2KHR-pRegions-00184
The union of all source regions, and the union of all destination regions, specified by the elements ofpRegions
, must not overlap in memory -
VUID-VkCopyImageToBufferInfo2KHR-srcImage-00186
srcImage
must have been created withVK_IMAGE_USAGE_TRANSFER_SRC_BIT
usage flag -
VUID-VkCopyImageToBufferInfo2KHR-srcImage-01998
The format features ofsrcImage
must containVK_FORMAT_FEATURE_TRANSFER_SRC_BIT
-
VUID-VkCopyImageToBufferInfo2KHR-srcImage-00187
IfsrcImage
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
object -
VUID-VkCopyImageToBufferInfo2KHR-dstBuffer-00191
dstBuffer
must have been created withVK_BUFFER_USAGE_TRANSFER_DST_BIT
usage flag -
VUID-VkCopyImageToBufferInfo2KHR-dstBuffer-00192
IfdstBuffer
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
object -
VUID-VkCopyImageToBufferInfo2KHR-srcImage-00188
srcImage
must have a sample count equal toVK_SAMPLE_COUNT_1_BIT
-
VUID-VkCopyImageToBufferInfo2KHR-srcImageLayout-00189
srcImageLayout
must specify the layout of the image subresources ofsrcImage
specified inpRegions
at the time this command is executed on aVkDevice
-
VUID-VkCopyImageToBufferInfo2KHR-srcImageLayout-01397
srcImageLayout
must beVK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL
,VK_IMAGE_LAYOUT_GENERAL
, orVK_IMAGE_LAYOUT_SHARED_PRESENT_KHR
-
VUID-VkCopyImageToBufferInfo2KHR-imageSubresource-01703
TheimageSubresource.mipLevel
member of each element ofpRegions
must be less than themipLevels
specified in VkImageCreateInfo whensrcImage
was created -
VUID-VkCopyImageToBufferInfo2KHR-imageSubresource-01704
TheimageSubresource.baseArrayLayer
+imageSubresource.layerCount
of each element ofpRegions
must be less than or equal to thearrayLayers
specified in VkImageCreateInfo whensrcImage
was created -
VUID-VkCopyImageToBufferInfo2KHR-imageOffset-01794
TheimageOffset
andimageExtent
members of each element ofpRegions
must respect the image transfer granularity requirements ofcommandBuffer
’s command pool’s queue family, as described in VkQueueFamilyProperties -
VUID-VkCopyImageToBufferInfo2KHR-srcImage-02544
srcImage
must not have been created withflags
containingVK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT
-
VUID-VkCopyImageToBufferInfo2KHR-imageOffset-00197
For each element ofpRegions
not containing VkCopyCommandTransformInfoQCOM in itspNext
chain, ,imageOffset.x
and (imageExtent.width
+imageOffset.x
) must both be greater than or equal to0
and less than or equal to the width of the specifiedimageSubresource
ofsrcImage
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-VkCopyImageToBufferInfo2KHR-imageOffset-00198
For each element ofpRegions
not containing VkCopyCommandTransformInfoQCOM in itspNext
chain, ,imageOffset.y
and (imageExtent.height +imageOffset.y
) must both be greater than or equal to0
and less than or equal to the height of the specifiedimageSubresource
ofsrcImage
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-VkCopyImageToBufferInfo2KHR-bufferOffset-01558
If {imageparam} does not have either a depth/stencil or a multi-planar format, then for each element ofpRegions
,bufferOffset
must be a multiple of the format’s texel block size -
VUID-VkCopyImageToBufferInfo2KHR-bufferOffset-01559
If {imageparam} has a multi-planar format, then for each element ofpRegions
,bufferOffset
must be a multiple of the element size of the compatible format for the format and theaspectMask
of theimageSubresource
as defined in [formats-compatible-planes] -
VUID-VkCopyImageToBufferInfo2KHR-srcImage-00199
If {imageparam} is of typeVK_IMAGE_TYPE_1D
, then for each element ofpRegions
,imageOffset.y
must be0
andimageExtent.height
must be1
-
VUID-VkCopyImageToBufferInfo2KHR-imageOffset-00200
For each element ofpRegions
,imageOffset.z
and (imageExtent.depth +imageOffset.z
) must both be greater than or equal to0
and less than or equal to the depth of the specifiedimageSubresource
of {imageparam} -
VUID-VkCopyImageToBufferInfo2KHR-srcImage-00201
If {imageparam} is of typeVK_IMAGE_TYPE_1D
orVK_IMAGE_TYPE_2D
, then for each element ofpRegions
,imageOffset.z
must be0
andimageExtent.depth
must be1
-
VUID-VkCopyImageToBufferInfo2KHR-bufferRowLength-00203
If {imageparam} is a blocked image, for each element ofpRegions
,bufferRowLength
must be a multiple of the compressed texel block width -
VUID-VkCopyImageToBufferInfo2KHR-bufferImageHeight-00204
If {imageparam} is a blocked image, for each element ofpRegions
,bufferImageHeight
must be a multiple of the compressed texel block height -
VUID-VkCopyImageToBufferInfo2KHR-imageOffset-00205
If {imageparam} is a blocked image, for each element ofpRegions
, all members ofimageOffset
must be a multiple of the corresponding dimensions of the compressed texel block -
VUID-VkCopyImageToBufferInfo2KHR-bufferOffset-00206
If {imageparam} is a blocked image, for each element ofpRegions
,bufferOffset
must be a multiple of the compressed texel block size in bytes -
VUID-VkCopyImageToBufferInfo2KHR-imageExtent-00207
If {imageparam} is a blocked image, for each element ofpRegions
,imageExtent.width
must be a multiple of the compressed texel block width or (imageExtent.width
+imageOffset.x
) must equal the width of the specifiedimageSubresource
of {imageparam} -
VUID-VkCopyImageToBufferInfo2KHR-imageExtent-00208
If {imageparam} is a blocked image, for each element ofpRegions
,imageExtent.height
must be a multiple of the compressed texel block height or (imageExtent.height
+imageOffset.y
) must equal the height of the specifiedimageSubresource
of {imageparam} -
VUID-VkCopyImageToBufferInfo2KHR-imageExtent-00209
If {imageparam} is a blocked image, for each element ofpRegions
,imageExtent.depth
must be a multiple of the compressed texel block depth or (imageExtent.depth
+imageOffset.z
) must equal the depth of the specifiedimageSubresource
of {imageparam} -
VUID-VkCopyImageToBufferInfo2KHR-aspectMask-00211
For each element ofpRegions
,imageSubresource.aspectMask
must specify aspects present in {imageparam} -
VUID-VkCopyImageToBufferInfo2KHR-aspectMask-01560
If {imageparam} has a multi-planar format, then for each element ofpRegions
,imageSubresource.aspectMask
must beVK_IMAGE_ASPECT_PLANE_0_BIT
,VK_IMAGE_ASPECT_PLANE_1_BIT
, orVK_IMAGE_ASPECT_PLANE_2_BIT
(withVK_IMAGE_ASPECT_PLANE_2_BIT
valid only for image formats with three planes) -
VUID-VkCopyImageToBufferInfo2KHR-baseArrayLayer-00213
If {imageparam} is of typeVK_IMAGE_TYPE_3D
, for each element ofpRegions
,imageSubresource.baseArrayLayer
must be0
andimageSubresource.layerCount
must be1
-
VUID-VkCopyImageToBufferInfo2KHR-pRegions-04725
If {imageparam} is not a blocked image, for each element ofpRegions
,bufferRowLength
multiplied by the texel block size of {imageparam} must be less than or equal to 231-1 -
VUID-VkCopyImageToBufferInfo2KHR-pRegions-04726
If {imageparam} is a blocked image, for each element ofpRegions
,bufferRowLength
divided by the compressed texel block width and then multiplied by the texel block size of {imageparam} must be less than or equal to 231-1 -
VUID-VkCopyImageToBufferInfo2KHR-commandBuffer-04052
If the queue family used to create the VkCommandPool whichcommandBuffer
was allocated from does not supportVK_QUEUE_GRAPHICS_BIT
orVK_QUEUE_COMPUTE_BIT
, thebufferOffset
member of any element ofpRegions
must be a multiple of4
-
VUID-VkCopyImageToBufferInfo2KHR-srcImage-04053
If {imageparam} has a depth/stencil format, thebufferOffset
member of any element ofpRegions
must be a multiple of4
-
VUID-VkCopyImageToBufferInfo2KHR-sType-sType
sType
must beVK_STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2_KHR
-
VUID-VkCopyImageToBufferInfo2KHR-pNext-pNext
pNext
must beNULL
-
VUID-VkCopyImageToBufferInfo2KHR-srcImage-parameter
srcImage
must be a valid VkImage handle -
VUID-VkCopyImageToBufferInfo2KHR-srcImageLayout-parameter
srcImageLayout
must be a valid VkImageLayout value -
VUID-VkCopyImageToBufferInfo2KHR-dstBuffer-parameter
dstBuffer
must be a valid VkBuffer handle -
VUID-VkCopyImageToBufferInfo2KHR-pRegions-parameter
pRegions
must be a valid pointer to an array ofregionCount
valid VkBufferImageCopy2KHR structures -
VUID-VkCopyImageToBufferInfo2KHR-regionCount-arraylength
regionCount
must be greater than0
-
VUID-VkCopyImageToBufferInfo2KHR-commonparent
Both ofdstBuffer
, andsrcImage
must have been created, allocated, or retrieved from the same VkDevice
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.