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 commands copying from images to buffers, or buffers to images 7// This relies on an additional attribute {imageparam} set by the command 8// which includes this file, specifying the name of the source or 9// destination image. 10 11ifndef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 12 * [[VUID-{refpage}-bufferOffset-00193]] 13 If {imageparam} does not have a depth/stencil format, then for each 14 element of pname:pRegions, pname:bufferOffset must: be a multiple of the 15 format's texel block size 16endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 17ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 18 * [[VUID-{refpage}-bufferOffset-01558]] 19 If {imageparam} does not have either a depth/stencil or a 20 <<formats-requiring-sampler-ycbcr-conversion,multi-planar format>>, then 21 for each element of pname:pRegions, pname:bufferOffset must: be a 22 multiple of the format's texel block size 23 * [[VUID-{refpage}-bufferOffset-01559]] 24 If {imageparam} has a 25 <<formats-requiring-sampler-ycbcr-conversion,multi-planar format>>, then 26 for each element of pname:pRegions, pname:bufferOffset must: be a 27 multiple of the element size of the compatible format for the format and 28 the pname:aspectMask of the pname:imageSubresource as defined in 29 <<formats-compatible-planes>> 30endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 31 * [[VUID-{refpage}-srcImage-00199]] 32 If {imageparam} is of type ename:VK_IMAGE_TYPE_1D, then for each element 33 of pname:pRegions, pname:imageOffset.y must: be `0` and 34 pname:imageExtent.height must: be `1` 35 * [[VUID-{refpage}-imageOffset-00200]] 36 For each element of pname:pRegions, pname:imageOffset.z and 37 [eq]#(pname:imageExtent.depth {plus} pname:imageOffset.z)# must: both be 38 greater than or equal to `0` and less than or equal to the depth of the 39 specified pname:imageSubresource of {imageparam} 40 * [[VUID-{refpage}-srcImage-00201]] 41 If {imageparam} is of type ename:VK_IMAGE_TYPE_1D or 42 ename:VK_IMAGE_TYPE_2D, then for each element of pname:pRegions, 43 pname:imageOffset.z must: be `0` and pname:imageExtent.depth must: be 44 `1` 45 * [[VUID-{refpage}-bufferRowLength-00203]] 46 If {imageparam} is a <<blocked-image, blocked image>>, for each element 47 of pname:pRegions, pname:bufferRowLength must: be a multiple of the 48 compressed texel block width 49 * [[VUID-{refpage}-bufferImageHeight-00204]] 50 If {imageparam} is a <<blocked-image, blocked image>>, for each element 51 of pname:pRegions, pname:bufferImageHeight must: be a multiple of the 52 compressed texel block height 53 * [[VUID-{refpage}-imageOffset-00205]] 54 If {imageparam} is a <<blocked-image, blocked image>>, for each element 55 of pname:pRegions, all members of pname:imageOffset must: be a multiple 56 of the corresponding dimensions of the compressed texel block 57 * [[VUID-{refpage}-bufferOffset-00206]] 58 If {imageparam} is a <<blocked-image, blocked image>>, for each element 59 of pname:pRegions, pname:bufferOffset must: be a multiple of the 60 compressed texel block size in bytes 61 * [[VUID-{refpage}-imageExtent-00207]] 62 If {imageparam} is a <<blocked-image, blocked image>>, for each element 63 of pname:pRegions, pname:imageExtent.width must: be a multiple of the 64 compressed texel block width or [eq]#(pname:imageExtent.width {plus} 65 pname:imageOffset.x)# must: equal the width of the specified 66 pname:imageSubresource of {imageparam} 67 * [[VUID-{refpage}-imageExtent-00208]] 68 If {imageparam} is a <<blocked-image, blocked image>>, for each element 69 of pname:pRegions, pname:imageExtent.height must: be a multiple of the 70 compressed texel block height or [eq]#(pname:imageExtent.height {plus} 71 pname:imageOffset.y)# must: equal the height of the specified 72 pname:imageSubresource of {imageparam} 73 * [[VUID-{refpage}-imageExtent-00209]] 74 If {imageparam} is a <<blocked-image, blocked image>>, for each element 75 of pname:pRegions, pname:imageExtent.depth must: be a multiple of the 76 compressed texel block depth or [eq]#(pname:imageExtent.depth {plus} 77 pname:imageOffset.z)# must: equal the depth of the specified 78 pname:imageSubresource of {imageparam} 79 * [[VUID-{refpage}-aspectMask-00211]] 80 For each element of pname:pRegions, pname:imageSubresource.aspectMask 81 must: specify aspects present in {imageparam} 82ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 83 * [[VUID-{refpage}-aspectMask-01560]] 84 If {imageparam} has a 85 <<formats-requiring-sampler-ycbcr-conversion,multi-planar format>>, then 86 for each element of pname:pRegions, pname:imageSubresource.aspectMask 87 must: be ename:VK_IMAGE_ASPECT_PLANE_0_BIT, 88 ename:VK_IMAGE_ASPECT_PLANE_1_BIT, or ename:VK_IMAGE_ASPECT_PLANE_2_BIT 89 (with ename:VK_IMAGE_ASPECT_PLANE_2_BIT valid only for image formats 90 with three planes) 91endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 92 * [[VUID-{refpage}-baseArrayLayer-00213]] 93 If {imageparam} is of type ename:VK_IMAGE_TYPE_3D, for each element of 94 pname:pRegions, pname:imageSubresource.baseArrayLayer must: be `0` and 95 pname:imageSubresource.layerCount must: be `1` 96 * [[VUID-{refpage}-pRegions-04725]] 97 If {imageparam} is not a <<blocked-image, blocked image>>, for each 98 element of pname:pRegions, pname:bufferRowLength multiplied by the texel 99 block size of {imageparam} must: be less than or equal to [eq]#2^31^-1# 100 * [[VUID-{refpage}-pRegions-04726]] 101 If {imageparam} is a <<blocked-image, blocked image>>, for each element 102 of pname:pRegions, pname:bufferRowLength divided by the compressed texel 103 block width and then multiplied by the texel block size of {imageparam} 104 must: be less than or equal to [eq]#2^31^-1# 105 * [[VUID-{refpage}-commandBuffer-04052]] 106 If the queue family used to create the slink:VkCommandPool which 107 pname:commandBuffer was allocated from does not support 108 ename:VK_QUEUE_GRAPHICS_BIT or ename:VK_QUEUE_COMPUTE_BIT, the 109 pname:bufferOffset member of any element of pname:pRegions must: be a 110 multiple of `4` 111 * [[VUID-{refpage}-srcImage-04053]] 112 If {imageparam} has a depth/stencil format, the pname:bufferOffset 113 member of any element of pname:pRegions must: be a multiple of `4` 114// Common Valid Usage 115