1// Copyright 2020-2021 The Khronos Group Inc. 2// 3// SPDX-License-Identifier: CC-BY-4.0 4 5// Common Valid Usage 6// Common to VkCmdCopyImage* commands 7 * [[VUID-{refpage}-pRegions-00124]] 8 The union of all source regions, and the union of all destination 9 regions, specified by the elements of pname:pRegions, must: not overlap 10 in memory 11ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[] 12 * [[VUID-{refpage}-srcImage-01995]] 13 The <<resources-image-format-features,format features>> of 14 pname:srcImage must: contain ename:VK_FORMAT_FEATURE_TRANSFER_SRC_BIT 15endif::VK_VERSION_1_1,VK_KHR_maintenance1[] 16 * [[VUID-{refpage}-srcImage-00126]] 17 pname:srcImage must: have been created with 18 ename:VK_IMAGE_USAGE_TRANSFER_SRC_BIT usage flag 19ifndef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 20 * [[VUID-{refpage}-srcImage-00127]] 21 If pname:srcImage is non-sparse then it must: be bound completely and 22 contiguously to a single sname:VkDeviceMemory object 23endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 24ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 25 * [[VUID-{refpage}-srcImage-01546]] 26 If pname:srcImage is non-sparse then the image or _disjoint_ plane to be 27 copied must: be bound completely and contiguously to a single 28 sname:VkDeviceMemory object 29endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 30 * [[VUID-{refpage}-srcImageLayout-00128]] 31 pname:srcImageLayout must: specify the layout of the image subresources 32 of pname:srcImage specified in pname:pRegions at the time this command 33 is executed on a sname:VkDevice 34ifndef::VK_KHR_shared_presentable_image[] 35 * [[VUID-{refpage}-srcImageLayout-00129]] 36 pname:srcImageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL 37 or ename:VK_IMAGE_LAYOUT_GENERAL 38endif::VK_KHR_shared_presentable_image[] 39ifdef::VK_KHR_shared_presentable_image[] 40 * [[VUID-{refpage}-srcImageLayout-01917]] 41 pname:srcImageLayout must: be 42 ename:VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, 43 ename:VK_IMAGE_LAYOUT_GENERAL, or 44 ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR 45endif::VK_KHR_shared_presentable_image[] 46ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[] 47 * [[VUID-{refpage}-dstImage-01996]] 48 The <<resources-image-format-features,format features>> of 49 pname:dstImage must: contain ename:VK_FORMAT_FEATURE_TRANSFER_DST_BIT 50endif::VK_VERSION_1_1,VK_KHR_maintenance1[] 51 * [[VUID-{refpage}-dstImage-00131]] 52 pname:dstImage must: have been created with 53 ename:VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag 54ifndef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 55 * [[VUID-{refpage}-dstImage-00132]] 56 If pname:dstImage is non-sparse then it must: be bound completely and 57 contiguously to a single sname:VkDeviceMemory object 58endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 59ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 60 * [[VUID-{refpage}-dstImage-01547]] 61 If pname:dstImage is non-sparse then the image or _disjoint_ plane that 62 is the destination of the copy must: be bound completely and 63 contiguously to a single sname:VkDeviceMemory object 64endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 65 * [[VUID-{refpage}-dstImageLayout-00133]] 66 pname:dstImageLayout must: specify the layout of the image subresources 67 of pname:dstImage specified in pname:pRegions at the time this command 68 is executed on a sname:VkDevice 69ifndef::VK_KHR_shared_presentable_image[] 70 * [[VUID-{refpage}-dstImageLayout-00134]] 71 pname:dstImageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL 72 or ename:VK_IMAGE_LAYOUT_GENERAL 73endif::VK_KHR_shared_presentable_image[] 74ifdef::VK_KHR_shared_presentable_image[] 75 * [[VUID-{refpage}-dstImageLayout-01395]] 76 pname:dstImageLayout must: be 77 ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 78 ename:VK_IMAGE_LAYOUT_GENERAL, or 79 ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR 80endif::VK_KHR_shared_presentable_image[] 81ifndef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 82 * [[VUID-{refpage}-srcImage-00135]] 83 The elink:VkFormat of each of pname:srcImage and pname:dstImage must: be 84 compatible, as defined <<copies-images-format-compatibility, above>> 85endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 86ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 87 * [[VUID-{refpage}-srcImage-01548]] 88 If the elink:VkFormat of each of pname:srcImage and pname:dstImage is 89 not a <<formats-requiring-sampler-ycbcr-conversion,_multi-planar 90 format_>>, the elink:VkFormat of each of pname:srcImage and 91 pname:dstImage must: be compatible, as defined 92 <<copies-images-format-compatibility, above>> 93 * [[VUID-{refpage}-None-01549]] 94 In a copy to or from a plane of a 95 <<formats-requiring-sampler-ycbcr-conversion,multi-planar image>>, the 96 elink:VkFormat of the image and plane must: be compatible according to 97 <<formats-compatible-planes,the description of compatible planes>> for 98 the plane being copied 99endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 100 * [[VUID-{refpage}-srcImage-00136]] 101 The sample count of pname:srcImage and pname:dstImage must: match 102 * [[VUID-{refpage}-srcSubresource-01696]] 103 The pname:srcSubresource.mipLevel member of each element of 104 pname:pRegions must: be less than the pname:mipLevels specified in 105 slink:VkImageCreateInfo when pname:srcImage was created 106 * [[VUID-{refpage}-dstSubresource-01697]] 107 The pname:dstSubresource.mipLevel member of each element of 108 pname:pRegions must: be less than the pname:mipLevels specified in 109 slink:VkImageCreateInfo when pname:dstImage was created 110 * [[VUID-{refpage}-srcSubresource-01698]] 111 The [eq]#pname:srcSubresource.baseArrayLayer {plus} 112 pname:srcSubresource.layerCount# of each element of pname:pRegions must: 113 be less than or equal to the pname:arrayLayers specified in 114 slink:VkImageCreateInfo when pname:srcImage was created 115 * [[VUID-{refpage}-dstSubresource-01699]] 116 The [eq]#pname:dstSubresource.baseArrayLayer {plus} 117 pname:dstSubresource.layerCount# of each element of pname:pRegions must: 118 be less than or equal to the pname:arrayLayers specified in 119 slink:VkImageCreateInfo when pname:dstImage was created 120 * [[VUID-{refpage}-srcOffset-01783]] 121 The pname:srcOffset and pname:extent members of each element of 122 pname:pRegions must: respect the image transfer granularity requirements 123 of pname:commandBuffer's command pool's queue family, as described in 124 slink:VkQueueFamilyProperties 125 * [[VUID-{refpage}-dstOffset-01784]] 126 The pname:dstOffset and pname:extent members of each element of 127 pname:pRegions must: respect the image transfer granularity requirements 128 of pname:commandBuffer's command pool's queue family, as described in 129 slink:VkQueueFamilyProperties 130ifdef::VK_EXT_fragment_density_map[] 131 * [[VUID-{refpage}-dstImage-02542]] 132 pname:dstImage and pname:srcImage must: not have been created with 133 pname:flags containing ename:VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT 134endif::VK_EXT_fragment_density_map[] 135// The remaining common VU used to be in image_copy_common.txt and have been 136// rewritten to apply to the calling command rather than the structure 137// parameter(s) of that command. 138ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 139 * [[VUID-{refpage}-srcImage-01551]] 140 If neither pname:srcImage nor pname:dstImage has a 141 <<formats-requiring-sampler-ycbcr-conversion, multi-planar image 142 format>> then for each element of pname:pRegions, 143 pname:srcSubresource.aspectMask and pname:dstSubresource.aspectMask 144 must: match 145 * [[VUID-{refpage}-srcImage-01552]] 146 If pname:srcImage has a elink:VkFormat with 147 <<formats-requiring-sampler-ycbcr-conversion,two planes>> then for each 148 element of pname:pRegions, pname:srcSubresource.aspectMask must: be 149 ename:VK_IMAGE_ASPECT_PLANE_0_BIT or ename:VK_IMAGE_ASPECT_PLANE_1_BIT 150 * [[VUID-{refpage}-srcImage-01553]] 151 If pname:srcImage has a elink:VkFormat with 152 <<formats-requiring-sampler-ycbcr-conversion,three planes>> then for 153 each element of pname:pRegions, pname:srcSubresource.aspectMask must: be 154 ename:VK_IMAGE_ASPECT_PLANE_0_BIT, ename:VK_IMAGE_ASPECT_PLANE_1_BIT, or 155 ename:VK_IMAGE_ASPECT_PLANE_2_BIT 156 * [[VUID-{refpage}-dstImage-01554]] 157 If pname:dstImage has a elink:VkFormat with 158 <<formats-requiring-sampler-ycbcr-conversion,two planes>> then for each 159 element of pname:pRegions, pname:dstSubresource.aspectMask must: be 160 ename:VK_IMAGE_ASPECT_PLANE_0_BIT or ename:VK_IMAGE_ASPECT_PLANE_1_BIT 161 * [[VUID-{refpage}-dstImage-01555]] 162 If pname:dstImage has a elink:VkFormat with 163 <<formats-requiring-sampler-ycbcr-conversion,three planes>> then for 164 each element of pname:pRegions, pname:dstSubresource.aspectMask must: be 165 ename:VK_IMAGE_ASPECT_PLANE_0_BIT, ename:VK_IMAGE_ASPECT_PLANE_1_BIT, or 166 ename:VK_IMAGE_ASPECT_PLANE_2_BIT 167 * [[VUID-{refpage}-srcImage-01556]] 168 If pname:srcImage has a 169 <<formats-requiring-sampler-ycbcr-conversion,multi-planar image format>> 170 and the pname:dstImage does not have a multi-planar image format, then 171 for each element of pname:pRegions, pname:dstSubresource.aspectMask 172 must: be ename:VK_IMAGE_ASPECT_COLOR_BIT 173 * [[VUID-{refpage}-dstImage-01557]] 174 If pname:dstImage has a 175 <<formats-requiring-sampler-ycbcr-conversion,multi-planar image format>> 176 and the pname:srcImage does not have a multi-planar image format, then 177 for each element of pname:pRegions, pname:srcSubresource.aspectMask 178 must: be ename:VK_IMAGE_ASPECT_COLOR_BIT 179endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 180ifndef::VK_VERSION_1_1,VK_KHR_maintenance1[] 181 * [[VUID-{refpage}-srcImage-00139]] 182 If either pname:srcImage or pname:dstImage is of type 183 ename:VK_IMAGE_TYPE_3D, then for each element of pname:pRegions, 184 pname:srcSubresource.baseArrayLayer and 185 pname:dstSubresource.baseArrayLayer must: each be `0`, and 186 pname:srcSubresource.layerCount and pname:dstSubresource.layerCount 187 must: each be `1` 188endif::VK_VERSION_1_1,VK_KHR_maintenance1[] 189ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[] 190 * [[VUID-{refpage}-srcImage-04443]] 191 If pname:srcImage is of type ename:VK_IMAGE_TYPE_3D, then for each 192 element of pname:pRegions, pname:srcSubresource.baseArrayLayer must: be 193 `0` and pname:srcSubresource.layerCount must: be `1` 194 * [[VUID-{refpage}-dstImage-04444]] 195 If pname:dstImage is of type ename:VK_IMAGE_TYPE_3D, then for each 196 element of pname:pRegions, pname:dstSubresource.baseArrayLayer must: be 197 `0` and pname:dstSubresource.layerCount must: be `1` 198endif::VK_VERSION_1_1,VK_KHR_maintenance1[] 199 * [[VUID-{refpage}-aspectMask-00142]] 200 For each element of pname:pRegions, pname:srcSubresource.aspectMask 201 must: specify aspects present in pname:srcImage 202 * [[VUID-{refpage}-aspectMask-00143]] 203 For each element of pname:pRegions, pname:dstSubresource.aspectMask 204 must: specify aspects present in pname:dstImage 205 * [[VUID-{refpage}-srcOffset-00144]] 206 For each element of pname:pRegions, pname:srcOffset.x and 207 [eq]#(pname:extent.width {plus} pname:srcOffset.x)# must: both be 208 greater than or equal to `0` and less than or equal to the width of the 209 specified pname:srcSubresource of pname:srcImage 210 * [[VUID-{refpage}-srcOffset-00145]] 211 For each element of pname:pRegions, pname:srcOffset.y and 212 [eq]#(pname:extent.height {plus} pname:srcOffset.y)# must: both be 213 greater than or equal to `0` and less than or equal to the height of the 214 specified pname:srcSubresource of pname:srcImage 215 * [[VUID-{refpage}-srcImage-00146]] 216 If pname:srcImage is of type ename:VK_IMAGE_TYPE_1D, then for each 217 element of pname:pRegions, pname:srcOffset.y must: be `0` and 218 pname:extent.height must: be `1` 219 * [[VUID-{refpage}-srcOffset-00147]] 220 For each element of pname:pRegions, pname:srcOffset.z and 221 [eq]#(pname:extent.depth {plus} pname:srcOffset.z)# must: both be 222 greater than or equal to `0` and less than or equal to the depth of the 223 specified pname:srcSubresource of pname:srcImage 224 * [[VUID-{refpage}-srcImage-01785]] 225 If pname:srcImage is of type ename:VK_IMAGE_TYPE_1D, then for each 226 element of pname:pRegions, pname:srcOffset.z must: be `0` and 227 pname:extent.depth must: be `1` 228 * [[VUID-{refpage}-dstImage-01786]] 229 If pname:dstImage is of type ename:VK_IMAGE_TYPE_1D, then for each 230 element of pname:pRegions, pname:dstOffset.z must: be `0` and 231 pname:extent.depth must: be `1` 232 * [[VUID-{refpage}-srcImage-01787]] 233 If pname:srcImage is of type ename:VK_IMAGE_TYPE_2D, then for each 234 element of pname:pRegions, pname:srcOffset.z must: be `0` 235 * [[VUID-{refpage}-dstImage-01788]] 236 If pname:dstImage is of type ename:VK_IMAGE_TYPE_2D, then for each 237 element of pname:pRegions, pname:dstOffset.z must: be `0` 238ifndef::VK_VERSION_1_1,VK_KHR_maintenance1[] 239 * [[VUID-{refpage}-srcImage-01789]] 240 If pname:srcImage or pname:dstImage is of type ename:VK_IMAGE_TYPE_2D, 241 then for each element of pname:pRegions, pname:extent.depth must: be `1` 242endif::VK_VERSION_1_1,VK_KHR_maintenance1[] 243ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[] 244 * [[VUID-{refpage}-srcImage-01790]] 245 If pname:srcImage and pname:dstImage are both of type 246 ename:VK_IMAGE_TYPE_2D, then for each element of pname:pRegions, 247 pname:extent.depth must: be `1` 248 * [[VUID-{refpage}-srcImage-01791]] 249 If pname:srcImage is of type ename:VK_IMAGE_TYPE_2D, and pname:dstImage 250 is of type ename:VK_IMAGE_TYPE_3D, then for each element of 251 pname:pRegions, pname:extent.depth must: equal 252 pname:srcSubresource.layerCount 253 * [[VUID-{refpage}-dstImage-01792]] 254 If pname:dstImage is of type ename:VK_IMAGE_TYPE_2D, and pname:srcImage 255 is of type ename:VK_IMAGE_TYPE_3D, then for each element of 256 pname:pRegions, pname:extent.depth must: equal 257 pname:dstSubresource.layerCount 258endif::VK_VERSION_1_1,VK_KHR_maintenance1[] 259 * [[VUID-{refpage}-dstOffset-00150]] 260 For each element of pname:pRegions, pname:dstOffset.x and 261 [eq]#(pname:extent.width {plus} pname:dstOffset.x)# must: both be 262 greater than or equal to `0` and less than or equal to the width of the 263 specified pname:dstSubresource of pname:dstImage 264 * [[VUID-{refpage}-dstOffset-00151]] 265 For each element of pname:pRegions, pname:dstOffset.y and 266 [eq]#(pname:extent.height {plus} pname:dstOffset.y)# must: both be 267 greater than or equal to `0` and less than or equal to the height of the 268 specified pname:dstSubresource of pname:dstImage 269 * [[VUID-{refpage}-dstImage-00152]] 270 If pname:dstImage is of type ename:VK_IMAGE_TYPE_1D, then for each 271 element of pname:pRegions, pname:dstOffset.y must: be `0` and 272 pname:extent.height must: be `1` 273 * [[VUID-{refpage}-dstOffset-00153]] 274 For each element of pname:pRegions, pname:dstOffset.z and 275 [eq]#(pname:extent.depth {plus} pname:dstOffset.z)# must: both be 276 greater than or equal to `0` and less than or equal to the depth of the 277 specified pname:dstSubresource of pname:dstImage 278 * [[VUID-{refpage}-srcImage-01727]] 279 If pname:srcImage is a <<blocked-image, blocked image>>, then for each 280 element of pname:pRegions, all members of pname:srcOffset must: be a 281 multiple of the corresponding dimensions of the compressed texel block 282 * [[VUID-{refpage}-srcImage-01728]] 283 If pname:srcImage is a <<blocked-image, blocked image>>, then for each 284 element of pname:pRegions, pname:extent.width must: be a multiple of the 285 compressed texel block width or [eq]#(pname:extent.width {plus} 286 pname:srcOffset.x)# must: equal the width of the specified 287 pname:srcSubresource of pname:srcImage 288 * [[VUID-{refpage}-srcImage-01729]] 289 If pname:srcImage is a <<blocked-image, blocked image>>, then for each 290 element of pname:pRegions, pname:extent.height must: be a multiple of 291 the compressed texel block height or [eq]#(pname:extent.height {plus} 292 pname:srcOffset.y)# must: equal the height of the specified 293 pname:srcSubresource of pname:srcImage 294 * [[VUID-{refpage}-srcImage-01730]] 295 If pname:srcImage is a <<blocked-image, blocked image>>, then for each 296 element of pname:pRegions, pname:extent.depth must: be a multiple of the 297 compressed texel block depth or [eq]#(pname:extent.depth {plus} 298 pname:srcOffset.z)# must: equal the depth of the specified 299 pname:srcSubresource of pname:srcImage 300 * [[VUID-{refpage}-dstImage-01731]] 301 If pname:dstImage is a <<blocked-image, blocked image>>, then for each 302 element of pname:pRegions, all members of pname:dstOffset must: be a 303 multiple of the corresponding dimensions of the compressed texel block 304 * [[VUID-{refpage}-dstImage-01732]] 305 If pname:dstImage is a <<blocked-image, blocked image>>, then for each 306 element of pname:pRegions, pname:extent.width must: be a multiple of the 307 compressed texel block width or [eq]#(pname:extent.width {plus} 308 pname:dstOffset.x)# must: equal the width of the specified 309 pname:dstSubresource of pname:dstImage 310 * [[VUID-{refpage}-dstImage-01733]] 311 If pname:dstImage is a <<blocked-image, blocked image>>, then for each 312 element of pname:pRegions, pname:extent.height must: be a multiple of 313 the compressed texel block height or [eq]#(pname:extent.height {plus} 314 pname:dstOffset.y)# must: equal the height of the specified 315 pname:dstSubresource of pname:dstImage 316 * [[VUID-{refpage}-dstImage-01734]] 317 If pname:dstImage is a <<blocked-image, blocked image>>, then for each 318 element of pname:pRegions, pname:extent.depth must: be a multiple of the 319 compressed texel block depth or [eq]#(pname:extent.depth {plus} 320 pname:dstOffset.z)# must: equal the depth of the specified 321 pname:dstSubresource of pname:dstImage 322// Common Valid Usage 323