1// Copyright 2020-2023 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 the following additional attributes set by the command which
8// includes this file:
9//
10//  - {imageparam}, specifying the name of the source or destination image,
11//  - {imagesubresource} specifying the field in pRegions corresponding to
12//    {imageparam},
13//  - {imageoffset} and {imageextents} specifying the fields in pRegions
14//    corresponding to the offset and extent of the copy.
15
16  * [[VUID-{refpage}-{imageparam}-07979]]
17    If pname:{imageparam} is of type ename:VK_IMAGE_TYPE_1D, then for each
18    element of pname:pRegions, pname:{imageoffset}.y must: be `0` and
19    pname:{imageextent}.height must: be `1`
20  * [[VUID-{refpage}-{imageoffset}-09104]]
21    For each element of pname:pRegions, pname:{imageoffset}.z and
22    [eq]#(pname:{imageextent}.depth {plus} pname:{imageoffset}.z)# must:
23    both be greater than or equal to `0` and less than or equal to the depth
24    of the specified pname:{imagesubresource} of pname:{imageparam}
25  * [[VUID-{refpage}-{imageparam}-07980]]
26    If pname:{imageparam} is of type ename:VK_IMAGE_TYPE_1D or
27    ename:VK_IMAGE_TYPE_2D, then for each element of pname:pRegions,
28    pname:{imageoffset}.z must: be `0` and pname:{imageextent}.depth must:
29    be `1`
30  * [[VUID-{refpage}-{imageparam}-07274]]
31    For each element of pname:pRegions, pname:{imageoffset}.x must: be a
32    multiple of the <<formats-compatibility-classes,texel block extent
33    width>> of the elink:VkFormat of pname:{imageparam}
34  * [[VUID-{refpage}-{imageparam}-07275]]
35    For each element of pname:pRegions, pname:{imageoffset}.y must: be a
36    multiple of the <<formats-compatibility-classes,texel block extent
37    height>> of the elink:VkFormat of pname:{imageparam}
38  * [[VUID-{refpage}-{imageparam}-07276]]
39    For each element of pname:pRegions, pname:{imageoffset}.z must: be a
40    multiple of the <<formats-compatibility-classes,texel block extent
41    depth>> of the elink:VkFormat of pname:{imageparam}
42  * [[VUID-{refpage}-{imageparam}-00207]]
43    For each element of pname:pRegions, if the sum of pname:{imageoffset}.x
44    and pname:extent.width does not equal the width of the subresource
45    specified by pname:srcSubresource, pname:extent.width must: be a
46    multiple of the <<formats-compatibility-classes,texel block extent
47    width>> of the elink:VkFormat of pname:{imageparam}
48  * [[VUID-{refpage}-{imageparam}-00208]]
49    For each element of pname:pRegions, if the sum of pname:{imageoffset}.y
50    and pname:extent.height does not equal the height of the subresource
51    specified by pname:srcSubresource, pname:extent.height must: be a
52    multiple of the <<formats-compatibility-classes,texel block extent
53    height>> of the elink:VkFormat of pname:{imageparam}
54  * [[VUID-{refpage}-{imageparam}-00209]]
55    For each element of pname:pRegions, if the sum of pname:{imageoffset}.z
56    and pname:extent.depth does not equal the depth of the subresource
57    specified by pname:srcSubresource, pname:extent.depth must: be a
58    multiple of the <<formats-compatibility-classes,texel block extent
59    depth>> of the elink:VkFormat of pname:{imageparam}
60  * [[VUID-{refpage}-{imagesubresource}-09105]]
61    For each element of pname:pRegions, pname:{imagesubresource}.aspectMask
62    must: specify aspects present in pname:{imageparam}
63ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
64  * [[VUID-{refpage}-{imageparam}-07981]]
65    If pname:{imageparam} has a
66    <<formats-requiring-sampler-ycbcr-conversion, multi-planar image
67    format>>, then for each element of pname:pRegions,
68    pname:{imagesubresource}.aspectMask must: be a single valid
69    <<formats-planes-image-aspect,multi-planar aspect mask>> bit
70endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
71  * [[VUID-{refpage}-{imageparam}-07983]]
72    If pname:{imageparam} is of type ename:VK_IMAGE_TYPE_3D, for each
73    element of pname:pRegions, pname:{imagesubresource}.baseArrayLayer must:
74    be `0` and pname:{imagesubresource}.layerCount must: be `1`
75// Common Valid Usage
76