1 /* Copyright (c) 2015-2021 The Khronos Group Inc.
2  * Copyright (c) 2015-2021 Valve Corporation
3  * Copyright (c) 2015-2021 LunarG, Inc.
4  * Copyright (C) 2015-2021 Google Inc.
5  * Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  * Author: Camden Stocker <camden@lunarg.com>
20  * Author: Nadav Geva <nadav.geva@amd.com>
21  */
22 
23 #ifndef BEST_PRACTICES_ERROR_ENUMS_H_
24 #define BEST_PRACTICES_ERROR_ENUMS_H_
25 
26 // Suppress unused warning on Linux
27 #if defined(__GNUC__)
28 #define DECORATE_UNUSED __attribute__((unused))
29 #else
30 #define DECORATE_UNUSED
31 #endif
32 
33 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateInstance_ExtensionMismatch =
34     "UNASSIGNED-BestPractices-vkCreateInstance-extension-mismatch";
35 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateDevice_ExtensionMismatch =
36     "UNASSIGNED-BestPractices-vkCreateDevice-extension-mismatch";
37 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateInstance_DeprecatedExtension =
38     "UNASSIGNED-BestPractices-vkCreateInstance-deprecated-extension";
39 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateDevice_DeprecatedExtension =
40     "UNASSIGNED-BestPractices-vkCreateDevice-deprecated-extension";
41 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateInstance_SpecialUseExtension_CADSupport =
42     "UNASSIGNED-BestPractices-vkCreateInstance-specialuse-extension-cadsupport";
43 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateInstance_SpecialUseExtension_D3DEmulation =
44     "UNASSIGNED-BestPractices-vkCreateInstance-specialuse-extension-d3demulation";
45 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateInstance_SpecialUseExtension_DevTools =
46     "UNASSIGNED-BestPractices-vkCreateInstance-specialuse-extension-devtools";
47 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateInstance_SpecialUseExtension_Debugging =
48     "UNASSIGNED-BestPractices-vkCreateInstance-specialuse-extension-debugging";
49 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateInstance_SpecialUseExtension_GLEmulation =
50     "UNASSIGNED-BestPractices-vkCreateInstance-specialuse-extension-glemulation";
51 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateDevice_SpecialUseExtension_CADSupport =
52     "UNASSIGNED-BestPractices-vkCreateDevice-specialuse-extension-cadsupport";
53 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateDevice_SpecialUseExtension_D3DEmulation =
54     "UNASSIGNED-BestPractices-vkCreateDevice-specialuse-extension-d3demulation";
55 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateDevice_SpecialUseExtension_DevTools =
56     "UNASSIGNED-BestPractices-vkCreateDevice-specialuse-extension-devtools";
57 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateDevice_SpecialUseExtension_Debugging =
58     "UNASSIGNED-BestPractices-vkCreateDevice-specialuse-extension-debugging";
59 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateDevice_SpecialUseExtension_GLEmulation =
60     "UNASSIGNED-BestPractices-vkCreateDevice-specialuse-extension-glemulation";
61 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateDevice_API_Mismatch =
62     "UNASSIGNED-BestPractices-vkCreateDevice-API-version-mismatch";
63 static const char DECORATE_UNUSED *kVUID_BestPractices_SharingModeExclusive =
64     "UNASSIGNED-BestPractices-vkCreateBuffer-sharing-mode-exclusive";
65 static const char DECORATE_UNUSED *kVUID_BestPractices_RenderPass_Attatchment =
66     "UNASSIGNED-BestPractices-vkCreateRenderPass-attatchment";
67 static const char DECORATE_UNUSED *kVUID_BestPractices_AllocateMemory_TooManyObjects =
68     "UNASSIGNED-BestPractices-vkAllocateMemory-too-many-objects";
69 static const char DECORATE_UNUSED *kVUID_BestPractices_CreatePipelines_MultiplePipelines =
70     "UNASSIGNED-BestPractices-vkCreatePipelines-multiple-pipelines-no-cache";
71 static const char DECORATE_UNUSED *kVUID_BestPractices_PipelineStageFlags = "UNASSIGNED-BestPractices-pipeline-stage-flags";
72 static const char DECORATE_UNUSED *kVUID_BestPractices_CmdDraw_InstanceCountZero =
73     "UNASSIGNED-BestPractices-vkCmdDraw-instance-count-zero";
74 static const char DECORATE_UNUSED *kVUID_BestPractices_CmdDraw_DrawCountZero = "UNASSIGNED-BestPractices-vkCmdDraw-draw-count-zero";
75 static const char DECORATE_UNUSED *kVUID_BestPractices_CmdDispatch_GroupCountZero =
76     "UNASSIGNED-BestPractices-vkCmdDispatch-group-count-zero";
77 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateDevice_PDFeaturesNotCalled =
78     "UNASSIGNED-BestPractices-vkCreateDevice-physical-device-features-not-retrieved";
79 static const char DECORATE_UNUSED *kVUID_BestPractices_Swapchain_GetSurfaceNotCalled =
80     "UNASSIGNED-BestPractices-vkCreateSwapchainKHR-surface-not-retrieved";
81 static const char DECORATE_UNUSED *kVUID_BestPractices_DisplayPlane_PropertiesNotCalled =
82     "UNASSIGNED-BestPractices-vkGetDisplayPlaneSupportedDisplaysKHR-properties-not-retrieved";
83 static const char DECORATE_UNUSED *kVUID_BestPractices_BufferMemReqNotCalled =
84     "UNASSIGNED-BestPractices-vkBindBufferMemory-requirements-not-retrieved";
85 static const char DECORATE_UNUSED *kVUID_BestPractices_ImageMemReqNotCalled =
86     "UNASSIGNED-BestPractices-vkBindImageMemory-requirements-not-retrieved";
87 static const char DECORATE_UNUSED *kVUID_BestPractices_BindAccelNV_NoMemReqQuery =
88     "UNASSIGNED-BestPractices-BindAccelerationStructureMemoryNV-requirements-not-retrieved";
89 static const char DECORATE_UNUSED *kVUID_BestPractices_DrawState_VtxIndexOutOfBounds =
90     "UNASSIGNED-BestPractices-DrawState-VtxIndexOutOfBounds";
91 static const char DECORATE_UNUSED *kVUID_BestPractices_DrawState_ClearCmdBeforeDraw =
92     "UNASSIGNED-BestPractices-DrawState-ClearCmdBeforeDraw";
93 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateCommandPool_CommandBufferReset =
94     "UNASSIGNED-BestPractices-vkCreateCommandPool-command-buffer-reset";
95 static const char DECORATE_UNUSED *kVUID_BestPractices_BeginCommandBuffer_SimultaneousUse =
96     "UNASSIGNED-BestPractices-vkBeginCommandBuffer-simultaneous-use";
97 static const char DECORATE_UNUSED *kVUID_BestPractices_AllocateMemory_SmallAllocation =
98     "UNASSIGNED-BestPractices-vkAllocateMemory-small-allocation";
99 static const char DECORATE_UNUSED *kVUID_BestPractices_SmallDedicatedAllocation =
100     "UNASSIGNED-BestPractices-vkBindMemory-small-dedicated-allocation";
101 static const char DECORATE_UNUSED *kVUID_BestPractices_NonLazyTransientImage =
102     "UNASSIGNED-BestPractices-vkBindImageMemory-non-lazy-transient-image";
103 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateRenderPass_ImageRequiresMemory =
104     "UNASSIGNED-BestPractices-vkCreateRenderPass-image-requires-memory";
105 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateFramebuffer_AttachmentShouldBeTransient =
106     "UNASSIGNED-BestPractices-vkCreateFramebuffer-attachment-should-be-transient";
107 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateFramebuffer_AttachmentShouldNotBeTransient =
108     "UNASSIGNED-BestPractices-vkCreateFramebuffer-attachment-should-not-be-transient";
109 static const char DECORATE_UNUSED *kVUID_BestPractices_CreatePipelines_TooManyInstancedVertexBuffers =
110     "UNASSIGNED-BestPractices-vkCreateGraphicsPipelines-too-many-instanced-vertex-buffers";
111 static const char DECORATE_UNUSED *kVUID_BestPractices_ClearAttachments_ClearAfterLoad =
112     "UNASSIGNED-BestPractices-vkCmdClearAttachments-clear-after-load";
113 static const char DECORATE_UNUSED *kVUID_BestPractices_Error_Result = "UNASSIGNED-BestPractices-Error-Result";
114 static const char DECORATE_UNUSED *kVUID_BestPractices_Failure_Result = "UNASSIGNED-BestPractices-Failure-Result";
115 static const char DECORATE_UNUSED *kVUID_BestPractices_NonSuccess_Result = "UNASSIGNED-BestPractices-NonSuccess-Result";
116 static const char DECORATE_UNUSED *kVUID_BestPractices_SuboptimalSwapchain = "UNASSIGNED-BestPractices-SuboptimalSwapchain";
117 static const char DECORATE_UNUSED *kVUID_BestPractices_SuboptimalSwapchainImageCount =
118     "UNASSIGNED-BestPractices-vkCreateSwapchainKHR-suboptimal-swapchain-image-count";
119 static const char DECORATE_UNUSED *kVUID_BestPractices_Swapchain_InvalidCount = "UNASSIGNED-BestPractices-SwapchainInvalidCount";
120 static const char DECORATE_UNUSED *kVUID_BestPractices_DepthBiasNoAttachment = "UNASSIGNED-BestPractices-DepthBiasNoAttachment";
121 
122 // Arm-specific best practice
123 static const char DECORATE_UNUSED *kVUID_BestPractices_AllocateDescriptorSets_SuboptimalReuse =
124     "UNASSIGNED-BestPractices-vkAllocateDescriptorSets-suboptimal-reuse";
125 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateComputePipelines_ComputeThreadGroupAlignment =
126     "UNASSIGNED-BestPractices-vkCreateComputePipelines-compute-thread-group-alignment";
127 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateComputePipelines_ComputeWorkGroupSize =
128     "UNASSIGNED-BestPractices-vkCreateComputePipelines-compute-work-group-size";
129 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateComputePipelines_ComputeSpatialLocality =
130     "UNASSIGNED-BestPractices-vkCreateComputePipelines-compute-spatial-locality";
131 static const char DECORATE_UNUSED *kVUID_BestPractices_CreatePipelines_MultisampledBlending =
132     "UNASSIGNED-BestPractices-vkCreatePipelines-multisampled-blending";
133 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateImage_TooLargeSampleCount =
134     "UNASSIGNED-BestPractices-vkCreateImage-too-large-sample-count";
135 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateImage_NonTransientMSImage =
136     "UNASSIGNED-BestPractices-vkCreateImage-non-transient-ms-image";
137 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateSampler_DifferentWrappingModes =
138     "UNASSIGNED-BestPractices-vkCreateSampler-different-wrapping-modes";
139 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateSampler_LodClamping =
140     "UNASSIGNED-BestPractices-vkCreateSampler-lod-clamping";
141 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateSampler_LodBias = "UNASSIGNED-BestPractices-vkCreateSampler-lod-bias";
142 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateSampler_BorderClampColor =
143     "UNASSIGNED-BestPractices-vkCreateSampler-border-clamp-color";
144 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateSampler_UnnormalizedCoordinates =
145     "UNASSIGNED-BestPractices-vkCreateSampler-unnormalized-coordinates";
146 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateSampler_Anisotropy =
147     "UNASSIGNED-BestPractices-vkCreateSampler-anisotropy";
148 static const char DECORATE_UNUSED *kVUID_BestPractices_CmdResolveImage_ResolvingImage =
149     "UNASSIGNED-BestPractices-vkCmdResolveImage-resolving-image";
150 static const char DECORATE_UNUSED *kVUID_BestPractices_CmdResolveImage2KHR_ResolvingImage =
151     "UNASSIGNED-BestPractices-vkCmdResolveImage2KHR-resolving-image";
152 static const char DECORATE_UNUSED *kVUID_BestPractices_CmdDrawIndexed_ManySmallIndexedDrawcalls =
153     "UNASSIGNED-BestPractices-vkCmdDrawIndexed-many-small-indexed-drawcalls";
154 static const char DECORATE_UNUSED *kVUID_BestPractices_CmdDrawIndexed_SparseIndexBuffer =
155     "UNASSIGNED-BestPractices-vkCmdDrawIndexed-sparse-index-buffer";
156 static const char DECORATE_UNUSED *kVUID_BestPractices_CmdDrawIndexed_PostTransformCacheThrashing =
157     "UNASSIGNED-BestPractices-vkCmdDrawIndexed-post-transform-cache-thrashing";
158 static const char DECORATE_UNUSED *kVUID_BestPractices_BeginCommandBuffer_OneTimeSubmit =
159     "UNASSIGNED-BestPractices-vkBeginCommandBuffer-one-time-submit";
160 static const char DECORATE_UNUSED *kVUID_BestPractices_BeginRenderPass_ZeroSizeRenderArea =
161     "UNASSIGNED-BestPractices-vkCmdBeginRenderPass-zero-size-render-area";
162 static const char DECORATE_UNUSED *kVUID_BestPractices_BeginRenderPass_AttachmentNeedsReadback =
163     "UNASSIGNED-BestPractices-vkCmdBeginRenderPass-attachment-needs-readback";
164 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateSwapchain_PresentMode =
165     "UNASSIGNED-BestPractices-vkCreateSwapchainKHR-swapchain-presentmode-not-fifo";
166 static const char DECORATE_UNUSED *kVUID_BestPractices_CreatePipelines_DepthBias_Zero =
167     "UNASSIGNED-BestPractices-vkCreatePipelines-depthbias-zero";
168 static const char DECORATE_UNUSED *kVUID_BestPractices_CreateDevice_RobustBufferAccess =
169     "UNASSIGNED-BestPractices-vkCreateDevice-RobustBufferAccess";
170 static const char DECORATE_UNUSED *kVUID_BestPractices_EndRenderPass_DepthPrePassUsage =
171     "UNASSIGNED-BestPractices-vkCmdEndRenderPass-depth-pre-pass-usage";
172 static const char DECORATE_UNUSED *kVUID_BestPractices_EndRenderPass_RedundantAttachmentOnTile =
173     "UNASSIGNED-BestPractices-vkCmdEndRenderPass-redundant-attachment-on-tile";
174 static const char DECORATE_UNUSED *kVUID_BestPractices_RenderPass_RedundantStore =
175     "UNASSIGNED-BestPractices-RenderPass-redundant-store";
176 static const char DECORATE_UNUSED *kVUID_BestPractices_RenderPass_RedundantClear =
177     "UNASSIGNED-BestPractices-RenderPass-redundant-clear";
178 static const char DECORATE_UNUSED *kVUID_BestPractices_RenderPass_InefficientClear =
179     "UNASSIGNED-BestPractices-RenderPass-inefficient-clear";
180 static const char DECORATE_UNUSED *kVUID_BestPractices_RenderPass_BlitImage_LoadOpLoad =
181     "UNASSIGNED-BestPractices-RenderPass-blitimage-loadopload";
182 static const char DECORATE_UNUSED *kVUID_BestPractices_RenderPass_CopyImage_LoadOpLoad =
183     "UNASSIGNED-BestPractices-RenderPass-copyimage-loadopload";
184 static const char DECORATE_UNUSED *kVUID_BestPractices_RenderPass_ResolveImage_LoadOpLoad =
185     "UNASSIGNED-BestPractices-RenderPass-resolveimage-loadopload";
186 
187 
188 // AMD-specific best practice
189 static const char DECORATE_UNUSED *kVUID_BestPractices_CmdBuffer_AvoidTinyCmdBuffers =
190     "UNASSIGNED-BestPractices-VkCommandBuffer-AvoidTinyCmdBuffers";
191 static const char DECORATE_UNUSED *kVUID_BestPractices_CmdBuffer_AvoidSecondaryCmdBuffers =
192     "UNASSIGNED-BestPractices-VkCommandBuffer-AvoidSecondaryCmdBuffers";
193 static const char DECORATE_UNUSED *kVUID_BestPractices_CmdBuffer_AvoidSmallSecondaryCmdBuffers =
194     "UNASSIGNED-BestPractices-VkCommandBuffer-AvoidSmallSecondaryCmdBuffers";
195 static const char DECORATE_UNUSED *kVUID_BestPractices_CmdBuffer_AvoidClearSecondaryCmdBuffers =
196     "UNASSIGNED-BestPractices-VkCommandBuffer-AvoidClearSecondaryCmdBuffers";
197 static const char DECORATE_UNUSED *kVUID_BestPractices_DrawState_AvoidVertexBindEveryDraw =
198     "UNASSIGNED-BestPractices-DrawState-AvoidVertexBindEveryDraw";
199 static const char DECORATE_UNUSED *kVUID_BestPractices_CmdPool_DisparateSizedCmdBuffers =
200     "UNASSIGNED-BestPractices-CmdPool-DisparateSizedCmdBuffers";
201 static const char DECORATE_UNUSED *kVUID_BestPractices_CreatePipelines_TooManyPipelines =
202     "UNASSIGNED-BestPractices-CreatePipelines-TooManyPipelines";
203 static const char DECORATE_UNUSED *kVUID_BestPractices_CreatePipelines_MultiplePipelineCaches =
204     "UNASSIGNED-BestPractices-vkCreatePipelines-multiple-pipelines-caches";
205 static const char DECORATE_UNUSED *kVUID_BestPractices_vkImage_DontUseMutableRenderTargets =
206     "UNASSIGNED-BestPractices-vkImage-DontUseMutableRenderTargets";
207 static const char DECORATE_UNUSED *kVUID_BestPractices_vkImage_AvoidImageToImageCopy =
208     "UNASSIGNED-BestPractices-vkImage-AvoidImageToImageCopy";
209 static const char DECORATE_UNUSED *kVUID_BestPractices_vkImage_AvoidConcurrentRenderTargets =
210     "UNASSIGNED-BestPractices-vkImage-AvoidConcurrentRenderTargets";
211 static const char DECORATE_UNUSED *kVUID_BestPractices_vkImage_DontUseStorageRenderTargets =
212     "UNASSIGNED-BestPractices-vkImage-DontUseStorageRenderTargets";
213 static const char DECORATE_UNUSED *kVUID_BestPractices_vkImage_AvoidGeneral = "UNASSIGNED-BestPractices-vkImage-AvoidGeneral";
214 static const char DECORATE_UNUSED *kVUID_BestPractices_CreatePipelines_AvoidPrimitiveRestart =
215     "UNASSIGNED-BestPractices-CreatePipelines-AvoidPrimitiveRestart";
216 static const char DECORATE_UNUSED *kVUID_BestPractices_CreatePipelines_MinimizeNumDynamicStates =
217     "UNASSIGNED-BestPractices-CreatePipelines-MinimizeNumDynamicStates";
218 static const char DECORATE_UNUSED *kVUID_BestPractices_CreatePipelinesLayout_KeepLayoutSmall =
219     "UNASSIGNED-BestPractices-CreatePipelinesLayout-KeepLayoutSmall";
220 static const char DECORATE_UNUSED *kVUID_BestPractices_UpdateDescriptors_AvoidCopyingDescriptors =
221     "UNASSIGNED-BestPractices-UpdateDescriptors-AvoidCopyingDescriptors";
222 static const char DECORATE_UNUSED *kVUID_BestPractices_UpdateDescriptors_PreferNonTemplate =
223     "UNASSIGNED-BestPractices-UpdateDescriptors-PreferNonTemplate";
224 static const char DECORATE_UNUSED *kVUID_BestPractices_ClearAttachment_FastClearValues =
225     "UNASSIGNED-BestPractices-ClearAttachment-FastClearValues";
226 static const char DECORATE_UNUSED *kVUID_BestPractices_ClearAttachment_ClearImage =
227     "UNASSIGNED-BestPractices-ClearAttachment-ClearImage";
228 static const char DECORATE_UNUSED *kVUID_BestPractices_CmdBuffer_backToBackBarrier =
229     "UNASSIGNED-BestPractices-CmdBuffer-backToBackBarrier";
230 static const char DECORATE_UNUSED *kVUID_BestPractices_CmdBuffer_highBarrierCount =
231     "UNASSIGNED-BestPractices-CmdBuffer-highBarrierCount";
232 static const char DECORATE_UNUSED *kVUID_BestPractices_PipelineBarrier_readToReadBarrier =
233     "UNASSIGNED-BestPractices-PipelineBarrier-readToReadBarrier";
234 static const char DECORATE_UNUSED *kVUID_BestPractices_Submission_ReduceNumberOfSubmissions =
235     "UNASSIGNED-BestPractices-Submission-ReduceNumberOfSubmissions";
236 static const char DECORATE_UNUSED *kVUID_BestPractices_Pipeline_SortAndBind = "UNASSIGNED-BestPractices-Pipeline-SortAndBind";
237 static const char DECORATE_UNUSED *kVUID_BestPractices_Pipeline_WorkPerPipelineChange =
238     "UNASSIGNED-BestPractices-Pipeline-WorkPerPipelineChange";
239 static const char DECORATE_UNUSED *kVUID_BestPractices_SyncObjects_HighNumberOfFences =
240     "UNASSIGNED-BestPractices-SyncObjects-HighNumberOfFences";
241 static const char DECORATE_UNUSED *kVUID_BestPractices_SyncObjects_HighNumberOfSemaphores =
242     "UNASSIGNED-BestPractices-SyncObjects-HighNumberOfSemaphores";
243 static const char DECORATE_UNUSED *kVUID_BestPractices_DynamicRendering_NotSupported =
244     "UNASSIGNED-BestPractices-DynamicRendering-NotSupported";
245 
246 #endif
247