1// Copyright 2015-2021 The Khronos Group, Inc. 2// 3// SPDX-License-Identifier: CC-BY-4.0 4 5[[copies]] 6= Copy Commands 7 8An application can: copy buffer and image data using several methods 9depending on the type of data transfer. 10Data can: be copied between buffer objects with 11ifdef::VK_KHR_copy_commands2[] 12fname:vkCmdCopyBuffer2KHR and 13endif::VK_KHR_copy_commands2[] 14fname:vkCmdCopyBuffer and a portion of an image can: be copied to another 15image with 16ifdef::VK_KHR_copy_commands2[] 17fname:vkCmdCopyImage2KHR and 18endif::VK_KHR_copy_commands2[] 19fname:vkCmdCopyImage. 20Image data can: also be copied to and from buffer memory using 21ifndef::VK_KHR_copy_commands2[] 22fname:vkCmdCopyImageToBuffer and fname:vkCmdCopyBufferToImage. 23endif::VK_KHR_copy_commands2[] 24ifdef::VK_KHR_copy_commands2[] 25fname:vkCmdCopyImageToBuffer2KHR, fname:vkCmdCopyImageToBuffer, 26fname:vkCmdCopyBufferToImage2KHR, and fname:vkCmdCopyBufferToImage. 27endif::VK_KHR_copy_commands2[] 28Image data can: be blitted (with or without scaling and filtering) with 29ifdef::VK_KHR_copy_commands2[] 30fname:vkCmdBlitImage2KHR and 31endif::VK_KHR_copy_commands2[] 32fname:vkCmdBlitImage. 33Multisampled images can: be resolved to a non-multisampled image with 34ifdef::VK_KHR_copy_commands2[] 35fname:vkCmdResolveImage2KHR and 36endif::VK_KHR_copy_commands2[] 37fname:vkCmdResolveImage. 38 39 40== Common Operation 41 42The following valid usage rules apply to all copy commands: 43 44 * Copy commands must: be recorded outside of a render pass instance. 45 * The set of all bytes bound to all the source regions must: not overlap 46 the set of all bytes bound to the destination regions. 47 * The set of all bytes bound to each destination region must: not overlap 48 the set of all bytes bound to another destination region. 49 * Copy regions must: be non-empty. 50 * Regions must: not extend outside the bounds of the buffer or image 51 level, except that regions of compressed images can: extend as far as 52 the dimension of the image level rounded up to a complete compressed 53 texel block. 54 * Source image subresources must: be in either the 55 ename:VK_IMAGE_LAYOUT_GENERAL or 56 ename:VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL layout. 57 Destination image subresources must: be in the 58ifdef::VK_KHR_shared_presentable_image[] 59 ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR, 60endif::VK_KHR_shared_presentable_image[] 61 ename:VK_IMAGE_LAYOUT_GENERAL or 62 ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL layout. 63 As a consequence, if an image subresource is used as both source and 64 destination of a copy, it must: be in the ename:VK_IMAGE_LAYOUT_GENERAL 65 layout. 66ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[] 67 * Source images must: have ename:VK_FORMAT_FEATURE_TRANSFER_SRC_BIT in 68 their <<resources-image-format-features,format features>>. 69 * Destination images must: have ename:VK_FORMAT_FEATURE_TRANSFER_DST_BIT 70 in their <<resources-image-format-features,format features>>. 71endif::VK_VERSION_1_1,VK_KHR_maintenance1[] 72 * Source buffers must: have been created with the 73 ename:VK_BUFFER_USAGE_TRANSFER_SRC_BIT usage bit enabled and destination 74 buffers must: have been created with the 75 ename:VK_BUFFER_USAGE_TRANSFER_DST_BIT usage bit enabled. 76ifndef::VK_VERSION_1_2+VK_EXT_separate_stencil_usage[] 77 * Source images must: have been created with 78 ename:VK_IMAGE_USAGE_TRANSFER_SRC_BIT set in 79 slink:VkImageCreateInfo::pname:usage 80 * Destination images must: have been created with 81 ename:VK_IMAGE_USAGE_TRANSFER_DST_BIT set in 82 slink:VkImageCreateInfo::pname:usage 83endif::VK_VERSION_1_2+VK_EXT_separate_stencil_usage[] 84ifdef::VK_VERSION_1_2,VK_EXT_separate_stencil_usage[] 85 * If the stencil aspect of source image is accessed, and the source image 86 was not created with <<VkImageStencilUsageCreateInfo,separate stencil 87 usage>>, the source image must: have been created with 88 ename:VK_IMAGE_USAGE_TRANSFER_SRC_BIT set in 89 slink:VkImageCreateInfo::pname:usage 90 * If the stencil aspect of destination image is accessed, and the 91 destination image was not created with 92 <<VkImageStencilUsageCreateInfo,separate stencil usage>>, the 93 destination image must: have been created with 94 ename:VK_IMAGE_USAGE_TRANSFER_DST_BIT set in 95 slink:VkImageCreateInfo::pname:usage 96 * If the stencil aspect of source image is accessed, and the source image 97 was created with <<VkImageStencilUsageCreateInfo,separate stencil 98 usage>>, the source image must: have been created with 99 ename:VK_IMAGE_USAGE_TRANSFER_SRC_BIT set in 100 slink:VkImageStencilUsageCreateInfo::pname:stencilUsage 101 * If the stencil aspect of destination image is accessed, and the 102 destination image was created with 103 <<VkImageStencilUsageCreateInfo,separate stencil usage>>, the 104 destination image must: have been created with 105 ename:VK_IMAGE_USAGE_TRANSFER_DST_BIT set in 106 slink:VkImageStencilUsageCreateInfo::pname:stencilUsage 107 * If non-stencil aspects of a source image are accessed, the source image 108 must: have been created with ename:VK_IMAGE_USAGE_TRANSFER_SRC_BIT set 109 in slink:VkImageCreateInfo::pname:usage 110 * If non-stencil aspects of a destination image are accessed, the 111 destination image must: have been created with 112 ename:VK_IMAGE_USAGE_TRANSFER_DST_BIT set in 113 slink:VkImageCreateInfo::pname:usage 114endif::VK_VERSION_1_2,VK_EXT_separate_stencil_usage[] 115 116All copy commands are treated as "`transfer`" operations for the purposes of 117synchronization barriers. 118 119All copy commands that have a source format with an X component in its 120format description read undefined: values from those bits. 121 122All copy commands that have a destination format with an X component in its 123format description write undefined: values to those bits. 124 125 126[[copies-buffers]] 127== Copying Data Between Buffers 128 129[open,refpage='vkCmdCopyBuffer',desc='Copy data between buffer regions',type='protos'] 130-- 131:refpage: vkCmdCopyBuffer 132 133To copy data between buffer objects, call: 134 135include::{generated}/api/protos/vkCmdCopyBuffer.txt[] 136 137 * pname:commandBuffer is the command buffer into which the command will be 138 recorded. 139 * pname:srcBuffer is the source buffer. 140 * pname:dstBuffer is the destination buffer. 141 * pname:regionCount is the number of regions to copy. 142 * pname:pRegions is a pointer to an array of slink:VkBufferCopy structures 143 specifying the regions to copy. 144 145Each region in pname:pRegions is copied from the source buffer to the same 146region of the destination buffer. 147pname:srcBuffer and pname:dstBuffer can: be the same buffer or alias the 148same memory, but the resulting values are undefined: if the copy regions 149overlap in memory. 150 151.Valid Usage 152**** 153include::{chapters}/commonvalidity/copy_buffer_command_buffer_common.txt[] 154include::{chapters}/commonvalidity/copy_buffer_common.txt[] 155**** 156 157include::{generated}/validity/protos/vkCmdCopyBuffer.txt[] 158-- 159 160[open,refpage='VkBufferCopy',desc='Structure specifying a buffer copy operation',type='structs'] 161-- 162:refpage: VkBufferCopy 163 164The sname:VkBufferCopy structure is defined as: 165 166include::{generated}/api/structs/VkBufferCopy.txt[] 167 168 * pname:srcOffset is the starting offset in bytes from the start of 169 pname:srcBuffer. 170 * pname:dstOffset is the starting offset in bytes from the start of 171 pname:dstBuffer. 172 * pname:size is the number of bytes to copy. 173 174.Valid Usage 175**** 176include::{chapters}/commonvalidity/buffer_copy_common.txt[] 177**** 178 179include::{generated}/validity/structs/VkBufferCopy.txt[] 180-- 181 182ifdef::VK_KHR_copy_commands2[] 183 184A more extensible version of the copy buffer command is defined below. 185 186[open,refpage='vkCmdCopyBuffer2KHR',desc='Copy data between buffer regions',type='protos'] 187-- 188:refpage: vkCmdCopyBuffer2KHR 189 190To copy data between buffer objects, call: 191 192include::{generated}/api/protos/vkCmdCopyBuffer2KHR.txt[] 193 194 * pname:commandBuffer is the command buffer into which the command will be 195 recorded. 196 * pname:pCopyBufferInfo is a pointer to a slink:VkCopyBufferInfo2KHR 197 structure describing the copy parameters. 198 199This command is functionally identical to flink:vkCmdCopyBuffer, but 200includes extensible sub-structures that include pname:sType and pname:pNext 201parameters, allowing them to be more easily extended. 202 203.Valid Usage 204**** 205include::{chapters}/commonvalidity/copy_buffer_command_buffer_common.txt[] 206**** 207 208include::{generated}/validity/protos/vkCmdCopyBuffer2KHR.txt[] 209-- 210 211[open,refpage='VkCopyBufferInfo2KHR',desc='Structure specifying parameters of a buffer copy command',type='structs'] 212-- 213:refpage: VkCopyBufferInfo2KHR 214 215The sname:VkCopyBufferInfo2KHR structure is defined as: 216 217include::{generated}/api/structs/VkCopyBufferInfo2KHR.txt[] 218 219 * pname:sType is the type of this structure. 220 * pname:pNext is `NULL` or a pointer to a structure extending this 221 structure. 222 * pname:srcBuffer is the source buffer. 223 * pname:dstBuffer is the destination buffer. 224 * pname:regionCount is the number of regions to copy. 225 * pname:pRegions is a pointer to an array of slink:VkBufferCopy2KHR 226 structures specifying the regions to copy. 227 228Members defined by this structure with the same name as parameters in 229flink:vkCmdCopyBuffer have the identical effect to those parameters; the 230child structure slink:VkBufferCopy2KHR is a variant of slink:VkBufferCopy 231which includes pname:sType and pname:pNext parameters, allowing it to be 232extended. 233 234.Valid Usage 235**** 236include::{chapters}/commonvalidity/copy_buffer_common.txt[] 237**** 238 239include::{generated}/validity/structs/VkCopyBufferInfo2KHR.txt[] 240-- 241 242[open,refpage='VkBufferCopy2KHR',desc='Structure specifying a buffer copy operation',type='structs'] 243-- 244:refpage: VkBufferCopy2KHR 245 246The sname:VkBufferCopy2KHR structure is defined as: 247 248include::{generated}/api/structs/VkBufferCopy2KHR.txt[] 249 250 * pname:sType is the type of this structure. 251 * pname:pNext is `NULL` or a pointer to a structure extending this 252 structure. 253 * pname:srcOffset is the starting offset in bytes from the start of 254 pname:srcBuffer. 255 * pname:dstOffset is the starting offset in bytes from the start of 256 pname:dstBuffer. 257 * pname:size is the number of bytes to copy. 258 259.Valid Usage 260**** 261include::{chapters}/commonvalidity/buffer_copy_common.txt[] 262**** 263 264include::{generated}/validity/structs/VkBufferCopy2KHR.txt[] 265-- 266 267endif::VK_KHR_copy_commands2[] 268 269 270[[copies-images]] 271== Copying Data Between Images 272 273fname:vkCmdCopyImage performs image copies in a similar manner to a host 274memcpy. 275It does not perform general-purpose conversions such as scaling, resizing, 276blending, color-space conversion, or format conversions. 277Rather, it simply copies raw image data. 278fname:vkCmdCopyImage can: copy between images with different formats, 279provided the formats are compatible as defined below. 280 281[open,refpage='vkCmdCopyImage',desc='Copy data between images',type='protos'] 282-- 283:refpage: vkCmdCopyImage 284 285To copy data between image objects, call: 286 287include::{generated}/api/protos/vkCmdCopyImage.txt[] 288 289 * pname:commandBuffer is the command buffer into which the command will be 290 recorded. 291 * pname:srcImage is the source image. 292 * pname:srcImageLayout is the current layout of the source image 293 subresource. 294 * pname:dstImage is the destination image. 295 * pname:dstImageLayout is the current layout of the destination image 296 subresource. 297 * pname:regionCount is the number of regions to copy. 298 * pname:pRegions is a pointer to an array of slink:VkImageCopy structures 299 specifying the regions to copy. 300 301Each region in pname:pRegions is copied from the source image to the same 302region of the destination image. 303pname:srcImage and pname:dstImage can: be the same image or alias the same 304memory. 305 306[[copies-images-format-compatibility]] 307The formats of pname:srcImage and pname:dstImage must: be compatible. 308Formats are compatible if they share the same class, as shown in the 309<<formats-compatibility,Compatible Formats>> table. 310Depth/stencil formats must: match exactly. 311 312ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 313If either pname:srcImage or pname:dstImage has a 314<<formats-requiring-sampler-ycbcr-conversion, _multi-planar_ format>>, 315regions of each plane to be copied must: be specified separately using the 316pname:srcSubresource and pname:dstSubresource members of the 317slink:VkImageCopy structure. 318In this case, the pname:aspectMask of the pname:srcSubresource or 319pname:dstSubresource that refers to the multi-planar image must: be 320ename:VK_IMAGE_ASPECT_PLANE_0_BIT, ename:VK_IMAGE_ASPECT_PLANE_1_BIT, or 321ename:VK_IMAGE_ASPECT_PLANE_2_BIT. 322For the purposes of fname:vkCmdCopyImage, each plane of a multi-planar image 323is treated as having the format listed in <<formats-compatible-planes>> for 324the plane identified by the pname:aspectMask of the corresponding 325subresource. 326This applies both to elink:VkFormat and to coordinates used in the copy, 327which correspond to texels in the _plane_ rather than how these texels map 328to coordinates in the image as a whole. 329 330[NOTE] 331.Note 332==== 333For example, the ename:VK_IMAGE_ASPECT_PLANE_1_BIT plane of a 334ename:VK_FORMAT_G8_B8R8_2PLANE_420_UNORM image is compatible with an image 335of format ename:VK_FORMAT_R8G8_UNORM and (less usefully) with the 336ename:VK_IMAGE_ASPECT_PLANE_0_BIT plane of an image of format 337ename:VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16, as each texel is 3382 bytes in size. 339==== 340endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 341 342[[copies-images-format-size-compatibility]] 343fname:vkCmdCopyImage allows copying between _size-compatible_ compressed and 344uncompressed internal formats. 345Formats are size-compatible if the texel block size of the uncompressed 346format is equal to the texel block size of the compressed format. 347Such a copy does not perform on-the-fly compression or decompression. 348When copying from an uncompressed format to a compressed format, each texel 349of uncompressed data of the source image is copied as a raw value to the 350corresponding compressed texel block of the destination image. 351When copying from a compressed format to an uncompressed format, each 352compressed texel block of the source image is copied as a raw value to the 353corresponding texel of uncompressed data in the destination image. 354Thus, for example, it is legal to copy between a 128-bit uncompressed format 355and a compressed format which has a 128-bit sized compressed texel block 356representing 4{times}4 texels (using 8 bits per texel), or between a 64-bit 357uncompressed format and a compressed format which has a 64-bit sized 358compressed texel block representing 4{times}4 texels (using 4 bits per 359texel). 360 361When copying between compressed and uncompressed formats the pname:extent 362members represent the texel dimensions of the source image and not the 363destination. 364When copying from a compressed image to an uncompressed image the image 365texel dimensions written to the uncompressed image will be source extent 366divided by the compressed texel block dimensions. 367When copying from an uncompressed image to a compressed image the image 368texel dimensions written to the compressed image will be the source extent 369multiplied by the compressed texel block dimensions. 370In both cases the number of bytes read and the number of bytes written will 371be identical. 372 373Copying to or from block-compressed images is typically done in multiples of 374the compressed texel block size. 375For this reason the pname:extent must: be a multiple of the compressed texel 376block dimension. 377There is one exception to this rule which is required: to handle compressed 378images created with dimensions that are not a multiple of the compressed 379texel block dimensions: if the pname:srcImage is compressed, then: 380 381 * If pname:extent.width is not a multiple of the compressed texel block 382 width, then [eq]#(pname:extent.width {plus} pname:srcOffset.x)# must: 383 equal the image subresource width. 384 * If pname:extent.height is not a multiple of the compressed texel block 385 height, then [eq]#(pname:extent.height {plus} pname:srcOffset.y)# must: 386 equal the image subresource height. 387 * If pname:extent.depth is not a multiple of the compressed texel block 388 depth, then [eq]#(pname:extent.depth {plus} pname:srcOffset.z)# must: 389 equal the image subresource depth. 390 391Similarly, if the pname:dstImage is compressed, then: 392 393 * If pname:extent.width is not a multiple of the compressed texel block 394 width, then [eq]#(pname:extent.width {plus} pname:dstOffset.x)# must: 395 equal the image subresource width. 396 * If pname:extent.height is not a multiple of the compressed texel block 397 height, then [eq]#(pname:extent.height {plus} pname:dstOffset.y)# must: 398 equal the image subresource height. 399 * If pname:extent.depth is not a multiple of the compressed texel block 400 depth, then [eq]#(pname:extent.depth {plus} pname:dstOffset.z)# must: 401 equal the image subresource depth. 402 403This allows the last compressed texel block of the image in each 404non-multiple dimension to be included as a source or destination of the 405copy. 406 407ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 408"`etext:_422`" image formats that are not 409<<formats-requiring-sampler-ycbcr-conversion,_multi-planar_>> are treated as 410having a 2{times}1 compressed texel block for the purposes of these rules. 411endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 412 413fname:vkCmdCopyImage can: be used to copy image data between multisample 414images, but both images must: have the same number of samples. 415 416.Valid Usage 417**** 418include::{chapters}/commonvalidity/copy_image_command_buffer_common.txt[] 419include::{chapters}/commonvalidity/copy_image_common.txt[] 420**** 421 422include::{generated}/validity/protos/vkCmdCopyImage.txt[] 423-- 424 425[open,refpage='VkImageCopy',desc='Structure specifying an image copy operation',type='structs'] 426-- 427:refpage: VkImageCopy 428 429The sname:VkImageCopy structure is defined as: 430 431include::{generated}/api/structs/VkImageCopy.txt[] 432 433 * pname:srcSubresource and pname:dstSubresource are 434 slink:VkImageSubresourceLayers structures specifying the image 435 subresources of the images used for the source and destination image 436 data, respectively. 437 * pname:srcOffset and pname:dstOffset select the initial pname:x, pname:y, 438 and pname:z offsets in texels of the sub-regions of the source and 439 destination image data. 440 * pname:extent is the size in texels of the image to copy in pname:width, 441 pname:height and pname:depth. 442 443ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[] 444For ename:VK_IMAGE_TYPE_3D images, copies are performed slice by slice 445starting with the pname:z member of the pname:srcOffset or pname:dstOffset, 446and copying pname:depth slices. 447For images with multiple layers, copies are performed layer by layer 448starting with the pname:baseArrayLayer member of the pname:srcSubresource or 449pname:dstSubresource and copying pname:layerCount layers. 450Image data can: be copied between images with different image types. 451If one image is ename:VK_IMAGE_TYPE_3D and the other image is 452ename:VK_IMAGE_TYPE_2D with multiple layers, then each slice is copied to or 453from a different layer. 454endif::VK_VERSION_1_1,VK_KHR_maintenance1[] 455ifndef::VK_VERSION_1_1,VK_KHR_maintenance1[] 456Copies are done layer by layer starting with pname:baseArrayLayer member of 457pname:srcSubresource for the source and pname:dstSubresource for the 458destination. 459pname:layerCount layers are copied to the destination image. 460endif::VK_VERSION_1_1,VK_KHR_maintenance1[] 461 462ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 463Copies involving a <<formats-requiring-sampler-ycbcr-conversion, 464multi-planar image format>> specify the region to be copied in terms of the 465_plane_ to be copied, not the coordinates of the multi-planar image. 466This means that copies accessing the R/B planes of "`etext:_422`" format 467images must: fit the copied region within half the pname:width of the parent 468image, and that copies accessing the R/B planes of "`etext:_420`" format 469images must: fit the copied region within half the pname:width and 470pname:height of the parent image. 471endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 472 473.Valid Usage 474**** 475include::{chapters}/commonvalidity/image_copy_common.txt[] 476**** 477 478include::{generated}/validity/structs/VkImageCopy.txt[] 479-- 480 481[open,refpage='VkImageSubresourceLayers',desc='Structure specifying an image subresource layers',type='structs'] 482-- 483 484The sname:VkImageSubresourceLayers structure is defined as: 485 486include::{generated}/api/structs/VkImageSubresourceLayers.txt[] 487 488 * pname:aspectMask is a combination of elink:VkImageAspectFlagBits, 489 selecting the color, depth and/or stencil aspects to be copied. 490 * pname:mipLevel is the mipmap level to copy 491 * pname:baseArrayLayer and pname:layerCount are the starting layer and 492 number of layers to copy. 493 494.Valid Usage 495**** 496 * [[VUID-VkImageSubresourceLayers-aspectMask-00167]] 497 If pname:aspectMask contains ename:VK_IMAGE_ASPECT_COLOR_BIT, it must: 498 not contain either of ename:VK_IMAGE_ASPECT_DEPTH_BIT or 499 ename:VK_IMAGE_ASPECT_STENCIL_BIT 500 * [[VUID-VkImageSubresourceLayers-aspectMask-00168]] 501 pname:aspectMask must: not contain ename:VK_IMAGE_ASPECT_METADATA_BIT 502ifdef::VK_EXT_image_drm_format_modifier[] 503 * [[VUID-VkImageSubresourceLayers-aspectMask-02247]] 504 pname:aspectMask must: not include 505 `VK_IMAGE_ASPECT_MEMORY_PLANE__{ibit}__BIT_EXT` for any index _i_ 506endif::VK_EXT_image_drm_format_modifier[] 507 * [[VUID-VkImageSubresourceLayers-layerCount-01700]] 508 pname:layerCount must: be greater than 0 509**** 510 511include::{generated}/validity/structs/VkImageSubresourceLayers.txt[] 512-- 513 514ifdef::VK_KHR_copy_commands2[] 515 516A more extensible version of the copy image command is defined below. 517 518[open,refpage='vkCmdCopyImage2KHR',desc='Copy data between images',type='protos'] 519-- 520:refpage: vkCmdCopyImage2KHR 521 522To copy data between image objects, call: 523 524include::{generated}/api/protos/vkCmdCopyImage2KHR.txt[] 525 526 * pname:commandBuffer is the command buffer into which the command will be 527 recorded. 528 * pname:pCopyImageInfo is a pointer to a slink:VkCopyImageInfo2KHR 529 structure describing the copy parameters. 530 531This command is functionally identical to flink:vkCmdCopyImage, but includes 532extensible sub-structures that include pname:sType and pname:pNext 533parameters, allowing them to be more easily extended. 534 535.Valid Usage 536**** 537include::{chapters}/commonvalidity/copy_image_command_buffer_common.txt[] 538**** 539 540include::{generated}/validity/protos/vkCmdCopyImage2KHR.txt[] 541-- 542 543 544[open,refpage='VkCopyImageInfo2KHR',desc='Structure specifying parameters of an image copy command',type='structs'] 545-- 546:refpage: VkCopyImageInfo2KHR 547 548The sname:VkCopyImageInfo2KHR structure is defined as: 549 550include::{generated}/api/structs/VkCopyImageInfo2KHR.txt[] 551 552 * pname:sType is the type of this structure. 553 * pname:pNext is `NULL` or a pointer to a structure extending this 554 structure. 555 * pname:srcImage is the source image. 556 * pname:srcImageLayout is the current layout of the source image 557 subresource. 558 * pname:dstImage is the destination image. 559 * pname:dstImageLayout is the current layout of the destination image 560 subresource. 561 * pname:regionCount is the number of regions to copy. 562 * pname:pRegions is a pointer to an array of slink:VkImageCopy2KHR 563 structures specifying the regions to copy. 564 565 566.Valid Usage 567**** 568include::{chapters}/commonvalidity/copy_image_common.txt[] 569**** 570 571include::{generated}/validity/structs/VkCopyImageInfo2KHR.txt[] 572-- 573 574[open,refpage='VkImageCopy2KHR',desc='Structure specifying an image copy operation',type='structs'] 575-- 576:refpage: VkImageCopy2KHR 577 578The sname:VkImageCopy2KHR structure is defined as: 579 580include::{generated}/api/structs/VkImageCopy2KHR.txt[] 581 582 * pname:sType is the type of this structure. 583 * pname:pNext is `NULL` or a pointer to a structure extending this 584 structure. 585 * pname:srcSubresource and pname:dstSubresource are 586 slink:VkImageSubresourceLayers structures specifying the image 587 subresources of the images used for the source and destination image 588 data, respectively. 589 * pname:srcOffset and pname:dstOffset select the initial pname:x, pname:y, 590 and pname:z offsets in texels of the sub-regions of the source and 591 destination image data. 592 * pname:extent is the size in texels of the image to copy in pname:width, 593 pname:height and pname:depth. 594 595.Valid Usage 596**** 597include::{chapters}/commonvalidity/image_copy_common.txt[] 598**** 599 600include::{generated}/validity/structs/VkImageCopy2KHR.txt[] 601-- 602 603endif::VK_KHR_copy_commands2[] 604 605 606[[copies-buffers-images]] 607== Copying Data Between Buffers and Images 608 609[open,refpage='vkCmdCopyBufferToImage',desc='Copy data from a buffer into an image',type='protos'] 610-- 611:refpage: vkCmdCopyBufferToImage 612:imageparam: pname:dstImage 613 614To copy data from a buffer object to an image object, call: 615 616include::{generated}/api/protos/vkCmdCopyBufferToImage.txt[] 617 618 * pname:commandBuffer is the command buffer into which the command will be 619 recorded. 620 * pname:srcBuffer is the source buffer. 621 * pname:dstImage is the destination image. 622 * pname:dstImageLayout is the layout of the destination image subresources 623 for the copy. 624 * pname:regionCount is the number of regions to copy. 625 * pname:pRegions is a pointer to an array of slink:VkBufferImageCopy 626 structures specifying the regions to copy. 627 628Each region in pname:pRegions is copied from the specified region of the 629source buffer to the specified region of the destination image. 630 631ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 632If pname:dstImage has a 633<<formats-requiring-sampler-ycbcr-conversion,multi-planar format>>, regions 634of each plane to be a target of a copy must: be specified separately using 635the pname:pRegions member of the slink:VkBufferImageCopy structure. 636In this case, the pname:aspectMask of pname:imageSubresource must: be 637ename:VK_IMAGE_ASPECT_PLANE_0_BIT, ename:VK_IMAGE_ASPECT_PLANE_1_BIT, or 638ename:VK_IMAGE_ASPECT_PLANE_2_BIT. 639For the purposes of fname:vkCmdCopyBufferToImage, each plane of a 640multi-planar image is treated as having the format listed in 641<<formats-compatible-planes>> for the plane identified by the 642pname:aspectMask of the corresponding subresource. 643This applies both to elink:VkFormat and to coordinates used in the copy, 644which correspond to texels in the _plane_ rather than how these texels map 645to coordinates in the image as a whole. 646endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 647 648.Valid Usage 649**** 650include::{chapters}/commonvalidity/copy_buffer_to_image_command_buffer_common.txt[] 651 * [[VUID-vkCmdCopyBufferToImage-pRegions-06217]] 652 The image region specified by each element of pname:pRegions must: be 653 contained within the specified pname:imageSubresource of pname:dstImage 654include::{chapters}/commonvalidity/copy_buffer_to_image_common.txt[] 655 * [[VUID-vkCmdCopyBufferToImage-pRegions-06218]] 656 For each element of pname:pRegions, pname:imageOffset.x and 657 [eq]#(pname:imageExtent.width {plus} pname:imageOffset.x)# must: both be 658 greater than or equal to `0` and less than or equal to the width of the 659 specified pname:imageSubresource of pname:dstImage 660 * [[VUID-vkCmdCopyBufferToImage-pRegions-06219]] 661 For each element of pname:pRegions, pname:imageOffset.y and 662 [eq]#(pname:imageExtent.height {plus} pname:imageOffset.y)# must: both 663 be greater than or equal to `0` and less than or equal to the height of 664 the specified pname:imageSubresource of pname:dstImage 665include::{chapters}/commonvalidity/copy_bufferimage_to_imagebuffer_common.txt[] 666**** 667 668include::{generated}/validity/protos/vkCmdCopyBufferToImage.txt[] 669-- 670 671[open,refpage='vkCmdCopyImageToBuffer',desc='Copy image data into a buffer',type='protos'] 672-- 673:refpage: vkCmdCopyImageToBuffer 674:imageparam: pname:srcImage 675 676To copy data from an image object to a buffer object, call: 677 678include::{generated}/api/protos/vkCmdCopyImageToBuffer.txt[] 679 680 * pname:commandBuffer is the command buffer into which the command will be 681 recorded. 682 * pname:srcImage is the source image. 683 * pname:srcImageLayout is the layout of the source image subresources for 684 the copy. 685 * pname:dstBuffer is the destination buffer. 686 * pname:regionCount is the number of regions to copy. 687 * pname:pRegions is a pointer to an array of slink:VkBufferImageCopy 688 structures specifying the regions to copy. 689 690Each region in pname:pRegions is copied from the specified region of the 691source image to the specified region of the destination buffer. 692 693ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 694If pname:srcImage has a <<formats-requiring-sampler-ycbcr-conversion, 695multi-planar format>>, regions of each plane to be a source of a copy must: 696be specified separately using the pname:pRegions member of the 697slink:VkBufferImageCopy structure. 698In this case, the pname:aspectMask of pname:imageSubresource must: be 699ename:VK_IMAGE_ASPECT_PLANE_0_BIT, ename:VK_IMAGE_ASPECT_PLANE_1_BIT, or 700ename:VK_IMAGE_ASPECT_PLANE_2_BIT. 701For the purposes of fname:vkCmdCopyBufferToImage, each plane of a 702multi-planar image is treated as having the format listed in 703<<formats-compatible-planes>> for the plane identified by the 704pname:aspectMask of the corresponding subresource. 705This applies both to elink:VkFormat and to coordinates used in the copy, 706which correspond to texels in the _plane_ rather than how these texels map 707to coordinates in the image as a whole. 708endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 709 710.Valid Usage 711**** 712include::{chapters}/commonvalidity/copy_image_to_buffer_command_buffer_common.txt[] 713 * [[VUID-vkCmdCopyImageToBuffer-pRegions-06220]] 714 The image region specified by each element of pname:pRegions must: be 715 contained within the specified pname:imageSubresource of pname:srcImage 716include::{chapters}/commonvalidity/copy_image_to_buffer_common.txt[] 717 * [[VUID-vkCmdCopyImageToBuffer-pRegions-06221]] 718 For each element of pname:pRegions, pname:imageOffset.x and 719 [eq]#(pname:imageExtent.width {plus} pname:imageOffset.x)# must: both be 720 greater than or equal to `0` and less than or equal to the width of the 721 specified pname:imageSubresource of pname:srcImage 722 * [[VUID-vkCmdCopyImageToBuffer-pRegions-06222]] 723 For each element of pname:pRegions, pname:imageOffset.y and 724 [eq]#(imageExtent.height {plus} pname:imageOffset.y)# must: both be 725 greater than or equal to `0` and less than or equal to the height of the 726 specified pname:imageSubresource of pname:srcImage 727include::{chapters}/commonvalidity/copy_bufferimage_to_imagebuffer_common.txt[] 728**** 729 730include::{generated}/validity/protos/vkCmdCopyImageToBuffer.txt[] 731-- 732 733[open,refpage='VkBufferImageCopy',desc='Structure specifying a buffer image copy operation',type='structs'] 734-- 735:refpage: VkBufferImageCopy 736 737For both flink:vkCmdCopyBufferToImage and flink:vkCmdCopyImageToBuffer, each 738element of pname:pRegions is a structure defined as: 739 740include::{generated}/api/structs/VkBufferImageCopy.txt[] 741 742 * pname:bufferOffset is the offset in bytes from the start of the buffer 743 object where the image data is copied from or to. 744 * pname:bufferRowLength and pname:bufferImageHeight specify in texels a 745 subregion of a larger two- or three-dimensional image in buffer memory, 746 and control the addressing calculations. 747 If either of these values is zero, that aspect of the buffer memory is 748 considered to be tightly packed according to the pname:imageExtent. 749 * pname:imageSubresource is a slink:VkImageSubresourceLayers used to 750 specify the specific image subresources of the image used for the source 751 or destination image data. 752 * pname:imageOffset selects the initial pname:x, pname:y, pname:z offsets 753 in texels of the sub-region of the source or destination image data. 754 * pname:imageExtent is the size in texels of the image to copy in 755 pname:width, pname:height and pname:depth. 756 757When copying to or from a depth or stencil aspect, the data in buffer memory 758uses a layout that is a (mostly) tightly packed representation of the depth 759or stencil data. 760Specifically: 761 762 * data copied to or from the stencil aspect of any depth/stencil format is 763 tightly packed with one ename:VK_FORMAT_S8_UINT value per texel. 764 * data copied to or from the depth aspect of a ename:VK_FORMAT_D16_UNORM 765 or ename:VK_FORMAT_D16_UNORM_S8_UINT format is tightly packed with one 766 ename:VK_FORMAT_D16_UNORM value per texel. 767 * data copied to or from the depth aspect of a ename:VK_FORMAT_D32_SFLOAT 768 or ename:VK_FORMAT_D32_SFLOAT_S8_UINT format is tightly packed with one 769 ename:VK_FORMAT_D32_SFLOAT value per texel. 770 * data copied to or from the depth aspect of a 771 ename:VK_FORMAT_X8_D24_UNORM_PACK32 or ename:VK_FORMAT_D24_UNORM_S8_UINT 772 format is packed with one 32-bit word per texel with the D24 value in 773 the LSBs of the word, and undefined: values in the eight MSBs. 774 775[NOTE] 776.Note 777==== 778To copy both the depth and stencil aspects of a depth/stencil format, two 779entries in pname:pRegions can: be used, where one specifies the depth aspect 780in pname:imageSubresource, and the other specifies the stencil aspect. 781==== 782 783Because depth or stencil aspect buffer to image copies may: require format 784conversions on some implementations, they are not supported on queues that 785do not support graphics. 786 787When copying to a depth aspect, 788ifdef::VK_EXT_depth_range_unrestricted[] 789and the `apiext:VK_EXT_depth_range_unrestricted` extension is not enabled, 790endif::VK_EXT_depth_range_unrestricted[] 791the data in buffer memory must: be in the range [eq]#[0,1]#, or the 792resulting values are undefined:. 793 794Copies are done layer by layer starting with image layer 795pname:baseArrayLayer member of pname:imageSubresource. 796pname:layerCount layers are copied from the source image or to the 797destination image. 798 799[[blocked-image]] 800For purpose of valid usage statements here and in related copy commands, a 801_blocked image_ is defined as: 802 803ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 804 * an image with a _single-plane_, "`etext:_422`" format, which is treated 805 as a format with a 2 {times} 1 compressed texel block, or 806endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 807 * a compressed image. 808 809.Valid Usage 810**** 811include::{chapters}/commonvalidity/buffer_image_copy_common.txt[] 812**** 813 814include::{generated}/validity/structs/VkBufferImageCopy.txt[] 815-- 816 817ifdef::VK_KHR_copy_commands2[] 818 819More extensible versions of the commands to copy between buffers and images 820are defined below. 821 822[open,refpage='vkCmdCopyBufferToImage2KHR',desc='Copy data from a buffer into an image',type='protos'] 823-- 824:refpage: vkCmdCopyBufferToImage2KHR 825 826To copy data from a buffer object to an image object, call: 827 828include::{generated}/api/protos/vkCmdCopyBufferToImage2KHR.txt[] 829 830 * pname:commandBuffer is the command buffer into which the command will be 831 recorded. 832 * pname:pCopyBufferToImageInfo is a pointer to a 833 slink:VkCopyBufferToImageInfo2KHR structure describing the copy 834 parameters. 835 836This command is functionally identical to flink:vkCmdCopyBufferToImage, but 837includes extensible sub-structures that include pname:sType and pname:pNext 838parameters, allowing them to be more easily extended. 839 840.Valid Usage 841**** 842include::{chapters}/commonvalidity/copy_buffer_to_image_command_buffer_common.txt[] 843**** 844 845include::{generated}/validity/protos/vkCmdCopyBufferToImage2KHR.txt[] 846-- 847 848[open,refpage='VkCopyBufferToImageInfo2KHR',desc='Structure specifying parameters of a buffer to image copy command',type='structs'] 849-- 850:refpage: VkCopyBufferToImageInfo2KHR 851:imageparam: pname:dstImage 852 853The sname:VkCopyBufferToImageInfo2KHR structure is defined as: 854 855include::{generated}/api/structs/VkCopyBufferToImageInfo2KHR.txt[] 856 857 * pname:sType is the type of this structure. 858 * pname:pNext is `NULL` or a pointer to a structure extending this 859 structure. 860 * pname:srcBuffer is the source buffer. 861 * pname:dstImage is the destination image. 862 * pname:dstImageLayout is the layout of the destination image subresources 863 for the copy. 864 * pname:regionCount is the number of regions to copy. 865 * pname:pRegions is a pointer to an array of slink:VkBufferImageCopy2KHR 866 structures specifying the regions to copy. 867 868.Valid Usage 869**** 870ifndef::VK_QCOM_rotated_copy_commands[] 871 * [[VUID-VkCopyBufferToImageInfo2KHR-pRegions-00172]] 872 The image region specified by each element of pname:pRegions must: be 873 contained within the specified pname:imageSubresource of pname:dstImage 874endif::VK_QCOM_rotated_copy_commands[] 875ifdef::VK_QCOM_rotated_copy_commands[] 876 * [[VUID-VkCopyBufferToImageInfo2KHR-pRegions-04565]] 877 If the image region specified by each element of pname:pRegions does not 878 contain slink:VkCopyCommandTransformInfoQCOM in its pname:pNext chain, 879 it must: be a region that is contained within the specified 880 pname:imageSubresource of pname:dstImage 881 * [[VUID-VkCopyBufferToImageInfo2KHR-pRegions-04554]] 882 If the image region specified by each element of pname:pRegions contains 883 slink:VkCopyCommandTransformInfoQCOM in its pname:pNext chain, the 884 rotated destination region as described in 885 <<copies-buffers-images-rotation-addressing>> must: be contained within 886 pname:dstImage 887 * [[VUID-VkCopyBufferToImageInfo2KHR-pRegions-04555]] 888 If any element of pname:pRegions contains 889 slink:VkCopyCommandTransformInfoQCOM in its pname:pNext chain, then 890 pname:dstImage must: not be a <<blocked-image,blocked image>> 891 * [[VUID-VkCopyBufferToImageInfo2KHR-pRegions-06203]] 892 If any element of pname:pRegions contains 893 slink:VkCopyCommandTransformInfoQCOM in its pname:pNext chain, then 894 pname:dstImage must: be of type ename:VK_IMAGE_TYPE_2D 895 * [[VUID-VkCopyBufferToImageInfo2KHR-pRegions-06204]] 896 If any element of pname:pRegions contains 897 slink:VkCopyCommandTransformInfoQCOM in its pname:pNext chain, then 898 pname:dstImage must: not have a 899 <<formats-requiring-sampler-ycbcr-conversion, multi-planar format>> 900endif::VK_QCOM_rotated_copy_commands[] 901include::{chapters}/commonvalidity/copy_buffer_to_image_common.txt[] 902 * [[VUID-VkCopyBufferToImageInfo2KHR-pRegions-06223]] 903 For each element of pname:pRegions not containing 904 sname:VkCopyCommandTransformInfoQCOM in its pname:pNext chain, 905 pname:imageOffset.x and [eq]#(pname:imageExtent.width {plus} 906 pname:imageOffset.x)# must: both be greater than or equal to `0` and 907 less than or equal to the width of the specified pname:imageSubresource 908 of pname:dstImage 909 * [[VUID-VkCopyBufferToImageInfo2KHR-pRegions-06224]] 910 For each element of pname:pRegions not containing 911 sname:VkCopyCommandTransformInfoQCOM in its pname:pNext chain, 912 pname:imageOffset.y and [eq]#(pname:imageExtent.height {plus} 913 pname:imageOffset.y)# must: both be greater than or equal to `0` and 914 less than or equal to the height of the specified pname:imageSubresource 915 of pname:dstImage 916include::{chapters}/commonvalidity/copy_bufferimage_to_imagebuffer_common.txt[] 917**** 918 919include::{generated}/validity/structs/VkCopyBufferToImageInfo2KHR.txt[] 920-- 921 922[open,refpage='vkCmdCopyImageToBuffer2KHR',desc='Copy image data into a buffer',type='protos'] 923-- 924:refpage: vkCmdCopyImageToBuffer2KHR 925:imageparam: pname:srcImage 926 927To copy data from an image object to a buffer object, call: 928 929include::{generated}/api/protos/vkCmdCopyImageToBuffer2KHR.txt[] 930 931 * pname:commandBuffer is the command buffer into which the command will be 932 recorded. 933 * pname:pCopyImageToBufferInfo is a pointer to a 934 slink:VkCopyImageToBufferInfo2KHR structure describing the copy 935 parameters. 936 937This command is functionally identical to flink:vkCmdCopyImageToBuffer, but 938includes extensible sub-structures that include pname:sType and pname:pNext 939parameters, allowing them to be more easily extended. 940 941 942.Valid Usage 943**** 944include::{chapters}/commonvalidity/copy_image_to_buffer_command_buffer_common.txt[] 945**** 946 947include::{generated}/validity/protos/vkCmdCopyImageToBuffer2KHR.txt[] 948-- 949 950[open,refpage='VkCopyImageToBufferInfo2KHR',desc='Structure specifying parameters of an image to buffer copy command',type='structs'] 951-- 952:refpage: VkCopyImageToBufferInfo2KHR 953 954The sname:VkCopyImageToBufferInfo2KHR structure is defined as: 955 956include::{generated}/api/structs/VkCopyImageToBufferInfo2KHR.txt[] 957 958 * pname:sType is the type of this structure. 959 * pname:pNext is `NULL` or a pointer to a structure extending this 960 structure. 961 * pname:srcImage is the source image. 962 * pname:srcImageLayout is the layout of the source image subresources for 963 the copy. 964 * pname:dstBuffer is the destination buffer. 965 * pname:regionCount is the number of regions to copy. 966 * pname:pRegions is a pointer to an array of slink:VkBufferImageCopy2KHR 967 structures specifying the regions to copy. 968 969.Valid Usage 970**** 971ifndef::VK_QCOM_rotated_copy_commands[] 972 * [[VUID-VkCopyImageToBufferInfo2KHR-pRegions-00182]] 973 The image region specified by each element of pname:pRegions must: be 974 contained within the specified pname:imageSubresource of pname:srcImage 975endif::VK_QCOM_rotated_copy_commands[] 976ifdef::VK_QCOM_rotated_copy_commands[] 977 * [[VUID-VkCopyImageToBufferInfo2KHR-pRegions-04566]] 978 If the image region specified by each element of pname:pRegions does not 979 contain slink:VkCopyCommandTransformInfoQCOM in its pname:pNext chain, 980 it must: be contained within the specified pname:imageSubresource of 981 pname:srcImage 982 * [[VUID-VkCopyImageToBufferInfo2KHR-pRegions-04557]] 983 If the image region specified by each element of pname:pRegions contains 984 slink:VkCopyCommandTransformInfoQCOM in its pname:pNext chain, the 985 rotated source region as described in 986 <<copies-buffers-images-rotation-addressing>> must: be contained within 987 pname:srcImage 988 * [[VUID-VkCopyImageToBufferInfo2KHR-pRegions-04558]] 989 If any element of pname:pRegions contains 990 slink:VkCopyCommandTransformInfoQCOM in its pname:pNext chain, then 991 pname:srcImage must: not be a <<blocked-image,blocked image>> 992 * [[VUID-VkCopyImageToBufferInfo2KHR-pRegions-06205]] 993 If any element of pname:pRegions contains 994 slink:VkCopyCommandTransformInfoQCOM in its pname:pNext chain, then 995 pname:srcImage must: be of type ename:VK_IMAGE_TYPE_2D 996 * [[VUID-VkCopyImageToBufferInfo2KHR-pRegions-06206]] 997 If any element of pname:pRegions contains 998 slink:VkCopyCommandTransformInfoQCOM in its pname:pNext chain, then 999 pname:srcImage must: not have a 1000 <<formats-requiring-sampler-ycbcr-conversion, multi-planar format>> 1001endif::VK_QCOM_rotated_copy_commands[] 1002include::{chapters}/commonvalidity/copy_image_to_buffer_common.txt[] 1003 * [[VUID-VkCopyImageToBufferInfo2KHR-imageOffset-00197]] 1004 For each element of pname:pRegions not containing 1005 sname:VkCopyCommandTransformInfoQCOM in its pname:pNext chain, 1006 pname:imageOffset.x and [eq]#(pname:imageExtent.width {plus} 1007 pname:imageOffset.x)# must: both be greater than or equal to `0` and 1008 less than or equal to the width of the specified pname:imageSubresource 1009 of pname:srcImage 1010 * [[VUID-VkCopyImageToBufferInfo2KHR-imageOffset-00198]] 1011 For each element of pname:pRegions not containing 1012 sname:VkCopyCommandTransformInfoQCOM in its pname:pNext chain, 1013 pname:imageOffset.y and [eq]#(pname:imageExtent.height {plus} 1014 pname:imageOffset.y)# must: both be greater than or equal to `0` and 1015 less than or equal to the height of the specified pname:imageSubresource 1016 of pname:srcImage 1017include::{chapters}/commonvalidity/copy_bufferimage_to_imagebuffer_common.txt[] 1018**** 1019 1020include::{generated}/validity/structs/VkCopyImageToBufferInfo2KHR.txt[] 1021-- 1022 1023[open,refpage='VkBufferImageCopy2KHR',desc='Structure specifying a buffer image copy operation',type='structs'] 1024-- 1025:refpage: VkBufferImageCopy2KHR 1026 1027For both flink:vkCmdCopyBufferToImage2KHR and 1028flink:vkCmdCopyImageToBuffer2KHR, each element of pname:pRegions is a 1029structure defined as: 1030 1031include::{generated}/api/structs/VkBufferImageCopy2KHR.txt[] 1032 1033 * pname:sType is the type of this structure. 1034 * pname:pNext is `NULL` or a pointer to a structure extending this 1035 structure. 1036 * pname:bufferOffset is the offset in bytes from the start of the buffer 1037 object where the image data is copied from or to. 1038 * pname:bufferRowLength and pname:bufferImageHeight specify in texels a 1039 subregion of a larger two- or three-dimensional image in buffer memory, 1040 and control the addressing calculations. 1041 If either of these values is zero, that aspect of the buffer memory is 1042 considered to be tightly packed according to the pname:imageExtent. 1043 * pname:imageSubresource is a slink:VkImageSubresourceLayers used to 1044 specify the specific image subresources of the image used for the source 1045 or destination image data. 1046 * pname:imageOffset selects the initial pname:x, pname:y, pname:z offsets 1047 in texels of the sub-region of the source or destination image data. 1048 * pname:imageExtent is the size in texels of the image to copy in 1049 pname:width, pname:height and pname:depth. 1050 1051This structure is functionally identical to slink:VkBufferImageCopy, but 1052adds pname:sType and pname:pNext parameters, allowing it to be more easily 1053extended. 1054 1055.Valid Usage 1056**** 1057include::{chapters}/commonvalidity/buffer_image_copy_common.txt[] 1058**** 1059 1060include::{generated}/validity/structs/VkBufferImageCopy2KHR.txt[] 1061-- 1062endif::VK_KHR_copy_commands2[] 1063 1064ifdef::VK_QCOM_rotated_copy_commands[] 1065For both flink:vkCmdCopyBufferToImage2KHR and 1066flink:vkCmdCopyImageToBuffer2KHR, each region copied can include a rotation. 1067To specify a region with rotation, add the 1068slink:VkCopyCommandTransformInfoQCOM to the pname:pNext chain of 1069slink:VkBufferImageCopy2KHR. 1070When a rotation is specified, <<copies-buffers-images-rotation-addressing, 1071Buffer and Image Addressing with Rotation>> specifies how coordinates of 1072texels in the source region are rotated by pname:transform to produce texel 1073coordinates in the destination region. 1074When rotation is specified, the source and destination images must: each be 10752D images. 1076They must: not be <<blocked-image,blocked images>> or have a 1077<<formats-requiring-sampler-ycbcr-conversion, multi-planar format>>. 1078 1079[open,refpage='VkCopyCommandTransformInfoQCOM',desc='Structure describing transform parameters of rotated copy command',type='structs'] 1080-- 1081The sname:VkRenderPassTransformBeginInfoQCOM structure is defined as: 1082 1083include::{generated}/api/structs/VkCopyCommandTransformInfoQCOM.txt[] 1084 1085 * pname:sType is the type of this structure. 1086 * pname:pNext is `NULL` or a pointer to a structure extending this 1087 structure. 1088 * pname:transform is a elink:VkSurfaceTransformFlagBitsKHR value 1089 describing the transform to be applied. 1090 1091.Valid Usage 1092**** 1093 * [[VUID-VkCopyCommandTransformInfoQCOM-transform-04560]] 1094 pname:transform must: be ename:VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR, 1095 ename:VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR, 1096 ename:VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR, or 1097 ename:VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR 1098**** 1099 1100include::{generated}/validity/structs/VkCopyCommandTransformInfoQCOM.txt[] 1101-- 1102 1103endif::VK_QCOM_rotated_copy_commands[] 1104 1105 1106[[copies-buffers-images-addressing]] 1107=== Buffer and Image Addressing 1108 1109Pseudocode for image/buffer addressing of uncompressed formats is: 1110 1111[source,c] 1112--------------------------------------------------- 1113rowLength = region->bufferRowLength; 1114if (rowLength == 0) 1115 rowLength = region->imageExtent.width; 1116 1117imageHeight = region->bufferImageHeight; 1118if (imageHeight == 0) 1119 imageHeight = region->imageExtent.height; 1120 1121texelBlockSize = <texel block size of the format of the src/dstImage>; 1122 1123address of (x,y,z) = region->bufferOffset + (((z * imageHeight) + y) * rowLength + x) * texelBlockSize; 1124 1125where x,y,z range from (0,0,0) to region->imageExtent.{width,height,depth}. 1126--------------------------------------------------- 1127 1128Note that pname:imageOffset does not affect addressing calculations for 1129buffer memory. 1130Instead, pname:bufferOffset can: be used to select the starting address in 1131buffer memory. 1132 1133For block-compressed formats, all parameters are still specified in texels 1134rather than compressed texel blocks, but the addressing math operates on 1135whole compressed texel blocks. 1136Pseudocode for compressed copy addressing is: 1137 1138[source,c] 1139--------------------------------------------------- 1140rowLength = region->bufferRowLength; 1141if (rowLength == 0) 1142 rowLength = region->imageExtent.width; 1143 1144imageHeight = region->bufferImageHeight; 1145if (imageHeight == 0) 1146 imageHeight = region->imageExtent.height; 1147 1148compressedTexelBlockSizeInBytes = <compressed texel block size taken from the src/dstImage>; 1149rowLength = (rowLength + compressedTexelBlockWidth - 1) / compressedTexelBlockWidth; 1150imageHeight = (imageHeight + compressedTexelBlockHeight - 1) / compressedTexelBlockHeight; 1151 1152address of (x,y,z) = region->bufferOffset + (((z * imageHeight) + y) * rowLength + x) * compressedTexelBlockSizeInBytes; 1153 1154where x,y,z range from (0,0,0) to region->imageExtent.{width/compressedTexelBlockWidth,height/compressedTexelBlockHeight,depth/compressedTexelBlockDepth}. 1155--------------------------------------------------- 1156 1157Copying to or from block-compressed images is typically done in multiples of 1158the compressed texel block size. 1159For this reason the pname:imageExtent must: be a multiple of the compressed 1160texel block dimension. 1161There is one exception to this rule which is required: to handle compressed 1162images created with dimensions that are not a multiple of the compressed 1163texel block dimensions: 1164 1165 * If pname:imageExtent.width is not a multiple of the compressed texel 1166 block width, then [eq]#(pname:imageExtent.width {plus} 1167 pname:imageOffset.x)# must: equal the image subresource width. 1168 * If pname:imageExtent.height is not a multiple of the compressed texel 1169 block height, then [eq]#(pname:imageExtent.height {plus} 1170 pname:imageOffset.y)# must: equal the image subresource height. 1171 * If pname:imageExtent.depth is not a multiple of the compressed texel 1172 block depth, then [eq]#(pname:imageExtent.depth {plus} 1173 pname:imageOffset.z)# must: equal the image subresource depth. 1174 1175This allows the last compressed texel block of the image in each 1176non-multiple dimension to be included as a source or destination of the 1177copy. 1178 1179ifdef::VK_QCOM_rotated_copy_commands[] 1180include::{chapters}/VK_QCOM_rotated_copies/rotated_addressing_copies.txt[] 1181endif::VK_QCOM_rotated_copy_commands[] 1182 1183 1184[[copies-imagescaling]] 1185== Image Copies with Scaling 1186 1187[open,refpage='vkCmdBlitImage',desc='Copy regions of an image, potentially performing format conversion,',type='protos'] 1188-- 1189:refpage: vkCmdBlitImage 1190 1191To copy regions of a source image into a destination image, potentially 1192performing format conversion, arbitrary scaling, and filtering, call: 1193 1194include::{generated}/api/protos/vkCmdBlitImage.txt[] 1195 1196 * pname:commandBuffer is the command buffer into which the command will be 1197 recorded. 1198 * pname:srcImage is the source image. 1199 * pname:srcImageLayout is the layout of the source image subresources for 1200 the blit. 1201 * pname:dstImage is the destination image. 1202 * pname:dstImageLayout is the layout of the destination image subresources 1203 for the blit. 1204 * pname:regionCount is the number of regions to blit. 1205 * pname:pRegions is a pointer to an array of slink:VkImageBlit structures 1206 specifying the regions to blit. 1207 * pname:filter is a elink:VkFilter specifying the filter to apply if the 1208 blits require scaling. 1209 1210fname:vkCmdBlitImage must: not be used for multisampled source or 1211destination images. 1212Use flink:vkCmdResolveImage for this purpose. 1213 1214As the sizes of the source and destination extents can: differ in any 1215dimension, texels in the source extent are scaled and filtered to the 1216destination extent. 1217Scaling occurs via the following operations: 1218 1219 * For each destination texel, the integer coordinate of that texel is 1220 converted to an unnormalized texture coordinate, using the effective 1221 inverse of the equations described in 1222 <<textures-unnormalized-to-integer, unnormalized to integer 1223 conversion>>: 1224 {empty}:: [eq]#u~base~ = i {plus} {onehalf}# 1225 {empty}:: [eq]#v~base~ = j {plus} {onehalf}# 1226 {empty}:: [eq]#w~base~ = k {plus} {onehalf}# 1227 * These base coordinates are then offset by the first destination offset: 1228 {empty}:: [eq]#u~offset~ = u~base~ - x~dst0~# 1229 {empty}:: [eq]#v~offset~ = v~base~ - y~dst0~# 1230 {empty}:: [eq]#w~offset~ = w~base~ - z~dst0~# 1231 {empty}:: [eq]#a~offset~ = a - pname:baseArrayCount~dst~# 1232 * The scale is determined from the source and destination regions, and 1233 applied to the offset coordinates: 1234 {empty}:: [eq]#scale~u~ = (x~src1~ - x~src0~) / (x~dst1~ - x~dst0~)# 1235 {empty}:: [eq]#scale~v~ = (y~src1~ - y~src0~) / (y~dst1~ - y~dst0~)# 1236 {empty}:: [eq]#scale~w~ = (z~src1~ - z~src0~) / (z~dst1~ - z~dst0~)# 1237 {empty}:: [eq]#u~scaled~ = u~offset~ {times} scale~u~# 1238 {empty}:: [eq]#v~scaled~ = v~offset~ {times} scale~v~# 1239 {empty}:: [eq]#w~scaled~ = w~offset~ {times} scale~w~# 1240 * Finally the source offset is added to the scaled coordinates, to 1241 determine the final unnormalized coordinates used to sample from 1242 pname:srcImage: 1243 {empty}:: [eq]#u = u~scaled~ {plus} x~src0~# 1244 {empty}:: [eq]#v = v~scaled~ {plus} y~src0~# 1245 {empty}:: [eq]#w = w~scaled~ {plus} z~src0~# 1246 {empty}:: [eq]#q = pname:mipLevel# 1247 {empty}:: [eq]#a = a~offset~ {plus} pname:baseArrayCount~src~# 1248 1249These coordinates are used to sample from the source image, as described in 1250<<textures, Image Operations chapter>>, with the filter mode equal to that 1251of pname:filter, a mipmap mode of ename:VK_SAMPLER_MIPMAP_MODE_NEAREST and 1252an address mode of ename:VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE. 1253Implementations must: clamp at the edge of the source image, and may: 1254additionally clamp to the edge of the source region. 1255 1256[NOTE] 1257.Note 1258==== 1259Due to allowable rounding errors in the generation of the source texture 1260coordinates, it is not always possible to guarantee exactly which source 1261texels will be sampled for a given blit. 1262As rounding errors are implementation-dependent, the exact results of a 1263blitting operation are also implementation-dependent. 1264==== 1265 1266Blits are done layer by layer starting with the pname:baseArrayLayer member 1267of pname:srcSubresource for the source and pname:dstSubresource for the 1268destination. 1269pname:layerCount layers are blitted to the destination image. 1270 1271When blitting 3D textures, slices in the destination region bounded by 1272pname:dstOffsets[0].z and pname:dstOffsets[1].z are sampled from slices in 1273the source region bounded by pname:srcOffsets[0].z and 1274pname:srcOffsets[1].z. 1275If the pname:filter parameter is ename:VK_FILTER_LINEAR then the value 1276sampled from the source image is taken by doing linear filtering using the 1277interpolated *z* coordinate represented by *w* in the previous equations. 1278If the pname:filter parameter is ename:VK_FILTER_NEAREST then the value 1279sampled from the source image is taken from the single nearest slice, with 1280an implementation-dependent arithmetic rounding mode. 1281 1282The following filtering and conversion rules apply: 1283 1284 * Integer formats can: only be converted to other integer formats with the 1285 same signedness. 1286 * No format conversion is supported between depth/stencil images. 1287 The formats must: match. 1288 * Format conversions on unorm, snorm, unscaled and packed float formats of 1289 the copied aspect of the image are performed by first converting the 1290 pixels to float values. 1291 * For sRGB source formats, nonlinear RGB values are converted to linear 1292 representation prior to filtering. 1293 * After filtering, the float values are first clamped and then cast to the 1294 destination image format. 1295 In case of sRGB destination format, linear RGB values are converted to 1296 nonlinear representation before writing the pixel to the image. 1297 1298Signed and unsigned integers are converted by first clamping to the 1299representable range of the destination format, then casting the value. 1300 1301.Valid Usage 1302**** 1303include::{chapters}/commonvalidity/blit_image_command_buffer_common.txt[] 1304include::{chapters}/commonvalidity/blit_image_common.txt[] 1305**** 1306 1307include::{generated}/validity/protos/vkCmdBlitImage.txt[] 1308-- 1309 1310[open,refpage='VkImageBlit',desc='Structure specifying an image blit operation',type='structs'] 1311-- 1312:refpage: VkImageBlit 1313 1314The sname:VkImageBlit structure is defined as: 1315 1316include::{generated}/api/structs/VkImageBlit.txt[] 1317 1318 * pname:srcSubresource is the subresource to blit from. 1319 * pname:srcOffsets is a pointer to an array of two slink:VkOffset3D 1320 structures specifying the bounds of the source region within 1321 pname:srcSubresource. 1322 * pname:dstSubresource is the subresource to blit into. 1323 * pname:dstOffsets is a pointer to an array of two slink:VkOffset3D 1324 structures specifying the bounds of the destination region within 1325 pname:dstSubresource. 1326 1327For each element of the pname:pRegions array, a blit operation is performed 1328for the specified source and destination regions. 1329 1330.Valid Usage 1331**** 1332include::{chapters}/commonvalidity/image_blit_common.txt[] 1333**** 1334 1335include::{generated}/validity/structs/VkImageBlit.txt[] 1336-- 1337 1338ifdef::VK_KHR_copy_commands2[] 1339 1340A more extensible version of the blit image command is defined below. 1341 1342[open,refpage='vkCmdBlitImage2KHR',desc='Copy regions of an image, potentially performing format conversion,',type='protos'] 1343-- 1344:refpage: vkCmdBlitImage2KHR 1345 1346To copy regions of a source image into a destination image, potentially 1347performing format conversion, arbitrary scaling, and filtering, call: 1348 1349include::{generated}/api/protos/vkCmdBlitImage2KHR.txt[] 1350 1351 * pname:commandBuffer is the command buffer into which the command will be 1352 recorded. 1353 * pname:pBlitImageInfo is a pointer to a slink:VkBlitImageInfo2KHR 1354 structure describing the blit parameters. 1355 1356This command is functionally identical to flink:vkCmdBlitImage, but includes 1357extensible sub-structures that include pname:sType and pname:pNext 1358parameters, allowing them to be more easily extended. 1359 1360.Valid Usage 1361**** 1362include::{chapters}/commonvalidity/blit_image_command_buffer_common.txt[] 1363**** 1364 1365include::{generated}/validity/protos/vkCmdBlitImage2KHR.txt[] 1366-- 1367 1368[open,refpage='VkBlitImageInfo2KHR',desc='Structure specifying parameters of blit image command',type='structs'] 1369-- 1370:refpage: VkBlitImageInfo2KHR 1371 1372The sname:VkBlitImageInfo2KHR structure is defined as: 1373 1374include::{generated}/api/structs/VkBlitImageInfo2KHR.txt[] 1375 1376 * pname:sType is the type of this structure. 1377 * pname:pNext is `NULL` or a pointer to a structure extending this 1378 structure. 1379 * pname:srcImage is the source image. 1380 * pname:srcImageLayout is the layout of the source image subresources for 1381 the blit. 1382 * pname:dstImage is the destination image. 1383 * pname:dstImageLayout is the layout of the destination image subresources 1384 for the blit. 1385 * pname:regionCount is the number of regions to blit. 1386 * pname:pRegions is a pointer to an array of slink:VkImageBlit2KHR 1387 structures specifying the regions to blit. 1388 * pname:filter is a elink:VkFilter specifying the filter to apply if the 1389 blits require scaling. 1390 1391.Valid Usage 1392**** 1393include::{chapters}/commonvalidity/blit_image_common.txt[] 1394ifdef::VK_QCOM_rotated_copy_commands[] 1395 * [[VUID-VkBlitImageInfo2KHR-pRegions-04561]] 1396 If any element of pname:pRegions contains 1397 slink:VkCopyCommandTransformInfoQCOM in its pname:pNext chain, then 1398 pname:srcImage and pname:dstImage must: not be block-compressed images 1399 * [[VUID-VkBlitImageInfo2KHR-pRegions-06207]] 1400 If any element of pname:pRegions contains 1401 slink:VkCopyCommandTransformInfoQCOM in its pname:pNext chain, then 1402 pname:srcImage must: be of type ename:VK_IMAGE_TYPE_2D 1403 * [[VUID-VkBlitImageInfo2KHR-pRegions-06208]] 1404 If any element of pname:pRegions contains 1405 slink:VkCopyCommandTransformInfoQCOM in its pname:pNext chain, then 1406 pname:srcImage must: not have a 1407 <<formats-requiring-sampler-ycbcr-conversion, multi-planar format>> 1408endif::VK_QCOM_rotated_copy_commands[] 1409**** 1410 1411include::{generated}/validity/structs/VkBlitImageInfo2KHR.txt[] 1412-- 1413 1414[open,refpage='VkImageBlit2KHR',desc='Structure specifying an image blit operation',type='structs'] 1415-- 1416:refpage: VkImageBlit2KHR 1417 1418The sname:VkImageBlit2KHR structure is defined as: 1419 1420include::{generated}/api/structs/VkImageBlit2KHR.txt[] 1421 1422 * pname:sType is the type of this structure. 1423 * pname:pNext is `NULL` or a pointer to a structure extending this 1424 structure. 1425 * pname:srcSubresource is the subresource to blit from. 1426 * pname:srcOffsets is a pointer to an array of two slink:VkOffset3D 1427 structures specifying the bounds of the source region within 1428 pname:srcSubresource. 1429 * pname:dstSubresource is the subresource to blit into. 1430 * pname:dstOffsets is a pointer to an array of two slink:VkOffset3D 1431 structures specifying the bounds of the destination region within 1432 pname:dstSubresource. 1433 1434For each element of the pname:pRegions array, a blit operation is performed 1435for the specified source and destination regions. 1436 1437.Valid Usage 1438**** 1439include::{chapters}/commonvalidity/image_blit_common.txt[] 1440**** 1441 1442include::{generated}/validity/structs/VkImageBlit2KHR.txt[] 1443-- 1444 1445ifdef::VK_QCOM_rotated_copy_commands[] 1446For flink:vkCmdBlitImage2KHR, each region copied can include a rotation. 1447To specify a rotated region, add slink:VkCopyCommandTransformInfoQCOM to the 1448pname:pNext chain of slink:VkImageBlit2KHR. 1449For each region with a rotation specified, 1450<<copies-images-scaling-rotation,Image Blits with Scaling and Rotation>> 1451specifies how coordinates are rotated prior to sampling from the source 1452image. 1453When rotation is specified, the source and destination images must: each be 14542D images. 1455They must: not be <<blocked-image,blocked images>> or have a 1456<<formats-requiring-sampler-ycbcr-conversion, multi-planar format>>. 1457endif::VK_QCOM_rotated_copy_commands[] 1458 1459endif::VK_KHR_copy_commands2[] 1460 1461ifdef::VK_QCOM_rotated_copy_commands[] 1462include::{chapters}/VK_QCOM_rotated_copies/rotated_addressing_blits.txt[] 1463endif::VK_QCOM_rotated_copy_commands[] 1464 1465 1466[[copies-resolve]] 1467== Resolving Multisample Images 1468 1469[open,refpage='vkCmdResolveImage',desc='Resolve regions of an image',type='protos'] 1470-- 1471:refpage: vkCmdResolveImage 1472 1473To resolve a multisample color image to a non-multisample color image, call: 1474 1475include::{generated}/api/protos/vkCmdResolveImage.txt[] 1476 1477 * pname:commandBuffer is the command buffer into which the command will be 1478 recorded. 1479 * pname:srcImage is the source image. 1480 * pname:srcImageLayout is the layout of the source image subresources for 1481 the resolve. 1482 * pname:dstImage is the destination image. 1483 * pname:dstImageLayout is the layout of the destination image subresources 1484 for the resolve. 1485 * pname:regionCount is the number of regions to resolve. 1486 * pname:pRegions is a pointer to an array of slink:VkImageResolve 1487 structures specifying the regions to resolve. 1488 1489During the resolve the samples corresponding to each pixel location in the 1490source are converted to a single sample before being written to the 1491destination. 1492If the source formats are floating-point or normalized types, the sample 1493values for each pixel are resolved in an implementation-dependent manner. 1494If the source formats are integer types, a single sample's value is selected 1495for each pixel. 1496 1497pname:srcOffset and pname:dstOffset select the initial pname:x, pname:y, and 1498pname:z offsets in texels of the sub-regions of the source and destination 1499image data. 1500pname:extent is the size in texels of the source image to resolve in 1501pname:width, pname:height and pname:depth. 1502Each element of pname:pRegions must: be a region that is contained within 1503its corresponding image. 1504 1505Resolves are done layer by layer starting with pname:baseArrayLayer member 1506of pname:srcSubresource for the source and pname:dstSubresource for the 1507destination. 1508pname:layerCount layers are resolved to the destination image. 1509 1510.Valid Usage 1511**** 1512include::{chapters}/commonvalidity/resolve_image_command_buffer_common.txt[] 1513include::{chapters}/commonvalidity/resolve_image_common.txt[] 1514**** 1515 1516include::{generated}/validity/protos/vkCmdResolveImage.txt[] 1517-- 1518 1519[open,refpage='VkImageResolve',desc='Structure specifying an image resolve operation',type='structs'] 1520-- 1521:refpage: VkImageResolve 1522 1523The sname:VkImageResolve structure is defined as: 1524 1525include::{generated}/api/structs/VkImageResolve.txt[] 1526 1527 * pname:srcSubresource and pname:dstSubresource are 1528 slink:VkImageSubresourceLayers structures specifying the image 1529 subresources of the images used for the source and destination image 1530 data, respectively. 1531 Resolve of depth/stencil images is not supported. 1532 * pname:srcOffset and pname:dstOffset select the initial pname:x, pname:y, 1533 and pname:z offsets in texels of the sub-regions of the source and 1534 destination image data. 1535 * pname:extent is the size in texels of the source image to resolve in 1536 pname:width, pname:height and pname:depth. 1537 1538.Valid Usage 1539**** 1540include::{chapters}/commonvalidity/image_resolve_common.txt[] 1541**** 1542 1543include::{generated}/validity/structs/VkImageResolve.txt[] 1544-- 1545 1546ifdef::VK_AMD_buffer_marker[] 1547include::{chapters}/VK_AMD_buffer_marker/copies.txt[] 1548endif::VK_AMD_buffer_marker[] 1549 1550ifdef::VK_KHR_copy_commands2[] 1551 1552A more extensible version of the resolve image command is defined below. 1553 1554[open,refpage='vkCmdResolveImage2KHR',desc='Resolve regions of an image',type='protos'] 1555-- 1556:refpage: vkCmdResolveImage2KHR 1557 1558To resolve a multisample image to a non-multisample image, call: 1559 1560include::{generated}/api/protos/vkCmdResolveImage2KHR.txt[] 1561 1562 * pname:commandBuffer is the command buffer into which the command will be 1563 recorded. 1564 * pname:pResolveImageInfo is a pointer to a slink:VkResolveImageInfo2KHR 1565 structure describing the resolve parameters. 1566 1567This command is functionally identical to flink:vkCmdResolveImage, but 1568includes extensible sub-structures that include pname:sType and pname:pNext 1569parameters, allowing them to be more easily extended. 1570 1571 1572.Valid Usage 1573**** 1574include::{chapters}/commonvalidity/resolve_image_command_buffer_common.txt[] 1575**** 1576 1577include::{generated}/validity/protos/vkCmdResolveImage2KHR.txt[] 1578-- 1579 1580[open,refpage='VkResolveImageInfo2KHR',desc='Structure specifying parameters of resolve image command',type='structs'] 1581-- 1582:refpage: VkResolveImageInfo2KHR 1583 1584The sname:VkResolveImageInfo2KHR structure is defined as: 1585 1586include::{generated}/api/structs/VkResolveImageInfo2KHR.txt[] 1587 1588 * pname:sType is the type of this structure. 1589 * pname:pNext is `NULL` or a pointer to a structure extending this 1590 structure. 1591 * pname:srcImage is the source image. 1592 * pname:srcImageLayout is the layout of the source image subresources for 1593 the resolve. 1594 * pname:dstImage is the destination image. 1595 * pname:dstImageLayout is the layout of the destination image subresources 1596 for the resolve. 1597 * pname:regionCount is the number of regions to resolve. 1598 * pname:pRegions is a pointer to an array of slink:VkImageResolve2KHR 1599 structures specifying the regions to resolve. 1600 1601.Valid Usage 1602**** 1603include::{chapters}/commonvalidity/resolve_image_common.txt[] 1604**** 1605 1606include::{generated}/validity/structs/VkResolveImageInfo2KHR.txt[] 1607-- 1608 1609[open,refpage='VkImageResolve2KHR',desc='Structure specifying an image resolve operation',type='structs'] 1610-- 1611:refpage: VkImageResolve2KHR 1612 1613The sname:VkImageResolve2KHR structure is defined as: 1614 1615include::{generated}/api/structs/VkImageResolve2KHR.txt[] 1616 1617 * pname:sType is the type of this structure. 1618 * pname:pNext is `NULL` or a pointer to a structure extending this 1619 structure. 1620 * pname:srcSubresource and pname:dstSubresource are 1621 slink:VkImageSubresourceLayers structures specifying the image 1622 subresources of the images used for the source and destination image 1623 data, respectively. 1624 Resolve of depth/stencil images is not supported. 1625 * pname:srcOffset and pname:dstOffset select the initial pname:x, pname:y, 1626 and pname:z offsets in texels of the sub-regions of the source and 1627 destination image data. 1628 * pname:extent is the size in texels of the source image to resolve in 1629 pname:width, pname:height and pname:depth. 1630 1631.Valid Usage 1632**** 1633include::{chapters}/commonvalidity/image_resolve_common.txt[] 1634**** 1635 1636include::{generated}/validity/structs/VkImageResolve2KHR.txt[] 1637-- 1638 1639endif::VK_KHR_copy_commands2[] 1640