blob: 023e7e12bdb0632dff611ab4a9ba21db250902d7 [file] [log] [blame]
Jeff Bolz7e7e6e02019-01-11 22:53:41 -06001/* Copyright (c) 2015-2019 The Khronos Group Inc.
2 * Copyright (c) 2015-2019 Valve Corporation
3 * Copyright (c) 2015-2019 LunarG, Inc.
4 * Copyright (C) 2015-2019 Google Inc.
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -07005 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 * Author: Dustin Graves <dustin@lunarg.com>
19 * Author: Mark Lobodzinski <mark@lunarg.com>
20 */
21
22#pragma once
23
24#include <bitset>
25
26#include "parameter_name.h"
27#include "vk_typemap_helper.h"
28
29// Suppress unused warning on Linux
30#if defined(__GNUC__)
31#define DECORATE_UNUSED __attribute__((unused))
32#else
33#define DECORATE_UNUSED
34#endif
35
36static const char DECORATE_UNUSED *kVUID_PVError_NONE = "UNASSIGNED-GeneralParameterError-Info";
37static const char DECORATE_UNUSED *kVUID_PVError_InvalidUsage = "UNASSIGNED-GeneralParameterError-InvalidUsage";
38static const char DECORATE_UNUSED *kVUID_PVError_InvalidStructSType = "UNASSIGNED-GeneralParameterError-InvalidStructSType";
39static const char DECORATE_UNUSED *kVUID_PVError_InvalidStructPNext = "UNASSIGNED-GeneralParameterError-InvalidStructPNext";
40static const char DECORATE_UNUSED *kVUID_PVError_RequiredParameter = "UNASSIGNED-GeneralParameterError-RequiredParameter";
41static const char DECORATE_UNUSED *kVUID_PVError_ReservedParameter = "UNASSIGNED-GeneralParameterError-ReservedParameter";
42static const char DECORATE_UNUSED *kVUID_PVError_UnrecognizedValue = "UNASSIGNED-GeneralParameterError-UnrecognizedValue";
43static const char DECORATE_UNUSED *kVUID_PVError_DeviceLimit = "UNASSIGNED-GeneralParameterError-DeviceLimit";
44static const char DECORATE_UNUSED *kVUID_PVError_DeviceFeature = "UNASSIGNED-GeneralParameterError-DeviceFeature";
45static const char DECORATE_UNUSED *kVUID_PVError_FailureCode = "UNASSIGNED-GeneralParameterError-FailureCode";
46static const char DECORATE_UNUSED *kVUID_PVError_ExtensionNotEnabled = "UNASSIGNED-GeneralParameterError-ExtensionNotEnabled";
locke-lunargb1909cd2019-08-01 23:40:05 -060047static const char DECORATE_UNUSED *kVUID_PVPerfWarn_SuboptimalSwapchain = "UNASSIGNED-GeneralParameterPerfWarn-SuboptimalSwapchain";
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -070048
49#undef DECORATE_UNUSED
50
51extern const uint32_t GeneratedVulkanHeaderVersion;
52
53extern const VkQueryPipelineStatisticFlags AllVkQueryPipelineStatisticFlagBits;
54extern const VkColorComponentFlags AllVkColorComponentFlagBits;
55extern const VkShaderStageFlags AllVkShaderStageFlagBits;
56extern const VkQueryControlFlags AllVkQueryControlFlagBits;
57extern const VkImageUsageFlags AllVkImageUsageFlagBits;
58
59extern const std::vector<VkCompareOp> AllVkCompareOpEnums;
60extern const std::vector<VkStencilOp> AllVkStencilOpEnums;
61extern const std::vector<VkBlendFactor> AllVkBlendFactorEnums;
62extern const std::vector<VkBlendOp> AllVkBlendOpEnums;
63extern const std::vector<VkLogicOp> AllVkLogicOpEnums;
64extern const std::vector<VkBorderColor> AllVkBorderColorEnums;
65extern const std::vector<VkImageLayout> AllVkImageLayoutEnums;
66
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -070067// String returned by string_VkStructureType for an unrecognized type.
68const std::string UnsupportedStructureTypeString = "Unhandled VkStructureType";
69
70// String returned by string_VkResult for an unrecognized type.
71const std::string UnsupportedResultString = "Unhandled VkResult";
72
73// The base value used when computing the offset for an enumeration token value that is added by an extension.
74// When validating enumeration tokens, any value >= to this value is considered to be provided by an extension.
75// See Appendix C.10 "Assigning Extension Token Values" from the Vulkan specification
76const uint32_t ExtEnumBaseValue = 1000000000;
77
78// The value of all VK_xxx_MAX_ENUM tokens
79const uint32_t MaxEnumValue = 0x7FFFFFFF;
80
81// Misc parameters of log_msg that are likely constant per command (or low frequency change)
82struct LogMiscParams {
83 VkDebugReportObjectTypeEXT objectType;
84 uint64_t srcObject;
85 const char *api_name;
86};
87
88class StatelessValidation : public ValidationObject {
89 public:
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -070090 VkPhysicalDeviceLimits device_limits = {};
91 VkPhysicalDeviceFeatures physical_device_features = {};
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -070092
Mark Lobodzinskif27a6bc2019-02-04 13:00:49 -070093 // Override chassis read/write locks for this validation object
94 // This override takes a deferred lock. i.e. it is not acquired.
95 std::unique_lock<std::mutex> write_lock() { return std::unique_lock<std::mutex>(validation_object_mutex, std::defer_lock); }
96
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -070097 // Device extension properties -- storing properties gathered from VkPhysicalDeviceProperties2KHR::pNext chain
98 struct DeviceExtensionProperties {
99 VkPhysicalDeviceShadingRateImagePropertiesNV shading_rate_image_props;
100 VkPhysicalDeviceMeshShaderPropertiesNV mesh_shader_props;
Jason Macnak5c954952019-07-09 15:46:12 -0700101 VkPhysicalDeviceRayTracingPropertiesNV ray_tracing_props;
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700102 };
103 DeviceExtensionProperties phys_dev_ext_props = {};
104
105 struct SubpassesUsageStates {
106 std::unordered_set<uint32_t> subpasses_using_color_attachment;
107 std::unordered_set<uint32_t> subpasses_using_depthstencil_attachment;
108 };
109
Mark Lobodzinskif27a6bc2019-02-04 13:00:49 -0700110 // Though this validation object is predominantly statless, the Framebuffer checks are greatly simplified by creating and
111 // updating a map of the renderpass usage states, and these accesses need thread protection. Use a mutex separate from the
112 // parent object's to maintain that functionality.
113 std::mutex renderpass_map_mutex;
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700114 std::unordered_map<VkRenderPass, SubpassesUsageStates> renderpasses_states;
115
116 // Constructor for stateles validation tracking
117 // StatelessValidation() : {}
118 /**
119 * Validate a minimum value.
120 *
121 * Verify that the specified value is greater than the specified lower bound.
122 *
123 * @param api_name Name of API call being validated.
124 * @param parameter_name Name of parameter being validated.
125 * @param value Value to validate.
126 * @param lower_bound Lower bound value to use for validation.
127 * @return Boolean value indicating that the call should be skipped.
128 */
129 template <typename T>
130 bool ValidateGreaterThan(const T value, const T lower_bound, const ParameterName &parameter_name, const std::string &vuid,
131 const LogMiscParams &misc) {
132 bool skip_call = false;
133
134 if (value <= lower_bound) {
135 std::ostringstream ss;
136 ss << misc.api_name << ": parameter " << parameter_name.get_name() << " (= " << value << ") is greater than "
137 << lower_bound;
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700138 skip_call |=
139 log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, misc.objectType, misc.srcObject, vuid, "%s", ss.str().c_str());
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700140 }
141
142 return skip_call;
143 }
144
145 template <typename T>
146 bool ValidateGreaterThanZero(const T value, const ParameterName &parameter_name, const std::string &vuid,
147 const LogMiscParams &misc) {
148 return ValidateGreaterThan(value, T{0}, parameter_name, vuid, misc);
149 }
150 /**
151 * Validate a required pointer.
152 *
153 * Verify that a required pointer is not NULL.
154 *
155 * @param apiName Name of API call being validated.
156 * @param parameterName Name of parameter being validated.
157 * @param value Pointer to validate.
158 * @return Boolean value indicating that the call should be skipped.
159 */
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700160 bool validate_required_pointer(const char *apiName, const ParameterName &parameterName, const void *value,
161 const std::string &vuid) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700162 bool skip_call = false;
163
164 if (value == NULL) {
165 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, vuid,
166 "%s: required parameter %s specified as NULL.", apiName, parameterName.get_name().c_str());
167 }
168
169 return skip_call;
170 }
171
172 /**
173 * Validate array count and pointer to array.
174 *
175 * Verify that required count and array parameters are not 0 or NULL. If the
176 * count parameter is not optional, verify that it is not 0. If the array
177 * parameter is NULL, and it is not optional, verify that count is 0.
178 *
179 * @param apiName Name of API call being validated.
180 * @param countName Name of count parameter.
181 * @param arrayName Name of array parameter.
182 * @param count Number of elements in the array.
183 * @param array Array to validate.
184 * @param countRequired The 'count' parameter may not be 0 when true.
185 * @param arrayRequired The 'array' parameter may not be NULL when true.
186 * @return Boolean value indicating that the call should be skipped.
187 */
188 template <typename T1, typename T2>
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700189 bool validate_array(const char *apiName, const ParameterName &countName, const ParameterName &arrayName, T1 count,
Jeff Bolzfdd0d852019-02-03 21:55:12 -0600190 const T2 *array, bool countRequired, bool arrayRequired, const char *count_required_vuid,
191 const char *array_required_vuid) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700192 bool skip_call = false;
193
194 // Count parameters not tagged as optional cannot be 0
195 if (countRequired && (count == 0)) {
196 skip_call |=
197 log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, count_required_vuid,
198 "%s: parameter %s must be greater than 0.", apiName, countName.get_name().c_str());
199 }
200
201 // Array parameters not tagged as optional cannot be NULL, unless the count is 0
202 if (arrayRequired && (count != 0) && (*array == NULL)) {
203 skip_call |=
204 log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, array_required_vuid,
205 "%s: required parameter %s specified as NULL.", apiName, arrayName.get_name().c_str());
206 }
207
208 return skip_call;
209 }
210
211 /**
212 * Validate pointer to array count and pointer to array.
213 *
214 * Verify that required count and array parameters are not NULL. If count
215 * is not NULL and its value is not optional, verify that it is not 0. If the
216 * array parameter is NULL, and it is not optional, verify that count is 0.
217 * The array parameter will typically be optional for this case (where count is
218 * a pointer), allowing the caller to retrieve the available count.
219 *
220 * @param apiName Name of API call being validated.
221 * @param countName Name of count parameter.
222 * @param arrayName Name of array parameter.
223 * @param count Pointer to the number of elements in the array.
224 * @param array Array to validate.
225 * @param countPtrRequired The 'count' parameter may not be NULL when true.
226 * @param countValueRequired The '*count' value may not be 0 when true.
227 * @param arrayRequired The 'array' parameter may not be NULL when true.
228 * @return Boolean value indicating that the call should be skipped.
229 */
230 template <typename T1, typename T2>
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700231 bool validate_array(const char *apiName, const ParameterName &countName, const ParameterName &arrayName, const T1 *count,
232 const T2 *array, bool countPtrRequired, bool countValueRequired, bool arrayRequired,
Jeff Bolzfdd0d852019-02-03 21:55:12 -0600233 const char *count_required_vuid, const char *array_required_vuid) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700234 bool skip_call = false;
235
236 if (count == NULL) {
237 if (countPtrRequired) {
238 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
239 kVUID_PVError_RequiredParameter, "%s: required parameter %s specified as NULL", apiName,
240 countName.get_name().c_str());
241 }
242 } else {
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700243 skip_call |= validate_array(apiName, countName, arrayName, *array ? (*count) : 0, &array, countValueRequired,
244 arrayRequired, count_required_vuid, array_required_vuid);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700245 }
246
247 return skip_call;
248 }
249
250 /**
251 * Validate a pointer to a Vulkan structure.
252 *
253 * Verify that a required pointer to a structure is not NULL. If the pointer is
254 * not NULL, verify that each structure's sType field is set to the correct
255 * VkStructureType value.
256 *
257 * @param apiName Name of API call being validated.
258 * @param parameterName Name of struct parameter being validated.
259 * @param sTypeName Name of expected VkStructureType value.
260 * @param value Pointer to the struct to validate.
261 * @param sType VkStructureType for structure validation.
262 * @param required The parameter may not be NULL when true.
263 * @return Boolean value indicating that the call should be skipped.
264 */
265 template <typename T>
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700266 bool validate_struct_type(const char *apiName, const ParameterName &parameterName, const char *sTypeName, const T *value,
Jeff Bolzfdd0d852019-02-03 21:55:12 -0600267 VkStructureType sType, bool required, const char *struct_vuid, const char *stype_vuid) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700268 bool skip_call = false;
269
270 if (value == NULL) {
271 if (required) {
272 skip_call |=
273 log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, struct_vuid,
274 "%s: required parameter %s specified as NULL", apiName, parameterName.get_name().c_str());
275 }
276 } else if (value->sType != sType) {
277 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, stype_vuid,
278 "%s: parameter %s->sType must be %s.", apiName, parameterName.get_name().c_str(), sTypeName);
279 }
280
281 return skip_call;
282 }
283
284 /**
285 * Validate an array of Vulkan structures
286 *
287 * Verify that required count and array parameters are not 0 or NULL. If
288 * the array contains 1 or more structures, verify that each structure's
289 * sType field is set to the correct VkStructureType value.
290 *
291 * @param apiName Name of API call being validated.
292 * @param countName Name of count parameter.
293 * @param arrayName Name of array parameter.
294 * @param sTypeName Name of expected VkStructureType value.
295 * @param count Number of elements in the array.
296 * @param array Array to validate.
297 * @param sType VkStructureType for structure validation.
298 * @param countRequired The 'count' parameter may not be 0 when true.
299 * @param arrayRequired The 'array' parameter may not be NULL when true.
300 * @return Boolean value indicating that the call should be skipped.
301 */
302 template <typename T>
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700303 bool validate_struct_type_array(const char *apiName, const ParameterName &countName, const ParameterName &arrayName,
304 const char *sTypeName, uint32_t count, const T *array, VkStructureType sType,
Jasper St. Pierre6c98f8c2019-01-22 15:18:03 -0800305 bool countRequired, bool arrayRequired, const char *stype_vuid, const char *param_vuid,
306 const char *count_required_vuid) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700307 bool skip_call = false;
308
309 if ((count == 0) || (array == NULL)) {
Jasper St. Pierre6c98f8c2019-01-22 15:18:03 -0800310 skip_call |= validate_array(apiName, countName, arrayName, count, &array, countRequired, arrayRequired,
311 count_required_vuid, param_vuid);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700312 } else {
313 // Verify that all structs in the array have the correct type
314 for (uint32_t i = 0; i < count; ++i) {
315 if (array[i].sType != sType) {
316 skip_call |=
317 log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, stype_vuid,
318 "%s: parameter %s[%d].sType must be %s", apiName, arrayName.get_name().c_str(), i, sTypeName);
319 }
320 }
321 }
322
323 return skip_call;
324 }
325
326 /**
327 * Validate an array of Vulkan structures.
328 *
329 * Verify that required count and array parameters are not NULL. If count
330 * is not NULL and its value is not optional, verify that it is not 0.
331 * If the array contains 1 or more structures, verify that each structure's
332 * sType field is set to the correct VkStructureType value.
333 *
334 * @param apiName Name of API call being validated.
335 * @param countName Name of count parameter.
336 * @param arrayName Name of array parameter.
337 * @param sTypeName Name of expected VkStructureType value.
338 * @param count Pointer to the number of elements in the array.
339 * @param array Array to validate.
340 * @param sType VkStructureType for structure validation.
341 * @param countPtrRequired The 'count' parameter may not be NULL when true.
342 * @param countValueRequired The '*count' value may not be 0 when true.
343 * @param arrayRequired The 'array' parameter may not be NULL when true.
344 * @return Boolean value indicating that the call should be skipped.
345 */
346 template <typename T>
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700347 bool validate_struct_type_array(const char *apiName, const ParameterName &countName, const ParameterName &arrayName,
348 const char *sTypeName, uint32_t *count, const T *array, VkStructureType sType,
Jeff Bolzfdd0d852019-02-03 21:55:12 -0600349 bool countPtrRequired, bool countValueRequired, bool arrayRequired, const char *stype_vuid,
Jasper St. Pierre6c98f8c2019-01-22 15:18:03 -0800350 const char *param_vuid, const char *count_required_vuid) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700351 bool skip_call = false;
352
353 if (count == NULL) {
354 if (countPtrRequired) {
355 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
356 kVUID_PVError_RequiredParameter, "%s: required parameter %s specified as NULL", apiName,
357 countName.get_name().c_str());
358 }
359 } else {
360 skip_call |= validate_struct_type_array(apiName, countName, arrayName, sTypeName, (*count), array, sType,
Jasper St. Pierre6c98f8c2019-01-22 15:18:03 -0800361 countValueRequired, arrayRequired, stype_vuid, param_vuid, count_required_vuid);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700362 }
363
364 return skip_call;
365 }
366
367 /**
368 * Validate a Vulkan handle.
369 *
370 * Verify that the specified handle is not VK_NULL_HANDLE.
371 *
372 * @param api_name Name of API call being validated.
373 * @param parameter_name Name of struct parameter being validated.
374 * @param value Handle to validate.
375 * @return Boolean value indicating that the call should be skipped.
376 */
377 template <typename T>
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700378 bool validate_required_handle(const char *api_name, const ParameterName &parameter_name, T value) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700379 bool skip_call = false;
380
381 if (value == VK_NULL_HANDLE) {
382 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
383 kVUID_PVError_RequiredParameter, "%s: required parameter %s specified as VK_NULL_HANDLE", api_name,
384 parameter_name.get_name().c_str());
385 }
386
387 return skip_call;
388 }
389
390 /**
391 * Validate an array of Vulkan handles.
392 *
393 * Verify that required count and array parameters are not NULL. If count
394 * is not NULL and its value is not optional, verify that it is not 0.
395 * If the array contains 1 or more handles, verify that no handle is set to
396 * VK_NULL_HANDLE.
397 *
398 * @note This function is only intended to validate arrays of handles when none
399 * of the handles are allowed to be VK_NULL_HANDLE. For arrays of handles
400 * that are allowed to contain VK_NULL_HANDLE, use validate_array() instead.
401 *
402 * @param api_name Name of API call being validated.
403 * @param count_name Name of count parameter.
404 * @param array_name Name of array parameter.
405 * @param count Number of elements in the array.
406 * @param array Array to validate.
407 * @param count_required The 'count' parameter may not be 0 when true.
408 * @param array_required The 'array' parameter may not be NULL when true.
409 * @return Boolean value indicating that the call should be skipped.
410 */
411 template <typename T>
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700412 bool validate_handle_array(const char *api_name, const ParameterName &count_name, const ParameterName &array_name,
413 uint32_t count, const T *array, bool count_required, bool array_required) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700414 bool skip_call = false;
415
416 if ((count == 0) || (array == NULL)) {
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700417 skip_call |= validate_array(api_name, count_name, array_name, count, &array, count_required, array_required,
418 kVUIDUndefined, kVUIDUndefined);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700419 } else {
420 // Verify that no handles in the array are VK_NULL_HANDLE
421 for (uint32_t i = 0; i < count; ++i) {
422 if (array[i] == VK_NULL_HANDLE) {
423 skip_call |=
424 log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
425 kVUID_PVError_RequiredParameter, "%s: required parameter %s[%d] specified as VK_NULL_HANDLE",
426 api_name, array_name.get_name().c_str(), i);
427 }
428 }
429 }
430
431 return skip_call;
432 }
433
434 /**
435 * Validate string array count and content.
436 *
437 * Verify that required count and array parameters are not 0 or NULL. If the
438 * count parameter is not optional, verify that it is not 0. If the array
439 * parameter is NULL, and it is not optional, verify that count is 0. If the
440 * array parameter is not NULL, verify that none of the strings are NULL.
441 *
442 * @param apiName Name of API call being validated.
443 * @param countName Name of count parameter.
444 * @param arrayName Name of array parameter.
445 * @param count Number of strings in the array.
446 * @param array Array of strings to validate.
447 * @param countRequired The 'count' parameter may not be 0 when true.
448 * @param arrayRequired The 'array' parameter may not be NULL when true.
449 * @return Boolean value indicating that the call should be skipped.
450 */
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700451 bool validate_string_array(const char *apiName, const ParameterName &countName, const ParameterName &arrayName, uint32_t count,
Jeff Bolzfdd0d852019-02-03 21:55:12 -0600452 const char *const *array, bool countRequired, bool arrayRequired, const char *count_required_vuid,
453 const char *array_required_vuid) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700454 bool skip_call = false;
455
456 if ((count == 0) || (array == NULL)) {
457 skip_call |= validate_array(apiName, countName, arrayName, count, &array, countRequired, arrayRequired,
458 count_required_vuid, array_required_vuid);
459 } else {
460 // Verify that strings in the array are not NULL
461 for (uint32_t i = 0; i < count; ++i) {
462 if (array[i] == NULL) {
463 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
464 kVUID_PVError_RequiredParameter, "%s: required parameter %s[%d] specified as NULL",
465 apiName, arrayName.get_name().c_str(), i);
466 }
467 }
468 }
469
470 return skip_call;
471 }
472
473 // Forward declaration for pNext validation
Lockefbdd1af2019-04-16 15:07:23 -0600474 bool ValidatePnextStructContents(const char *api_name, const ParameterName &parameter_name, const VkBaseOutStructure *header);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700475
476 /**
477 * Validate a structure's pNext member.
478 *
479 * Verify that the specified pNext value points to the head of a list of
480 * allowed extension structures. If no extension structures are allowed,
481 * verify that pNext is null.
482 *
483 * @param api_name Name of API call being validated.
484 * @param parameter_name Name of parameter being validated.
485 * @param allowed_struct_names Names of allowed structs.
486 * @param next Pointer to validate.
487 * @param allowed_type_count Total number of allowed structure types.
488 * @param allowed_types Array of structure types allowed for pNext.
489 * @param header_version Version of header defining the pNext validation rules.
490 * @return Boolean value indicating that the call should be skipped.
491 */
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700492 bool validate_struct_pnext(const char *api_name, const ParameterName &parameter_name, const char *allowed_struct_names,
493 const void *next, size_t allowed_type_count, const VkStructureType *allowed_types,
Jeff Bolzfdd0d852019-02-03 21:55:12 -0600494 uint32_t header_version, const char *vuid) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700495 bool skip_call = false;
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700496
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700497 // TODO: The valid pNext structure types are not recursive. Each structure has its own list of valid sTypes for pNext.
498 // Codegen a map of vectors containing the allowable pNext types for each struct and use that here -- also simplifies parms.
499 if (next != NULL) {
Jeff Bolzfdd0d852019-02-03 21:55:12 -0600500 std::unordered_set<const void *> cycle_check;
501 std::unordered_set<VkStructureType, std::hash<int>> unique_stype_check;
502
Jeff Bolz6d3beaa2019-02-09 21:00:05 -0600503 const char *disclaimer =
504 "This warning is based on the Valid Usage documentation for version %d of the Vulkan header. It is possible that "
505 "you "
506 "are "
507 "using a struct from a private extension or an extension that was added to a later version of the Vulkan header, "
508 "in "
509 "which "
510 "case your use of %s is perfectly valid but is not guaranteed to work correctly with validation enabled";
511
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700512 if (allowed_type_count == 0) {
513 std::string message = "%s: value of %s must be NULL. ";
514 message += disclaimer;
515 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, vuid,
516 message.c_str(), api_name, parameter_name.get_name().c_str(), header_version,
517 parameter_name.get_name().c_str());
518 } else {
519 const VkStructureType *start = allowed_types;
520 const VkStructureType *end = allowed_types + allowed_type_count;
Lockefbdd1af2019-04-16 15:07:23 -0600521 const VkBaseOutStructure *current = reinterpret_cast<const VkBaseOutStructure *>(next);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700522
523 cycle_check.insert(next);
524
525 while (current != NULL) {
526 if (((strncmp(api_name, "vkCreateInstance", strlen(api_name)) != 0) ||
527 (current->sType != VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO)) &&
528 ((strncmp(api_name, "vkCreateDevice", strlen(api_name)) != 0) ||
529 (current->sType != VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO))) {
530 if (cycle_check.find(current->pNext) != cycle_check.end()) {
531 std::string message = "%s: %s chain contains a cycle -- pNext pointer " PRIx64 " is repeated.";
532 skip_call |=
533 log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
534 kVUID_PVError_InvalidStructPNext, message.c_str(), api_name,
535 parameter_name.get_name().c_str(), reinterpret_cast<uint64_t>(next));
536 break;
537 } else {
538 cycle_check.insert(current->pNext);
539 }
540
541 std::string type_name = string_VkStructureType(current->sType);
542 if (unique_stype_check.find(current->sType) != unique_stype_check.end()) {
543 std::string message = "%s: %s chain contains duplicate structure types: %s appears multiple times.";
544 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT,
545 VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, kVUID_PVError_InvalidStructPNext,
546 message.c_str(), api_name, parameter_name.get_name().c_str(), type_name.c_str());
547 } else {
548 unique_stype_check.insert(current->sType);
549 }
550
551 if (std::find(start, end, current->sType) == end) {
552 if (type_name == UnsupportedStructureTypeString) {
553 std::string message =
554 "%s: %s chain includes a structure with unknown VkStructureType (%d); Allowed structures are "
555 "[%s]. ";
556 message += disclaimer;
557 skip_call |=
558 log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT,
559 0, vuid, message.c_str(), api_name, parameter_name.get_name().c_str(), current->sType,
560 allowed_struct_names, header_version, parameter_name.get_name().c_str());
561 } else {
562 std::string message =
563 "%s: %s chain includes a structure with unexpected VkStructureType %s; Allowed structures are "
564 "[%s]. ";
565 message += disclaimer;
566 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT,
567 VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, vuid, message.c_str(), api_name,
568 parameter_name.get_name().c_str(), type_name.c_str(), allowed_struct_names,
569 header_version, parameter_name.get_name().c_str());
570 }
571 }
572 skip_call |= ValidatePnextStructContents(api_name, parameter_name, current);
573 }
Lockefbdd1af2019-04-16 15:07:23 -0600574 current = reinterpret_cast<const VkBaseOutStructure *>(current->pNext);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700575 }
576 }
577 }
578
579 return skip_call;
580 }
581
582 /**
583 * Validate a VkBool32 value.
584 *
585 * Generate a warning if a VkBool32 value is neither VK_TRUE nor VK_FALSE.
586 *
587 * @param apiName Name of API call being validated.
588 * @param parameterName Name of parameter being validated.
589 * @param value Boolean value to validate.
590 * @return Boolean value indicating that the call should be skipped.
591 */
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700592 bool validate_bool32(const char *apiName, const ParameterName &parameterName, VkBool32 value) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700593 bool skip_call = false;
594
595 if ((value != VK_TRUE) && (value != VK_FALSE)) {
596 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
597 kVUID_PVError_UnrecognizedValue, "%s: value of %s (%d) is neither VK_TRUE nor VK_FALSE", apiName,
598 parameterName.get_name().c_str(), value);
599 }
600
601 return skip_call;
602 }
603
604 /**
605 * Validate a Vulkan enumeration value.
606 *
607 * Generate a warning if an enumeration token value does not fall within the core enumeration
608 * begin and end token values, and was not added to the enumeration by an extension. Extension
609 * provided enumerations use the equation specified in Appendix C.10 of the Vulkan specification,
610 * with 1,000,000,000 as the base token value.
611 *
612 * @note This function does not expect to process enumerations defining bitmask flag bits.
613 *
614 * @param apiName Name of API call being validated.
615 * @param parameterName Name of parameter being validated.
616 * @param enumName Name of the enumeration being validated.
617 * @param valid_values The list of valid values for the enumeration.
618 * @param value Enumeration value to validate.
619 * @return Boolean value indicating that the call should be skipped.
620 */
621 template <typename T>
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700622 bool validate_ranged_enum(const char *apiName, const ParameterName &parameterName, const char *enumName,
Jeff Bolzfdd0d852019-02-03 21:55:12 -0600623 const std::vector<T> &valid_values, T value, const char *vuid) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700624 bool skip = false;
625
626 if (std::find(valid_values.begin(), valid_values.end(), value) == valid_values.end()) {
627 skip |=
628 log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, vuid,
629 "%s: value of %s (%d) does not fall within the begin..end range of the core %s enumeration tokens and is "
630 "not an extension added token.",
631 apiName, parameterName.get_name().c_str(), value, enumName);
632 }
633
634 return skip;
635 }
636
637 /**
638 * Validate an array of Vulkan enumeration value.
639 *
640 * Process all enumeration token values in the specified array and generate a warning if a value
641 * does not fall within the core enumeration begin and end token values, and was not added to
642 * the enumeration by an extension. Extension provided enumerations use the equation specified
643 * in Appendix C.10 of the Vulkan specification, with 1,000,000,000 as the base token value.
644 *
645 * @note This function does not expect to process enumerations defining bitmask flag bits.
646 *
647 * @param apiName Name of API call being validated.
648 * @param countName Name of count parameter.
649 * @param arrayName Name of array parameter.
650 * @param enumName Name of the enumeration being validated.
651 * @param valid_values The list of valid values for the enumeration.
652 * @param count Number of enumeration values in the array.
653 * @param array Array of enumeration values to validate.
654 * @param countRequired The 'count' parameter may not be 0 when true.
655 * @param arrayRequired The 'array' parameter may not be NULL when true.
656 * @return Boolean value indicating that the call should be skipped.
657 */
658 template <typename T>
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700659 bool validate_ranged_enum_array(const char *apiName, const ParameterName &countName, const ParameterName &arrayName,
660 const char *enumName, const std::vector<T> &valid_values, uint32_t count, const T *array,
661 bool countRequired, bool arrayRequired) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700662 bool skip_call = false;
663
664 if ((count == 0) || (array == NULL)) {
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700665 skip_call |= validate_array(apiName, countName, arrayName, count, &array, countRequired, arrayRequired, kVUIDUndefined,
666 kVUIDUndefined);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700667 } else {
668 for (uint32_t i = 0; i < count; ++i) {
669 if (std::find(valid_values.begin(), valid_values.end(), array[i]) == valid_values.end()) {
670 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
671 kVUID_PVError_UnrecognizedValue,
672 "%s: value of %s[%d] (%d) does not fall within the begin..end range of the core %s "
673 "enumeration tokens and is not an extension added token",
674 apiName, arrayName.get_name().c_str(), i, array[i], enumName);
675 }
676 }
677 }
678
679 return skip_call;
680 }
681
682 /**
683 * Verify that a reserved VkFlags value is zero.
684 *
685 * Verify that the specified value is zero, to check VkFlags values that are reserved for
686 * future use.
687 *
688 * @param api_name Name of API call being validated.
689 * @param parameter_name Name of parameter being validated.
690 * @param value Value to validate.
691 * @return Boolean value indicating that the call should be skipped.
692 */
Jeff Bolzfdd0d852019-02-03 21:55:12 -0600693 bool validate_reserved_flags(const char *api_name, const ParameterName &parameter_name, VkFlags value, const char *vuid) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700694 bool skip_call = false;
695
696 if (value != 0) {
697 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, vuid,
698 "%s: parameter %s must be 0.", api_name, parameter_name.get_name().c_str());
699 }
700
701 return skip_call;
702 }
703
704 /**
705 * Validate a Vulkan bitmask value.
706 *
707 * Generate a warning if a value with a VkFlags derived type does not contain valid flag bits
708 * for that type.
709 *
710 * @param api_name Name of API call being validated.
711 * @param parameter_name Name of parameter being validated.
712 * @param flag_bits_name Name of the VkFlags type being validated.
713 * @param all_flags A bit mask combining all valid flag bits for the VkFlags type being validated.
714 * @param value VkFlags value to validate.
715 * @param flags_required The 'value' parameter may not be 0 when true.
716 * @param singleFlag The 'value' parameter may not contain more than one bit from all_flags.
717 * @return Boolean value indicating that the call should be skipped.
718 */
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700719 bool validate_flags(const char *api_name, const ParameterName &parameter_name, const char *flag_bits_name, VkFlags all_flags,
Jeff Bolzfdd0d852019-02-03 21:55:12 -0600720 VkFlags value, bool flags_required, bool singleFlag, const char *vuid) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700721 bool skip_call = false;
722
723 if (value == 0) {
724 if (flags_required) {
725 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, vuid,
726 "%s: value of %s must not be 0.", api_name, parameter_name.get_name().c_str());
727 }
728 } else if ((value & (~all_flags)) != 0) {
729 skip_call |=
730 log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
731 kVUID_PVError_UnrecognizedValue, "%s: value of %s contains flag bits that are not recognized members of %s",
732 api_name, parameter_name.get_name().c_str(), flag_bits_name);
733 } else if (singleFlag && (std::bitset<sizeof(VkFlags) * 8>(value).count() > 1)) {
734 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
735 kVUID_PVError_UnrecognizedValue,
736 "%s: value of %s contains multiple members of %s when only a single value is allowed", api_name,
737 parameter_name.get_name().c_str(), flag_bits_name);
738 }
739
740 return skip_call;
741 }
742
743 /**
744 * Validate an array of Vulkan bitmask values.
745 *
746 * Generate a warning if a value with a VkFlags derived type does not contain valid flag bits
747 * for that type.
748 *
749 * @param api_name Name of API call being validated.
750 * @param count_name Name of parameter being validated.
751 * @param array_name Name of parameter being validated.
752 * @param flag_bits_name Name of the VkFlags type being validated.
753 * @param all_flags A bitmask combining all valid flag bits for the VkFlags type being validated.
754 * @param count Number of VkFlags values in the array.
755 * @param array Array of VkFlags value to validate.
756 * @param count_required The 'count' parameter may not be 0 when true.
757 * @param array_required The 'array' parameter may not be NULL when true.
758 * @return Boolean value indicating that the call should be skipped.
759 */
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700760 bool validate_flags_array(const char *api_name, const ParameterName &count_name, const ParameterName &array_name,
761 const char *flag_bits_name, VkFlags all_flags, uint32_t count, const VkFlags *array,
762 bool count_required, bool array_required) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700763 bool skip_call = false;
764
765 if ((count == 0) || (array == NULL)) {
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700766 skip_call |= validate_array(api_name, count_name, array_name, count, &array, count_required, array_required,
767 kVUIDUndefined, kVUIDUndefined);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700768 } else {
769 // Verify that all VkFlags values in the array
770 for (uint32_t i = 0; i < count; ++i) {
771 if (array[i] == 0) {
772 // Current XML registry logic for validity generation uses the array parameter's optional tag to determine if
773 // elements in the array are allowed be 0
774 if (array_required) {
775 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
776 kVUID_PVError_RequiredParameter, "%s: value of %s[%d] must not be 0", api_name,
777 array_name.get_name().c_str(), i);
778 }
779 } else if ((array[i] & (~all_flags)) != 0) {
780 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
781 kVUID_PVError_UnrecognizedValue,
782 "%s: value of %s[%d] contains flag bits that are not recognized members of %s", api_name,
783 array_name.get_name().c_str(), i, flag_bits_name);
784 }
785 }
786 }
787
788 return skip_call;
789 }
790
791 template <typename ExtensionState>
Jeff Bolzfdd0d852019-02-03 21:55:12 -0600792 bool validate_extension_reqs(const ExtensionState &extensions, const char *vuid, const char *extension_type,
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700793 const char *extension_name) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700794 bool skip = false;
795 if (!extension_name) {
796 return skip; // Robust to invalid char *
797 }
798 auto info = ExtensionState::get_info(extension_name);
799
800 if (!info.state) {
801 return skip; // Unknown extensions cannot be checked so report OK
802 }
803
804 // Check against the required list in the info
805 std::vector<const char *> missing;
806 for (const auto &req : info.requires) {
807 if (!(extensions.*(req.enabled))) {
808 missing.push_back(req.name);
809 }
810 }
811
812 // Report any missing requirements
813 if (missing.size()) {
814 std::string missing_joined_list = string_join(", ", missing);
815 skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT,
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700816 HandleToUint64(instance), vuid, "Missing extension%s required by the %s extension %s: %s.",
817 ((missing.size() > 1) ? "s" : ""), extension_type, extension_name, missing_joined_list.c_str());
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700818 }
819 return skip;
820 }
821
822 enum RenderPassCreateVersion { RENDER_PASS_VERSION_1 = 0, RENDER_PASS_VERSION_2 = 1 };
823
824 template <typename RenderPassCreateInfoGeneric>
Petr Kraus3e52eba2019-07-10 01:24:10 +0200825 bool ValidateSubpassGraphicsFlags(const debug_report_data *report_data, const RenderPassCreateInfoGeneric *pCreateInfo,
826 uint32_t dependency_index, uint32_t subpass, VkPipelineStageFlags stages, const char *vuid,
827 const char *target) {
828 const VkPipelineStageFlags kGraphicsStages =
829 VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT | VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT | VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT |
830 VK_PIPELINE_STAGE_TASK_SHADER_BIT_NV | VK_PIPELINE_STAGE_MESH_SHADER_BIT_NV | VK_PIPELINE_STAGE_VERTEX_INPUT_BIT |
831 VK_PIPELINE_STAGE_VERTEX_SHADER_BIT | VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT |
832 VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT | VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT |
833 VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT |
834 VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT |
835 VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT | VK_PIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXT |
836 VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT | VK_PIPELINE_STAGE_SHADING_RATE_IMAGE_BIT_NV |
837 VK_PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT;
838
839 bool skip = false;
840 const bool is_all_graphics_stages = (stages & ~kGraphicsStages) == 0;
841 const auto IsGraphics = [pCreateInfo](uint32_t subpass) {
842 if (subpass == VK_SUBPASS_EXTERNAL)
843 return false;
844 else
845 return pCreateInfo->pSubpasses[subpass].pipelineBindPoint == VK_PIPELINE_BIND_POINT_GRAPHICS;
846 };
847
848 if (IsGraphics(subpass) && !is_all_graphics_stages) {
849 skip |=
850 log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT, 0, vuid,
851 "Dependency pDependencies[%" PRIu32
852 "] specifies a %sStageMask that contains stages (%s) that are not part "
853 "of the Graphics pipeline, as specified by the %sSubpass (= %" PRIu32 ") in pipelineBindPoint.",
854 dependency_index, target, string_VkPipelineStageFlags(stages & ~kGraphicsStages).c_str(), target, subpass);
855 }
856
857 return skip;
858 };
859
860 template <typename RenderPassCreateInfoGeneric>
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700861 bool CreateRenderPassGeneric(VkDevice device, const RenderPassCreateInfoGeneric *pCreateInfo,
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700862 const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass,
863 RenderPassCreateVersion rp_version) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700864 bool skip = false;
865 uint32_t max_color_attachments = device_limits.maxColorAttachments;
866 bool use_rp2 = (rp_version == RENDER_PASS_VERSION_2);
867 const char *vuid;
868
869 for (uint32_t i = 0; i < pCreateInfo->attachmentCount; ++i) {
870 if (pCreateInfo->pAttachments[i].format == VK_FORMAT_UNDEFINED) {
871 std::stringstream ss;
872 ss << (use_rp2 ? "vkCreateRenderPass2KHR" : "vkCreateRenderPass") << ": pCreateInfo->pAttachments[" << i
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700873 << "].format is VK_FORMAT_UNDEFINED. ";
874 vuid =
875 use_rp2 ? "VUID-VkAttachmentDescription2KHR-format-parameter" : "VUID-VkAttachmentDescription-format-parameter";
876 skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, vuid,
877 "%s", ss.str().c_str());
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700878 }
879 if (pCreateInfo->pAttachments[i].finalLayout == VK_IMAGE_LAYOUT_UNDEFINED ||
880 pCreateInfo->pAttachments[i].finalLayout == VK_IMAGE_LAYOUT_PREINITIALIZED) {
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700881 vuid = use_rp2 ? "VUID-VkAttachmentDescription2KHR-finalLayout-03061"
882 : "VUID-VkAttachmentDescription-finalLayout-00843";
883 skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, vuid,
884 "pCreateInfo->pAttachments[%d].finalLayout must not be VK_IMAGE_LAYOUT_UNDEFINED or "
885 "VK_IMAGE_LAYOUT_PREINITIALIZED.",
886 i);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700887 }
888 }
889
890 for (uint32_t i = 0; i < pCreateInfo->subpassCount; ++i) {
891 if (pCreateInfo->pSubpasses[i].colorAttachmentCount > max_color_attachments) {
892 vuid = use_rp2 ? "VUID-VkSubpassDescription2KHR-colorAttachmentCount-03063"
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700893 : "VUID-VkSubpassDescription-colorAttachmentCount-00845";
894 skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, vuid,
895 "Cannot create a render pass with %d color attachments. Max is %d.",
896 pCreateInfo->pSubpasses[i].colorAttachmentCount, max_color_attachments);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700897 }
898 }
Petr Kraus3e52eba2019-07-10 01:24:10 +0200899
900 for (uint32_t i = 0; i < pCreateInfo->dependencyCount; ++i) {
901 const auto &dependency = pCreateInfo->pDependencies[i];
902
903 // Spec currently only supports Graphics pipeline in render pass -- so only that pipeline is currently checked
904 vuid =
905 use_rp2 ? "VUID-VkRenderPassCreateInfo2KHR-pDependencies-03054" : "VUID-VkRenderPassCreateInfo-pDependencies-00837";
906 skip |= ValidateSubpassGraphicsFlags(report_data, pCreateInfo, i, dependency.srcSubpass, dependency.srcStageMask, vuid,
907 "src");
908
909 vuid =
910 use_rp2 ? "VUID-VkRenderPassCreateInfo2KHR-pDependencies-03055" : "VUID-VkRenderPassCreateInfo-pDependencies-00838";
911 skip |= ValidateSubpassGraphicsFlags(report_data, pCreateInfo, i, dependency.dstSubpass, dependency.dstStageMask, vuid,
912 "dst");
913 }
914
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700915 return skip;
916 }
917
918 template <typename T>
919 void RecordRenderPass(VkRenderPass renderPass, const T *pCreateInfo) {
Mark Lobodzinskif27a6bc2019-02-04 13:00:49 -0700920 std::unique_lock<std::mutex> lock(renderpass_map_mutex);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700921 auto &renderpass_state = renderpasses_states[renderPass];
Mark Lobodzinskif27a6bc2019-02-04 13:00:49 -0700922 lock.unlock();
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700923
924 for (uint32_t subpass = 0; subpass < pCreateInfo->subpassCount; ++subpass) {
925 bool uses_color = false;
926 for (uint32_t i = 0; i < pCreateInfo->pSubpasses[subpass].colorAttachmentCount && !uses_color; ++i)
927 if (pCreateInfo->pSubpasses[subpass].pColorAttachments[i].attachment != VK_ATTACHMENT_UNUSED) uses_color = true;
928
929 bool uses_depthstencil = false;
930 if (pCreateInfo->pSubpasses[subpass].pDepthStencilAttachment)
931 if (pCreateInfo->pSubpasses[subpass].pDepthStencilAttachment->attachment != VK_ATTACHMENT_UNUSED)
932 uses_depthstencil = true;
933
934 if (uses_color) renderpass_state.subpasses_using_color_attachment.insert(subpass);
935 if (uses_depthstencil) renderpass_state.subpasses_using_depthstencil_attachment.insert(subpass);
936 }
937 }
938
939 bool require_device_extension(bool flag, char const *function_name, char const *extension_name);
940
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700941 bool validate_instance_extensions(const VkInstanceCreateInfo *pCreateInfo);
942
943 bool validate_api_version(uint32_t api_version, uint32_t effective_api_version);
944
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700945 bool validate_string(const char *apiName, const ParameterName &stringName, const std::string &vuid, const char *validateString);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700946
947 bool ValidateCoarseSampleOrderCustomNV(const VkCoarseSampleOrderCustomNV *order);
948
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700949 bool ValidateQueueFamilies(uint32_t queue_family_count, const uint32_t *queue_families, const char *cmd_name,
950 const char *array_parameter_name, const std::string &unique_error_code,
951 const std::string &valid_error_code, bool optional);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700952
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700953 bool ValidateDeviceQueueFamily(uint32_t queue_family, const char *cmd_name, const char *parameter_name,
954 const std::string &error_code, bool optional);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700955
Jason Macnak192fa0e2019-07-26 15:07:16 -0700956 bool ValidateGeometryTrianglesNV(const VkGeometryTrianglesNV &triangles, VkDebugReportObjectTypeEXT object_type,
957 uint64_t object_handle, const char *func_name) const;
958 bool ValidateGeometryAABBNV(const VkGeometryAABBNV &geometry, VkDebugReportObjectTypeEXT object_type, uint64_t object_handle,
959 const char *func_name) const;
960 bool ValidateGeometryNV(const VkGeometryNV &geometry, VkDebugReportObjectTypeEXT object_type, uint64_t object_handle,
961 const char *func_name) const;
962 bool ValidateAccelerationStructureInfoNV(const VkAccelerationStructureInfoNV &info, VkDebugReportObjectTypeEXT object_type,
963 uint64_t object_handle, const char *func_nam) const;
Jason Macnak5c954952019-07-09 15:46:12 -0700964
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700965 bool OutputExtensionError(const std::string &api_name, const std::string &extension_name);
966
967 void PostCallRecordCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo,
Mark Lobodzinskicd05c1e2019-01-17 15:33:46 -0700968 const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass, VkResult result);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700969 void PostCallRecordCreateRenderPass2KHR(VkDevice device, const VkRenderPassCreateInfo2KHR *pCreateInfo,
Mark Lobodzinskicd05c1e2019-01-17 15:33:46 -0700970 const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass, VkResult result);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700971 void PostCallRecordDestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks *pAllocator);
972 void PostCallRecordCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo,
Mark Lobodzinskicd05c1e2019-01-17 15:33:46 -0700973 const VkAllocationCallbacks *pAllocator, VkDevice *pDevice, VkResult result);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700974
975 void PostCallRecordCreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator,
Mark Lobodzinskicd05c1e2019-01-17 15:33:46 -0700976 VkInstance *pInstance, VkResult result);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700977
locke-lunargb1909cd2019-08-01 23:40:05 -0600978 void PostCallRecordQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *pPresentInfo, VkResult result);
979
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700980 bool manual_PreCallValidateCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo *pCreateInfo,
981 const VkAllocationCallbacks *pAllocator, VkQueryPool *pQueryPool);
982
983 bool manual_PreCallValidateCreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator,
984 VkInstance *pInstance);
985
986 bool manual_PreCallValidateCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo,
987 const VkAllocationCallbacks *pAllocator, VkDevice *pDevice);
988
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700989 bool manual_PreCallValidateCreateBuffer(VkDevice device, const VkBufferCreateInfo *pCreateInfo,
990 const VkAllocationCallbacks *pAllocator, VkBuffer *pBuffer);
991
992 bool manual_PreCallValidateCreateImage(VkDevice device, const VkImageCreateInfo *pCreateInfo,
993 const VkAllocationCallbacks *pAllocator, VkImage *pImage);
994
995 bool manual_PreCallValidateCreateImageView(VkDevice device, const VkImageViewCreateInfo *pCreateInfo,
996 const VkAllocationCallbacks *pAllocator, VkImageView *pView);
997
Jeff Bolz6d3beaa2019-02-09 21:00:05 -0600998 bool manual_PreCallValidateViewport(const VkViewport &viewport, const char *fn_name, const ParameterName &parameter_name,
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700999 VkDebugReportObjectTypeEXT object_type, uint64_t object);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -07001000
1001 bool manual_PreCallValidateCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount,
1002 const VkGraphicsPipelineCreateInfo *pCreateInfos,
1003 const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines);
1004 bool manual_PreCallValidateCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount,
1005 const VkComputePipelineCreateInfo *pCreateInfos,
1006 const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines);
1007
1008 bool manual_PreCallValidateCreateSampler(VkDevice device, const VkSamplerCreateInfo *pCreateInfo,
1009 const VkAllocationCallbacks *pAllocator, VkSampler *pSampler);
1010 bool manual_PreCallValidateCreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo *pCreateInfo,
Mark Lobodzinskibf599b92018-12-31 12:15:55 -07001011 const VkAllocationCallbacks *pAllocator,
1012 VkDescriptorSetLayout *pSetLayout);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -07001013
Mark Lobodzinskibf599b92018-12-31 12:15:55 -07001014 bool manual_PreCallValidateUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount,
1015 const VkWriteDescriptorSet *pDescriptorWrites, uint32_t descriptorCopyCount,
1016 const VkCopyDescriptorSet *pDescriptorCopies);
Jason Macnak5c954952019-07-09 15:46:12 -07001017
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -07001018 bool manual_PreCallValidateFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount,
1019 const VkDescriptorSet *pDescriptorSets);
1020
1021 bool manual_PreCallValidateCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo,
1022 const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass);
1023
1024 bool manual_PreCallValidateCreateRenderPass2KHR(VkDevice device, const VkRenderPassCreateInfo2KHR *pCreateInfo,
1025 const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass);
1026
1027 bool manual_PreCallValidateFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount,
1028 const VkCommandBuffer *pCommandBuffers);
1029
1030 bool manual_PreCallValidateBeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo *pBeginInfo);
1031
1032 bool manual_PreCallValidateCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount,
1033 const VkViewport *pViewports);
1034
1035 bool manual_PreCallValidateCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount,
1036 const VkRect2D *pScissors);
1037 bool manual_PreCallValidateCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth);
1038
1039 bool manual_PreCallValidateCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount,
1040 uint32_t firstVertex, uint32_t firstInstance);
1041
1042 bool manual_PreCallValidateCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count,
1043 uint32_t stride);
1044
1045 bool manual_PreCallValidateCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset,
1046 uint32_t count, uint32_t stride);
1047
Mark Lobodzinskif77a4ac2019-06-27 15:30:51 -06001048 bool manual_PreCallValidateCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount,
1049 const VkClearAttachment *pAttachments, uint32_t rectCount,
1050 const VkClearRect *pRects);
1051
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -07001052 bool manual_PreCallValidateCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout,
1053 VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount,
1054 const VkImageCopy *pRegions);
1055
1056 bool manual_PreCallValidateCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout,
1057 VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount,
1058 const VkImageBlit *pRegions, VkFilter filter);
1059
1060 bool manual_PreCallValidateCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage,
1061 VkImageLayout dstImageLayout, uint32_t regionCount,
1062 const VkBufferImageCopy *pRegions);
1063
1064 bool manual_PreCallValidateCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout,
1065 VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy *pRegions);
1066
1067 bool manual_PreCallValidateCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset,
1068 VkDeviceSize dataSize, const void *pData);
1069
1070 bool manual_PreCallValidateCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset,
1071 VkDeviceSize size, uint32_t data);
1072
1073 bool manual_PreCallValidateCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo,
1074 const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchain);
1075 bool manual_PreCallValidateQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *pPresentInfo);
1076
1077#ifdef VK_USE_PLATFORM_WIN32_KHR
1078 bool manual_PreCallValidateCreateWin32SurfaceKHR(VkInstance instance, const VkWin32SurfaceCreateInfoKHR *pCreateInfo,
1079 const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface);
1080#endif // VK_USE_PLATFORM_WIN32_KHR
1081
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -07001082 bool manual_PreCallValidateCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo *pCreateInfo,
1083 const VkAllocationCallbacks *pAllocator, VkDescriptorPool *pDescriptorPool);
1084 bool manual_PreCallValidateCmdDispatch(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY,
1085 uint32_t groupCountZ);
1086
1087 bool manual_PreCallValidateCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset);
1088
1089 bool manual_PreCallValidateCmdDispatchBaseKHR(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY,
1090 uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY,
1091 uint32_t groupCountZ);
1092 bool manual_PreCallValidateCmdSetExclusiveScissorNV(VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor,
1093 uint32_t exclusiveScissorCount, const VkRect2D *pExclusiveScissors);
1094 bool manual_PreCallValidateCmdSetViewportShadingRatePaletteNV(VkCommandBuffer commandBuffer, uint32_t firstViewport,
1095 uint32_t viewportCount,
1096 const VkShadingRatePaletteNV *pShadingRatePalettes);
1097
1098 bool manual_PreCallValidateCmdSetCoarseSampleOrderNV(VkCommandBuffer commandBuffer, VkCoarseSampleOrderTypeNV sampleOrderType,
1099 uint32_t customSampleOrderCount,
1100 const VkCoarseSampleOrderCustomNV *pCustomSampleOrders);
1101
1102 bool manual_PreCallValidateCmdDrawMeshTasksNV(VkCommandBuffer commandBuffer, uint32_t taskCount, uint32_t firstTask);
1103 bool manual_PreCallValidateCmdDrawMeshTasksIndirectNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset,
1104 uint32_t drawCount, uint32_t stride);
1105
1106 bool manual_PreCallValidateCmdDrawMeshTasksIndirectCountNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset,
1107 VkBuffer countBuffer, VkDeviceSize countBufferOffset,
1108 uint32_t maxDrawCount, uint32_t stride);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -07001109
1110 bool manual_PreCallValidateEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char *pLayerName,
1111 uint32_t *pPropertyCount, VkExtensionProperties *pProperties);
Jeff Bolz7e7e6e02019-01-11 22:53:41 -06001112 bool manual_PreCallValidateAllocateMemory(VkDevice device, const VkMemoryAllocateInfo *pAllocateInfo,
1113 const VkAllocationCallbacks *pAllocator, VkDeviceMemory *pMemory);
Ricardo Garciaa4935972019-02-21 17:43:18 +01001114
1115 bool manual_PreCallValidateCreateAccelerationStructureNV(VkDevice device,
1116 const VkAccelerationStructureCreateInfoNV *pCreateInfo,
1117 const VkAllocationCallbacks *pAllocator,
1118 VkAccelerationStructureNV *pAccelerationStructure);
Jason Macnak5c954952019-07-09 15:46:12 -07001119 bool manual_PreCallValidateCmdBuildAccelerationStructureNV(VkCommandBuffer commandBuffer,
1120 const VkAccelerationStructureInfoNV *pInfo, VkBuffer instanceData,
1121 VkDeviceSize instanceOffset, VkBool32 update,
1122 VkAccelerationStructureNV dst, VkAccelerationStructureNV src,
1123 VkBuffer scratch, VkDeviceSize scratchOffset);
1124 bool manual_PreCallValidateGetAccelerationStructureHandleNV(VkDevice device, VkAccelerationStructureNV accelerationStructure,
1125 size_t dataSize, void *pData);
Peter Chen85366392019-05-14 15:20:11 -04001126 bool manual_PreCallValidateCreateRayTracingPipelinesNV(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount,
1127 const VkRayTracingPipelineCreateInfoNV *pCreateInfos,
1128 const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines);
Mike Schuchardt21638df2019-03-16 10:52:02 -07001129
1130#ifdef VK_USE_PLATFORM_WIN32_KHR
1131 bool PreCallValidateGetDeviceGroupSurfacePresentModes2EXT(VkDevice device, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo,
1132 VkDeviceGroupPresentModeFlagsKHR *pModes);
1133#endif // VK_USE_PLATFORM_WIN32_KHR
Tobias Hectorebb855f2019-07-23 12:17:33 +01001134
1135 bool manual_PreCallValidateCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo *pCreateInfo,
1136 const VkAllocationCallbacks *pAllocator, VkFramebuffer *pFramebuffer);
1137
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -07001138#include "parameter_validation.h"
1139}; // Class StatelessValidation