1// Copyright 2023-2024 The Khronos Group Inc.
2//
3// SPDX-License-Identifier: CC-BY-4.0
4
5// Common Valid Usage
6// Common to VkImageMemoryBarrier* structs
7
8  * [[VUID-{refpage}-subresourceRange-01486]]
9    pname:subresourceRange.baseMipLevel must: be less than the
10    pname:mipLevels specified in slink:VkImageCreateInfo when pname:image
11    was created
12  * [[VUID-{refpage}-subresourceRange-01724]]
13    If pname:subresourceRange.levelCount is not
14    ename:VK_REMAINING_MIP_LEVELS, [eq]#pname:subresourceRange.baseMipLevel
15    {plus} pname:subresourceRange.levelCount# must: be less than or equal to
16    the pname:mipLevels specified in slink:VkImageCreateInfo when
17    pname:image was created
18  * [[VUID-{refpage}-subresourceRange-01488]]
19    pname:subresourceRange.baseArrayLayer must: be less than the
20    pname:arrayLayers specified in slink:VkImageCreateInfo when pname:image
21    was created
22  * [[VUID-{refpage}-subresourceRange-01725]]
23    If pname:subresourceRange.layerCount is not
24    ename:VK_REMAINING_ARRAY_LAYERS,
25    [eq]#pname:subresourceRange.baseArrayLayer {plus}
26    pname:subresourceRange.layerCount# must: be less than or equal to the
27    pname:arrayLayers specified in slink:VkImageCreateInfo when pname:image
28    was created
29  * [[VUID-{refpage}-image-01932]]
30    If pname:image is non-sparse then it must: be bound completely and
31    contiguously to a single sname:VkDeviceMemory object
32  * [[VUID-{refpage}-image-09241]]
33    If pname:image has a color format
34ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
35    that is single-plane,
36endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
37    then the pname:aspectMask member of pname:subresourceRange must: be
38    ename:VK_IMAGE_ASPECT_COLOR_BIT
39ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
40  * [[VUID-{refpage}-image-09242]]
41    If pname:image has a color format and is not _disjoint_, then the
42    pname:aspectMask member of pname:subresourceRange must: be
43    ename:VK_IMAGE_ASPECT_COLOR_BIT
44  * [[VUID-{refpage}-image-01672]]
45    If pname:image has a multi-planar format and the image is _disjoint_,
46    then the pname:aspectMask member of pname:subresourceRange must: include
47    at least one <<formats-planes-image-aspect,multi-planar aspect mask>>
48    bit or ename:VK_IMAGE_ASPECT_COLOR_BIT
49endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
50  * [[VUID-{refpage}-image-03320]]
51    If pname:image has a depth/stencil format with both depth and stencil
52ifdef::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[]
53    and the <<features-separateDepthStencilLayouts,
54    pname:separateDepthStencilLayouts>> feature is not enabled,
55endif::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[]
56    then the pname:aspectMask member of pname:subresourceRange must: include
57    both ename:VK_IMAGE_ASPECT_DEPTH_BIT and
58    ename:VK_IMAGE_ASPECT_STENCIL_BIT
59ifdef::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[]
60  * [[VUID-{refpage}-image-03319]]
61    If pname:image has a depth/stencil format with both depth and stencil
62    and the <<features-separateDepthStencilLayouts,
63    pname:separateDepthStencilLayouts>> feature is enabled, then the
64    pname:aspectMask member of pname:subresourceRange must: include either
65    or both ename:VK_IMAGE_ASPECT_DEPTH_BIT and
66    ename:VK_IMAGE_ASPECT_STENCIL_BIT
67  * [[VUID-{refpage}-aspectMask-08702]]
68    If the pname:aspectMask member of pname:subresourceRange includes
69    ename:VK_IMAGE_ASPECT_DEPTH_BIT, pname:oldLayout and pname:newLayout
70    must: not be one of ename:VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL or
71    ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL
72  * [[VUID-{refpage}-aspectMask-08703]]
73    If the pname:aspectMask member of pname:subresourceRange includes
74    ename:VK_IMAGE_ASPECT_STENCIL_BIT, pname:oldLayout and pname:newLayout
75    must: not be one of ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL or
76    ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL
77endif::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[]
78// Common Valid Usage
79