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 attachment description structures
7  * [[VUID-{refpage}-format-06699]]
8    If pname:format includes a color or depth component and pname:loadOp is
9    ename:VK_ATTACHMENT_LOAD_OP_LOAD, then pname:initialLayout must: not be
10    ename:VK_IMAGE_LAYOUT_UNDEFINED
11  * [[VUID-{refpage}-finalLayout-00843]]
12    pname:finalLayout must: not be ename:VK_IMAGE_LAYOUT_UNDEFINED or
13    ename:VK_IMAGE_LAYOUT_PREINITIALIZED
14  * [[VUID-{refpage}-format-03280]]
15    If pname:format is a color format, pname:initialLayout must: not be
16    ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL or
17    ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL
18  * [[VUID-{refpage}-format-03281]]
19    If pname:format is a depth/stencil format, pname:initialLayout must: not
20    be ename:VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
21  * [[VUID-{refpage}-format-03282]]
22    If pname:format is a color format, pname:finalLayout must: not be
23    ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL or
24    ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL
25  * [[VUID-{refpage}-format-03283]]
26    If pname:format is a depth/stencil format, pname:finalLayout must: not
27    be ename:VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
28ifdef::VK_VERSION_1_1,VK_KHR_maintenance2[]
29  * [[VUID-{refpage}-format-06487]]
30    If pname:format is a color format, pname:initialLayout must: not be
31    ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL or
32    ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL
33  * [[VUID-{refpage}-format-06488]]
34    If pname:format is a color format, pname:finalLayout must: not be
35    ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL or
36    ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL
37endif::VK_VERSION_1_1,VK_KHR_maintenance2[]
38ifdef::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[]
39  * [[VUID-{refpage}-separateDepthStencilLayouts-03284]]
40    If the <<features-separateDepthStencilLayouts,
41    pname:separateDepthStencilLayouts>> feature is not enabled,
42    pname:initialLayout must: not be
43    ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL,
44    ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL,
45    ename:VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL, or
46    ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL,
47  * [[VUID-{refpage}-separateDepthStencilLayouts-03285]]
48    If the <<features-separateDepthStencilLayouts,
49    pname:separateDepthStencilLayouts>> feature is not enabled,
50    pname:finalLayout must: not be
51    ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL,
52    ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL,
53    ename:VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL, or
54    ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL,
55  * [[VUID-{refpage}-format-03286]]
56    If pname:format is a color format, pname:initialLayout must: not be
57    ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL,
58    ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL,
59    ename:VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL, or
60    ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL
61  * [[VUID-{refpage}-format-03287]]
62    If pname:format is a color format, pname:finalLayout must: not be
63    ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL,
64    ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL,
65    ename:VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL, or
66    ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL
67  * [[VUID-{refpage}-format-06906]]
68    If pname:format is a depth/stencil format which includes both depth and
69    stencil components, pname:initialLayout must: not be
70    ename:VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL or
71    ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL
72  * [[VUID-{refpage}-format-06907]]
73    If pname:format is a depth/stencil format which includes both depth and
74    stencil components, pname:finalLayout must: not be
75    ename:VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL or
76    ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL
77  * [[VUID-{refpage}-format-03290]]
78    If pname:format is a depth/stencil format which includes only the depth
79    component, pname:initialLayout must: not be
80    ename:VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL or
81    ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL
82  * [[VUID-{refpage}-format-03291]]
83    If pname:format is a depth/stencil format which includes only the depth
84    component, pname:finalLayout must: not be
85    ename:VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL or
86    ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL
87endif::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[]
88ifdef::VK_KHR_synchronization2[]
89  * [[VUID-{refpage}-synchronization2-06908]]
90    If the <<features-synchronization2, pname:synchronization2>> feature is
91    not enabled, pname:initialLayout must: not be
92    ename:VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL_KHR or
93    ename:VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHR
94  * [[VUID-{refpage}-synchronization2-06909]]
95    If the <<features-synchronization2, pname:synchronization2>> feature is
96    not enabled, pname:finalLayout must: not be
97    ename:VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL_KHR or
98    ename:VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHR
99endif::VK_KHR_synchronization2[]
100ifdef::VK_EXT_attachment_feedback_loop_layout[]
101  * [[VUID-{refpage}-attachmentFeedbackLoopLayout-07309]]
102    If the <<features-attachmentFeedbackLoopLayout,
103    pname:attachmentFeedbackLoopLayout>> feature is not enabled,
104    pname:initialLayout must: not be
105    ename:VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT
106  * [[VUID-{refpage}-attachmentFeedbackLoopLayout-07310]]
107    If the <<features-attachmentFeedbackLoopLayout,
108    pname:attachmentFeedbackLoopLayout>> feature is not enabled,
109    pname:finalLayout must: not be
110    ename:VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT
111endif::VK_EXT_attachment_feedback_loop_layout[]
112  * [[VUID-{refpage}-samples-08745]]
113    pname:samples must: be a bit value that is set in
114    pname:imageCreateSampleCounts (as defined in
115    <<resources-image-creation-limits,Image Creation Limits>>) for the given
116    pname:format
117// Common Valid Usage
118