1e5c31af7Sopenharmony_ci// Copyright 2015-2024 The Khronos Group Inc.
2e5c31af7Sopenharmony_ci//
3e5c31af7Sopenharmony_ci// SPDX-License-Identifier: CC-BY-4.0
4e5c31af7Sopenharmony_ci
5e5c31af7Sopenharmony_ci[[copies]]
6e5c31af7Sopenharmony_ci= Copy Commands
7e5c31af7Sopenharmony_ci
8e5c31af7Sopenharmony_ciAn application can: copy buffer and image data using several methods
9e5c31af7Sopenharmony_cidescribed in this chapter, depending on the type of data transfer.
10e5c31af7Sopenharmony_ci
11e5c31af7Sopenharmony_ciAll copy commands are treated as "`transfer`" operations for the purposes of
12e5c31af7Sopenharmony_cisynchronization barriers.
13e5c31af7Sopenharmony_ci
14e5c31af7Sopenharmony_ciAll copy commands that have a source format with an X component in its
15e5c31af7Sopenharmony_ciformat description read undefined: values from those bits.
16e5c31af7Sopenharmony_ci
17e5c31af7Sopenharmony_ciAll copy commands that have a destination format with an X component in its
18e5c31af7Sopenharmony_ciformat description write undefined: values to those bits.
19e5c31af7Sopenharmony_ci
20e5c31af7Sopenharmony_ci
21e5c31af7Sopenharmony_ci[[copies-buffers]]
22e5c31af7Sopenharmony_ci== Copying Data Between Buffers
23e5c31af7Sopenharmony_ci
24e5c31af7Sopenharmony_ci[open,refpage='vkCmdCopyBuffer',desc='Copy data between buffer regions',type='protos']
25e5c31af7Sopenharmony_ci--
26e5c31af7Sopenharmony_ci:refpage: vkCmdCopyBuffer
27e5c31af7Sopenharmony_ci
28e5c31af7Sopenharmony_ciTo copy data between buffer objects, call:
29e5c31af7Sopenharmony_ci
30e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdCopyBuffer.adoc[]
31e5c31af7Sopenharmony_ci
32e5c31af7Sopenharmony_ci  * pname:commandBuffer is the command buffer into which the command will be
33e5c31af7Sopenharmony_ci    recorded.
34e5c31af7Sopenharmony_ci  * pname:srcBuffer is the source buffer.
35e5c31af7Sopenharmony_ci  * pname:dstBuffer is the destination buffer.
36e5c31af7Sopenharmony_ci  * pname:regionCount is the number of regions to copy.
37e5c31af7Sopenharmony_ci  * pname:pRegions is a pointer to an array of slink:VkBufferCopy structures
38e5c31af7Sopenharmony_ci    specifying the regions to copy.
39e5c31af7Sopenharmony_ci
40e5c31af7Sopenharmony_ciEach source region specified by pname:pRegions is copied from the source
41e5c31af7Sopenharmony_cibuffer to the destination region of the destination buffer.
42e5c31af7Sopenharmony_ciIf any of the specified regions in pname:srcBuffer overlaps in memory with
43e5c31af7Sopenharmony_ciany of the specified regions in pname:dstBuffer, values read from those
44e5c31af7Sopenharmony_cioverlapping regions are undefined:.
45e5c31af7Sopenharmony_ci
46e5c31af7Sopenharmony_ci.Valid Usage
47e5c31af7Sopenharmony_ci****
48e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_buffer_command_buffer_common.adoc[]
49e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_buffer_common.adoc[]
50e5c31af7Sopenharmony_ci****
51e5c31af7Sopenharmony_ci
52e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdCopyBuffer.adoc[]
53e5c31af7Sopenharmony_ci--
54e5c31af7Sopenharmony_ci
55e5c31af7Sopenharmony_ci[open,refpage='VkBufferCopy',desc='Structure specifying a buffer copy operation',type='structs']
56e5c31af7Sopenharmony_ci--
57e5c31af7Sopenharmony_ci:refpage: VkBufferCopy
58e5c31af7Sopenharmony_ci
59e5c31af7Sopenharmony_ciThe sname:VkBufferCopy structure is defined as:
60e5c31af7Sopenharmony_ci
61e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBufferCopy.adoc[]
62e5c31af7Sopenharmony_ci
63e5c31af7Sopenharmony_ci  * pname:srcOffset is the starting offset in bytes from the start of
64e5c31af7Sopenharmony_ci    pname:srcBuffer.
65e5c31af7Sopenharmony_ci  * pname:dstOffset is the starting offset in bytes from the start of
66e5c31af7Sopenharmony_ci    pname:dstBuffer.
67e5c31af7Sopenharmony_ci  * pname:size is the number of bytes to copy.
68e5c31af7Sopenharmony_ci
69e5c31af7Sopenharmony_ci.Valid Usage
70e5c31af7Sopenharmony_ci****
71e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/buffer_copy_common.adoc[]
72e5c31af7Sopenharmony_ci****
73e5c31af7Sopenharmony_ci
74e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkBufferCopy.adoc[]
75e5c31af7Sopenharmony_ci--
76e5c31af7Sopenharmony_ci
77e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3,VK_KHR_copy_commands2[]
78e5c31af7Sopenharmony_ciA more extensible version of the copy buffer command is defined below.
79e5c31af7Sopenharmony_ci
80e5c31af7Sopenharmony_ci[open,refpage='vkCmdCopyBuffer2',desc='Copy data between buffer regions',type='protos',alias='vkCmdCopyBuffer2KHR']
81e5c31af7Sopenharmony_ci--
82e5c31af7Sopenharmony_ci:refpage: vkCmdCopyBuffer2
83e5c31af7Sopenharmony_ci
84e5c31af7Sopenharmony_ciTo copy data between buffer objects, call:
85e5c31af7Sopenharmony_ci
86e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3[]
87e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdCopyBuffer2.adoc[]
88e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3[]
89e5c31af7Sopenharmony_ci
90e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3+VK_KHR_copy_commands2[or the equivalent command]
91e5c31af7Sopenharmony_ci
92e5c31af7Sopenharmony_ciifdef::VK_KHR_copy_commands2[]
93e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdCopyBuffer2KHR.adoc[]
94e5c31af7Sopenharmony_ciendif::VK_KHR_copy_commands2[]
95e5c31af7Sopenharmony_ci
96e5c31af7Sopenharmony_ci  * pname:commandBuffer is the command buffer into which the command will be
97e5c31af7Sopenharmony_ci    recorded.
98e5c31af7Sopenharmony_ci  * pname:pCopyBufferInfo is a pointer to a slink:VkCopyBufferInfo2
99e5c31af7Sopenharmony_ci    structure describing the copy parameters.
100e5c31af7Sopenharmony_ci
101e5c31af7Sopenharmony_ciEach source region specified by pname:pCopyBufferInfo->pRegions is copied
102e5c31af7Sopenharmony_cifrom the source buffer to the destination region of the destination buffer.
103e5c31af7Sopenharmony_ciIf any of the specified regions in pname:pCopyBufferInfo->srcBuffer overlaps
104e5c31af7Sopenharmony_ciin memory with any of the specified regions in
105e5c31af7Sopenharmony_cipname:pCopyBufferInfo->dstBuffer, values read from those overlapping regions
106e5c31af7Sopenharmony_ciare undefined:.
107e5c31af7Sopenharmony_ci
108e5c31af7Sopenharmony_ci.Valid Usage
109e5c31af7Sopenharmony_ci****
110e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_buffer_command_buffer_common.adoc[]
111e5c31af7Sopenharmony_ci****
112e5c31af7Sopenharmony_ci
113e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdCopyBuffer2.adoc[]
114e5c31af7Sopenharmony_ci--
115e5c31af7Sopenharmony_ci
116e5c31af7Sopenharmony_ci[open,refpage='VkCopyBufferInfo2',desc='Structure specifying parameters of a buffer copy command',type='structs',alias='VkCopyBufferInfo2KHR']
117e5c31af7Sopenharmony_ci--
118e5c31af7Sopenharmony_ci:refpage: VkCopyBufferInfo2
119e5c31af7Sopenharmony_ci
120e5c31af7Sopenharmony_ciThe sname:VkCopyBufferInfo2 structure is defined as:
121e5c31af7Sopenharmony_ci
122e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkCopyBufferInfo2.adoc[]
123e5c31af7Sopenharmony_ci
124e5c31af7Sopenharmony_ciifdef::VK_KHR_copy_commands2[]
125e5c31af7Sopenharmony_cior the equivalent
126e5c31af7Sopenharmony_ci
127e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkCopyBufferInfo2KHR.adoc[]
128e5c31af7Sopenharmony_ciendif::VK_KHR_copy_commands2[]
129e5c31af7Sopenharmony_ci
130e5c31af7Sopenharmony_ci  * pname:sType is a elink:VkStructureType value identifying this structure.
131e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
132e5c31af7Sopenharmony_ci    structure.
133e5c31af7Sopenharmony_ci  * pname:srcBuffer is the source buffer.
134e5c31af7Sopenharmony_ci  * pname:dstBuffer is the destination buffer.
135e5c31af7Sopenharmony_ci  * pname:regionCount is the number of regions to copy.
136e5c31af7Sopenharmony_ci  * pname:pRegions is a pointer to an array of slink:VkBufferCopy2
137e5c31af7Sopenharmony_ci    structures specifying the regions to copy.
138e5c31af7Sopenharmony_ci
139e5c31af7Sopenharmony_ci.Valid Usage
140e5c31af7Sopenharmony_ci****
141e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_buffer_common.adoc[]
142e5c31af7Sopenharmony_ci****
143e5c31af7Sopenharmony_ci
144e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkCopyBufferInfo2.adoc[]
145e5c31af7Sopenharmony_ci--
146e5c31af7Sopenharmony_ci
147e5c31af7Sopenharmony_ci[open,refpage='VkBufferCopy2',desc='Structure specifying a buffer copy operation',type='structs',alias='VkBufferCopy2KHR']
148e5c31af7Sopenharmony_ci--
149e5c31af7Sopenharmony_ci:refpage: VkBufferCopy2
150e5c31af7Sopenharmony_ci
151e5c31af7Sopenharmony_ciThe sname:VkBufferCopy2 structure is defined as:
152e5c31af7Sopenharmony_ci
153e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBufferCopy2.adoc[]
154e5c31af7Sopenharmony_ci
155e5c31af7Sopenharmony_ciifdef::VK_KHR_copy_commands2[]
156e5c31af7Sopenharmony_cior the equivalent
157e5c31af7Sopenharmony_ci
158e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBufferCopy2KHR.adoc[]
159e5c31af7Sopenharmony_ciendif::VK_KHR_copy_commands2[]
160e5c31af7Sopenharmony_ci
161e5c31af7Sopenharmony_ci  * pname:sType is a elink:VkStructureType value identifying this structure.
162e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
163e5c31af7Sopenharmony_ci    structure.
164e5c31af7Sopenharmony_ci  * pname:srcOffset is the starting offset in bytes from the start of
165e5c31af7Sopenharmony_ci    pname:srcBuffer.
166e5c31af7Sopenharmony_ci  * pname:dstOffset is the starting offset in bytes from the start of
167e5c31af7Sopenharmony_ci    pname:dstBuffer.
168e5c31af7Sopenharmony_ci  * pname:size is the number of bytes to copy.
169e5c31af7Sopenharmony_ci
170e5c31af7Sopenharmony_ci.Valid Usage
171e5c31af7Sopenharmony_ci****
172e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/buffer_copy_common.adoc[]
173e5c31af7Sopenharmony_ci****
174e5c31af7Sopenharmony_ci
175e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkBufferCopy2.adoc[]
176e5c31af7Sopenharmony_ci--
177e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3,VK_KHR_copy_commands2[]
178e5c31af7Sopenharmony_ci
179e5c31af7Sopenharmony_ci
180e5c31af7Sopenharmony_ci[[copies-images]]
181e5c31af7Sopenharmony_ci== Copying Data Between Images
182e5c31af7Sopenharmony_ci
183e5c31af7Sopenharmony_ci[open,refpage='vkCmdCopyImage',desc='Copy data between images',type='protos']
184e5c31af7Sopenharmony_ci--
185e5c31af7Sopenharmony_ci:refpage: vkCmdCopyImage
186e5c31af7Sopenharmony_ci
187e5c31af7Sopenharmony_ciTo copy data between image objects, call:
188e5c31af7Sopenharmony_ci
189e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdCopyImage.adoc[]
190e5c31af7Sopenharmony_ci
191e5c31af7Sopenharmony_ci  * pname:commandBuffer is the command buffer into which the command will be
192e5c31af7Sopenharmony_ci    recorded.
193e5c31af7Sopenharmony_ci  * pname:srcImage is the source image.
194e5c31af7Sopenharmony_ci  * pname:srcImageLayout is the current layout of the source image
195e5c31af7Sopenharmony_ci    subresource.
196e5c31af7Sopenharmony_ci  * pname:dstImage is the destination image.
197e5c31af7Sopenharmony_ci  * pname:dstImageLayout is the current layout of the destination image
198e5c31af7Sopenharmony_ci    subresource.
199e5c31af7Sopenharmony_ci  * pname:regionCount is the number of regions to copy.
200e5c31af7Sopenharmony_ci  * pname:pRegions is a pointer to an array of slink:VkImageCopy structures
201e5c31af7Sopenharmony_ci    specifying the regions to copy.
202e5c31af7Sopenharmony_ci
203e5c31af7Sopenharmony_ciEach source region specified by pname:pRegions is copied from the source
204e5c31af7Sopenharmony_ciimage to the destination region of the destination image.
205e5c31af7Sopenharmony_ciIf any of the specified regions in pname:srcImage overlaps in memory with
206e5c31af7Sopenharmony_ciany of the specified regions in pname:dstImage, values read from those
207e5c31af7Sopenharmony_cioverlapping regions are undefined:.
208e5c31af7Sopenharmony_ci
209e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
210e5c31af7Sopenharmony_ci<<formats-requiring-sampler-ycbcr-conversion, Multi-planar images>> can:
211e5c31af7Sopenharmony_cionly be copied on a per-plane basis, and the subresources used in each
212e5c31af7Sopenharmony_ciregion when copying to or from such images must: specify only one plane,
213e5c31af7Sopenharmony_cithough different regions can: specify different planes.
214e5c31af7Sopenharmony_ciWhen copying planes of multi-planar images, the format considered is the
215e5c31af7Sopenharmony_ci<<formats-compatible-planes, compatible format for that plane>>, rather than
216e5c31af7Sopenharmony_cithe format of the multi-planar image.
217e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
218e5c31af7Sopenharmony_ci
219e5c31af7Sopenharmony_ciIf the format of the destination image has a different
220e5c31af7Sopenharmony_ci<<formats-compatibility-classes,block extent>> than the source image (e.g.
221e5c31af7Sopenharmony_cione is a compressed format), the offset and extent for each of the regions
222e5c31af7Sopenharmony_cispecified is <<formats-size-compatibility, scaled according to the block
223e5c31af7Sopenharmony_ciextents of each format>> to match in size.
224e5c31af7Sopenharmony_ciCopy regions for each image must: be aligned to a multiple of the texel
225e5c31af7Sopenharmony_ciblock extent in each dimension, except at the edges of the image, where
226e5c31af7Sopenharmony_ciregion extents must: match the edge of the image.
227e5c31af7Sopenharmony_ci
228e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
229e5c31af7Sopenharmony_ciImage data can: be copied between images with different image types.
230e5c31af7Sopenharmony_ciIf one image is ename:VK_IMAGE_TYPE_3D and the other image is
231e5c31af7Sopenharmony_ciename:VK_IMAGE_TYPE_2D with multiple layers, then each slice is copied to or
232e5c31af7Sopenharmony_cifrom a different layer; pname:depth slices in the 3D image correspond to
233e5c31af7Sopenharmony_cipname:layerCount layers in the 2D image, with an effective pname:depth of
234e5c31af7Sopenharmony_ci`1` used for the 2D image.
235e5c31af7Sopenharmony_ciifndef::VK_KHR_maintenance5[]
236e5c31af7Sopenharmony_ciOther combinations of image types are disallowed.
237e5c31af7Sopenharmony_ciendif::VK_KHR_maintenance5[]
238e5c31af7Sopenharmony_ciifdef::VK_KHR_maintenance5[]
239e5c31af7Sopenharmony_ciIf <<features-maintenance5,pname:maintenance5>> is enabled, all other
240e5c31af7Sopenharmony_cicombinations are allowed and function as if 1D images are 2D images with a
241e5c31af7Sopenharmony_ciheight of 1.
242e5c31af7Sopenharmony_ciOtherwise, other combinations of image types are disallowed.
243e5c31af7Sopenharmony_ciendif::VK_KHR_maintenance5[]
244e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance1[]
245e5c31af7Sopenharmony_ci
246e5c31af7Sopenharmony_ci.Valid Usage
247e5c31af7Sopenharmony_ci****
248e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_image_command_buffer_common.adoc[]
249e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_image_common.adoc[]
250e5c31af7Sopenharmony_ci
251e5c31af7Sopenharmony_ci:imageparam: srcImage
252e5c31af7Sopenharmony_ci:imagesubresource: srcSubresource
253e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_anyimage_to_imageany_common.adoc[]
254e5c31af7Sopenharmony_ci
255e5c31af7Sopenharmony_ci:imageparam: dstImage
256e5c31af7Sopenharmony_ci:imagesubresource: dstSubresource
257e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_anyimage_to_imageany_common.adoc[]
258e5c31af7Sopenharmony_ci****
259e5c31af7Sopenharmony_ci
260e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdCopyImage.adoc[]
261e5c31af7Sopenharmony_ci--
262e5c31af7Sopenharmony_ci
263e5c31af7Sopenharmony_ci[open,refpage='VkImageCopy',desc='Structure specifying an image copy operation',type='structs']
264e5c31af7Sopenharmony_ci--
265e5c31af7Sopenharmony_ci:refpage: VkImageCopy
266e5c31af7Sopenharmony_ci
267e5c31af7Sopenharmony_ciThe sname:VkImageCopy structure is defined as:
268e5c31af7Sopenharmony_ci
269e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImageCopy.adoc[]
270e5c31af7Sopenharmony_ci
271e5c31af7Sopenharmony_ci  * pname:srcSubresource and pname:dstSubresource are
272e5c31af7Sopenharmony_ci    slink:VkImageSubresourceLayers structures specifying the image
273e5c31af7Sopenharmony_ci    subresources of the images used for the source and destination image
274e5c31af7Sopenharmony_ci    data, respectively.
275e5c31af7Sopenharmony_ci  * pname:srcOffset and pname:dstOffset select the initial pname:x, pname:y,
276e5c31af7Sopenharmony_ci    and pname:z offsets in texels of the sub-regions of the source and
277e5c31af7Sopenharmony_ci    destination image data.
278e5c31af7Sopenharmony_ci  * pname:extent is the size in texels of the image to copy in pname:width,
279e5c31af7Sopenharmony_ci    pname:height and pname:depth.
280e5c31af7Sopenharmony_ci
281e5c31af7Sopenharmony_ci.Valid Usage
282e5c31af7Sopenharmony_ci****
283e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/image_copy_common.adoc[]
284e5c31af7Sopenharmony_ci****
285e5c31af7Sopenharmony_ci
286e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkImageCopy.adoc[]
287e5c31af7Sopenharmony_ci--
288e5c31af7Sopenharmony_ci
289e5c31af7Sopenharmony_ci[open,refpage='VkImageSubresourceLayers',desc='Structure specifying an image subresource layers',type='structs']
290e5c31af7Sopenharmony_ci--
291e5c31af7Sopenharmony_ciThe sname:VkImageSubresourceLayers structure is defined as:
292e5c31af7Sopenharmony_ci
293e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImageSubresourceLayers.adoc[]
294e5c31af7Sopenharmony_ci
295e5c31af7Sopenharmony_ci  * pname:aspectMask is a combination of elink:VkImageAspectFlagBits,
296e5c31af7Sopenharmony_ci    selecting the color, depth and/or stencil aspects to be copied.
297e5c31af7Sopenharmony_ci  * pname:mipLevel is the mipmap level to copy
298e5c31af7Sopenharmony_ci  * pname:baseArrayLayer and pname:layerCount are the starting layer and
299e5c31af7Sopenharmony_ci    number of layers to copy.
300e5c31af7Sopenharmony_ci
301e5c31af7Sopenharmony_ci.Valid Usage
302e5c31af7Sopenharmony_ci****
303e5c31af7Sopenharmony_ci  * [[VUID-VkImageSubresourceLayers-aspectMask-00167]]
304e5c31af7Sopenharmony_ci    If pname:aspectMask contains ename:VK_IMAGE_ASPECT_COLOR_BIT, it must:
305e5c31af7Sopenharmony_ci    not contain either of ename:VK_IMAGE_ASPECT_DEPTH_BIT or
306e5c31af7Sopenharmony_ci    ename:VK_IMAGE_ASPECT_STENCIL_BIT
307e5c31af7Sopenharmony_ci  * [[VUID-VkImageSubresourceLayers-aspectMask-00168]]
308e5c31af7Sopenharmony_ci    pname:aspectMask must: not contain ename:VK_IMAGE_ASPECT_METADATA_BIT
309e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[]
310e5c31af7Sopenharmony_ci  * [[VUID-VkImageSubresourceLayers-aspectMask-02247]]
311e5c31af7Sopenharmony_ci    pname:aspectMask must: not include
312e5c31af7Sopenharmony_ci    `VK_IMAGE_ASPECT_MEMORY_PLANE__{ibit}__BIT_EXT` for any index _i_
313e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
314e5c31af7Sopenharmony_ci  * [[VUID-VkImageSubresourceLayers-layerCount-09243]]
315e5c31af7Sopenharmony_ci    {empty}
316e5c31af7Sopenharmony_ciifdef::VK_KHR_maintenance5[]
317e5c31af7Sopenharmony_ci    If the <<features-maintenance5, pname:maintenance5>> feature is not
318e5c31af7Sopenharmony_ci    enabled,
319e5c31af7Sopenharmony_ciendif::VK_KHR_maintenance5[]
320e5c31af7Sopenharmony_ci    pname:layerCount must: not be ename:VK_REMAINING_ARRAY_LAYERS
321e5c31af7Sopenharmony_ci  * [[VUID-VkImageSubresourceLayers-layerCount-01700]]
322e5c31af7Sopenharmony_ci    If pname:layerCount is not ename:VK_REMAINING_ARRAY_LAYERS, it must: be
323e5c31af7Sopenharmony_ci    greater than 0
324e5c31af7Sopenharmony_ci****
325e5c31af7Sopenharmony_ci
326e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkImageSubresourceLayers.adoc[]
327e5c31af7Sopenharmony_ci--
328e5c31af7Sopenharmony_ci
329e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3,VK_KHR_copy_commands2[]
330e5c31af7Sopenharmony_ciA more extensible version of the copy image command is defined below.
331e5c31af7Sopenharmony_ci
332e5c31af7Sopenharmony_ci[open,refpage='vkCmdCopyImage2',desc='Copy data between images',type='protos',alias='vkCmdCopyImage2KHR']
333e5c31af7Sopenharmony_ci--
334e5c31af7Sopenharmony_ci:refpage: vkCmdCopyImage2
335e5c31af7Sopenharmony_ci
336e5c31af7Sopenharmony_ciTo copy data between image objects, call:
337e5c31af7Sopenharmony_ci
338e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3[]
339e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdCopyImage2.adoc[]
340e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3[]
341e5c31af7Sopenharmony_ci
342e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3+VK_KHR_copy_commands2[or the equivalent command]
343e5c31af7Sopenharmony_ci
344e5c31af7Sopenharmony_ciifdef::VK_KHR_copy_commands2[]
345e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdCopyImage2KHR.adoc[]
346e5c31af7Sopenharmony_ciendif::VK_KHR_copy_commands2[]
347e5c31af7Sopenharmony_ci
348e5c31af7Sopenharmony_ci  * pname:commandBuffer is the command buffer into which the command will be
349e5c31af7Sopenharmony_ci    recorded.
350e5c31af7Sopenharmony_ci  * pname:pCopyImageInfo is a pointer to a slink:VkCopyImageInfo2 structure
351e5c31af7Sopenharmony_ci    describing the copy parameters.
352e5c31af7Sopenharmony_ci
353e5c31af7Sopenharmony_ciThis command is functionally identical to flink:vkCmdCopyImage, but includes
354e5c31af7Sopenharmony_ciextensible sub-structures that include pname:sType and pname:pNext
355e5c31af7Sopenharmony_ciparameters, allowing them to be more easily extended.
356e5c31af7Sopenharmony_ci
357e5c31af7Sopenharmony_ci.Valid Usage
358e5c31af7Sopenharmony_ci****
359e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_image_command_buffer_common.adoc[]
360e5c31af7Sopenharmony_ci****
361e5c31af7Sopenharmony_ci
362e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdCopyImage2.adoc[]
363e5c31af7Sopenharmony_ci--
364e5c31af7Sopenharmony_ci
365e5c31af7Sopenharmony_ci
366e5c31af7Sopenharmony_ci[open,refpage='VkCopyImageInfo2',desc='Structure specifying parameters of an image copy command',type='structs',alias='VkCopyImageInfo2KHR']
367e5c31af7Sopenharmony_ci--
368e5c31af7Sopenharmony_ci:refpage: VkCopyImageInfo2
369e5c31af7Sopenharmony_ci
370e5c31af7Sopenharmony_ciThe sname:VkCopyImageInfo2 structure is defined as:
371e5c31af7Sopenharmony_ci
372e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkCopyImageInfo2.adoc[]
373e5c31af7Sopenharmony_ci
374e5c31af7Sopenharmony_ciifdef::VK_KHR_copy_commands2[]
375e5c31af7Sopenharmony_cior the equivalent
376e5c31af7Sopenharmony_ci
377e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkCopyImageInfo2KHR.adoc[]
378e5c31af7Sopenharmony_ciendif::VK_KHR_copy_commands2[]
379e5c31af7Sopenharmony_ci
380e5c31af7Sopenharmony_ci  * pname:sType is a elink:VkStructureType value identifying this structure.
381e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
382e5c31af7Sopenharmony_ci    structure.
383e5c31af7Sopenharmony_ci  * pname:srcImage is the source image.
384e5c31af7Sopenharmony_ci  * pname:srcImageLayout is the current layout of the source image
385e5c31af7Sopenharmony_ci    subresource.
386e5c31af7Sopenharmony_ci  * pname:dstImage is the destination image.
387e5c31af7Sopenharmony_ci  * pname:dstImageLayout is the current layout of the destination image
388e5c31af7Sopenharmony_ci    subresource.
389e5c31af7Sopenharmony_ci  * pname:regionCount is the number of regions to copy.
390e5c31af7Sopenharmony_ci  * pname:pRegions is a pointer to an array of slink:VkImageCopy2 structures
391e5c31af7Sopenharmony_ci    specifying the regions to copy.
392e5c31af7Sopenharmony_ci
393e5c31af7Sopenharmony_ci
394e5c31af7Sopenharmony_ci.Valid Usage
395e5c31af7Sopenharmony_ci****
396e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_image_common.adoc[]
397e5c31af7Sopenharmony_ci
398e5c31af7Sopenharmony_ci:imageparam: srcImage
399e5c31af7Sopenharmony_ci:imagesubresource: srcSubresource
400e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_anyimage_to_imageany_common.adoc[]
401e5c31af7Sopenharmony_ci
402e5c31af7Sopenharmony_ci:imageparam: dstImage
403e5c31af7Sopenharmony_ci:imagesubresource: dstSubresource
404e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_anyimage_to_imageany_common.adoc[]
405e5c31af7Sopenharmony_ci****
406e5c31af7Sopenharmony_ci
407e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkCopyImageInfo2.adoc[]
408e5c31af7Sopenharmony_ci--
409e5c31af7Sopenharmony_ci
410e5c31af7Sopenharmony_ci[open,refpage='VkImageCopy2',desc='Structure specifying an image copy operation',type='structs',alias='VkImageCopy2KHR']
411e5c31af7Sopenharmony_ci--
412e5c31af7Sopenharmony_ci:refpage: VkImageCopy2
413e5c31af7Sopenharmony_ci
414e5c31af7Sopenharmony_ciThe sname:VkImageCopy2 structure is defined as:
415e5c31af7Sopenharmony_ci
416e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImageCopy2.adoc[]
417e5c31af7Sopenharmony_ci
418e5c31af7Sopenharmony_ciifdef::VK_KHR_copy_commands2[]
419e5c31af7Sopenharmony_cior the equivalent
420e5c31af7Sopenharmony_ci
421e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImageCopy2KHR.adoc[]
422e5c31af7Sopenharmony_ciendif::VK_KHR_copy_commands2[]
423e5c31af7Sopenharmony_ci
424e5c31af7Sopenharmony_ci  * pname:sType is a elink:VkStructureType value identifying this structure.
425e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
426e5c31af7Sopenharmony_ci    structure.
427e5c31af7Sopenharmony_ci  * pname:srcSubresource and pname:dstSubresource are
428e5c31af7Sopenharmony_ci    slink:VkImageSubresourceLayers structures specifying the image
429e5c31af7Sopenharmony_ci    subresources of the images used for the source and destination image
430e5c31af7Sopenharmony_ci    data, respectively.
431e5c31af7Sopenharmony_ci  * pname:srcOffset and pname:dstOffset select the initial pname:x, pname:y,
432e5c31af7Sopenharmony_ci    and pname:z offsets in texels of the sub-regions of the source and
433e5c31af7Sopenharmony_ci    destination image data.
434e5c31af7Sopenharmony_ci  * pname:extent is the size in texels of the image to copy in pname:width,
435e5c31af7Sopenharmony_ci    pname:height and pname:depth.
436e5c31af7Sopenharmony_ci
437e5c31af7Sopenharmony_ci.Valid Usage
438e5c31af7Sopenharmony_ci****
439e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/image_copy_common.adoc[]
440e5c31af7Sopenharmony_ci****
441e5c31af7Sopenharmony_ci
442e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkImageCopy2.adoc[]
443e5c31af7Sopenharmony_ci--
444e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3,VK_KHR_copy_commands2[]
445e5c31af7Sopenharmony_ci
446e5c31af7Sopenharmony_ci
447e5c31af7Sopenharmony_ci[[copies-buffers-images]]
448e5c31af7Sopenharmony_ci== Copying Data Between Buffers and Images
449e5c31af7Sopenharmony_ci
450e5c31af7Sopenharmony_ciData can: be copied between buffers and images, enabling applications to
451e5c31af7Sopenharmony_ciload and store data between images and user defined offsets in buffer
452e5c31af7Sopenharmony_cimemory.
453e5c31af7Sopenharmony_ci
454e5c31af7Sopenharmony_ci[[copies-buffers-images-addressing]]
455e5c31af7Sopenharmony_ciWhen copying between a buffer and an image, whole texel blocks are always
456e5c31af7Sopenharmony_cicopied; each texel block in the specified extent in the image to be copied
457e5c31af7Sopenharmony_ciwill be written to a region in the buffer, specified according to the
458e5c31af7Sopenharmony_ciposition of the texel block, and the <<formats-compatibility-classes,texel
459e5c31af7Sopenharmony_ciblock extent>> and size of the format being copied.
460e5c31af7Sopenharmony_ci
461e5c31af7Sopenharmony_ciFor a set of coordinates [eq]#(x,y,z,layer)#, where:
462e5c31af7Sopenharmony_ci
463e5c31af7Sopenharmony_ci  {empty}:: [eq]#x# is in the range [eq]#[pname:imageOffset.x / blockWidth,
464e5c31af7Sopenharmony_ci            {lceil}(pname:imageOffset.x {plus} pname:imageExtent.width) /
465e5c31af7Sopenharmony_ci            blockWidth{rceil})#,
466e5c31af7Sopenharmony_ci  {empty}:: [eq]#y# is in the range [eq]#[pname:imageOffset.y / blockHeight,
467e5c31af7Sopenharmony_ci            {lceil}(pname:imageOffset.y {plus} pname:imageExtent.height) /
468e5c31af7Sopenharmony_ci            blockHeight{rceil})#,
469e5c31af7Sopenharmony_ci  {empty}:: [eq]#z# is in the range [eq]#[pname:imageOffset.z / blockDepth,
470e5c31af7Sopenharmony_ci            {lceil}(pname:imageOffset.z {plus} pname:imageExtent.depth) /
471e5c31af7Sopenharmony_ci            blockDepth{rceil})#,
472e5c31af7Sopenharmony_ci  {empty}:: [eq]#layer# is in the range
473e5c31af7Sopenharmony_ci            [pname:imageSubresource.baseArrayLayer,
474e5c31af7Sopenharmony_ci            pname:imageSubresource.baseArrayLayer {plus}
475e5c31af7Sopenharmony_ci            pname:imageSubresource.layerCount),
476e5c31af7Sopenharmony_ci
477e5c31af7Sopenharmony_ciand where [eq]#blockWidth#, [eq]#blockHeight#, and [eq]#blockDepth# are the
478e5c31af7Sopenharmony_cidimensions of the <<formats-compatibility-classes,texel block extent>> of
479e5c31af7Sopenharmony_cithe image's format.
480e5c31af7Sopenharmony_ci
481e5c31af7Sopenharmony_ciFor each [eq]#(x,y,z,layer)# coordinate, texels in the image layer selected
482e5c31af7Sopenharmony_ciby [eq]#layer# are accessed in the following ranges:
483e5c31af7Sopenharmony_ci
484e5c31af7Sopenharmony_ci  {empty}:: [eq]#[x {times} blockWidth, max( (x {times} blockWidth) {plus}
485e5c31af7Sopenharmony_ci            blockWidth, imageWidth) )#
486e5c31af7Sopenharmony_ci  {empty}:: [eq]#[y {times} blockHeight, max( (y {times} blockHeight) {plus}
487e5c31af7Sopenharmony_ci            blockHeight, imageHeight) )#
488e5c31af7Sopenharmony_ci  {empty}:: [eq]#[z {times} blockDepth, max( (z {times} blockDepth) {plus}
489e5c31af7Sopenharmony_ci            blockDepth, imageDepth) )#
490e5c31af7Sopenharmony_ci
491e5c31af7Sopenharmony_ciwhere [eq]#imageWidth#, [eq]#imageHeight#, and [eq]#imageDepth# are the
492e5c31af7Sopenharmony_cidimensions of the image subresource.
493e5c31af7Sopenharmony_ci
494e5c31af7Sopenharmony_ciFor each [eq]#(x,y,z,layer)# coordinate, bytes in the buffer are accessed at
495e5c31af7Sopenharmony_cioffsets in the range [eq]#[texelOffset, texelOffset {plus} blockSize)#,
496e5c31af7Sopenharmony_ciwhere:
497e5c31af7Sopenharmony_ci
498e5c31af7Sopenharmony_ci  {empty}:: [eq]#texelOffset = pname:bufferOffset {plus} (x {times}
499e5c31af7Sopenharmony_ci            blockSize) {plus} (y {times} rowExtent) {plus} (z {times}
500e5c31af7Sopenharmony_ci            sliceExtent) + (layer {times} layerExtent)#
501e5c31af7Sopenharmony_ci  {empty}:: [eq]#blockSize# is the size of the block in bytes for the format
502e5c31af7Sopenharmony_ci  {empty}:: [eq]#rowExtent = max(pname:bufferRowLength,
503e5c31af7Sopenharmony_ci            {lceil}pname:imageExtent.width / blockWidth{rceil} {times}
504e5c31af7Sopenharmony_ci            blockSize)#
505e5c31af7Sopenharmony_ci  {empty}:: [eq]#sliceExtent = max(pname:bufferImageHeight,
506e5c31af7Sopenharmony_ci            pname:imageExtent.height {times} rowExtent)#
507e5c31af7Sopenharmony_ci  {empty}:: [eq]#layerExtent = pname:imageExtent.depth {times} sliceExtent#
508e5c31af7Sopenharmony_ci
509e5c31af7Sopenharmony_ciifdef::VK_QCOM_rotated_copy_commands[]
510e5c31af7Sopenharmony_ci[[copies-buffers-images-rotation-addressing]]
511e5c31af7Sopenharmony_ciIf a rotation is specified by slink:VkCopyCommandTransformInfoQCOM, the 2D
512e5c31af7Sopenharmony_ciregion of the image being addressed is rotated around the offset, modifying
513e5c31af7Sopenharmony_cithe range of [eq]#x# and [eq]#y# coordinates for the image address according
514e5c31af7Sopenharmony_cito the specified elink:VkSurfaceTransformFlagBitsKHR:
515e5c31af7Sopenharmony_ci
516e5c31af7Sopenharmony_ci  * If ename:VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR is specified, no rotation
517e5c31af7Sopenharmony_ci    is performed:
518e5c31af7Sopenharmony_ci      {empty}:: [eq]#x'# is in the same range as [eq]#x#
519e5c31af7Sopenharmony_ci      {empty}:: [eq]#y'# is in the same range as [eq]#y#
520e5c31af7Sopenharmony_ci      {empty}:: [eq]#blockWidth' = blockWidth#
521e5c31af7Sopenharmony_ci      {empty}:: [eq]#blockHeight' = blockHeight#
522e5c31af7Sopenharmony_ci      {empty}:: [eq]#imageWidth' = imageWidth#
523e5c31af7Sopenharmony_ci      {empty}:: [eq]#imageHeight' = imageHeight#
524e5c31af7Sopenharmony_ci  * If ename:VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR is specified
525e5c31af7Sopenharmony_ci      {empty}:: [eq]#x'# is in the range [eq]#[{lceil}(pname:imageOffset.x
526e5c31af7Sopenharmony_ci                {minus} pname:imageExtent.height) / blockHeight{rceil},
527e5c31af7Sopenharmony_ci                pname:imageOffset.x {minus} image/ blockHeight)#
528e5c31af7Sopenharmony_ci      {empty}:: [eq]#y'# is in the range [eq]#[pname:imageOffset.y /
529e5c31af7Sopenharmony_ci                blockWidth, {lceil}(pname:imageOffset.y {plus}
530e5c31af7Sopenharmony_ci                pname:imageExtent.width) / blockWidth{rceil})#
531e5c31af7Sopenharmony_ci      {empty}:: [eq]#blockWidth' = blockHeight#
532e5c31af7Sopenharmony_ci      {empty}:: [eq]#blockHeight' = blockWidth#
533e5c31af7Sopenharmony_ci      {empty}:: [eq]#imageWidth' = imageHeight#
534e5c31af7Sopenharmony_ci      {empty}:: [eq]#imageHeight' = imageWidth#
535e5c31af7Sopenharmony_ci  * If ename:VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR is specified:
536e5c31af7Sopenharmony_ci      {empty}:: [eq]#x'# is in the range [eq]#[{lceil}(pname:imageOffset.x
537e5c31af7Sopenharmony_ci                {minus} pname:imageExtent.width) / blockWidth{rceil},
538e5c31af7Sopenharmony_ci                pname:imageOffset.x / blockWidth)#,
539e5c31af7Sopenharmony_ci      {empty}:: [eq]#y'# is in the range [eq]#[{lceil}(pname:imageOffset.x
540e5c31af7Sopenharmony_ci                {plus} pname:imageExtent.height) / blockHeight{rceil},
541e5c31af7Sopenharmony_ci                pname:imageOffset.x / blockHeight)#,
542e5c31af7Sopenharmony_ci      {empty}:: [eq]#blockWidth' = blockWidth#
543e5c31af7Sopenharmony_ci      {empty}:: [eq]#blockHeight' = blockHeight#
544e5c31af7Sopenharmony_ci      {empty}:: [eq]#imageWidth' = imageWidth#
545e5c31af7Sopenharmony_ci      {empty}:: [eq]#imageHeight' = imageHeight#
546e5c31af7Sopenharmony_ci  * If ename:VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR is specified:
547e5c31af7Sopenharmony_ci      {empty}:: [eq]#x# is in the range [eq]#[pname:imageOffset.x /
548e5c31af7Sopenharmony_ci                blockHeight, {lceil}(pname:imageOffset.x {plus}
549e5c31af7Sopenharmony_ci                pname:imageExtent.height) / blockHeight{rceil})#
550e5c31af7Sopenharmony_ci      {empty}:: [eq]#y# is in the range [eq]#[{lceil}(pname:imageOffset.y
551e5c31af7Sopenharmony_ci                {minus} pname:imageExtent.width) / blockWidth{rceil},
552e5c31af7Sopenharmony_ci                pname:imageOffset.y / blockWidth)#.
553e5c31af7Sopenharmony_ci      {empty}:: [eq]#blockWidth' = blockHeight#
554e5c31af7Sopenharmony_ci      {empty}:: [eq]#blockHeight' = blockWidth#
555e5c31af7Sopenharmony_ci      {empty}:: [eq]#imageWidth' = imageHeight#
556e5c31af7Sopenharmony_ci      {empty}:: [eq]#imageHeight' = imageWidth#
557e5c31af7Sopenharmony_ci
558e5c31af7Sopenharmony_ciWhen rotation is performed, for each [eq]#(x,y,z,layer)# coordinate, texels
559e5c31af7Sopenharmony_ciin the image layer selected by [eq]#layer# are instead accessed in the
560e5c31af7Sopenharmony_cifollowing ranges:
561e5c31af7Sopenharmony_ci
562e5c31af7Sopenharmony_ci  {empty}:: [eq]#[x' {times} blockWidth', max( (x' {times} blockWidth')
563e5c31af7Sopenharmony_ci            {plus} blockWidth', imageWidth') )#
564e5c31af7Sopenharmony_ci  {empty}:: [eq]#[y' {times} blockHeight', max( (y' {times} blockHeight')
565e5c31af7Sopenharmony_ci            {plus} blockHeight', imageHeight') )#
566e5c31af7Sopenharmony_ci  {empty}:: [eq]#[z' {times} blockDepth', max( (z' {times} blockDepth')
567e5c31af7Sopenharmony_ci            {plus} blockDepth', imageDepth') )#
568e5c31af7Sopenharmony_ci
569e5c31af7Sopenharmony_ciBuffer addressing calculations are unaffected by this rotation.
570e5c31af7Sopenharmony_ciendif::VK_QCOM_rotated_copy_commands[]
571e5c31af7Sopenharmony_ci
572e5c31af7Sopenharmony_ci[[copies-buffers-images-depth-stencil]]
573e5c31af7Sopenharmony_ciWhen copying between a buffer and the depth or stencil aspect of an image,
574e5c31af7Sopenharmony_cidata in the buffer is assumed to be laid out as separate planes rather than
575e5c31af7Sopenharmony_ciinterleaved.
576e5c31af7Sopenharmony_ciAddressing calculations are thus performed for a different format than the
577e5c31af7Sopenharmony_cibase image, according to the aspect, as described in the following table:
578e5c31af7Sopenharmony_ci
579e5c31af7Sopenharmony_ci.Depth/Stencil Aspect Copy Table
580e5c31af7Sopenharmony_ci[width="95%",cols="1,1,1",options="header"]
581e5c31af7Sopenharmony_ci|====
582e5c31af7Sopenharmony_ci^| Base Format ^| Depth Aspect Format ^| Stencil Aspect Format
583e5c31af7Sopenharmony_ci^| ename:VK_FORMAT_D16_UNORM
584e5c31af7Sopenharmony_ci^| ename:VK_FORMAT_D16_UNORM
585e5c31af7Sopenharmony_ci^| -
586e5c31af7Sopenharmony_ci^| ename:VK_FORMAT_X8_D24_UNORM_PACK32
587e5c31af7Sopenharmony_ci^| ename:VK_FORMAT_X8_D24_UNORM_PACK32
588e5c31af7Sopenharmony_ci^| -
589e5c31af7Sopenharmony_ci^| ename:VK_FORMAT_D32_SFLOAT
590e5c31af7Sopenharmony_ci^| ename:VK_FORMAT_D32_SFLOAT
591e5c31af7Sopenharmony_ci^| -
592e5c31af7Sopenharmony_ci^| ename:VK_FORMAT_S8_UINT
593e5c31af7Sopenharmony_ci^| -
594e5c31af7Sopenharmony_ci^| ename:VK_FORMAT_S8_UINT
595e5c31af7Sopenharmony_ci^| ename:VK_FORMAT_D16_UNORM_S8_UINT
596e5c31af7Sopenharmony_ci^| ename:VK_FORMAT_D16_UNORM
597e5c31af7Sopenharmony_ci^| ename:VK_FORMAT_S8_UINT
598e5c31af7Sopenharmony_ci^| ename:VK_FORMAT_D24_UNORM_S8_UINT
599e5c31af7Sopenharmony_ci^| ename:VK_FORMAT_X8_D24_UNORM_PACK32
600e5c31af7Sopenharmony_ci^| ename:VK_FORMAT_S8_UINT
601e5c31af7Sopenharmony_ci^| ename:VK_FORMAT_D32_SFLOAT_S8_UINT
602e5c31af7Sopenharmony_ci^| ename:VK_FORMAT_D32_SFLOAT
603e5c31af7Sopenharmony_ci^| ename:VK_FORMAT_S8_UINT
604e5c31af7Sopenharmony_ci|====
605e5c31af7Sopenharmony_ci
606e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
607e5c31af7Sopenharmony_ci[[copies-buffers-images-multi-planar]]
608e5c31af7Sopenharmony_ciWhen copying between a buffer and any plane of a
609e5c31af7Sopenharmony_ci<<formats-requiring-sampler-ycbcr-conversion, multi-planar image>>,
610e5c31af7Sopenharmony_ciaddressing calculations are performed using the <<formats-compatible-planes,
611e5c31af7Sopenharmony_cicompatible format for that plane>>, rather than the format of the
612e5c31af7Sopenharmony_cimulti-planar image.
613e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
614e5c31af7Sopenharmony_ci
615e5c31af7Sopenharmony_ciEach texel block is copied from one resource to the other according to the
616e5c31af7Sopenharmony_ciabove addressing equations.
617e5c31af7Sopenharmony_ci
618e5c31af7Sopenharmony_ci
619e5c31af7Sopenharmony_ci[open,refpage='vkCmdCopyBufferToImage',desc='Copy data from a buffer into an image',type='protos']
620e5c31af7Sopenharmony_ci--
621e5c31af7Sopenharmony_ci:refpage: vkCmdCopyBufferToImage
622e5c31af7Sopenharmony_ci
623e5c31af7Sopenharmony_ciTo copy data from a buffer object to an image object, call:
624e5c31af7Sopenharmony_ci
625e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdCopyBufferToImage.adoc[]
626e5c31af7Sopenharmony_ci
627e5c31af7Sopenharmony_ci  * pname:commandBuffer is the command buffer into which the command will be
628e5c31af7Sopenharmony_ci    recorded.
629e5c31af7Sopenharmony_ci  * pname:srcBuffer is the source buffer.
630e5c31af7Sopenharmony_ci  * pname:dstImage is the destination image.
631e5c31af7Sopenharmony_ci  * pname:dstImageLayout is the layout of the destination image subresources
632e5c31af7Sopenharmony_ci    for the copy.
633e5c31af7Sopenharmony_ci  * pname:regionCount is the number of regions to copy.
634e5c31af7Sopenharmony_ci  * pname:pRegions is a pointer to an array of slink:VkBufferImageCopy
635e5c31af7Sopenharmony_ci    structures specifying the regions to copy.
636e5c31af7Sopenharmony_ci
637e5c31af7Sopenharmony_ciEach source region specified by pname:pRegions is copied from the source
638e5c31af7Sopenharmony_cibuffer to the destination region of the destination image according to the
639e5c31af7Sopenharmony_ci<<copies-buffers-images-addressing,addressing calculations>> for each
640e5c31af7Sopenharmony_ciresource.
641e5c31af7Sopenharmony_ciIf any of the specified regions in pname:srcBuffer overlaps in memory with
642e5c31af7Sopenharmony_ciany of the specified regions in pname:dstImage, values read from those
643e5c31af7Sopenharmony_cioverlapping regions are undefined:.
644e5c31af7Sopenharmony_ciIf any region accesses a depth aspect in pname:dstImage
645e5c31af7Sopenharmony_ciifdef::VK_EXT_depth_range_unrestricted[]
646e5c31af7Sopenharmony_ciand the `apiext:VK_EXT_depth_range_unrestricted` extension is not enabled,
647e5c31af7Sopenharmony_ciendif::VK_EXT_depth_range_unrestricted[]
648e5c31af7Sopenharmony_civalues copied from pname:srcBuffer outside of the range [eq]#[0,1]# will be
649e5c31af7Sopenharmony_cibe written as undefined: values to the destination image.
650e5c31af7Sopenharmony_ci
651e5c31af7Sopenharmony_ciCopy regions for the image must: be aligned to a multiple of the texel block
652e5c31af7Sopenharmony_ciextent in each dimension, except at the edges of the image, where region
653e5c31af7Sopenharmony_ciextents must: match the edge of the image.
654e5c31af7Sopenharmony_ci
655e5c31af7Sopenharmony_ci:imageparam: dstImage
656e5c31af7Sopenharmony_ci:imagesubresource: imageSubresource
657e5c31af7Sopenharmony_ci:imageoffset: imageOffset
658e5c31af7Sopenharmony_ci:imageextent: imageExtent
659e5c31af7Sopenharmony_ci:bufferrowlength: bufferRowLength
660e5c31af7Sopenharmony_ci:bufferimageheight: bufferImageHeight
661e5c31af7Sopenharmony_ci:regionsparam: pname:pRegions
662e5c31af7Sopenharmony_ci
663e5c31af7Sopenharmony_ci.Valid Usage
664e5c31af7Sopenharmony_ci****
665e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_anyimage_to_imageany_common.adoc[]
666e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_anyimage_to_imageany_no_rotation_common.adoc[]
667e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_anyimage_to_imageany_single_sampled_common.adoc[]
668e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_buffer_to_image_command_buffer_common.adoc[]
669e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_buffer_to_image_common.adoc[]
670e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_bufferimage_to_imagebuffer_common.adoc[]
671e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_bufferimage_to_imagebuffer_not_both_image_common.adoc[]
672e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_bufferimage_to_imagebuffer_buffer_alignment_common.adoc[]
673e5c31af7Sopenharmony_ci****
674e5c31af7Sopenharmony_ci
675e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdCopyBufferToImage.adoc[]
676e5c31af7Sopenharmony_ci--
677e5c31af7Sopenharmony_ci
678e5c31af7Sopenharmony_ci[open,refpage='vkCmdCopyImageToBuffer',desc='Copy image data into a buffer',type='protos']
679e5c31af7Sopenharmony_ci--
680e5c31af7Sopenharmony_ci:refpage: vkCmdCopyImageToBuffer
681e5c31af7Sopenharmony_ci
682e5c31af7Sopenharmony_ciTo copy data from an image object to a buffer object, call:
683e5c31af7Sopenharmony_ci
684e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdCopyImageToBuffer.adoc[]
685e5c31af7Sopenharmony_ci
686e5c31af7Sopenharmony_ci  * pname:commandBuffer is the command buffer into which the command will be
687e5c31af7Sopenharmony_ci    recorded.
688e5c31af7Sopenharmony_ci  * pname:srcImage is the source image.
689e5c31af7Sopenharmony_ci  * pname:srcImageLayout is the layout of the source image subresources for
690e5c31af7Sopenharmony_ci    the copy.
691e5c31af7Sopenharmony_ci  * pname:dstBuffer is the destination buffer.
692e5c31af7Sopenharmony_ci  * pname:regionCount is the number of regions to copy.
693e5c31af7Sopenharmony_ci  * pname:pRegions is a pointer to an array of slink:VkBufferImageCopy
694e5c31af7Sopenharmony_ci    structures specifying the regions to copy.
695e5c31af7Sopenharmony_ci
696e5c31af7Sopenharmony_ciEach source region specified by pname:pRegions is copied from the source
697e5c31af7Sopenharmony_ciimage to the destination region of the destination buffer according to the
698e5c31af7Sopenharmony_ci<<copies-buffers-images-addressing,addressing calculations>> for each
699e5c31af7Sopenharmony_ciresource.
700e5c31af7Sopenharmony_ciIf any of the specified regions in pname:srcImage overlaps in memory with
701e5c31af7Sopenharmony_ciany of the specified regions in pname:dstBuffer, values read from those
702e5c31af7Sopenharmony_cioverlapping regions are undefined:.
703e5c31af7Sopenharmony_ci
704e5c31af7Sopenharmony_ciCopy regions for the image must: be aligned to a multiple of the texel block
705e5c31af7Sopenharmony_ciextent in each dimension, except at the edges of the image, where region
706e5c31af7Sopenharmony_ciextents must: match the edge of the image.
707e5c31af7Sopenharmony_ci
708e5c31af7Sopenharmony_ci:imageparam: srcImage
709e5c31af7Sopenharmony_ci:imagesubresource: imageSubresource
710e5c31af7Sopenharmony_ci:imageoffset: imageOffset
711e5c31af7Sopenharmony_ci:imageextent: imageExtent
712e5c31af7Sopenharmony_ci:bufferrowlength: bufferRowLength
713e5c31af7Sopenharmony_ci:bufferimageheight: bufferImageHeight
714e5c31af7Sopenharmony_ci:regionsparam: pname:pRegions
715e5c31af7Sopenharmony_ci
716e5c31af7Sopenharmony_ci.Valid Usage
717e5c31af7Sopenharmony_ci****
718e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_anyimage_to_imageany_common.adoc[]
719e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_anyimage_to_imageany_no_rotation_common.adoc[]
720e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_anyimage_to_imageany_single_sampled_common.adoc[]
721e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_image_to_buffer_command_buffer_common.adoc[]
722e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_image_to_buffer_common.adoc[]
723e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_bufferimage_to_imagebuffer_common.adoc[]
724e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_bufferimage_to_imagebuffer_not_both_image_common.adoc[]
725e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_bufferimage_to_imagebuffer_buffer_alignment_common.adoc[]
726e5c31af7Sopenharmony_ci****
727e5c31af7Sopenharmony_ci
728e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdCopyImageToBuffer.adoc[]
729e5c31af7Sopenharmony_ci--
730e5c31af7Sopenharmony_ci
731e5c31af7Sopenharmony_ci[open,refpage='VkBufferImageCopy',desc='Structure specifying a buffer image copy operation',type='structs']
732e5c31af7Sopenharmony_ci--
733e5c31af7Sopenharmony_ci:refpage: VkBufferImageCopy
734e5c31af7Sopenharmony_ci
735e5c31af7Sopenharmony_ciFor both flink:vkCmdCopyBufferToImage and flink:vkCmdCopyImageToBuffer, each
736e5c31af7Sopenharmony_cielement of pname:pRegions is a structure defined as:
737e5c31af7Sopenharmony_ci
738e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBufferImageCopy.adoc[]
739e5c31af7Sopenharmony_ci
740e5c31af7Sopenharmony_ci  * pname:bufferOffset is the offset in bytes from the start of the buffer
741e5c31af7Sopenharmony_ci    object where the image data is copied from or to.
742e5c31af7Sopenharmony_ci  * pname:bufferRowLength and pname:bufferImageHeight specify in texels a
743e5c31af7Sopenharmony_ci    subregion of a larger two- or three-dimensional image in buffer memory,
744e5c31af7Sopenharmony_ci    and control the addressing calculations.
745e5c31af7Sopenharmony_ci    If either of these values is zero, that aspect of the buffer memory is
746e5c31af7Sopenharmony_ci    considered to be tightly packed according to the pname:imageExtent.
747e5c31af7Sopenharmony_ci  * pname:imageSubresource is a slink:VkImageSubresourceLayers used to
748e5c31af7Sopenharmony_ci    specify the specific image subresources of the image used for the source
749e5c31af7Sopenharmony_ci    or destination image data.
750e5c31af7Sopenharmony_ci  * pname:imageOffset selects the initial pname:x, pname:y, pname:z offsets
751e5c31af7Sopenharmony_ci    in texels of the sub-region of the source or destination image data.
752e5c31af7Sopenharmony_ci  * pname:imageExtent is the size in texels of the image to copy in
753e5c31af7Sopenharmony_ci    pname:width, pname:height and pname:depth.
754e5c31af7Sopenharmony_ci
755e5c31af7Sopenharmony_ci:bufferrowlength: bufferRowLength
756e5c31af7Sopenharmony_ci:bufferimageheight: bufferImageHeight
757e5c31af7Sopenharmony_ci
758e5c31af7Sopenharmony_ci.Valid Usage
759e5c31af7Sopenharmony_ci****
760e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/buffer_or_memory_image_copy_common.adoc[]
761e5c31af7Sopenharmony_ci****
762e5c31af7Sopenharmony_ci
763e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkBufferImageCopy.adoc[]
764e5c31af7Sopenharmony_ci--
765e5c31af7Sopenharmony_ci
766e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3,VK_KHR_copy_commands2[]
767e5c31af7Sopenharmony_ciMore extensible versions of the commands to copy between buffers and images
768e5c31af7Sopenharmony_ciare defined below.
769e5c31af7Sopenharmony_ci
770e5c31af7Sopenharmony_ci[open,refpage='vkCmdCopyBufferToImage2',desc='Copy data from a buffer into an image',type='protos',alias='vkCmdCopyBufferToImage2KHR']
771e5c31af7Sopenharmony_ci--
772e5c31af7Sopenharmony_ci:refpage: vkCmdCopyBufferToImage2
773e5c31af7Sopenharmony_ci
774e5c31af7Sopenharmony_ciTo copy data from a buffer object to an image object, call:
775e5c31af7Sopenharmony_ci
776e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3[]
777e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdCopyBufferToImage2.adoc[]
778e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3[]
779e5c31af7Sopenharmony_ci
780e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3+VK_KHR_copy_commands2[or the equivalent command]
781e5c31af7Sopenharmony_ci
782e5c31af7Sopenharmony_ciifdef::VK_KHR_copy_commands2[]
783e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdCopyBufferToImage2KHR.adoc[]
784e5c31af7Sopenharmony_ciendif::VK_KHR_copy_commands2[]
785e5c31af7Sopenharmony_ci
786e5c31af7Sopenharmony_ci  * pname:commandBuffer is the command buffer into which the command will be
787e5c31af7Sopenharmony_ci    recorded.
788e5c31af7Sopenharmony_ci  * pname:pCopyBufferToImageInfo is a pointer to a
789e5c31af7Sopenharmony_ci    slink:VkCopyBufferToImageInfo2 structure describing the copy parameters.
790e5c31af7Sopenharmony_ci
791e5c31af7Sopenharmony_ciThis command is functionally identical to flink:vkCmdCopyBufferToImage, but
792e5c31af7Sopenharmony_ciincludes extensible sub-structures that include pname:sType and pname:pNext
793e5c31af7Sopenharmony_ciparameters, allowing them to be more easily extended.
794e5c31af7Sopenharmony_ci
795e5c31af7Sopenharmony_ci:regionsparam: pname:pCopyBufferToImageInfo->pRegions
796e5c31af7Sopenharmony_ci
797e5c31af7Sopenharmony_ci.Valid Usage
798e5c31af7Sopenharmony_ci****
799e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_buffer_to_image_command_buffer_common.adoc[]
800e5c31af7Sopenharmony_ci****
801e5c31af7Sopenharmony_ci
802e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdCopyBufferToImage2.adoc[]
803e5c31af7Sopenharmony_ci--
804e5c31af7Sopenharmony_ci
805e5c31af7Sopenharmony_ci[open,refpage='VkCopyBufferToImageInfo2',desc='Structure specifying parameters of a buffer to image copy command',type='structs',alias='VkCopyBufferToImageInfo2KHR']
806e5c31af7Sopenharmony_ci--
807e5c31af7Sopenharmony_ci:refpage: VkCopyBufferToImageInfo2
808e5c31af7Sopenharmony_ci
809e5c31af7Sopenharmony_ciThe sname:VkCopyBufferToImageInfo2 structure is defined as:
810e5c31af7Sopenharmony_ci
811e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkCopyBufferToImageInfo2.adoc[]
812e5c31af7Sopenharmony_ci
813e5c31af7Sopenharmony_ciifdef::VK_KHR_copy_commands2[]
814e5c31af7Sopenharmony_cior the equivalent
815e5c31af7Sopenharmony_ci
816e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkCopyBufferToImageInfo2KHR.adoc[]
817e5c31af7Sopenharmony_ciendif::VK_KHR_copy_commands2[]
818e5c31af7Sopenharmony_ci
819e5c31af7Sopenharmony_ci  * pname:sType is a elink:VkStructureType value identifying this structure.
820e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
821e5c31af7Sopenharmony_ci    structure.
822e5c31af7Sopenharmony_ci  * pname:srcBuffer is the source buffer.
823e5c31af7Sopenharmony_ci  * pname:dstImage is the destination image.
824e5c31af7Sopenharmony_ci  * pname:dstImageLayout is the layout of the destination image subresources
825e5c31af7Sopenharmony_ci    for the copy.
826e5c31af7Sopenharmony_ci  * pname:regionCount is the number of regions to copy.
827e5c31af7Sopenharmony_ci  * pname:pRegions is a pointer to an array of slink:VkBufferImageCopy2
828e5c31af7Sopenharmony_ci    structures specifying the regions to copy.
829e5c31af7Sopenharmony_ci
830e5c31af7Sopenharmony_ci:imageparam: dstImage
831e5c31af7Sopenharmony_ci:imagesubresource: imageSubresource
832e5c31af7Sopenharmony_ci:imageoffset: imageOffset
833e5c31af7Sopenharmony_ci:imageextent: imageExtent
834e5c31af7Sopenharmony_ci:bufferrowlength: bufferRowLength
835e5c31af7Sopenharmony_ci:bufferimageheight: bufferImageHeight
836e5c31af7Sopenharmony_ci:regionsparam: pname:pRegions
837e5c31af7Sopenharmony_ci
838e5c31af7Sopenharmony_ci.Valid Usage
839e5c31af7Sopenharmony_ci****
840e5c31af7Sopenharmony_ci  * [[VUID-VkCopyBufferToImageInfo2-pRegions-04565]]
841e5c31af7Sopenharmony_ci    The image region specified by each element of pname:pRegions
842e5c31af7Sopenharmony_ciifdef::VK_QCOM_rotated_copy_commands[]
843e5c31af7Sopenharmony_ci    that does not contain slink:VkCopyCommandTransformInfoQCOM in its
844e5c31af7Sopenharmony_ci    pname:pNext chain
845e5c31af7Sopenharmony_ciendif::VK_QCOM_rotated_copy_commands[]
846e5c31af7Sopenharmony_ci    must: be contained within the specified pname:imageSubresource of
847e5c31af7Sopenharmony_ci    pname:dstImage
848e5c31af7Sopenharmony_ciifdef::VK_QCOM_rotated_copy_commands[]
849e5c31af7Sopenharmony_ci  * [[VUID-VkCopyBufferToImageInfo2KHR-pRegions-04554]]
850e5c31af7Sopenharmony_ci    If the image region specified by each element of pname:pRegions contains
851e5c31af7Sopenharmony_ci    slink:VkCopyCommandTransformInfoQCOM in its pname:pNext chain, the
852e5c31af7Sopenharmony_ci    rotated destination region as described in
853e5c31af7Sopenharmony_ci    <<copies-buffers-images-rotation-addressing>> must: be contained within
854e5c31af7Sopenharmony_ci    pname:dstImage
855e5c31af7Sopenharmony_ci  * [[VUID-VkCopyBufferToImageInfo2KHR-pRegions-04555]]
856e5c31af7Sopenharmony_ci    If any element of pname:pRegions contains
857e5c31af7Sopenharmony_ci    slink:VkCopyCommandTransformInfoQCOM in its pname:pNext chain, then
858e5c31af7Sopenharmony_ci    pname:dstImage must: have a 1x1x1 <<formats-compatibility-classes,texel
859e5c31af7Sopenharmony_ci    block extent>>
860e5c31af7Sopenharmony_ci  * [[VUID-VkCopyBufferToImageInfo2KHR-pRegions-06203]]
861e5c31af7Sopenharmony_ci    If any element of pname:pRegions contains
862e5c31af7Sopenharmony_ci    slink:VkCopyCommandTransformInfoQCOM in its pname:pNext chain, then
863e5c31af7Sopenharmony_ci    pname:dstImage must: be of type ename:VK_IMAGE_TYPE_2D
864e5c31af7Sopenharmony_ci  * [[VUID-VkCopyBufferToImageInfo2KHR-pRegions-06204]]
865e5c31af7Sopenharmony_ci    If any element of pname:pRegions contains
866e5c31af7Sopenharmony_ci    slink:VkCopyCommandTransformInfoQCOM in its pname:pNext chain, then
867e5c31af7Sopenharmony_ci    pname:dstImage must: not have a
868e5c31af7Sopenharmony_ci    <<formats-requiring-sampler-ycbcr-conversion, multi-planar format>>
869e5c31af7Sopenharmony_ciendif::VK_QCOM_rotated_copy_commands[]
870e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_buffer_to_image_common.adoc[]
871e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_anyimage_to_imageany_common.adoc[]
872e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_anyimage_to_imageany_single_sampled_common.adoc[]
873e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_bufferimage_to_imagebuffer_common.adoc[]
874e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_bufferimage_to_imagebuffer_not_both_image_common.adoc[]
875e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_bufferimage_to_imagebuffer_buffer_alignment_common.adoc[]
876e5c31af7Sopenharmony_ci  * [[VUID-VkCopyBufferToImageInfo2-pRegions-06223]]
877e5c31af7Sopenharmony_ci    For each element of pname:pRegions not containing
878e5c31af7Sopenharmony_ci    sname:VkCopyCommandTransformInfoQCOM in its pname:pNext chain,
879e5c31af7Sopenharmony_ci    pname:imageOffset.x and [eq]#(pname:imageExtent.width {plus}
880e5c31af7Sopenharmony_ci    pname:imageOffset.x)# must: both be greater than or equal to `0` and
881e5c31af7Sopenharmony_ci    less than or equal to the width of the specified pname:imageSubresource
882e5c31af7Sopenharmony_ci    of pname:dstImage
883e5c31af7Sopenharmony_ci  * [[VUID-VkCopyBufferToImageInfo2-pRegions-06224]]
884e5c31af7Sopenharmony_ci    For each element of pname:pRegions not containing
885e5c31af7Sopenharmony_ci    sname:VkCopyCommandTransformInfoQCOM in its pname:pNext chain,
886e5c31af7Sopenharmony_ci    pname:imageOffset.y and [eq]#(pname:imageExtent.height {plus}
887e5c31af7Sopenharmony_ci    pname:imageOffset.y)# must: both be greater than or equal to `0` and
888e5c31af7Sopenharmony_ci    less than or equal to the height of the specified pname:imageSubresource
889e5c31af7Sopenharmony_ci    of pname:dstImage
890e5c31af7Sopenharmony_ci****
891e5c31af7Sopenharmony_ci
892e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkCopyBufferToImageInfo2.adoc[]
893e5c31af7Sopenharmony_ci--
894e5c31af7Sopenharmony_ci
895e5c31af7Sopenharmony_ci[open,refpage='vkCmdCopyImageToBuffer2',desc='Copy image data into a buffer',type='protos',alias='vkCmdCopyImageToBuffer2KHR']
896e5c31af7Sopenharmony_ci--
897e5c31af7Sopenharmony_ci:refpage: vkCmdCopyImageToBuffer2
898e5c31af7Sopenharmony_ci
899e5c31af7Sopenharmony_ciTo copy data from an image object to a buffer object, call:
900e5c31af7Sopenharmony_ci
901e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3[]
902e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdCopyImageToBuffer2.adoc[]
903e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3[]
904e5c31af7Sopenharmony_ci
905e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3+VK_KHR_copy_commands2[or the equivalent command]
906e5c31af7Sopenharmony_ci
907e5c31af7Sopenharmony_ciifdef::VK_KHR_copy_commands2[]
908e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdCopyImageToBuffer2KHR.adoc[]
909e5c31af7Sopenharmony_ciendif::VK_KHR_copy_commands2[]
910e5c31af7Sopenharmony_ci
911e5c31af7Sopenharmony_ci  * pname:commandBuffer is the command buffer into which the command will be
912e5c31af7Sopenharmony_ci    recorded.
913e5c31af7Sopenharmony_ci  * pname:pCopyImageToBufferInfo is a pointer to a
914e5c31af7Sopenharmony_ci    slink:VkCopyImageToBufferInfo2 structure describing the copy parameters.
915e5c31af7Sopenharmony_ci
916e5c31af7Sopenharmony_ciThis command is functionally identical to flink:vkCmdCopyImageToBuffer, but
917e5c31af7Sopenharmony_ciincludes extensible sub-structures that include pname:sType and pname:pNext
918e5c31af7Sopenharmony_ciparameters, allowing them to be more easily extended.
919e5c31af7Sopenharmony_ci
920e5c31af7Sopenharmony_ci:regionsparam: pname:pCopyImageToBufferInfo->pRegions
921e5c31af7Sopenharmony_ci
922e5c31af7Sopenharmony_ci.Valid Usage
923e5c31af7Sopenharmony_ci****
924e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_image_to_buffer_command_buffer_common.adoc[]
925e5c31af7Sopenharmony_ci****
926e5c31af7Sopenharmony_ci
927e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdCopyImageToBuffer2.adoc[]
928e5c31af7Sopenharmony_ci--
929e5c31af7Sopenharmony_ci
930e5c31af7Sopenharmony_ci[open,refpage='VkCopyImageToBufferInfo2',desc='Structure specifying parameters of an image to buffer copy command',type='structs',alias='VkCopyImageToBufferInfo2KHR']
931e5c31af7Sopenharmony_ci--
932e5c31af7Sopenharmony_ci:refpage: VkCopyImageToBufferInfo2
933e5c31af7Sopenharmony_ci
934e5c31af7Sopenharmony_ciThe sname:VkCopyImageToBufferInfo2 structure is defined as:
935e5c31af7Sopenharmony_ci
936e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkCopyImageToBufferInfo2.adoc[]
937e5c31af7Sopenharmony_ci
938e5c31af7Sopenharmony_ciifdef::VK_KHR_copy_commands2[]
939e5c31af7Sopenharmony_cior the equivalent
940e5c31af7Sopenharmony_ci
941e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkCopyImageToBufferInfo2KHR.adoc[]
942e5c31af7Sopenharmony_ciendif::VK_KHR_copy_commands2[]
943e5c31af7Sopenharmony_ci
944e5c31af7Sopenharmony_ci  * pname:sType is a elink:VkStructureType value identifying this structure.
945e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
946e5c31af7Sopenharmony_ci    structure.
947e5c31af7Sopenharmony_ci  * pname:srcImage is the source image.
948e5c31af7Sopenharmony_ci  * pname:srcImageLayout is the layout of the source image subresources for
949e5c31af7Sopenharmony_ci    the copy.
950e5c31af7Sopenharmony_ci  * pname:dstBuffer is the destination buffer.
951e5c31af7Sopenharmony_ci  * pname:regionCount is the number of regions to copy.
952e5c31af7Sopenharmony_ci  * pname:pRegions is a pointer to an array of slink:VkBufferImageCopy2
953e5c31af7Sopenharmony_ci    structures specifying the regions to copy.
954e5c31af7Sopenharmony_ci
955e5c31af7Sopenharmony_ci:imageparam: srcImage
956e5c31af7Sopenharmony_ci:imagesubresource: imageSubresource
957e5c31af7Sopenharmony_ci:imageoffset: imageOffset
958e5c31af7Sopenharmony_ci:imageextent: imageExtent
959e5c31af7Sopenharmony_ci:bufferrowlength: bufferRowLength
960e5c31af7Sopenharmony_ci:bufferimageheight: bufferImageHeight
961e5c31af7Sopenharmony_ci:regionsparam: pname:pRegions
962e5c31af7Sopenharmony_ci
963e5c31af7Sopenharmony_ci.Valid Usage
964e5c31af7Sopenharmony_ci****
965e5c31af7Sopenharmony_ci  * [[VUID-VkCopyImageToBufferInfo2-pRegions-04566]]
966e5c31af7Sopenharmony_ci    The image region specified by each element of pname:pRegions
967e5c31af7Sopenharmony_ciifdef::VK_QCOM_rotated_copy_commands[]
968e5c31af7Sopenharmony_ci    that does not contain slink:VkCopyCommandTransformInfoQCOM in its
969e5c31af7Sopenharmony_ci    pname:pNext chain
970e5c31af7Sopenharmony_ciendif::VK_QCOM_rotated_copy_commands[]
971e5c31af7Sopenharmony_ci    must: be contained within the specified pname:imageSubresource of
972e5c31af7Sopenharmony_ci    pname:srcImage
973e5c31af7Sopenharmony_ciifdef::VK_QCOM_rotated_copy_commands[]
974e5c31af7Sopenharmony_ci  * [[VUID-VkCopyImageToBufferInfo2KHR-pRegions-04557]]
975e5c31af7Sopenharmony_ci    If the image region specified by each element of pname:pRegions contains
976e5c31af7Sopenharmony_ci    slink:VkCopyCommandTransformInfoQCOM in its pname:pNext chain, the
977e5c31af7Sopenharmony_ci    rotated source region as described in
978e5c31af7Sopenharmony_ci    <<copies-buffers-images-rotation-addressing>> must: be contained within
979e5c31af7Sopenharmony_ci    pname:srcImage
980e5c31af7Sopenharmony_ci  * [[VUID-VkCopyImageToBufferInfo2KHR-pRegions-04558]]
981e5c31af7Sopenharmony_ci    If any element of pname:pRegions contains
982e5c31af7Sopenharmony_ci    slink:VkCopyCommandTransformInfoQCOM in its pname:pNext chain, then
983e5c31af7Sopenharmony_ci    pname:srcImage must: have a 1x1x1 <<formats-compatibility-classes,texel
984e5c31af7Sopenharmony_ci    block extent>>
985e5c31af7Sopenharmony_ci  * [[VUID-VkCopyImageToBufferInfo2KHR-pRegions-06205]]
986e5c31af7Sopenharmony_ci    If any element of pname:pRegions contains
987e5c31af7Sopenharmony_ci    slink:VkCopyCommandTransformInfoQCOM in its pname:pNext chain, then
988e5c31af7Sopenharmony_ci    pname:srcImage must: be of type ename:VK_IMAGE_TYPE_2D
989e5c31af7Sopenharmony_ci  * [[VUID-VkCopyImageToBufferInfo2KHR-pRegions-06206]]
990e5c31af7Sopenharmony_ci    If any element of pname:pRegions contains
991e5c31af7Sopenharmony_ci    slink:VkCopyCommandTransformInfoQCOM in its pname:pNext chain, then
992e5c31af7Sopenharmony_ci    pname:srcImage must: not have a
993e5c31af7Sopenharmony_ci    <<formats-requiring-sampler-ycbcr-conversion, multi-planar format>>
994e5c31af7Sopenharmony_ciendif::VK_QCOM_rotated_copy_commands[]
995e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_image_to_buffer_common.adoc[]
996e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_anyimage_to_imageany_common.adoc[]
997e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_anyimage_to_imageany_single_sampled_common.adoc[]
998e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_bufferimage_to_imagebuffer_common.adoc[]
999e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_bufferimage_to_imagebuffer_not_both_image_common.adoc[]
1000e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_bufferimage_to_imagebuffer_buffer_alignment_common.adoc[]
1001e5c31af7Sopenharmony_ci  * [[VUID-VkCopyImageToBufferInfo2-imageOffset-00197]]
1002e5c31af7Sopenharmony_ci    For each element of pname:pRegions not containing
1003e5c31af7Sopenharmony_ci    sname:VkCopyCommandTransformInfoQCOM in its pname:pNext chain,
1004e5c31af7Sopenharmony_ci    pname:imageOffset.x and [eq]#(pname:imageExtent.width {plus}
1005e5c31af7Sopenharmony_ci    pname:imageOffset.x)# must: both be greater than or equal to `0` and
1006e5c31af7Sopenharmony_ci    less than or equal to the width of the specified pname:imageSubresource
1007e5c31af7Sopenharmony_ci    of pname:srcImage
1008e5c31af7Sopenharmony_ci  * [[VUID-VkCopyImageToBufferInfo2-imageOffset-00198]]
1009e5c31af7Sopenharmony_ci    For each element of pname:pRegions not containing
1010e5c31af7Sopenharmony_ci    sname:VkCopyCommandTransformInfoQCOM in its pname:pNext chain,
1011e5c31af7Sopenharmony_ci    pname:imageOffset.y and [eq]#(pname:imageExtent.height {plus}
1012e5c31af7Sopenharmony_ci    pname:imageOffset.y)# must: both be greater than or equal to `0` and
1013e5c31af7Sopenharmony_ci    less than or equal to the height of the specified pname:imageSubresource
1014e5c31af7Sopenharmony_ci    of pname:srcImage
1015e5c31af7Sopenharmony_ci****
1016e5c31af7Sopenharmony_ci
1017e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkCopyImageToBufferInfo2.adoc[]
1018e5c31af7Sopenharmony_ci--
1019e5c31af7Sopenharmony_ci
1020e5c31af7Sopenharmony_ci[open,refpage='VkBufferImageCopy2',desc='Structure specifying a buffer image copy operation',type='structs',alias='VkBufferImageCopy2KHR']
1021e5c31af7Sopenharmony_ci--
1022e5c31af7Sopenharmony_ci:refpage: VkBufferImageCopy2
1023e5c31af7Sopenharmony_ci
1024e5c31af7Sopenharmony_ciFor both flink:vkCmdCopyBufferToImage2 and flink:vkCmdCopyImageToBuffer2,
1025e5c31af7Sopenharmony_cieach element of pname:pRegions is a structure defined as:
1026e5c31af7Sopenharmony_ci
1027e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBufferImageCopy2.adoc[]
1028e5c31af7Sopenharmony_ci
1029e5c31af7Sopenharmony_ciifdef::VK_KHR_copy_commands2[]
1030e5c31af7Sopenharmony_cior the equivalent
1031e5c31af7Sopenharmony_ci
1032e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBufferImageCopy2KHR.adoc[]
1033e5c31af7Sopenharmony_ciendif::VK_KHR_copy_commands2[]
1034e5c31af7Sopenharmony_ci
1035e5c31af7Sopenharmony_ci  * pname:sType is a elink:VkStructureType value identifying this structure.
1036e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
1037e5c31af7Sopenharmony_ci    structure.
1038e5c31af7Sopenharmony_ci  * pname:bufferOffset is the offset in bytes from the start of the buffer
1039e5c31af7Sopenharmony_ci    object where the image data is copied from or to.
1040e5c31af7Sopenharmony_ci  * pname:bufferRowLength and pname:bufferImageHeight specify in texels a
1041e5c31af7Sopenharmony_ci    subregion of a larger two- or three-dimensional image in buffer memory,
1042e5c31af7Sopenharmony_ci    and control the addressing calculations.
1043e5c31af7Sopenharmony_ci    If either of these values is zero, that aspect of the buffer memory is
1044e5c31af7Sopenharmony_ci    considered to be tightly packed according to the pname:imageExtent.
1045e5c31af7Sopenharmony_ci  * pname:imageSubresource is a slink:VkImageSubresourceLayers used to
1046e5c31af7Sopenharmony_ci    specify the specific image subresources of the image used for the source
1047e5c31af7Sopenharmony_ci    or destination image data.
1048e5c31af7Sopenharmony_ci  * pname:imageOffset selects the initial pname:x, pname:y, pname:z offsets
1049e5c31af7Sopenharmony_ci    in texels of the sub-region of the source or destination image data.
1050e5c31af7Sopenharmony_ci  * pname:imageExtent is the size in texels of the image to copy in
1051e5c31af7Sopenharmony_ci    pname:width, pname:height and pname:depth.
1052e5c31af7Sopenharmony_ci
1053e5c31af7Sopenharmony_ciThis structure is functionally identical to slink:VkBufferImageCopy, but
1054e5c31af7Sopenharmony_ciadds pname:sType and pname:pNext parameters, allowing it to be more easily
1055e5c31af7Sopenharmony_ciextended.
1056e5c31af7Sopenharmony_ci
1057e5c31af7Sopenharmony_ci:bufferrowlength: bufferRowLength
1058e5c31af7Sopenharmony_ci:bufferimageheight: bufferImageHeight
1059e5c31af7Sopenharmony_ci
1060e5c31af7Sopenharmony_ci.Valid Usage
1061e5c31af7Sopenharmony_ci****
1062e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/buffer_or_memory_image_copy_common.adoc[]
1063e5c31af7Sopenharmony_ci****
1064e5c31af7Sopenharmony_ci
1065e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkBufferImageCopy2.adoc[]
1066e5c31af7Sopenharmony_ci--
1067e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3,VK_KHR_copy_commands2[]
1068e5c31af7Sopenharmony_ci
1069e5c31af7Sopenharmony_ciifdef::VK_QCOM_rotated_copy_commands[]
1070e5c31af7Sopenharmony_ci[open,refpage='VkCopyCommandTransformInfoQCOM',desc='Structure describing transform parameters of rotated copy command',type='structs']
1071e5c31af7Sopenharmony_ci--
1072e5c31af7Sopenharmony_ciThe sname:VkCopyCommandTransformInfoQCOM structure is defined as:
1073e5c31af7Sopenharmony_ci
1074e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkCopyCommandTransformInfoQCOM.adoc[]
1075e5c31af7Sopenharmony_ci
1076e5c31af7Sopenharmony_ci  * pname:sType is a elink:VkStructureType value identifying this structure.
1077e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
1078e5c31af7Sopenharmony_ci    structure.
1079e5c31af7Sopenharmony_ci  * pname:transform is a elink:VkSurfaceTransformFlagBitsKHR value
1080e5c31af7Sopenharmony_ci    describing the transform to be applied.
1081e5c31af7Sopenharmony_ci
1082e5c31af7Sopenharmony_ciIncluding this structure in the pname:pNext chain of
1083e5c31af7Sopenharmony_cislink:VkBufferImageCopy2 defines a rotation to be performed when copying
1084e5c31af7Sopenharmony_cibetween an image and a buffer.
1085e5c31af7Sopenharmony_ciIncluding this structure in the pname:pNext chain of slink:VkBlitImageInfo2
1086e5c31af7Sopenharmony_cidefines a rotation to be performed when blitting between two images.
1087e5c31af7Sopenharmony_ciIf this structure is not specified in either case, the implementation
1088e5c31af7Sopenharmony_cibehaves as if it was specified with a pname:transform equal to
1089e5c31af7Sopenharmony_ciename:VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR.
1090e5c31af7Sopenharmony_ci
1091e5c31af7Sopenharmony_ciSpecifying a transform for a copy between an image and a buffer
1092e5c31af7Sopenharmony_ci<<copies-buffers-images-rotation-addressing, rotates the region accessed in
1093e5c31af7Sopenharmony_cithe image around the offset>>.
1094e5c31af7Sopenharmony_ciSpecifying a transform for a blit performs a similar transform as described
1095e5c31af7Sopenharmony_ciin <<copies-images-scaling-rotation, Image Blits with Scaling and
1096e5c31af7Sopenharmony_ciRotation>>.
1097e5c31af7Sopenharmony_ci
1098e5c31af7Sopenharmony_ciRotations other than ename:VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR can: only
1099e5c31af7Sopenharmony_cibe specified for single-plane 2D images with a 1x1x1
1100e5c31af7Sopenharmony_ci<<formats-compatibility-classes,texel block extent>>.
1101e5c31af7Sopenharmony_ci
1102e5c31af7Sopenharmony_ci.Valid Usage
1103e5c31af7Sopenharmony_ci****
1104e5c31af7Sopenharmony_ci  * [[VUID-VkCopyCommandTransformInfoQCOM-transform-04560]]
1105e5c31af7Sopenharmony_ci    pname:transform must: be ename:VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR,
1106e5c31af7Sopenharmony_ci    ename:VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR,
1107e5c31af7Sopenharmony_ci    ename:VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR, or
1108e5c31af7Sopenharmony_ci    ename:VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR
1109e5c31af7Sopenharmony_ci****
1110e5c31af7Sopenharmony_ci
1111e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkCopyCommandTransformInfoQCOM.adoc[]
1112e5c31af7Sopenharmony_ci--
1113e5c31af7Sopenharmony_ciendif::VK_QCOM_rotated_copy_commands[]
1114e5c31af7Sopenharmony_ci
1115e5c31af7Sopenharmony_ciifdef::VK_EXT_host_image_copy[]
1116e5c31af7Sopenharmony_ciinclude::{chapters}/VK_EXT_host_image_copy/copies.adoc[]
1117e5c31af7Sopenharmony_ciendif::VK_EXT_host_image_copy[]
1118e5c31af7Sopenharmony_ci
1119e5c31af7Sopenharmony_ci
1120e5c31af7Sopenharmony_ciifdef::VK_NV_copy_memory_indirect[]
1121e5c31af7Sopenharmony_ci[[indirect-copies]]
1122e5c31af7Sopenharmony_ci== Indirect Copies
1123e5c31af7Sopenharmony_ci
1124e5c31af7Sopenharmony_ciAn application can use indirect copies when the copy parameters are not
1125e5c31af7Sopenharmony_ciknown during the command buffer creation time.
1126e5c31af7Sopenharmony_ci
1127e5c31af7Sopenharmony_ci[open,refpage='vkCmdCopyMemoryIndirectNV',desc='Copy data between memory regions',type='protos']
1128e5c31af7Sopenharmony_ci--
1129e5c31af7Sopenharmony_ciTo copy data between two memory regions by specifying copy parameters
1130e5c31af7Sopenharmony_ciindirectly in a buffer, call:
1131e5c31af7Sopenharmony_ci
1132e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdCopyMemoryIndirectNV.adoc[]
1133e5c31af7Sopenharmony_ci
1134e5c31af7Sopenharmony_ci  * pname:commandBuffer is the command buffer into which the command will be
1135e5c31af7Sopenharmony_ci    recorded.
1136e5c31af7Sopenharmony_ci  * pname:copyBufferAddress is the buffer address specifying the copy
1137e5c31af7Sopenharmony_ci    parameters.
1138e5c31af7Sopenharmony_ci    This buffer is laid out in memory as an array of
1139e5c31af7Sopenharmony_ci    slink:VkCopyMemoryIndirectCommandNV structures.
1140e5c31af7Sopenharmony_ci  * pname:copyCount is the number of copies to execute, and can be zero.
1141e5c31af7Sopenharmony_ci  * pname:stride is the stride in bytes between successive sets of copy
1142e5c31af7Sopenharmony_ci    parameters.
1143e5c31af7Sopenharmony_ci
1144e5c31af7Sopenharmony_ciEach region read from pname:copyBufferAddress is copied from the source
1145e5c31af7Sopenharmony_ciregion to the specified destination region.
1146e5c31af7Sopenharmony_ciThe results are undefined: if any of the source and destination regions
1147e5c31af7Sopenharmony_cioverlap in memory.
1148e5c31af7Sopenharmony_ci
1149e5c31af7Sopenharmony_ci.Valid Usage
1150e5c31af7Sopenharmony_ci****
1151e5c31af7Sopenharmony_ci  * [[VUID-vkCmdCopyMemoryIndirectNV-None-07653]]
1152e5c31af7Sopenharmony_ci    The <<features-indirectCopy, pname:indirectCopy>> feature must: be
1153e5c31af7Sopenharmony_ci    enabled
1154e5c31af7Sopenharmony_ci  * [[VUID-vkCmdCopyMemoryIndirectNV-copyBufferAddress-07654]]
1155e5c31af7Sopenharmony_ci    pname:copyBufferAddress must: be 4 byte aligned
1156e5c31af7Sopenharmony_ci  * [[VUID-vkCmdCopyMemoryIndirectNV-stride-07655]]
1157e5c31af7Sopenharmony_ci    pname:stride must: be a multiple of `4` and must: be greater than or
1158e5c31af7Sopenharmony_ci    equal to sizeof(sname:VkCopyMemoryIndirectCommandNV)
1159e5c31af7Sopenharmony_ci  * [[VUID-vkCmdCopyMemoryIndirectNV-commandBuffer-07656]]
1160e5c31af7Sopenharmony_ci    The slink:VkCommandPool that pname:commandBuffer was allocated from
1161e5c31af7Sopenharmony_ci    must: support at least one of the
1162e5c31af7Sopenharmony_ci    slink:VkPhysicalDeviceCopyMemoryIndirectPropertiesNV::pname:supportedQueues
1163e5c31af7Sopenharmony_ci****
1164e5c31af7Sopenharmony_ci
1165e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdCopyMemoryIndirectNV.adoc[]
1166e5c31af7Sopenharmony_ci--
1167e5c31af7Sopenharmony_ci
1168e5c31af7Sopenharmony_ci[open,refpage='VkCopyMemoryIndirectCommandNV',desc='Structure specifying indirect memory region copy operation',type='structs']
1169e5c31af7Sopenharmony_ci--
1170e5c31af7Sopenharmony_ciThe structure describing source and destination memory regions,
1171e5c31af7Sopenharmony_cisname:VkCopyMemoryIndirectCommandNV is defined as:
1172e5c31af7Sopenharmony_ci
1173e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkCopyMemoryIndirectCommandNV.adoc[]
1174e5c31af7Sopenharmony_ci
1175e5c31af7Sopenharmony_ci  * pname:srcAddress is the starting address of the source device memory to
1176e5c31af7Sopenharmony_ci    copy from.
1177e5c31af7Sopenharmony_ci  * pname:dstAddress is the starting address of the destination device
1178e5c31af7Sopenharmony_ci    memory to copy to.
1179e5c31af7Sopenharmony_ci  * pname:size is the size of the copy in bytes.
1180e5c31af7Sopenharmony_ci
1181e5c31af7Sopenharmony_ci.Valid Usage
1182e5c31af7Sopenharmony_ci****
1183e5c31af7Sopenharmony_ci  * [[VUID-VkCopyMemoryIndirectCommandNV-srcAddress-07657]]
1184e5c31af7Sopenharmony_ci    The pname:srcAddress must: be 4 byte aligned
1185e5c31af7Sopenharmony_ci  * [[VUID-VkCopyMemoryIndirectCommandNV-dstAddress-07658]]
1186e5c31af7Sopenharmony_ci    The pname:dstAddress must: be 4 byte aligned
1187e5c31af7Sopenharmony_ci  * [[VUID-VkCopyMemoryIndirectCommandNV-size-07659]]
1188e5c31af7Sopenharmony_ci    The pname:size must: be 4 byte aligned
1189e5c31af7Sopenharmony_ci****
1190e5c31af7Sopenharmony_ci
1191e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkCopyMemoryIndirectCommandNV.adoc[]
1192e5c31af7Sopenharmony_ci--
1193e5c31af7Sopenharmony_ci
1194e5c31af7Sopenharmony_ci[open,refpage='vkCmdCopyMemoryToImageIndirectNV',desc='Copy data from a memory region into an image',type='protos']
1195e5c31af7Sopenharmony_ci--
1196e5c31af7Sopenharmony_ci:refpage: vkCmdCopyMemoryToImageIndirectNV
1197e5c31af7Sopenharmony_ci
1198e5c31af7Sopenharmony_ciTo copy data from a memory region to an image object by specifying copy
1199e5c31af7Sopenharmony_ciparameters in a buffer, call:
1200e5c31af7Sopenharmony_ci
1201e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdCopyMemoryToImageIndirectNV.adoc[]
1202e5c31af7Sopenharmony_ci
1203e5c31af7Sopenharmony_ci  * pname:commandBuffer is the command buffer into which the command will be
1204e5c31af7Sopenharmony_ci    recorded.
1205e5c31af7Sopenharmony_ci  * pname:copyBufferAddress is the buffer address specifying the copy
1206e5c31af7Sopenharmony_ci    parameters.
1207e5c31af7Sopenharmony_ci    This buffer is laid out in memory as an array of
1208e5c31af7Sopenharmony_ci    slink:VkCopyMemoryToImageIndirectCommandNV structures.
1209e5c31af7Sopenharmony_ci  * pname:copyCount is the number of copies to execute, and can be zero.
1210e5c31af7Sopenharmony_ci  * pname:stride is the byte stride between successive sets of copy
1211e5c31af7Sopenharmony_ci    parameters.
1212e5c31af7Sopenharmony_ci  * pname:dstImage is the destination image.
1213e5c31af7Sopenharmony_ci  * pname:dstImageLayout is the layout of the destination image subresources
1214e5c31af7Sopenharmony_ci    for the copy.
1215e5c31af7Sopenharmony_ci  * pname:pImageSubresources is a pointer to an array of size
1216e5c31af7Sopenharmony_ci    pname:copyCount of slink:VkImageSubresourceLayers used to specify the
1217e5c31af7Sopenharmony_ci    specific image subresource of the destination image data for that copy.
1218e5c31af7Sopenharmony_ci
1219e5c31af7Sopenharmony_ciEach region in pname:copyBufferAddress is copied from the source memory
1220e5c31af7Sopenharmony_ciregion to an image region in the destination image.
1221e5c31af7Sopenharmony_ciIf the destination image is of type ename:VK_IMAGE_TYPE_3D, the starting
1222e5c31af7Sopenharmony_cislice and number of slices to copy are specified in
1223e5c31af7Sopenharmony_cipname:pImageSubresources->baseArrayLayer and
1224e5c31af7Sopenharmony_cipname:pImageSubresources->layerCount respectively.
1225e5c31af7Sopenharmony_ciThe copy must: be performed on a queue that supports indirect copy
1226e5c31af7Sopenharmony_cioperations, see slink:VkPhysicalDeviceCopyMemoryIndirectPropertiesNV.
1227e5c31af7Sopenharmony_ci
1228e5c31af7Sopenharmony_ci:imageparam: dstImage
1229e5c31af7Sopenharmony_ci
1230e5c31af7Sopenharmony_ci.Valid Usage
1231e5c31af7Sopenharmony_ci****
1232e5c31af7Sopenharmony_ci  * [[VUID-vkCmdCopyMemoryToImageIndirectNV-None-07660]]
1233e5c31af7Sopenharmony_ci    The <<features-indirectCopy, pname:indirectCopy>> feature must: be
1234e5c31af7Sopenharmony_ci    enabled
1235e5c31af7Sopenharmony_ci  * [[VUID-vkCmdCopyMemoryToImageIndirectNV-dstImage-07661]]
1236e5c31af7Sopenharmony_ci    pname:dstImage must: not be a protected image
1237e5c31af7Sopenharmony_ci  * [[VUID-vkCmdCopyMemoryToImageIndirectNV-aspectMask-07662]]
1238e5c31af7Sopenharmony_ci    The pname:aspectMask member for every subresource in
1239e5c31af7Sopenharmony_ci    pname:pImageSubresources must: only have a single bit set
1240e5c31af7Sopenharmony_ci  * [[VUID-vkCmdCopyMemoryToImageIndirectNV-dstImage-07663]]
1241e5c31af7Sopenharmony_ci    The image region specified by each element in sname:copyBufferAddress
1242e5c31af7Sopenharmony_ci    must: be a region that is contained within pname:dstImage
1243e5c31af7Sopenharmony_ci  * [[VUID-vkCmdCopyMemoryToImageIndirectNV-dstImage-07664]]
1244e5c31af7Sopenharmony_ci    pname:dstImage must: have been created with
1245e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag
1246e5c31af7Sopenharmony_ci  * [[VUID-vkCmdCopyMemoryToImageIndirectNV-dstImage-07665]]
1247e5c31af7Sopenharmony_ci    If pname:dstImage is non-sparse then it must: be bound completely and
1248e5c31af7Sopenharmony_ci    contiguously to a single sname:VkDeviceMemory object
1249e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_anyimage_to_imageany_single_sampled_common.adoc[]
1250e5c31af7Sopenharmony_ci  * [[VUID-vkCmdCopyMemoryToImageIndirectNV-dstImageLayout-07667]]
1251e5c31af7Sopenharmony_ci    pname:dstImageLayout must: specify the layout of the image subresources
1252e5c31af7Sopenharmony_ci    of pname:dstImage at the time this command is executed on a
1253e5c31af7Sopenharmony_ci    sname:VkDevice
1254e5c31af7Sopenharmony_ci  * [[VUID-vkCmdCopyMemoryToImageIndirectNV-dstImageLayout-07669]]
1255e5c31af7Sopenharmony_ci    pname:dstImageLayout must: be
1256e5c31af7Sopenharmony_ci    ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
1257e5c31af7Sopenharmony_ciifdef::VK_KHR_shared_presentable_image[]
1258e5c31af7Sopenharmony_ci    ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR,
1259e5c31af7Sopenharmony_ciendif::VK_KHR_shared_presentable_image[]
1260e5c31af7Sopenharmony_ci    or ename:VK_IMAGE_LAYOUT_GENERAL
1261e5c31af7Sopenharmony_ci  * [[VUID-vkCmdCopyMemoryToImageIndirectNV-mipLevel-07670]]
1262e5c31af7Sopenharmony_ci    The specified pname:mipLevel of each region must: be less than the
1263e5c31af7Sopenharmony_ci    pname:mipLevels specified in slink:VkImageCreateInfo when pname:dstImage
1264e5c31af7Sopenharmony_ci    was created
1265e5c31af7Sopenharmony_ci  * [[VUID-vkCmdCopyMemoryToImageIndirectNV-layerCount-08764]]
1266e5c31af7Sopenharmony_ci    If pname:layerCount is not ename:VK_REMAINING_ARRAY_LAYERS, the
1267e5c31af7Sopenharmony_ci    specified pname:baseArrayLayer {plus} pname:layerCount of each region
1268e5c31af7Sopenharmony_ci    must: be less than or equal to the pname:arrayLayers specified in
1269e5c31af7Sopenharmony_ci    slink:VkImageCreateInfo when pname:dstImage was created
1270e5c31af7Sopenharmony_ci  * [[VUID-vkCmdCopyMemoryToImageIndirectNV-imageOffset-07672]]
1271e5c31af7Sopenharmony_ci    The pname:imageOffset and pname:imageExtent members of each region must:
1272e5c31af7Sopenharmony_ci    respect the image transfer granularity requirements of
1273e5c31af7Sopenharmony_ci    pname:commandBuffer's command pool's queue family, as described in
1274e5c31af7Sopenharmony_ci    slink:VkQueueFamilyProperties
1275e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map[]
1276e5c31af7Sopenharmony_ci  * [[VUID-vkCmdCopyMemoryToImageIndirectNV-dstImage-07673]]
1277e5c31af7Sopenharmony_ci    pname:dstImage must: not have been created with pname:flags containing
1278e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT
1279e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[]
1280e5c31af7Sopenharmony_ci  * [[VUID-vkCmdCopyMemoryToImageIndirectNV-commandBuffer-07674]]
1281e5c31af7Sopenharmony_ci    If the queue family used to create the slink:VkCommandPool which
1282e5c31af7Sopenharmony_ci    pname:commandBuffer was allocated from does not support
1283e5c31af7Sopenharmony_ci    ename:VK_QUEUE_GRAPHICS_BIT, for each region, the pname:aspectMask
1284e5c31af7Sopenharmony_ci    member of pname:pImageSubresources must: not be
1285e5c31af7Sopenharmony_ci    ename:VK_IMAGE_ASPECT_DEPTH_BIT or ename:VK_IMAGE_ASPECT_STENCIL_BIT
1286e5c31af7Sopenharmony_ci  * [[VUID-vkCmdCopyMemoryToImageIndirectNV-imageOffset-07675]]
1287e5c31af7Sopenharmony_ci    For each region in sname:copyBufferAddress, pname:imageOffset.y and
1288e5c31af7Sopenharmony_ci    [eq]#(pname:imageExtent.height {plus} pname:imageOffset.y)# must: both
1289e5c31af7Sopenharmony_ci    be greater than or equal to `0` and less than or equal to the height of
1290e5c31af7Sopenharmony_ci    the specified subresource
1291e5c31af7Sopenharmony_ci  * [[VUID-vkCmdCopyMemoryToImageIndirectNV-offset-07676]]
1292e5c31af7Sopenharmony_ci    pname:offset must: be 4 byte aligned
1293e5c31af7Sopenharmony_ci  * [[VUID-vkCmdCopyMemoryToImageIndirectNV-stride-07677]]
1294e5c31af7Sopenharmony_ci    pname:stride must: be a multiple of `4` and must: be greater than or
1295e5c31af7Sopenharmony_ci    equal to sizeof(sname:VkCopyMemoryToImageIndirectCommandNV)
1296e5c31af7Sopenharmony_ci****
1297e5c31af7Sopenharmony_ci
1298e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdCopyMemoryToImageIndirectNV.adoc[]
1299e5c31af7Sopenharmony_ci--
1300e5c31af7Sopenharmony_ci
1301e5c31af7Sopenharmony_ci[open,refpage='VkCopyMemoryToImageIndirectCommandNV',desc='Structure specifying indirect buffer image copy operation',type='structs']
1302e5c31af7Sopenharmony_ci--
1303e5c31af7Sopenharmony_ciThe sname:VkCopyMemoryToImageIndirectCommandNV is defined as:
1304e5c31af7Sopenharmony_ci
1305e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkCopyMemoryToImageIndirectCommandNV.adoc[]
1306e5c31af7Sopenharmony_ci
1307e5c31af7Sopenharmony_ci  * pname:srcAddress is the starting address of the source device memory to
1308e5c31af7Sopenharmony_ci    copy from.
1309e5c31af7Sopenharmony_ci  * pname:bufferRowLength and pname:bufferImageHeight specify in texels a
1310e5c31af7Sopenharmony_ci    subregion of a larger two- or three-dimensional image in buffer memory,
1311e5c31af7Sopenharmony_ci    and control the addressing calculations.
1312e5c31af7Sopenharmony_ci    If either of these values is zero, that aspect of the buffer memory is
1313e5c31af7Sopenharmony_ci    considered to be tightly packed according to the pname:imageExtent.
1314e5c31af7Sopenharmony_ci  * pname:imageSubresource is a slink:VkImageSubresourceLayers used to
1315e5c31af7Sopenharmony_ci    specify the specific image subresources of the image used for the
1316e5c31af7Sopenharmony_ci    destination image data, which must: match the values specified in
1317e5c31af7Sopenharmony_ci    pname:pImageSubresources parameter of
1318e5c31af7Sopenharmony_ci    flink:vkCmdCopyMemoryToImageIndirectNV during command recording.
1319e5c31af7Sopenharmony_ci  * pname:imageOffset selects the initial pname:x, pname:y, pname:z offsets
1320e5c31af7Sopenharmony_ci    in texels of the sub-region of the destination image data.
1321e5c31af7Sopenharmony_ci  * pname:imageExtent is the size in texels of the destination image in
1322e5c31af7Sopenharmony_ci    pname:width, pname:height and pname:depth.
1323e5c31af7Sopenharmony_ci
1324e5c31af7Sopenharmony_ci.Valid Usage
1325e5c31af7Sopenharmony_ci****
1326e5c31af7Sopenharmony_ci  * [[VUID-VkCopyMemoryToImageIndirectCommandNV-srcAddress-07678]]
1327e5c31af7Sopenharmony_ci    The pname:srcAddress must: be 4 byte aligned
1328e5c31af7Sopenharmony_ci  * [[VUID-VkCopyMemoryToImageIndirectCommandNV-bufferRowLength-07679]]
1329e5c31af7Sopenharmony_ci    pname:bufferRowLength must: be `0`, or greater than or equal to the
1330e5c31af7Sopenharmony_ci    pname:width member of pname:imageExtent
1331e5c31af7Sopenharmony_ci  * [[VUID-VkCopyMemoryToImageIndirectCommandNV-bufferImageHeight-07680]]
1332e5c31af7Sopenharmony_ci    pname:bufferImageHeight must: be `0`, or greater than or equal to the
1333e5c31af7Sopenharmony_ci    pname:height member of pname:imageExtent
1334e5c31af7Sopenharmony_ci  * [[VUID-VkCopyMemoryToImageIndirectCommandNV-imageOffset-07681]]
1335e5c31af7Sopenharmony_ci    pname:imageOffset must: specify a valid offset in the destination image
1336e5c31af7Sopenharmony_ci  * [[VUID-VkCopyMemoryToImageIndirectCommandNV-imageExtent-07682]]
1337e5c31af7Sopenharmony_ci    pname:imageExtent must: specify a valid region in the destination image
1338e5c31af7Sopenharmony_ci    and can be `0`
1339e5c31af7Sopenharmony_ci****
1340e5c31af7Sopenharmony_ci
1341e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkCopyMemoryToImageIndirectCommandNV.adoc[]
1342e5c31af7Sopenharmony_ci--
1343e5c31af7Sopenharmony_ciendif::VK_NV_copy_memory_indirect[]
1344e5c31af7Sopenharmony_ci
1345e5c31af7Sopenharmony_ci
1346e5c31af7Sopenharmony_ci[[copies-imagescaling]]
1347e5c31af7Sopenharmony_ci== Image Copies With Scaling
1348e5c31af7Sopenharmony_ci
1349e5c31af7Sopenharmony_ci[open,refpage='vkCmdBlitImage',desc='Copy regions of an image, potentially performing format conversion,',type='protos']
1350e5c31af7Sopenharmony_ci--
1351e5c31af7Sopenharmony_ci:refpage: vkCmdBlitImage
1352e5c31af7Sopenharmony_ci
1353e5c31af7Sopenharmony_ciTo copy regions of a source image into a destination image, potentially
1354e5c31af7Sopenharmony_ciperforming format conversion, arbitrary scaling, and filtering, call:
1355e5c31af7Sopenharmony_ci
1356e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdBlitImage.adoc[]
1357e5c31af7Sopenharmony_ci
1358e5c31af7Sopenharmony_ci  * pname:commandBuffer is the command buffer into which the command will be
1359e5c31af7Sopenharmony_ci    recorded.
1360e5c31af7Sopenharmony_ci  * pname:srcImage is the source image.
1361e5c31af7Sopenharmony_ci  * pname:srcImageLayout is the layout of the source image subresources for
1362e5c31af7Sopenharmony_ci    the blit.
1363e5c31af7Sopenharmony_ci  * pname:dstImage is the destination image.
1364e5c31af7Sopenharmony_ci  * pname:dstImageLayout is the layout of the destination image subresources
1365e5c31af7Sopenharmony_ci    for the blit.
1366e5c31af7Sopenharmony_ci  * pname:regionCount is the number of regions to blit.
1367e5c31af7Sopenharmony_ci  * pname:pRegions is a pointer to an array of slink:VkImageBlit structures
1368e5c31af7Sopenharmony_ci    specifying the regions to blit.
1369e5c31af7Sopenharmony_ci  * pname:filter is a elink:VkFilter specifying the filter to apply if the
1370e5c31af7Sopenharmony_ci    blits require scaling.
1371e5c31af7Sopenharmony_ci
1372e5c31af7Sopenharmony_cifname:vkCmdBlitImage must: not be used for multisampled source or
1373e5c31af7Sopenharmony_cidestination images.
1374e5c31af7Sopenharmony_ciUse flink:vkCmdResolveImage for this purpose.
1375e5c31af7Sopenharmony_ci
1376e5c31af7Sopenharmony_ciAs the sizes of the source and destination extents can: differ in any
1377e5c31af7Sopenharmony_cidimension, texels in the source extent are scaled and filtered to the
1378e5c31af7Sopenharmony_cidestination extent.
1379e5c31af7Sopenharmony_ciScaling occurs via the following operations:
1380e5c31af7Sopenharmony_ci
1381e5c31af7Sopenharmony_ci  * For each destination texel, the integer coordinate of that texel is
1382e5c31af7Sopenharmony_ci    converted to an unnormalized texture coordinate, using the effective
1383e5c31af7Sopenharmony_ci    inverse of the equations described in
1384e5c31af7Sopenharmony_ci    <<textures-unnormalized-to-integer, unnormalized to integer
1385e5c31af7Sopenharmony_ci    conversion>>:
1386e5c31af7Sopenharmony_ci  {empty}:: [eq]#u~base~ = i {plus} {onehalf}#
1387e5c31af7Sopenharmony_ci  {empty}:: [eq]#v~base~ = j {plus} {onehalf}#
1388e5c31af7Sopenharmony_ci  {empty}:: [eq]#w~base~ = k {plus} {onehalf}#
1389e5c31af7Sopenharmony_ci  * These base coordinates are then offset by the first destination offset:
1390e5c31af7Sopenharmony_ci  {empty}:: [eq]#u~offset~ = u~base~ - x~dst0~#
1391e5c31af7Sopenharmony_ci  {empty}:: [eq]#v~offset~ = v~base~ - y~dst0~#
1392e5c31af7Sopenharmony_ci  {empty}:: [eq]#w~offset~ = w~base~ - z~dst0~#
1393e5c31af7Sopenharmony_ci  {empty}:: [eq]#a~offset~ = a - pname:baseArrayCount~dst~#
1394e5c31af7Sopenharmony_ci  * The scale is determined from the source and destination regions, and
1395e5c31af7Sopenharmony_ci    applied to the offset coordinates:
1396e5c31af7Sopenharmony_ci  {empty}:: [eq]#scale~u~ = (x~src1~ - x~src0~) / (x~dst1~ - x~dst0~)#
1397e5c31af7Sopenharmony_ci  {empty}:: [eq]#scale~v~ = (y~src1~ - y~src0~) / (y~dst1~ - y~dst0~)#
1398e5c31af7Sopenharmony_ci  {empty}:: [eq]#scale~w~ = (z~src1~ - z~src0~) / (z~dst1~ - z~dst0~)#
1399e5c31af7Sopenharmony_ci  {empty}:: [eq]#u~scaled~ = u~offset~ {times} scale~u~#
1400e5c31af7Sopenharmony_ci  {empty}:: [eq]#v~scaled~ = v~offset~ {times} scale~v~#
1401e5c31af7Sopenharmony_ci  {empty}:: [eq]#w~scaled~ = w~offset~ {times} scale~w~#
1402e5c31af7Sopenharmony_ci  * Finally the source offset is added to the scaled coordinates, to
1403e5c31af7Sopenharmony_ci    determine the final unnormalized coordinates used to sample from
1404e5c31af7Sopenharmony_ci    pname:srcImage:
1405e5c31af7Sopenharmony_ci  {empty}:: [eq]#u = u~scaled~ {plus} x~src0~#
1406e5c31af7Sopenharmony_ci  {empty}:: [eq]#v = v~scaled~ {plus} y~src0~#
1407e5c31af7Sopenharmony_ci  {empty}:: [eq]#w = w~scaled~ {plus} z~src0~#
1408e5c31af7Sopenharmony_ci  {empty}:: [eq]#q = pname:mipLevel#
1409e5c31af7Sopenharmony_ci  {empty}:: [eq]#a = a~offset~ {plus} pname:baseArrayCount~src~#
1410e5c31af7Sopenharmony_ci
1411e5c31af7Sopenharmony_ciThese coordinates are used to sample from the source image, as described in
1412e5c31af7Sopenharmony_ci<<textures, Image Operations chapter>>, with the filter mode equal to that
1413e5c31af7Sopenharmony_ciof pname:filter, a mipmap mode of ename:VK_SAMPLER_MIPMAP_MODE_NEAREST and
1414e5c31af7Sopenharmony_cian address mode of ename:VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE.
1415e5c31af7Sopenharmony_ciImplementations must: clamp at the edge of the source image, and may:
1416e5c31af7Sopenharmony_ciadditionally clamp to the edge of the source region.
1417e5c31af7Sopenharmony_ci
1418e5c31af7Sopenharmony_ci[NOTE]
1419e5c31af7Sopenharmony_ci.Note
1420e5c31af7Sopenharmony_ci====
1421e5c31af7Sopenharmony_ciDue to allowable rounding errors in the generation of the source texture
1422e5c31af7Sopenharmony_cicoordinates, it is not always possible to guarantee exactly which source
1423e5c31af7Sopenharmony_citexels will be sampled for a given blit.
1424e5c31af7Sopenharmony_ciAs rounding errors are implementation-dependent, the exact results of a
1425e5c31af7Sopenharmony_ciblitting operation are also implementation-dependent.
1426e5c31af7Sopenharmony_ci====
1427e5c31af7Sopenharmony_ci
1428e5c31af7Sopenharmony_ciBlits are done layer by layer starting with the pname:baseArrayLayer member
1429e5c31af7Sopenharmony_ciof pname:srcSubresource for the source and pname:dstSubresource for the
1430e5c31af7Sopenharmony_cidestination.
1431e5c31af7Sopenharmony_cipname:layerCount layers are blitted to the destination image.
1432e5c31af7Sopenharmony_ci
1433e5c31af7Sopenharmony_ciWhen blitting 3D textures, slices in the destination region bounded by
1434e5c31af7Sopenharmony_cipname:dstOffsets[0].z and pname:dstOffsets[1].z are sampled from slices in
1435e5c31af7Sopenharmony_cithe source region bounded by pname:srcOffsets[0].z and
1436e5c31af7Sopenharmony_cipname:srcOffsets[1].z.
1437e5c31af7Sopenharmony_ciIf the pname:filter parameter is ename:VK_FILTER_LINEAR then the value
1438e5c31af7Sopenharmony_cisampled from the source image is taken by doing linear filtering using the
1439e5c31af7Sopenharmony_ciinterpolated *z* coordinate represented by *w* in the previous equations.
1440e5c31af7Sopenharmony_ciIf the pname:filter parameter is ename:VK_FILTER_NEAREST then the value
1441e5c31af7Sopenharmony_cisampled from the source image is taken from the single nearest slice, with
1442e5c31af7Sopenharmony_cian implementation-dependent arithmetic rounding mode.
1443e5c31af7Sopenharmony_ci
1444e5c31af7Sopenharmony_ciThe following filtering and conversion rules apply:
1445e5c31af7Sopenharmony_ci
1446e5c31af7Sopenharmony_ci  * Integer formats can: only be converted to other integer formats with the
1447e5c31af7Sopenharmony_ci    same signedness.
1448e5c31af7Sopenharmony_ci  * No format conversion is supported between depth/stencil images.
1449e5c31af7Sopenharmony_ci    The formats must: match.
1450e5c31af7Sopenharmony_ci  * Format conversions on unorm, snorm, scaled and packed float formats of
1451e5c31af7Sopenharmony_ci    the copied aspect of the image are performed by first converting the
1452e5c31af7Sopenharmony_ci    pixels to float values.
1453e5c31af7Sopenharmony_ci  * For sRGB source formats, nonlinear RGB values are converted to linear
1454e5c31af7Sopenharmony_ci    representation prior to filtering.
1455e5c31af7Sopenharmony_ci  * After filtering, the float values are first clamped and then cast to the
1456e5c31af7Sopenharmony_ci    destination image format.
1457e5c31af7Sopenharmony_ci    In case of sRGB destination format, linear RGB values are converted to
1458e5c31af7Sopenharmony_ci    nonlinear representation before writing the pixel to the image.
1459e5c31af7Sopenharmony_ci
1460e5c31af7Sopenharmony_ciSigned and unsigned integers are converted by first clamping to the
1461e5c31af7Sopenharmony_cirepresentable range of the destination format, then casting the value.
1462e5c31af7Sopenharmony_ci
1463e5c31af7Sopenharmony_ci.Valid Usage
1464e5c31af7Sopenharmony_ci****
1465e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/blit_image_command_buffer_common.adoc[]
1466e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/blit_image_common.adoc[]
1467e5c31af7Sopenharmony_ci****
1468e5c31af7Sopenharmony_ci
1469e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdBlitImage.adoc[]
1470e5c31af7Sopenharmony_ci--
1471e5c31af7Sopenharmony_ci
1472e5c31af7Sopenharmony_ci[open,refpage='VkImageBlit',desc='Structure specifying an image blit operation',type='structs']
1473e5c31af7Sopenharmony_ci--
1474e5c31af7Sopenharmony_ci:refpage: VkImageBlit
1475e5c31af7Sopenharmony_ci
1476e5c31af7Sopenharmony_ciThe sname:VkImageBlit structure is defined as:
1477e5c31af7Sopenharmony_ci
1478e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImageBlit.adoc[]
1479e5c31af7Sopenharmony_ci
1480e5c31af7Sopenharmony_ci  * pname:srcSubresource is the subresource to blit from.
1481e5c31af7Sopenharmony_ci  * pname:srcOffsets is a pointer to an array of two slink:VkOffset3D
1482e5c31af7Sopenharmony_ci    structures specifying the bounds of the source region within
1483e5c31af7Sopenharmony_ci    pname:srcSubresource.
1484e5c31af7Sopenharmony_ci  * pname:dstSubresource is the subresource to blit into.
1485e5c31af7Sopenharmony_ci  * pname:dstOffsets is a pointer to an array of two slink:VkOffset3D
1486e5c31af7Sopenharmony_ci    structures specifying the bounds of the destination region within
1487e5c31af7Sopenharmony_ci    pname:dstSubresource.
1488e5c31af7Sopenharmony_ci
1489e5c31af7Sopenharmony_ciFor each element of the pname:pRegions array, a blit operation is performed
1490e5c31af7Sopenharmony_cifor the specified source and destination regions.
1491e5c31af7Sopenharmony_ci
1492e5c31af7Sopenharmony_ci.Valid Usage
1493e5c31af7Sopenharmony_ci****
1494e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/image_blit_common.adoc[]
1495e5c31af7Sopenharmony_ci****
1496e5c31af7Sopenharmony_ci
1497e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkImageBlit.adoc[]
1498e5c31af7Sopenharmony_ci--
1499e5c31af7Sopenharmony_ci
1500e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3,VK_KHR_copy_commands2[]
1501e5c31af7Sopenharmony_ciA more extensible version of the blit image command is defined below.
1502e5c31af7Sopenharmony_ci
1503e5c31af7Sopenharmony_ci[open,refpage='vkCmdBlitImage2',desc='Copy regions of an image, potentially performing format conversion,',type='protos',alias='vkCmdBlitImage2KHR']
1504e5c31af7Sopenharmony_ci--
1505e5c31af7Sopenharmony_ci:refpage: vkCmdBlitImage2
1506e5c31af7Sopenharmony_ci
1507e5c31af7Sopenharmony_ciTo copy regions of a source image into a destination image, potentially
1508e5c31af7Sopenharmony_ciperforming format conversion, arbitrary scaling, and filtering, call:
1509e5c31af7Sopenharmony_ci
1510e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3[]
1511e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdBlitImage2.adoc[]
1512e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3[]
1513e5c31af7Sopenharmony_ci
1514e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3+VK_KHR_copy_commands2[or the equivalent command]
1515e5c31af7Sopenharmony_ci
1516e5c31af7Sopenharmony_ciifdef::VK_KHR_copy_commands2[]
1517e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdBlitImage2KHR.adoc[]
1518e5c31af7Sopenharmony_ciendif::VK_KHR_copy_commands2[]
1519e5c31af7Sopenharmony_ci
1520e5c31af7Sopenharmony_ci  * pname:commandBuffer is the command buffer into which the command will be
1521e5c31af7Sopenharmony_ci    recorded.
1522e5c31af7Sopenharmony_ci  * pname:pBlitImageInfo is a pointer to a slink:VkBlitImageInfo2 structure
1523e5c31af7Sopenharmony_ci    describing the blit parameters.
1524e5c31af7Sopenharmony_ci
1525e5c31af7Sopenharmony_ciThis command is functionally identical to flink:vkCmdBlitImage, but includes
1526e5c31af7Sopenharmony_ciextensible sub-structures that include pname:sType and pname:pNext
1527e5c31af7Sopenharmony_ciparameters, allowing them to be more easily extended.
1528e5c31af7Sopenharmony_ci
1529e5c31af7Sopenharmony_ci.Valid Usage
1530e5c31af7Sopenharmony_ci****
1531e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/blit_image_command_buffer_common.adoc[]
1532e5c31af7Sopenharmony_ci****
1533e5c31af7Sopenharmony_ci
1534e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdBlitImage2.adoc[]
1535e5c31af7Sopenharmony_ci--
1536e5c31af7Sopenharmony_ci
1537e5c31af7Sopenharmony_ci[open,refpage='VkBlitImageInfo2',desc='Structure specifying parameters of blit image command',type='structs',alias='VkBlitImageInfo2KHR']
1538e5c31af7Sopenharmony_ci--
1539e5c31af7Sopenharmony_ci:refpage: VkBlitImageInfo2
1540e5c31af7Sopenharmony_ci
1541e5c31af7Sopenharmony_ciThe sname:VkBlitImageInfo2 structure is defined as:
1542e5c31af7Sopenharmony_ci
1543e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBlitImageInfo2.adoc[]
1544e5c31af7Sopenharmony_ci
1545e5c31af7Sopenharmony_ciifdef::VK_KHR_copy_commands2[]
1546e5c31af7Sopenharmony_cior the equivalent
1547e5c31af7Sopenharmony_ci
1548e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBlitImageInfo2KHR.adoc[]
1549e5c31af7Sopenharmony_ciendif::VK_KHR_copy_commands2[]
1550e5c31af7Sopenharmony_ci
1551e5c31af7Sopenharmony_ci  * pname:sType is a elink:VkStructureType value identifying this structure.
1552e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
1553e5c31af7Sopenharmony_ci    structure.
1554e5c31af7Sopenharmony_ci  * pname:srcImage is the source image.
1555e5c31af7Sopenharmony_ci  * pname:srcImageLayout is the layout of the source image subresources for
1556e5c31af7Sopenharmony_ci    the blit.
1557e5c31af7Sopenharmony_ci  * pname:dstImage is the destination image.
1558e5c31af7Sopenharmony_ci  * pname:dstImageLayout is the layout of the destination image subresources
1559e5c31af7Sopenharmony_ci    for the blit.
1560e5c31af7Sopenharmony_ci  * pname:regionCount is the number of regions to blit.
1561e5c31af7Sopenharmony_ci  * pname:pRegions is a pointer to an array of slink:VkImageBlit2 structures
1562e5c31af7Sopenharmony_ci    specifying the regions to blit.
1563e5c31af7Sopenharmony_ci  * pname:filter is a elink:VkFilter specifying the filter to apply if the
1564e5c31af7Sopenharmony_ci    blits require scaling.
1565e5c31af7Sopenharmony_ci
1566e5c31af7Sopenharmony_ci.Valid Usage
1567e5c31af7Sopenharmony_ci****
1568e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/blit_image_common.adoc[]
1569e5c31af7Sopenharmony_ciifdef::VK_QCOM_rotated_copy_commands[]
1570e5c31af7Sopenharmony_ci  * [[VUID-VkBlitImageInfo2-pRegions-04561]]
1571e5c31af7Sopenharmony_ci    If any element of pname:pRegions contains
1572e5c31af7Sopenharmony_ci    slink:VkCopyCommandTransformInfoQCOM in its pname:pNext chain, then
1573e5c31af7Sopenharmony_ci    pname:srcImage and pname:dstImage must: not be block-compressed images
1574e5c31af7Sopenharmony_ci  * [[VUID-VkBlitImageInfo2KHR-pRegions-06207]]
1575e5c31af7Sopenharmony_ci    If any element of pname:pRegions contains
1576e5c31af7Sopenharmony_ci    slink:VkCopyCommandTransformInfoQCOM in its pname:pNext chain, then
1577e5c31af7Sopenharmony_ci    pname:srcImage must: be of type ename:VK_IMAGE_TYPE_2D
1578e5c31af7Sopenharmony_ci  * [[VUID-VkBlitImageInfo2KHR-pRegions-06208]]
1579e5c31af7Sopenharmony_ci    If any element of pname:pRegions contains
1580e5c31af7Sopenharmony_ci    slink:VkCopyCommandTransformInfoQCOM in its pname:pNext chain, then
1581e5c31af7Sopenharmony_ci    pname:srcImage must: not have a
1582e5c31af7Sopenharmony_ci    <<formats-requiring-sampler-ycbcr-conversion, multi-planar format>>
1583e5c31af7Sopenharmony_ciendif::VK_QCOM_rotated_copy_commands[]
1584e5c31af7Sopenharmony_ciifdef::VK_QCOM_filter_cubic_weights[]
1585e5c31af7Sopenharmony_ci  * [[VUID-VkBlitImageInfo2-filter-09204]]
1586e5c31af7Sopenharmony_ci    If pname:filter is ename:VK_FILTER_CUBIC_EXT and if the
1587e5c31af7Sopenharmony_ci    <<features-filter-cubic-weight-selection,selectableCubicWeights>>
1588e5c31af7Sopenharmony_ci    feature is not enabled then the cubic weights must: be
1589e5c31af7Sopenharmony_ci    ename:VK_CUBIC_FILTER_WEIGHTS_CATMULL_ROM_QCOM
1590e5c31af7Sopenharmony_ciendif::VK_QCOM_filter_cubic_weights[]
1591e5c31af7Sopenharmony_ci****
1592e5c31af7Sopenharmony_ci
1593e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkBlitImageInfo2.adoc[]
1594e5c31af7Sopenharmony_ci--
1595e5c31af7Sopenharmony_ci
1596e5c31af7Sopenharmony_ciifdef::VK_QCOM_filter_cubic_weights[]
1597e5c31af7Sopenharmony_ci
1598e5c31af7Sopenharmony_ciIf pname:filter is ename:VK_FILTER_CUBIC_EXT and if the pname:pNext chain of
1599e5c31af7Sopenharmony_cislink:VkBlitImageInfo2 includes a sname:VkBlitImageCubicWeightsInfoQCOM
1600e5c31af7Sopenharmony_cistructure, then that structure specifies cubic weights are used in the blit.
1601e5c31af7Sopenharmony_ciIf that structure is not present, then cubic weights are considered to be
1602e5c31af7Sopenharmony_ciename:VK_CUBIC_FILTER_WEIGHTS_CATMULL_ROM_QCOM.
1603e5c31af7Sopenharmony_ci
1604e5c31af7Sopenharmony_ci[open,refpage='VkBlitImageCubicWeightsInfoQCOM',desc='Structure specifying image blit cubic weight info',type='structs',alias='VkImageBlit2KHR']
1605e5c31af7Sopenharmony_ci--
1606e5c31af7Sopenharmony_ci:refpage: VkBlitImageCubicWeightsInfoQCOM
1607e5c31af7Sopenharmony_ci
1608e5c31af7Sopenharmony_ciThe sname:VkBlitImageCubicWeightsInfoQCOM structure is defined as:
1609e5c31af7Sopenharmony_ci
1610e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBlitImageCubicWeightsInfoQCOM.adoc[]
1611e5c31af7Sopenharmony_ci
1612e5c31af7Sopenharmony_ci  * pname:sType is a elink:VkStructureType value identifying this structure.
1613e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
1614e5c31af7Sopenharmony_ci    structure.
1615e5c31af7Sopenharmony_ci  * pname:cubicWeights is a elink:VkCubicFilterWeightsQCOM value controlling
1616e5c31af7Sopenharmony_ci    cubic filter weights for the blit.
1617e5c31af7Sopenharmony_ci
1618e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkBlitImageCubicWeightsInfoQCOM.adoc[]
1619e5c31af7Sopenharmony_ci--
1620e5c31af7Sopenharmony_ci
1621e5c31af7Sopenharmony_ciendif::VK_QCOM_filter_cubic_weights[]
1622e5c31af7Sopenharmony_ci
1623e5c31af7Sopenharmony_ci
1624e5c31af7Sopenharmony_ci[open,refpage='VkImageBlit2',desc='Structure specifying an image blit operation',type='structs',alias='VkImageBlit2KHR']
1625e5c31af7Sopenharmony_ci--
1626e5c31af7Sopenharmony_ci:refpage: VkImageBlit2
1627e5c31af7Sopenharmony_ci
1628e5c31af7Sopenharmony_ciThe sname:VkImageBlit2 structure is defined as:
1629e5c31af7Sopenharmony_ci
1630e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImageBlit2.adoc[]
1631e5c31af7Sopenharmony_ci
1632e5c31af7Sopenharmony_ciifdef::VK_KHR_copy_commands2[]
1633e5c31af7Sopenharmony_cior the equivalent
1634e5c31af7Sopenharmony_ci
1635e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImageBlit2KHR.adoc[]
1636e5c31af7Sopenharmony_ciendif::VK_KHR_copy_commands2[]
1637e5c31af7Sopenharmony_ci
1638e5c31af7Sopenharmony_ci  * pname:sType is a elink:VkStructureType value identifying this structure.
1639e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
1640e5c31af7Sopenharmony_ci    structure.
1641e5c31af7Sopenharmony_ci  * pname:srcSubresource is the subresource to blit from.
1642e5c31af7Sopenharmony_ci  * pname:srcOffsets is a pointer to an array of two slink:VkOffset3D
1643e5c31af7Sopenharmony_ci    structures specifying the bounds of the source region within
1644e5c31af7Sopenharmony_ci    pname:srcSubresource.
1645e5c31af7Sopenharmony_ci  * pname:dstSubresource is the subresource to blit into.
1646e5c31af7Sopenharmony_ci  * pname:dstOffsets is a pointer to an array of two slink:VkOffset3D
1647e5c31af7Sopenharmony_ci    structures specifying the bounds of the destination region within
1648e5c31af7Sopenharmony_ci    pname:dstSubresource.
1649e5c31af7Sopenharmony_ci
1650e5c31af7Sopenharmony_ciFor each element of the pname:pRegions array, a blit operation is performed
1651e5c31af7Sopenharmony_cifor the specified source and destination regions.
1652e5c31af7Sopenharmony_ci
1653e5c31af7Sopenharmony_ci.Valid Usage
1654e5c31af7Sopenharmony_ci****
1655e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/image_blit_common.adoc[]
1656e5c31af7Sopenharmony_ci****
1657e5c31af7Sopenharmony_ci
1658e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkImageBlit2.adoc[]
1659e5c31af7Sopenharmony_ci--
1660e5c31af7Sopenharmony_ci
1661e5c31af7Sopenharmony_ciifdef::VK_QCOM_rotated_copy_commands[]
1662e5c31af7Sopenharmony_ciFor flink:vkCmdBlitImage2, each region copied can include a rotation.
1663e5c31af7Sopenharmony_ciTo specify a rotated region, add slink:VkCopyCommandTransformInfoQCOM to the
1664e5c31af7Sopenharmony_cipname:pNext chain of slink:VkImageBlit2.
1665e5c31af7Sopenharmony_ciFor each region with a rotation specified,
1666e5c31af7Sopenharmony_ci<<copies-images-scaling-rotation,Image Blits with Scaling and Rotation>>
1667e5c31af7Sopenharmony_cispecifies how coordinates are rotated prior to sampling from the source
1668e5c31af7Sopenharmony_ciimage.
1669e5c31af7Sopenharmony_ciWhen rotation is specified, the source and destination images must: each be
1670e5c31af7Sopenharmony_ci2D images, have a 1x1x1 <<formats-compatibility-classes,texel block
1671e5c31af7Sopenharmony_ciextent>>, and only one plane.
1672e5c31af7Sopenharmony_ciendif::VK_QCOM_rotated_copy_commands[]
1673e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3,VK_KHR_copy_commands2[]
1674e5c31af7Sopenharmony_ci
1675e5c31af7Sopenharmony_ciifdef::VK_QCOM_rotated_copy_commands[]
1676e5c31af7Sopenharmony_ciinclude::{chapters}/VK_QCOM_rotated_copies/rotated_addressing_blits.adoc[]
1677e5c31af7Sopenharmony_ciendif::VK_QCOM_rotated_copy_commands[]
1678e5c31af7Sopenharmony_ci
1679e5c31af7Sopenharmony_ci
1680e5c31af7Sopenharmony_ci[[copies-resolve]]
1681e5c31af7Sopenharmony_ci== Resolving Multisample Images
1682e5c31af7Sopenharmony_ci
1683e5c31af7Sopenharmony_ci[open,refpage='vkCmdResolveImage',desc='Resolve regions of an image',type='protos']
1684e5c31af7Sopenharmony_ci--
1685e5c31af7Sopenharmony_ci:refpage: vkCmdResolveImage
1686e5c31af7Sopenharmony_ci
1687e5c31af7Sopenharmony_ciTo resolve a multisample color image to a non-multisample color image, call:
1688e5c31af7Sopenharmony_ci
1689e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdResolveImage.adoc[]
1690e5c31af7Sopenharmony_ci
1691e5c31af7Sopenharmony_ci  * pname:commandBuffer is the command buffer into which the command will be
1692e5c31af7Sopenharmony_ci    recorded.
1693e5c31af7Sopenharmony_ci  * pname:srcImage is the source image.
1694e5c31af7Sopenharmony_ci  * pname:srcImageLayout is the layout of the source image subresources for
1695e5c31af7Sopenharmony_ci    the resolve.
1696e5c31af7Sopenharmony_ci  * pname:dstImage is the destination image.
1697e5c31af7Sopenharmony_ci  * pname:dstImageLayout is the layout of the destination image subresources
1698e5c31af7Sopenharmony_ci    for the resolve.
1699e5c31af7Sopenharmony_ci  * pname:regionCount is the number of regions to resolve.
1700e5c31af7Sopenharmony_ci  * pname:pRegions is a pointer to an array of slink:VkImageResolve
1701e5c31af7Sopenharmony_ci    structures specifying the regions to resolve.
1702e5c31af7Sopenharmony_ci
1703e5c31af7Sopenharmony_ciDuring the resolve the samples corresponding to each pixel location in the
1704e5c31af7Sopenharmony_cisource are converted to a single sample before being written to the
1705e5c31af7Sopenharmony_cidestination.
1706e5c31af7Sopenharmony_ciIf the source formats are floating-point or normalized types, the sample
1707e5c31af7Sopenharmony_civalues for each pixel are resolved in an implementation-dependent manner.
1708e5c31af7Sopenharmony_ciIf the source formats are integer types, a single sample's value is selected
1709e5c31af7Sopenharmony_cifor each pixel.
1710e5c31af7Sopenharmony_ci
1711e5c31af7Sopenharmony_cipname:srcOffset and pname:dstOffset select the initial pname:x, pname:y, and
1712e5c31af7Sopenharmony_cipname:z offsets in texels of the sub-regions of the source and destination
1713e5c31af7Sopenharmony_ciimage data.
1714e5c31af7Sopenharmony_cipname:extent is the size in texels of the source image to resolve in
1715e5c31af7Sopenharmony_cipname:width, pname:height and pname:depth.
1716e5c31af7Sopenharmony_ciEach element of pname:pRegions must: be a region that is contained within
1717e5c31af7Sopenharmony_ciits corresponding image.
1718e5c31af7Sopenharmony_ci
1719e5c31af7Sopenharmony_ciResolves are done layer by layer starting with pname:baseArrayLayer member
1720e5c31af7Sopenharmony_ciof pname:srcSubresource for the source and pname:dstSubresource for the
1721e5c31af7Sopenharmony_cidestination.
1722e5c31af7Sopenharmony_cipname:layerCount layers are resolved to the destination image.
1723e5c31af7Sopenharmony_ci
1724e5c31af7Sopenharmony_ci.Valid Usage
1725e5c31af7Sopenharmony_ci****
1726e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/resolve_image_command_buffer_common.adoc[]
1727e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/resolve_image_common.adoc[]
1728e5c31af7Sopenharmony_ci****
1729e5c31af7Sopenharmony_ci
1730e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdResolveImage.adoc[]
1731e5c31af7Sopenharmony_ci--
1732e5c31af7Sopenharmony_ci
1733e5c31af7Sopenharmony_ci[open,refpage='VkImageResolve',desc='Structure specifying an image resolve operation',type='structs']
1734e5c31af7Sopenharmony_ci--
1735e5c31af7Sopenharmony_ci:refpage: VkImageResolve
1736e5c31af7Sopenharmony_ci
1737e5c31af7Sopenharmony_ciThe sname:VkImageResolve structure is defined as:
1738e5c31af7Sopenharmony_ci
1739e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImageResolve.adoc[]
1740e5c31af7Sopenharmony_ci
1741e5c31af7Sopenharmony_ci  * pname:srcSubresource and pname:dstSubresource are
1742e5c31af7Sopenharmony_ci    slink:VkImageSubresourceLayers structures specifying the image
1743e5c31af7Sopenharmony_ci    subresources of the images used for the source and destination image
1744e5c31af7Sopenharmony_ci    data, respectively.
1745e5c31af7Sopenharmony_ci    Resolve of depth/stencil images is not supported.
1746e5c31af7Sopenharmony_ci  * pname:srcOffset and pname:dstOffset select the initial pname:x, pname:y,
1747e5c31af7Sopenharmony_ci    and pname:z offsets in texels of the sub-regions of the source and
1748e5c31af7Sopenharmony_ci    destination image data.
1749e5c31af7Sopenharmony_ci  * pname:extent is the size in texels of the source image to resolve in
1750e5c31af7Sopenharmony_ci    pname:width, pname:height and pname:depth.
1751e5c31af7Sopenharmony_ci
1752e5c31af7Sopenharmony_ci.Valid Usage
1753e5c31af7Sopenharmony_ci****
1754e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/image_resolve_common.adoc[]
1755e5c31af7Sopenharmony_ci****
1756e5c31af7Sopenharmony_ci
1757e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkImageResolve.adoc[]
1758e5c31af7Sopenharmony_ci--
1759e5c31af7Sopenharmony_ci
1760e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3,VK_KHR_copy_commands2[]
1761e5c31af7Sopenharmony_ci
1762e5c31af7Sopenharmony_ciA more extensible version of the resolve image command is defined below.
1763e5c31af7Sopenharmony_ci
1764e5c31af7Sopenharmony_ci[open,refpage='vkCmdResolveImage2',desc='Resolve regions of an image',type='protos',alias='vkCmdResolveImage2KHR']
1765e5c31af7Sopenharmony_ci--
1766e5c31af7Sopenharmony_ci:refpage: vkCmdResolveImage2
1767e5c31af7Sopenharmony_ci
1768e5c31af7Sopenharmony_ciTo resolve a multisample image to a non-multisample image, call:
1769e5c31af7Sopenharmony_ci
1770e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3[]
1771e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdResolveImage2.adoc[]
1772e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3[]
1773e5c31af7Sopenharmony_ci
1774e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3+VK_KHR_copy_commands2[or the equivalent command]
1775e5c31af7Sopenharmony_ci
1776e5c31af7Sopenharmony_ciifdef::VK_KHR_copy_commands2[]
1777e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdResolveImage2KHR.adoc[]
1778e5c31af7Sopenharmony_ciendif::VK_KHR_copy_commands2[]
1779e5c31af7Sopenharmony_ci
1780e5c31af7Sopenharmony_ci  * pname:commandBuffer is the command buffer into which the command will be
1781e5c31af7Sopenharmony_ci    recorded.
1782e5c31af7Sopenharmony_ci  * pname:pResolveImageInfo is a pointer to a slink:VkResolveImageInfo2
1783e5c31af7Sopenharmony_ci    structure describing the resolve parameters.
1784e5c31af7Sopenharmony_ci
1785e5c31af7Sopenharmony_ciThis command is functionally identical to flink:vkCmdResolveImage, but
1786e5c31af7Sopenharmony_ciincludes extensible sub-structures that include pname:sType and pname:pNext
1787e5c31af7Sopenharmony_ciparameters, allowing them to be more easily extended.
1788e5c31af7Sopenharmony_ci
1789e5c31af7Sopenharmony_ci
1790e5c31af7Sopenharmony_ci.Valid Usage
1791e5c31af7Sopenharmony_ci****
1792e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/resolve_image_command_buffer_common.adoc[]
1793e5c31af7Sopenharmony_ci****
1794e5c31af7Sopenharmony_ci
1795e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdResolveImage2.adoc[]
1796e5c31af7Sopenharmony_ci--
1797e5c31af7Sopenharmony_ci
1798e5c31af7Sopenharmony_ci[open,refpage='VkResolveImageInfo2',desc='Structure specifying parameters of resolve image command',type='structs',alias='VkResolveImageInfo2KHR']
1799e5c31af7Sopenharmony_ci--
1800e5c31af7Sopenharmony_ci:refpage: VkResolveImageInfo2
1801e5c31af7Sopenharmony_ci
1802e5c31af7Sopenharmony_ciThe sname:VkResolveImageInfo2 structure is defined as:
1803e5c31af7Sopenharmony_ci
1804e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkResolveImageInfo2.adoc[]
1805e5c31af7Sopenharmony_ci
1806e5c31af7Sopenharmony_ciifdef::VK_KHR_copy_commands2[]
1807e5c31af7Sopenharmony_cior the equivalent
1808e5c31af7Sopenharmony_ci
1809e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkResolveImageInfo2KHR.adoc[]
1810e5c31af7Sopenharmony_ciendif::VK_KHR_copy_commands2[]
1811e5c31af7Sopenharmony_ci
1812e5c31af7Sopenharmony_ci  * pname:sType is a elink:VkStructureType value identifying this structure.
1813e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
1814e5c31af7Sopenharmony_ci    structure.
1815e5c31af7Sopenharmony_ci  * pname:srcImage is the source image.
1816e5c31af7Sopenharmony_ci  * pname:srcImageLayout is the layout of the source image subresources for
1817e5c31af7Sopenharmony_ci    the resolve.
1818e5c31af7Sopenharmony_ci  * pname:dstImage is the destination image.
1819e5c31af7Sopenharmony_ci  * pname:dstImageLayout is the layout of the destination image subresources
1820e5c31af7Sopenharmony_ci    for the resolve.
1821e5c31af7Sopenharmony_ci  * pname:regionCount is the number of regions to resolve.
1822e5c31af7Sopenharmony_ci  * pname:pRegions is a pointer to an array of slink:VkImageResolve2
1823e5c31af7Sopenharmony_ci    structures specifying the regions to resolve.
1824e5c31af7Sopenharmony_ci
1825e5c31af7Sopenharmony_ci.Valid Usage
1826e5c31af7Sopenharmony_ci****
1827e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/resolve_image_common.adoc[]
1828e5c31af7Sopenharmony_ci****
1829e5c31af7Sopenharmony_ci
1830e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkResolveImageInfo2.adoc[]
1831e5c31af7Sopenharmony_ci--
1832e5c31af7Sopenharmony_ci
1833e5c31af7Sopenharmony_ci[open,refpage='VkImageResolve2',desc='Structure specifying an image resolve operation',type='structs',alias='VkImageResolve2KHR']
1834e5c31af7Sopenharmony_ci--
1835e5c31af7Sopenharmony_ci:refpage: VkImageResolve2
1836e5c31af7Sopenharmony_ci
1837e5c31af7Sopenharmony_ciThe sname:VkImageResolve2 structure is defined as:
1838e5c31af7Sopenharmony_ci
1839e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImageResolve2.adoc[]
1840e5c31af7Sopenharmony_ci
1841e5c31af7Sopenharmony_ciifdef::VK_KHR_copy_commands2[]
1842e5c31af7Sopenharmony_cior the equivalent
1843e5c31af7Sopenharmony_ci
1844e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImageResolve2KHR.adoc[]
1845e5c31af7Sopenharmony_ciendif::VK_KHR_copy_commands2[]
1846e5c31af7Sopenharmony_ci
1847e5c31af7Sopenharmony_ci  * pname:sType is a elink:VkStructureType value identifying this structure.
1848e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
1849e5c31af7Sopenharmony_ci    structure.
1850e5c31af7Sopenharmony_ci  * pname:srcSubresource and pname:dstSubresource are
1851e5c31af7Sopenharmony_ci    slink:VkImageSubresourceLayers structures specifying the image
1852e5c31af7Sopenharmony_ci    subresources of the images used for the source and destination image
1853e5c31af7Sopenharmony_ci    data, respectively.
1854e5c31af7Sopenharmony_ci    Resolve of depth/stencil images is not supported.
1855e5c31af7Sopenharmony_ci  * pname:srcOffset and pname:dstOffset select the initial pname:x, pname:y,
1856e5c31af7Sopenharmony_ci    and pname:z offsets in texels of the sub-regions of the source and
1857e5c31af7Sopenharmony_ci    destination image data.
1858e5c31af7Sopenharmony_ci  * pname:extent is the size in texels of the source image to resolve in
1859e5c31af7Sopenharmony_ci    pname:width, pname:height and pname:depth.
1860e5c31af7Sopenharmony_ci
1861e5c31af7Sopenharmony_ci.Valid Usage
1862e5c31af7Sopenharmony_ci****
1863e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/image_resolve_common.adoc[]
1864e5c31af7Sopenharmony_ci****
1865e5c31af7Sopenharmony_ci
1866e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkImageResolve2.adoc[]
1867e5c31af7Sopenharmony_ci--
1868e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3,VK_KHR_copy_commands2[]
1869e5c31af7Sopenharmony_ci
1870e5c31af7Sopenharmony_ciifdef::VK_KHR_object_refresh[]
1871e5c31af7Sopenharmony_ciinclude::{chapters}/VK_KHR_object_refresh/copies.adoc[]
1872e5c31af7Sopenharmony_ciendif::VK_KHR_object_refresh[]
1873e5c31af7Sopenharmony_ci
1874e5c31af7Sopenharmony_ciifdef::VK_AMD_buffer_marker[]
1875e5c31af7Sopenharmony_ciinclude::{chapters}/VK_AMD_buffer_marker/copies.adoc[]
1876e5c31af7Sopenharmony_ciendif::VK_AMD_buffer_marker[]
1877