blob: 976524208a1d6eb812e6701aaf31782e47aa1f71 [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;
Mark Lobodzinski876d5b52019-08-06 16:32:27 -060058extern const VkSampleCountFlags AllVkSampleCountFlagBits;
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -070059
60extern const std::vector<VkCompareOp> AllVkCompareOpEnums;
61extern const std::vector<VkStencilOp> AllVkStencilOpEnums;
62extern const std::vector<VkBlendFactor> AllVkBlendFactorEnums;
63extern const std::vector<VkBlendOp> AllVkBlendOpEnums;
64extern const std::vector<VkLogicOp> AllVkLogicOpEnums;
65extern const std::vector<VkBorderColor> AllVkBorderColorEnums;
66extern const std::vector<VkImageLayout> AllVkImageLayoutEnums;
Mark Lobodzinski876d5b52019-08-06 16:32:27 -060067extern const std::vector<VkFormat> AllVkFormatEnums;
68extern const std::vector<VkVertexInputRate> AllVkVertexInputRateEnums;
69extern const std::vector<VkPrimitiveTopology> AllVkPrimitiveTopologyEnums;
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -070070
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -070071// String returned by string_VkStructureType for an unrecognized type.
72const std::string UnsupportedStructureTypeString = "Unhandled VkStructureType";
73
74// String returned by string_VkResult for an unrecognized type.
75const std::string UnsupportedResultString = "Unhandled VkResult";
76
77// The base value used when computing the offset for an enumeration token value that is added by an extension.
78// When validating enumeration tokens, any value >= to this value is considered to be provided by an extension.
79// See Appendix C.10 "Assigning Extension Token Values" from the Vulkan specification
80const uint32_t ExtEnumBaseValue = 1000000000;
81
82// The value of all VK_xxx_MAX_ENUM tokens
83const uint32_t MaxEnumValue = 0x7FFFFFFF;
84
85// Misc parameters of log_msg that are likely constant per command (or low frequency change)
86struct LogMiscParams {
87 VkDebugReportObjectTypeEXT objectType;
88 uint64_t srcObject;
89 const char *api_name;
90};
91
92class StatelessValidation : public ValidationObject {
93 public:
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -070094 VkPhysicalDeviceLimits device_limits = {};
95 VkPhysicalDeviceFeatures physical_device_features = {};
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -070096
Mark Lobodzinskif27a6bc2019-02-04 13:00:49 -070097 // Override chassis read/write locks for this validation object
98 // This override takes a deferred lock. i.e. it is not acquired.
99 std::unique_lock<std::mutex> write_lock() { return std::unique_lock<std::mutex>(validation_object_mutex, std::defer_lock); }
100
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700101 // Device extension properties -- storing properties gathered from VkPhysicalDeviceProperties2KHR::pNext chain
102 struct DeviceExtensionProperties {
103 VkPhysicalDeviceShadingRateImagePropertiesNV shading_rate_image_props;
104 VkPhysicalDeviceMeshShaderPropertiesNV mesh_shader_props;
Jason Macnak5c954952019-07-09 15:46:12 -0700105 VkPhysicalDeviceRayTracingPropertiesNV ray_tracing_props;
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700106 };
107 DeviceExtensionProperties phys_dev_ext_props = {};
108
109 struct SubpassesUsageStates {
110 std::unordered_set<uint32_t> subpasses_using_color_attachment;
111 std::unordered_set<uint32_t> subpasses_using_depthstencil_attachment;
112 };
113
Mark Lobodzinskif27a6bc2019-02-04 13:00:49 -0700114 // Though this validation object is predominantly statless, the Framebuffer checks are greatly simplified by creating and
115 // updating a map of the renderpass usage states, and these accesses need thread protection. Use a mutex separate from the
116 // parent object's to maintain that functionality.
117 std::mutex renderpass_map_mutex;
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700118 std::unordered_map<VkRenderPass, SubpassesUsageStates> renderpasses_states;
119
120 // Constructor for stateles validation tracking
121 // StatelessValidation() : {}
122 /**
123 * Validate a minimum value.
124 *
125 * Verify that the specified value is greater than the specified lower bound.
126 *
127 * @param api_name Name of API call being validated.
128 * @param parameter_name Name of parameter being validated.
129 * @param value Value to validate.
130 * @param lower_bound Lower bound value to use for validation.
131 * @return Boolean value indicating that the call should be skipped.
132 */
133 template <typename T>
134 bool ValidateGreaterThan(const T value, const T lower_bound, const ParameterName &parameter_name, const std::string &vuid,
135 const LogMiscParams &misc) {
136 bool skip_call = false;
137
138 if (value <= lower_bound) {
139 std::ostringstream ss;
140 ss << misc.api_name << ": parameter " << parameter_name.get_name() << " (= " << value << ") is greater than "
141 << lower_bound;
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700142 skip_call |=
143 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 -0700144 }
145
146 return skip_call;
147 }
148
149 template <typename T>
150 bool ValidateGreaterThanZero(const T value, const ParameterName &parameter_name, const std::string &vuid,
151 const LogMiscParams &misc) {
152 return ValidateGreaterThan(value, T{0}, parameter_name, vuid, misc);
153 }
154 /**
155 * Validate a required pointer.
156 *
157 * Verify that a required pointer is not NULL.
158 *
159 * @param apiName Name of API call being validated.
160 * @param parameterName Name of parameter being validated.
161 * @param value Pointer to validate.
162 * @return Boolean value indicating that the call should be skipped.
163 */
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700164 bool validate_required_pointer(const char *apiName, const ParameterName &parameterName, const void *value,
165 const std::string &vuid) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700166 bool skip_call = false;
167
168 if (value == NULL) {
169 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, vuid,
170 "%s: required parameter %s specified as NULL.", apiName, parameterName.get_name().c_str());
171 }
172
173 return skip_call;
174 }
175
176 /**
177 * Validate array count and pointer to array.
178 *
179 * Verify that required count and array parameters are not 0 or NULL. If the
180 * count parameter is not optional, verify that it is not 0. If the array
181 * parameter is NULL, and it is not optional, verify that count is 0.
182 *
183 * @param apiName Name of API call being validated.
184 * @param countName Name of count parameter.
185 * @param arrayName Name of array parameter.
186 * @param count Number of elements in the array.
187 * @param array Array to validate.
188 * @param countRequired The 'count' parameter may not be 0 when true.
189 * @param arrayRequired The 'array' parameter may not be NULL when true.
190 * @return Boolean value indicating that the call should be skipped.
191 */
192 template <typename T1, typename T2>
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700193 bool validate_array(const char *apiName, const ParameterName &countName, const ParameterName &arrayName, T1 count,
Jeff Bolzfdd0d852019-02-03 21:55:12 -0600194 const T2 *array, bool countRequired, bool arrayRequired, const char *count_required_vuid,
195 const char *array_required_vuid) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700196 bool skip_call = false;
197
198 // Count parameters not tagged as optional cannot be 0
199 if (countRequired && (count == 0)) {
200 skip_call |=
201 log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, count_required_vuid,
202 "%s: parameter %s must be greater than 0.", apiName, countName.get_name().c_str());
203 }
204
205 // Array parameters not tagged as optional cannot be NULL, unless the count is 0
206 if (arrayRequired && (count != 0) && (*array == NULL)) {
207 skip_call |=
208 log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, array_required_vuid,
209 "%s: required parameter %s specified as NULL.", apiName, arrayName.get_name().c_str());
210 }
211
212 return skip_call;
213 }
214
215 /**
216 * Validate pointer to array count and pointer to array.
217 *
218 * Verify that required count and array parameters are not NULL. If count
219 * is not NULL and its value is not optional, verify that it is not 0. If the
220 * array parameter is NULL, and it is not optional, verify that count is 0.
221 * The array parameter will typically be optional for this case (where count is
222 * a pointer), allowing the caller to retrieve the available count.
223 *
224 * @param apiName Name of API call being validated.
225 * @param countName Name of count parameter.
226 * @param arrayName Name of array parameter.
227 * @param count Pointer to the number of elements in the array.
228 * @param array Array to validate.
229 * @param countPtrRequired The 'count' parameter may not be NULL when true.
230 * @param countValueRequired The '*count' value may not be 0 when true.
231 * @param arrayRequired The 'array' parameter may not be NULL when true.
232 * @return Boolean value indicating that the call should be skipped.
233 */
234 template <typename T1, typename T2>
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700235 bool validate_array(const char *apiName, const ParameterName &countName, const ParameterName &arrayName, const T1 *count,
236 const T2 *array, bool countPtrRequired, bool countValueRequired, bool arrayRequired,
Jeff Bolzfdd0d852019-02-03 21:55:12 -0600237 const char *count_required_vuid, const char *array_required_vuid) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700238 bool skip_call = false;
239
240 if (count == NULL) {
241 if (countPtrRequired) {
242 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
243 kVUID_PVError_RequiredParameter, "%s: required parameter %s specified as NULL", apiName,
244 countName.get_name().c_str());
245 }
246 } else {
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700247 skip_call |= validate_array(apiName, countName, arrayName, *array ? (*count) : 0, &array, countValueRequired,
248 arrayRequired, count_required_vuid, array_required_vuid);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700249 }
250
251 return skip_call;
252 }
253
254 /**
255 * Validate a pointer to a Vulkan structure.
256 *
257 * Verify that a required pointer to a structure is not NULL. If the pointer is
258 * not NULL, verify that each structure's sType field is set to the correct
259 * VkStructureType value.
260 *
261 * @param apiName Name of API call being validated.
262 * @param parameterName Name of struct parameter being validated.
263 * @param sTypeName Name of expected VkStructureType value.
264 * @param value Pointer to the struct to validate.
265 * @param sType VkStructureType for structure validation.
266 * @param required The parameter may not be NULL when true.
267 * @return Boolean value indicating that the call should be skipped.
268 */
269 template <typename T>
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700270 bool validate_struct_type(const char *apiName, const ParameterName &parameterName, const char *sTypeName, const T *value,
Jeff Bolzfdd0d852019-02-03 21:55:12 -0600271 VkStructureType sType, bool required, const char *struct_vuid, const char *stype_vuid) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700272 bool skip_call = false;
273
274 if (value == NULL) {
275 if (required) {
276 skip_call |=
277 log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, struct_vuid,
278 "%s: required parameter %s specified as NULL", apiName, parameterName.get_name().c_str());
279 }
280 } else if (value->sType != sType) {
281 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, stype_vuid,
282 "%s: parameter %s->sType must be %s.", apiName, parameterName.get_name().c_str(), sTypeName);
283 }
284
285 return skip_call;
286 }
287
288 /**
289 * Validate an array of Vulkan structures
290 *
291 * Verify that required count and array parameters are not 0 or NULL. If
292 * the array contains 1 or more structures, verify that each structure's
293 * sType field is set to the correct VkStructureType value.
294 *
295 * @param apiName Name of API call being validated.
296 * @param countName Name of count parameter.
297 * @param arrayName Name of array parameter.
298 * @param sTypeName Name of expected VkStructureType value.
299 * @param count Number of elements in the array.
300 * @param array Array to validate.
301 * @param sType VkStructureType for structure validation.
302 * @param countRequired The 'count' parameter may not be 0 when true.
303 * @param arrayRequired The 'array' parameter may not be NULL when true.
304 * @return Boolean value indicating that the call should be skipped.
305 */
306 template <typename T>
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700307 bool validate_struct_type_array(const char *apiName, const ParameterName &countName, const ParameterName &arrayName,
308 const char *sTypeName, uint32_t count, const T *array, VkStructureType sType,
Jasper St. Pierre6c98f8c2019-01-22 15:18:03 -0800309 bool countRequired, bool arrayRequired, const char *stype_vuid, const char *param_vuid,
310 const char *count_required_vuid) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700311 bool skip_call = false;
312
313 if ((count == 0) || (array == NULL)) {
Jasper St. Pierre6c98f8c2019-01-22 15:18:03 -0800314 skip_call |= validate_array(apiName, countName, arrayName, count, &array, countRequired, arrayRequired,
315 count_required_vuid, param_vuid);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700316 } else {
317 // Verify that all structs in the array have the correct type
318 for (uint32_t i = 0; i < count; ++i) {
319 if (array[i].sType != sType) {
320 skip_call |=
321 log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, stype_vuid,
322 "%s: parameter %s[%d].sType must be %s", apiName, arrayName.get_name().c_str(), i, sTypeName);
323 }
324 }
325 }
326
327 return skip_call;
328 }
329
330 /**
331 * Validate an array of Vulkan structures.
332 *
333 * Verify that required count and array parameters are not NULL. If count
334 * is not NULL and its value is not optional, verify that it is not 0.
335 * If the array contains 1 or more structures, verify that each structure's
336 * sType field is set to the correct VkStructureType value.
337 *
338 * @param apiName Name of API call being validated.
339 * @param countName Name of count parameter.
340 * @param arrayName Name of array parameter.
341 * @param sTypeName Name of expected VkStructureType value.
342 * @param count Pointer to the number of elements in the array.
343 * @param array Array to validate.
344 * @param sType VkStructureType for structure validation.
345 * @param countPtrRequired The 'count' parameter may not be NULL when true.
346 * @param countValueRequired The '*count' value may not be 0 when true.
347 * @param arrayRequired The 'array' parameter may not be NULL when true.
348 * @return Boolean value indicating that the call should be skipped.
349 */
350 template <typename T>
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700351 bool validate_struct_type_array(const char *apiName, const ParameterName &countName, const ParameterName &arrayName,
352 const char *sTypeName, uint32_t *count, const T *array, VkStructureType sType,
Jeff Bolzfdd0d852019-02-03 21:55:12 -0600353 bool countPtrRequired, bool countValueRequired, bool arrayRequired, const char *stype_vuid,
Jasper St. Pierre6c98f8c2019-01-22 15:18:03 -0800354 const char *param_vuid, const char *count_required_vuid) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700355 bool skip_call = false;
356
357 if (count == NULL) {
358 if (countPtrRequired) {
359 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
360 kVUID_PVError_RequiredParameter, "%s: required parameter %s specified as NULL", apiName,
361 countName.get_name().c_str());
362 }
363 } else {
364 skip_call |= validate_struct_type_array(apiName, countName, arrayName, sTypeName, (*count), array, sType,
Jasper St. Pierre6c98f8c2019-01-22 15:18:03 -0800365 countValueRequired, arrayRequired, stype_vuid, param_vuid, count_required_vuid);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700366 }
367
368 return skip_call;
369 }
370
371 /**
372 * Validate a Vulkan handle.
373 *
374 * Verify that the specified handle is not VK_NULL_HANDLE.
375 *
376 * @param api_name Name of API call being validated.
377 * @param parameter_name Name of struct parameter being validated.
378 * @param value Handle to validate.
379 * @return Boolean value indicating that the call should be skipped.
380 */
381 template <typename T>
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700382 bool validate_required_handle(const char *api_name, const ParameterName &parameter_name, T value) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700383 bool skip_call = false;
384
385 if (value == VK_NULL_HANDLE) {
386 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
387 kVUID_PVError_RequiredParameter, "%s: required parameter %s specified as VK_NULL_HANDLE", api_name,
388 parameter_name.get_name().c_str());
389 }
390
391 return skip_call;
392 }
393
394 /**
395 * Validate an array of Vulkan handles.
396 *
397 * Verify that required count and array parameters are not NULL. If count
398 * is not NULL and its value is not optional, verify that it is not 0.
399 * If the array contains 1 or more handles, verify that no handle is set to
400 * VK_NULL_HANDLE.
401 *
402 * @note This function is only intended to validate arrays of handles when none
403 * of the handles are allowed to be VK_NULL_HANDLE. For arrays of handles
404 * that are allowed to contain VK_NULL_HANDLE, use validate_array() instead.
405 *
406 * @param api_name Name of API call being validated.
407 * @param count_name Name of count parameter.
408 * @param array_name Name of array parameter.
409 * @param count Number of elements in the array.
410 * @param array Array to validate.
411 * @param count_required The 'count' parameter may not be 0 when true.
412 * @param array_required The 'array' parameter may not be NULL when true.
413 * @return Boolean value indicating that the call should be skipped.
414 */
415 template <typename T>
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700416 bool validate_handle_array(const char *api_name, const ParameterName &count_name, const ParameterName &array_name,
417 uint32_t count, const T *array, bool count_required, bool array_required) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700418 bool skip_call = false;
419
420 if ((count == 0) || (array == NULL)) {
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700421 skip_call |= validate_array(api_name, count_name, array_name, count, &array, count_required, array_required,
422 kVUIDUndefined, kVUIDUndefined);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700423 } else {
424 // Verify that no handles in the array are VK_NULL_HANDLE
425 for (uint32_t i = 0; i < count; ++i) {
426 if (array[i] == VK_NULL_HANDLE) {
427 skip_call |=
428 log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
429 kVUID_PVError_RequiredParameter, "%s: required parameter %s[%d] specified as VK_NULL_HANDLE",
430 api_name, array_name.get_name().c_str(), i);
431 }
432 }
433 }
434
435 return skip_call;
436 }
437
438 /**
439 * Validate string array count and content.
440 *
441 * Verify that required count and array parameters are not 0 or NULL. If the
442 * count parameter is not optional, verify that it is not 0. If the array
443 * parameter is NULL, and it is not optional, verify that count is 0. If the
444 * array parameter is not NULL, verify that none of the strings are NULL.
445 *
446 * @param apiName Name of API call being validated.
447 * @param countName Name of count parameter.
448 * @param arrayName Name of array parameter.
449 * @param count Number of strings in the array.
450 * @param array Array of strings to validate.
451 * @param countRequired The 'count' parameter may not be 0 when true.
452 * @param arrayRequired The 'array' parameter may not be NULL when true.
453 * @return Boolean value indicating that the call should be skipped.
454 */
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700455 bool validate_string_array(const char *apiName, const ParameterName &countName, const ParameterName &arrayName, uint32_t count,
Jeff Bolzfdd0d852019-02-03 21:55:12 -0600456 const char *const *array, bool countRequired, bool arrayRequired, const char *count_required_vuid,
457 const char *array_required_vuid) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700458 bool skip_call = false;
459
460 if ((count == 0) || (array == NULL)) {
461 skip_call |= validate_array(apiName, countName, arrayName, count, &array, countRequired, arrayRequired,
462 count_required_vuid, array_required_vuid);
463 } else {
464 // Verify that strings in the array are not NULL
465 for (uint32_t i = 0; i < count; ++i) {
466 if (array[i] == NULL) {
467 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
468 kVUID_PVError_RequiredParameter, "%s: required parameter %s[%d] specified as NULL",
469 apiName, arrayName.get_name().c_str(), i);
470 }
471 }
472 }
473
474 return skip_call;
475 }
476
477 // Forward declaration for pNext validation
Lockefbdd1af2019-04-16 15:07:23 -0600478 bool ValidatePnextStructContents(const char *api_name, const ParameterName &parameter_name, const VkBaseOutStructure *header);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700479
480 /**
481 * Validate a structure's pNext member.
482 *
483 * Verify that the specified pNext value points to the head of a list of
484 * allowed extension structures. If no extension structures are allowed,
485 * verify that pNext is null.
486 *
487 * @param api_name Name of API call being validated.
488 * @param parameter_name Name of parameter being validated.
489 * @param allowed_struct_names Names of allowed structs.
490 * @param next Pointer to validate.
491 * @param allowed_type_count Total number of allowed structure types.
492 * @param allowed_types Array of structure types allowed for pNext.
493 * @param header_version Version of header defining the pNext validation rules.
494 * @return Boolean value indicating that the call should be skipped.
495 */
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700496 bool validate_struct_pnext(const char *api_name, const ParameterName &parameter_name, const char *allowed_struct_names,
497 const void *next, size_t allowed_type_count, const VkStructureType *allowed_types,
Jeff Bolzfdd0d852019-02-03 21:55:12 -0600498 uint32_t header_version, const char *vuid) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700499 bool skip_call = false;
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700500
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700501 // TODO: The valid pNext structure types are not recursive. Each structure has its own list of valid sTypes for pNext.
502 // Codegen a map of vectors containing the allowable pNext types for each struct and use that here -- also simplifies parms.
503 if (next != NULL) {
Jeff Bolzfdd0d852019-02-03 21:55:12 -0600504 std::unordered_set<const void *> cycle_check;
505 std::unordered_set<VkStructureType, std::hash<int>> unique_stype_check;
506
Jeff Bolz6d3beaa2019-02-09 21:00:05 -0600507 const char *disclaimer =
508 "This warning is based on the Valid Usage documentation for version %d of the Vulkan header. It is possible that "
509 "you "
510 "are "
511 "using a struct from a private extension or an extension that was added to a later version of the Vulkan header, "
512 "in "
513 "which "
514 "case your use of %s is perfectly valid but is not guaranteed to work correctly with validation enabled";
515
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700516 if (allowed_type_count == 0) {
517 std::string message = "%s: value of %s must be NULL. ";
518 message += disclaimer;
519 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, vuid,
520 message.c_str(), api_name, parameter_name.get_name().c_str(), header_version,
521 parameter_name.get_name().c_str());
522 } else {
523 const VkStructureType *start = allowed_types;
524 const VkStructureType *end = allowed_types + allowed_type_count;
Lockefbdd1af2019-04-16 15:07:23 -0600525 const VkBaseOutStructure *current = reinterpret_cast<const VkBaseOutStructure *>(next);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700526
527 cycle_check.insert(next);
528
529 while (current != NULL) {
530 if (((strncmp(api_name, "vkCreateInstance", strlen(api_name)) != 0) ||
531 (current->sType != VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO)) &&
532 ((strncmp(api_name, "vkCreateDevice", strlen(api_name)) != 0) ||
533 (current->sType != VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO))) {
534 if (cycle_check.find(current->pNext) != cycle_check.end()) {
535 std::string message = "%s: %s chain contains a cycle -- pNext pointer " PRIx64 " is repeated.";
536 skip_call |=
537 log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
538 kVUID_PVError_InvalidStructPNext, message.c_str(), api_name,
539 parameter_name.get_name().c_str(), reinterpret_cast<uint64_t>(next));
540 break;
541 } else {
542 cycle_check.insert(current->pNext);
543 }
544
545 std::string type_name = string_VkStructureType(current->sType);
546 if (unique_stype_check.find(current->sType) != unique_stype_check.end()) {
547 std::string message = "%s: %s chain contains duplicate structure types: %s appears multiple times.";
548 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT,
549 VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, kVUID_PVError_InvalidStructPNext,
550 message.c_str(), api_name, parameter_name.get_name().c_str(), type_name.c_str());
551 } else {
552 unique_stype_check.insert(current->sType);
553 }
554
555 if (std::find(start, end, current->sType) == end) {
556 if (type_name == UnsupportedStructureTypeString) {
557 std::string message =
558 "%s: %s chain includes a structure with unknown VkStructureType (%d); Allowed structures are "
559 "[%s]. ";
560 message += disclaimer;
561 skip_call |=
562 log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT,
563 0, vuid, message.c_str(), api_name, parameter_name.get_name().c_str(), current->sType,
564 allowed_struct_names, header_version, parameter_name.get_name().c_str());
565 } else {
566 std::string message =
567 "%s: %s chain includes a structure with unexpected VkStructureType %s; Allowed structures are "
568 "[%s]. ";
569 message += disclaimer;
570 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT,
571 VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, vuid, message.c_str(), api_name,
572 parameter_name.get_name().c_str(), type_name.c_str(), allowed_struct_names,
573 header_version, parameter_name.get_name().c_str());
574 }
575 }
576 skip_call |= ValidatePnextStructContents(api_name, parameter_name, current);
577 }
Lockefbdd1af2019-04-16 15:07:23 -0600578 current = reinterpret_cast<const VkBaseOutStructure *>(current->pNext);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700579 }
580 }
581 }
582
583 return skip_call;
584 }
585
586 /**
587 * Validate a VkBool32 value.
588 *
589 * Generate a warning if a VkBool32 value is neither VK_TRUE nor VK_FALSE.
590 *
591 * @param apiName Name of API call being validated.
592 * @param parameterName Name of parameter being validated.
593 * @param value Boolean value to validate.
594 * @return Boolean value indicating that the call should be skipped.
595 */
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700596 bool validate_bool32(const char *apiName, const ParameterName &parameterName, VkBool32 value) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700597 bool skip_call = false;
598
599 if ((value != VK_TRUE) && (value != VK_FALSE)) {
600 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
601 kVUID_PVError_UnrecognizedValue, "%s: value of %s (%d) is neither VK_TRUE nor VK_FALSE", apiName,
602 parameterName.get_name().c_str(), value);
603 }
604
605 return skip_call;
606 }
607
608 /**
609 * Validate a Vulkan enumeration value.
610 *
611 * Generate a warning if an enumeration token value does not fall within the core enumeration
612 * begin and end token values, and was not added to the enumeration by an extension. Extension
613 * provided enumerations use the equation specified in Appendix C.10 of the Vulkan specification,
614 * with 1,000,000,000 as the base token value.
615 *
616 * @note This function does not expect to process enumerations defining bitmask flag bits.
617 *
618 * @param apiName Name of API call being validated.
619 * @param parameterName Name of parameter being validated.
620 * @param enumName Name of the enumeration being validated.
621 * @param valid_values The list of valid values for the enumeration.
622 * @param value Enumeration value to validate.
623 * @return Boolean value indicating that the call should be skipped.
624 */
625 template <typename T>
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700626 bool validate_ranged_enum(const char *apiName, const ParameterName &parameterName, const char *enumName,
Jeff Bolzfdd0d852019-02-03 21:55:12 -0600627 const std::vector<T> &valid_values, T value, const char *vuid) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700628 bool skip = false;
629
630 if (std::find(valid_values.begin(), valid_values.end(), value) == valid_values.end()) {
631 skip |=
632 log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, vuid,
633 "%s: value of %s (%d) does not fall within the begin..end range of the core %s enumeration tokens and is "
634 "not an extension added token.",
635 apiName, parameterName.get_name().c_str(), value, enumName);
636 }
637
638 return skip;
639 }
640
641 /**
642 * Validate an array of Vulkan enumeration value.
643 *
644 * Process all enumeration token values in the specified array and generate a warning if a value
645 * does not fall within the core enumeration begin and end token values, and was not added to
646 * the enumeration by an extension. Extension provided enumerations use the equation specified
647 * in Appendix C.10 of the Vulkan specification, with 1,000,000,000 as the base token value.
648 *
649 * @note This function does not expect to process enumerations defining bitmask flag bits.
650 *
651 * @param apiName Name of API call being validated.
652 * @param countName Name of count parameter.
653 * @param arrayName Name of array parameter.
654 * @param enumName Name of the enumeration being validated.
655 * @param valid_values The list of valid values for the enumeration.
656 * @param count Number of enumeration values in the array.
657 * @param array Array of enumeration values to validate.
658 * @param countRequired The 'count' parameter may not be 0 when true.
659 * @param arrayRequired The 'array' parameter may not be NULL when true.
660 * @return Boolean value indicating that the call should be skipped.
661 */
662 template <typename T>
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700663 bool validate_ranged_enum_array(const char *apiName, const ParameterName &countName, const ParameterName &arrayName,
664 const char *enumName, const std::vector<T> &valid_values, uint32_t count, const T *array,
665 bool countRequired, bool arrayRequired) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700666 bool skip_call = false;
667
668 if ((count == 0) || (array == NULL)) {
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700669 skip_call |= validate_array(apiName, countName, arrayName, count, &array, countRequired, arrayRequired, kVUIDUndefined,
670 kVUIDUndefined);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700671 } else {
672 for (uint32_t i = 0; i < count; ++i) {
673 if (std::find(valid_values.begin(), valid_values.end(), array[i]) == valid_values.end()) {
674 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
675 kVUID_PVError_UnrecognizedValue,
676 "%s: value of %s[%d] (%d) does not fall within the begin..end range of the core %s "
677 "enumeration tokens and is not an extension added token",
678 apiName, arrayName.get_name().c_str(), i, array[i], enumName);
679 }
680 }
681 }
682
683 return skip_call;
684 }
685
686 /**
687 * Verify that a reserved VkFlags value is zero.
688 *
689 * Verify that the specified value is zero, to check VkFlags values that are reserved for
690 * future use.
691 *
692 * @param api_name Name of API call being validated.
693 * @param parameter_name Name of parameter being validated.
694 * @param value Value to validate.
695 * @return Boolean value indicating that the call should be skipped.
696 */
Jeff Bolzfdd0d852019-02-03 21:55:12 -0600697 bool validate_reserved_flags(const char *api_name, const ParameterName &parameter_name, VkFlags value, const char *vuid) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700698 bool skip_call = false;
699
700 if (value != 0) {
701 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, vuid,
702 "%s: parameter %s must be 0.", api_name, parameter_name.get_name().c_str());
703 }
704
705 return skip_call;
706 }
707
708 /**
709 * Validate a Vulkan bitmask value.
710 *
711 * Generate a warning if a value with a VkFlags derived type does not contain valid flag bits
712 * for that type.
713 *
714 * @param api_name Name of API call being validated.
715 * @param parameter_name Name of parameter being validated.
716 * @param flag_bits_name Name of the VkFlags type being validated.
717 * @param all_flags A bit mask combining all valid flag bits for the VkFlags type being validated.
718 * @param value VkFlags value to validate.
719 * @param flags_required The 'value' parameter may not be 0 when true.
720 * @param singleFlag The 'value' parameter may not contain more than one bit from all_flags.
721 * @return Boolean value indicating that the call should be skipped.
722 */
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700723 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 -0600724 VkFlags value, bool flags_required, bool singleFlag, const char *vuid) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700725 bool skip_call = false;
726
727 if (value == 0) {
728 if (flags_required) {
729 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, vuid,
730 "%s: value of %s must not be 0.", api_name, parameter_name.get_name().c_str());
731 }
732 } else if ((value & (~all_flags)) != 0) {
733 skip_call |=
734 log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
735 kVUID_PVError_UnrecognizedValue, "%s: value of %s contains flag bits that are not recognized members of %s",
736 api_name, parameter_name.get_name().c_str(), flag_bits_name);
737 } else if (singleFlag && (std::bitset<sizeof(VkFlags) * 8>(value).count() > 1)) {
738 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
739 kVUID_PVError_UnrecognizedValue,
740 "%s: value of %s contains multiple members of %s when only a single value is allowed", api_name,
741 parameter_name.get_name().c_str(), flag_bits_name);
742 }
743
744 return skip_call;
745 }
746
747 /**
748 * Validate an array of Vulkan bitmask values.
749 *
750 * Generate a warning if a value with a VkFlags derived type does not contain valid flag bits
751 * for that type.
752 *
753 * @param api_name Name of API call being validated.
754 * @param count_name Name of parameter being validated.
755 * @param array_name Name of parameter being validated.
756 * @param flag_bits_name Name of the VkFlags type being validated.
757 * @param all_flags A bitmask combining all valid flag bits for the VkFlags type being validated.
758 * @param count Number of VkFlags values in the array.
759 * @param array Array of VkFlags value to validate.
760 * @param count_required The 'count' parameter may not be 0 when true.
761 * @param array_required The 'array' parameter may not be NULL when true.
762 * @return Boolean value indicating that the call should be skipped.
763 */
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700764 bool validate_flags_array(const char *api_name, const ParameterName &count_name, const ParameterName &array_name,
765 const char *flag_bits_name, VkFlags all_flags, uint32_t count, const VkFlags *array,
766 bool count_required, bool array_required) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700767 bool skip_call = false;
768
769 if ((count == 0) || (array == NULL)) {
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700770 skip_call |= validate_array(api_name, count_name, array_name, count, &array, count_required, array_required,
771 kVUIDUndefined, kVUIDUndefined);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700772 } else {
773 // Verify that all VkFlags values in the array
774 for (uint32_t i = 0; i < count; ++i) {
775 if (array[i] == 0) {
776 // Current XML registry logic for validity generation uses the array parameter's optional tag to determine if
777 // elements in the array are allowed be 0
778 if (array_required) {
779 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
780 kVUID_PVError_RequiredParameter, "%s: value of %s[%d] must not be 0", api_name,
781 array_name.get_name().c_str(), i);
782 }
783 } else if ((array[i] & (~all_flags)) != 0) {
784 skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
785 kVUID_PVError_UnrecognizedValue,
786 "%s: value of %s[%d] contains flag bits that are not recognized members of %s", api_name,
787 array_name.get_name().c_str(), i, flag_bits_name);
788 }
789 }
790 }
791
792 return skip_call;
793 }
794
795 template <typename ExtensionState>
Jeff Bolzfdd0d852019-02-03 21:55:12 -0600796 bool validate_extension_reqs(const ExtensionState &extensions, const char *vuid, const char *extension_type,
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700797 const char *extension_name) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700798 bool skip = false;
799 if (!extension_name) {
800 return skip; // Robust to invalid char *
801 }
802 auto info = ExtensionState::get_info(extension_name);
803
804 if (!info.state) {
805 return skip; // Unknown extensions cannot be checked so report OK
806 }
807
808 // Check against the required list in the info
809 std::vector<const char *> missing;
810 for (const auto &req : info.requires) {
811 if (!(extensions.*(req.enabled))) {
812 missing.push_back(req.name);
813 }
814 }
815
816 // Report any missing requirements
817 if (missing.size()) {
818 std::string missing_joined_list = string_join(", ", missing);
819 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 -0700820 HandleToUint64(instance), vuid, "Missing extension%s required by the %s extension %s: %s.",
821 ((missing.size() > 1) ? "s" : ""), extension_type, extension_name, missing_joined_list.c_str());
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700822 }
823 return skip;
824 }
825
826 enum RenderPassCreateVersion { RENDER_PASS_VERSION_1 = 0, RENDER_PASS_VERSION_2 = 1 };
827
828 template <typename RenderPassCreateInfoGeneric>
Petr Kraus3e52eba2019-07-10 01:24:10 +0200829 bool ValidateSubpassGraphicsFlags(const debug_report_data *report_data, const RenderPassCreateInfoGeneric *pCreateInfo,
830 uint32_t dependency_index, uint32_t subpass, VkPipelineStageFlags stages, const char *vuid,
831 const char *target) {
832 const VkPipelineStageFlags kGraphicsStages =
833 VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT | VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT | VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT |
834 VK_PIPELINE_STAGE_TASK_SHADER_BIT_NV | VK_PIPELINE_STAGE_MESH_SHADER_BIT_NV | VK_PIPELINE_STAGE_VERTEX_INPUT_BIT |
835 VK_PIPELINE_STAGE_VERTEX_SHADER_BIT | VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT |
836 VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT | VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT |
837 VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT |
838 VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT |
839 VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT | VK_PIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXT |
840 VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT | VK_PIPELINE_STAGE_SHADING_RATE_IMAGE_BIT_NV |
841 VK_PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT;
842
843 bool skip = false;
844 const bool is_all_graphics_stages = (stages & ~kGraphicsStages) == 0;
845 const auto IsGraphics = [pCreateInfo](uint32_t subpass) {
846 if (subpass == VK_SUBPASS_EXTERNAL)
847 return false;
848 else
849 return pCreateInfo->pSubpasses[subpass].pipelineBindPoint == VK_PIPELINE_BIND_POINT_GRAPHICS;
850 };
851
852 if (IsGraphics(subpass) && !is_all_graphics_stages) {
853 skip |=
854 log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT, 0, vuid,
855 "Dependency pDependencies[%" PRIu32
856 "] specifies a %sStageMask that contains stages (%s) that are not part "
857 "of the Graphics pipeline, as specified by the %sSubpass (= %" PRIu32 ") in pipelineBindPoint.",
858 dependency_index, target, string_VkPipelineStageFlags(stages & ~kGraphicsStages).c_str(), target, subpass);
859 }
860
861 return skip;
862 };
863
864 template <typename RenderPassCreateInfoGeneric>
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700865 bool CreateRenderPassGeneric(VkDevice device, const RenderPassCreateInfoGeneric *pCreateInfo,
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700866 const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass,
867 RenderPassCreateVersion rp_version) {
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700868 bool skip = false;
869 uint32_t max_color_attachments = device_limits.maxColorAttachments;
870 bool use_rp2 = (rp_version == RENDER_PASS_VERSION_2);
871 const char *vuid;
872
873 for (uint32_t i = 0; i < pCreateInfo->attachmentCount; ++i) {
874 if (pCreateInfo->pAttachments[i].format == VK_FORMAT_UNDEFINED) {
875 std::stringstream ss;
876 ss << (use_rp2 ? "vkCreateRenderPass2KHR" : "vkCreateRenderPass") << ": pCreateInfo->pAttachments[" << i
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700877 << "].format is VK_FORMAT_UNDEFINED. ";
878 vuid =
879 use_rp2 ? "VUID-VkAttachmentDescription2KHR-format-parameter" : "VUID-VkAttachmentDescription-format-parameter";
880 skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, vuid,
881 "%s", ss.str().c_str());
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700882 }
883 if (pCreateInfo->pAttachments[i].finalLayout == VK_IMAGE_LAYOUT_UNDEFINED ||
884 pCreateInfo->pAttachments[i].finalLayout == VK_IMAGE_LAYOUT_PREINITIALIZED) {
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700885 vuid = use_rp2 ? "VUID-VkAttachmentDescription2KHR-finalLayout-03061"
886 : "VUID-VkAttachmentDescription-finalLayout-00843";
887 skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, vuid,
888 "pCreateInfo->pAttachments[%d].finalLayout must not be VK_IMAGE_LAYOUT_UNDEFINED or "
889 "VK_IMAGE_LAYOUT_PREINITIALIZED.",
890 i);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700891 }
892 }
893
894 for (uint32_t i = 0; i < pCreateInfo->subpassCount; ++i) {
895 if (pCreateInfo->pSubpasses[i].colorAttachmentCount > max_color_attachments) {
896 vuid = use_rp2 ? "VUID-VkSubpassDescription2KHR-colorAttachmentCount-03063"
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700897 : "VUID-VkSubpassDescription-colorAttachmentCount-00845";
898 skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, vuid,
899 "Cannot create a render pass with %d color attachments. Max is %d.",
900 pCreateInfo->pSubpasses[i].colorAttachmentCount, max_color_attachments);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700901 }
902 }
Petr Kraus3e52eba2019-07-10 01:24:10 +0200903
904 for (uint32_t i = 0; i < pCreateInfo->dependencyCount; ++i) {
905 const auto &dependency = pCreateInfo->pDependencies[i];
906
907 // Spec currently only supports Graphics pipeline in render pass -- so only that pipeline is currently checked
908 vuid =
909 use_rp2 ? "VUID-VkRenderPassCreateInfo2KHR-pDependencies-03054" : "VUID-VkRenderPassCreateInfo-pDependencies-00837";
910 skip |= ValidateSubpassGraphicsFlags(report_data, pCreateInfo, i, dependency.srcSubpass, dependency.srcStageMask, vuid,
911 "src");
912
913 vuid =
914 use_rp2 ? "VUID-VkRenderPassCreateInfo2KHR-pDependencies-03055" : "VUID-VkRenderPassCreateInfo-pDependencies-00838";
915 skip |= ValidateSubpassGraphicsFlags(report_data, pCreateInfo, i, dependency.dstSubpass, dependency.dstStageMask, vuid,
916 "dst");
917 }
918
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700919 return skip;
920 }
921
922 template <typename T>
923 void RecordRenderPass(VkRenderPass renderPass, const T *pCreateInfo) {
Mark Lobodzinskif27a6bc2019-02-04 13:00:49 -0700924 std::unique_lock<std::mutex> lock(renderpass_map_mutex);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700925 auto &renderpass_state = renderpasses_states[renderPass];
Mark Lobodzinskif27a6bc2019-02-04 13:00:49 -0700926 lock.unlock();
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700927
928 for (uint32_t subpass = 0; subpass < pCreateInfo->subpassCount; ++subpass) {
929 bool uses_color = false;
930 for (uint32_t i = 0; i < pCreateInfo->pSubpasses[subpass].colorAttachmentCount && !uses_color; ++i)
931 if (pCreateInfo->pSubpasses[subpass].pColorAttachments[i].attachment != VK_ATTACHMENT_UNUSED) uses_color = true;
932
933 bool uses_depthstencil = false;
934 if (pCreateInfo->pSubpasses[subpass].pDepthStencilAttachment)
935 if (pCreateInfo->pSubpasses[subpass].pDepthStencilAttachment->attachment != VK_ATTACHMENT_UNUSED)
936 uses_depthstencil = true;
937
938 if (uses_color) renderpass_state.subpasses_using_color_attachment.insert(subpass);
939 if (uses_depthstencil) renderpass_state.subpasses_using_depthstencil_attachment.insert(subpass);
940 }
941 }
942
943 bool require_device_extension(bool flag, char const *function_name, char const *extension_name);
944
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700945 bool validate_instance_extensions(const VkInstanceCreateInfo *pCreateInfo);
946
947 bool validate_api_version(uint32_t api_version, uint32_t effective_api_version);
948
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700949 bool validate_string(const char *apiName, const ParameterName &stringName, const std::string &vuid, const char *validateString);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700950
951 bool ValidateCoarseSampleOrderCustomNV(const VkCoarseSampleOrderCustomNV *order);
952
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700953 bool ValidateQueueFamilies(uint32_t queue_family_count, const uint32_t *queue_families, const char *cmd_name,
954 const char *array_parameter_name, const std::string &unique_error_code,
955 const std::string &valid_error_code, bool optional);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700956
Mark Lobodzinskibf599b92018-12-31 12:15:55 -0700957 bool ValidateDeviceQueueFamily(uint32_t queue_family, const char *cmd_name, const char *parameter_name,
958 const std::string &error_code, bool optional);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700959
Jason Macnak192fa0e2019-07-26 15:07:16 -0700960 bool ValidateGeometryTrianglesNV(const VkGeometryTrianglesNV &triangles, VkDebugReportObjectTypeEXT object_type,
961 uint64_t object_handle, const char *func_name) const;
962 bool ValidateGeometryAABBNV(const VkGeometryAABBNV &geometry, VkDebugReportObjectTypeEXT object_type, uint64_t object_handle,
963 const char *func_name) const;
964 bool ValidateGeometryNV(const VkGeometryNV &geometry, VkDebugReportObjectTypeEXT object_type, uint64_t object_handle,
965 const char *func_name) const;
966 bool ValidateAccelerationStructureInfoNV(const VkAccelerationStructureInfoNV &info, VkDebugReportObjectTypeEXT object_type,
967 uint64_t object_handle, const char *func_nam) const;
Jason Macnak5c954952019-07-09 15:46:12 -0700968
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700969 bool OutputExtensionError(const std::string &api_name, const std::string &extension_name);
970
971 void PostCallRecordCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo,
Mark Lobodzinskicd05c1e2019-01-17 15:33:46 -0700972 const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass, VkResult result);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700973 void PostCallRecordCreateRenderPass2KHR(VkDevice device, const VkRenderPassCreateInfo2KHR *pCreateInfo,
Mark Lobodzinskicd05c1e2019-01-17 15:33:46 -0700974 const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass, VkResult result);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700975 void PostCallRecordDestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks *pAllocator);
976 void PostCallRecordCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo,
Mark Lobodzinskicd05c1e2019-01-17 15:33:46 -0700977 const VkAllocationCallbacks *pAllocator, VkDevice *pDevice, VkResult result);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700978
979 void PostCallRecordCreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator,
Mark Lobodzinskicd05c1e2019-01-17 15:33:46 -0700980 VkInstance *pInstance, VkResult result);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700981
locke-lunargb1909cd2019-08-01 23:40:05 -0600982 void PostCallRecordQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *pPresentInfo, VkResult result);
983
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700984 bool manual_PreCallValidateCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo *pCreateInfo,
985 const VkAllocationCallbacks *pAllocator, VkQueryPool *pQueryPool);
986
987 bool manual_PreCallValidateCreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator,
988 VkInstance *pInstance);
989
990 bool manual_PreCallValidateCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo,
991 const VkAllocationCallbacks *pAllocator, VkDevice *pDevice);
992
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -0700993 bool manual_PreCallValidateCreateBuffer(VkDevice device, const VkBufferCreateInfo *pCreateInfo,
994 const VkAllocationCallbacks *pAllocator, VkBuffer *pBuffer);
995
996 bool manual_PreCallValidateCreateImage(VkDevice device, const VkImageCreateInfo *pCreateInfo,
997 const VkAllocationCallbacks *pAllocator, VkImage *pImage);
998
Jeff Bolz6d3beaa2019-02-09 21:00:05 -0600999 bool manual_PreCallValidateViewport(const VkViewport &viewport, const char *fn_name, const ParameterName &parameter_name,
Mark Lobodzinskibf599b92018-12-31 12:15:55 -07001000 VkDebugReportObjectTypeEXT object_type, uint64_t object);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -07001001
1002 bool manual_PreCallValidateCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount,
1003 const VkGraphicsPipelineCreateInfo *pCreateInfos,
1004 const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines);
1005 bool manual_PreCallValidateCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount,
1006 const VkComputePipelineCreateInfo *pCreateInfos,
1007 const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines);
1008
1009 bool manual_PreCallValidateCreateSampler(VkDevice device, const VkSamplerCreateInfo *pCreateInfo,
1010 const VkAllocationCallbacks *pAllocator, VkSampler *pSampler);
1011 bool manual_PreCallValidateCreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo *pCreateInfo,
Mark Lobodzinskibf599b92018-12-31 12:15:55 -07001012 const VkAllocationCallbacks *pAllocator,
1013 VkDescriptorSetLayout *pSetLayout);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -07001014
Mark Lobodzinskibf599b92018-12-31 12:15:55 -07001015 bool manual_PreCallValidateUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount,
1016 const VkWriteDescriptorSet *pDescriptorWrites, uint32_t descriptorCopyCount,
1017 const VkCopyDescriptorSet *pDescriptorCopies);
Jason Macnak5c954952019-07-09 15:46:12 -07001018
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -07001019 bool manual_PreCallValidateFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount,
1020 const VkDescriptorSet *pDescriptorSets);
1021
1022 bool manual_PreCallValidateCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo,
1023 const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass);
1024
1025 bool manual_PreCallValidateCreateRenderPass2KHR(VkDevice device, const VkRenderPassCreateInfo2KHR *pCreateInfo,
1026 const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass);
1027
1028 bool manual_PreCallValidateFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount,
1029 const VkCommandBuffer *pCommandBuffers);
1030
1031 bool manual_PreCallValidateBeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo *pBeginInfo);
1032
1033 bool manual_PreCallValidateCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount,
1034 const VkViewport *pViewports);
1035
1036 bool manual_PreCallValidateCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount,
1037 const VkRect2D *pScissors);
1038 bool manual_PreCallValidateCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth);
1039
1040 bool manual_PreCallValidateCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount,
1041 uint32_t firstVertex, uint32_t firstInstance);
1042
1043 bool manual_PreCallValidateCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count,
1044 uint32_t stride);
1045
1046 bool manual_PreCallValidateCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset,
1047 uint32_t count, uint32_t stride);
1048
Mark Lobodzinskif77a4ac2019-06-27 15:30:51 -06001049 bool manual_PreCallValidateCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount,
1050 const VkClearAttachment *pAttachments, uint32_t rectCount,
1051 const VkClearRect *pRects);
1052
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -07001053 bool manual_PreCallValidateCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout,
1054 VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount,
1055 const VkImageCopy *pRegions);
1056
1057 bool manual_PreCallValidateCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout,
1058 VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount,
1059 const VkImageBlit *pRegions, VkFilter filter);
1060
1061 bool manual_PreCallValidateCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage,
1062 VkImageLayout dstImageLayout, uint32_t regionCount,
1063 const VkBufferImageCopy *pRegions);
1064
1065 bool manual_PreCallValidateCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout,
1066 VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy *pRegions);
1067
1068 bool manual_PreCallValidateCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset,
1069 VkDeviceSize dataSize, const void *pData);
1070
1071 bool manual_PreCallValidateCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset,
1072 VkDeviceSize size, uint32_t data);
1073
1074 bool manual_PreCallValidateCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo,
1075 const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchain);
1076 bool manual_PreCallValidateQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *pPresentInfo);
1077
1078#ifdef VK_USE_PLATFORM_WIN32_KHR
1079 bool manual_PreCallValidateCreateWin32SurfaceKHR(VkInstance instance, const VkWin32SurfaceCreateInfoKHR *pCreateInfo,
1080 const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface);
1081#endif // VK_USE_PLATFORM_WIN32_KHR
1082
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -07001083 bool manual_PreCallValidateCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo *pCreateInfo,
1084 const VkAllocationCallbacks *pAllocator, VkDescriptorPool *pDescriptorPool);
1085 bool manual_PreCallValidateCmdDispatch(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY,
1086 uint32_t groupCountZ);
1087
1088 bool manual_PreCallValidateCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset);
1089
1090 bool manual_PreCallValidateCmdDispatchBaseKHR(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY,
1091 uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY,
1092 uint32_t groupCountZ);
1093 bool manual_PreCallValidateCmdSetExclusiveScissorNV(VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor,
1094 uint32_t exclusiveScissorCount, const VkRect2D *pExclusiveScissors);
1095 bool manual_PreCallValidateCmdSetViewportShadingRatePaletteNV(VkCommandBuffer commandBuffer, uint32_t firstViewport,
1096 uint32_t viewportCount,
1097 const VkShadingRatePaletteNV *pShadingRatePalettes);
1098
1099 bool manual_PreCallValidateCmdSetCoarseSampleOrderNV(VkCommandBuffer commandBuffer, VkCoarseSampleOrderTypeNV sampleOrderType,
1100 uint32_t customSampleOrderCount,
1101 const VkCoarseSampleOrderCustomNV *pCustomSampleOrders);
1102
1103 bool manual_PreCallValidateCmdDrawMeshTasksNV(VkCommandBuffer commandBuffer, uint32_t taskCount, uint32_t firstTask);
1104 bool manual_PreCallValidateCmdDrawMeshTasksIndirectNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset,
1105 uint32_t drawCount, uint32_t stride);
1106
1107 bool manual_PreCallValidateCmdDrawMeshTasksIndirectCountNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset,
1108 VkBuffer countBuffer, VkDeviceSize countBufferOffset,
1109 uint32_t maxDrawCount, uint32_t stride);
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -07001110
1111 bool manual_PreCallValidateEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char *pLayerName,
1112 uint32_t *pPropertyCount, VkExtensionProperties *pProperties);
Jeff Bolz7e7e6e02019-01-11 22:53:41 -06001113 bool manual_PreCallValidateAllocateMemory(VkDevice device, const VkMemoryAllocateInfo *pAllocateInfo,
1114 const VkAllocationCallbacks *pAllocator, VkDeviceMemory *pMemory);
Ricardo Garciaa4935972019-02-21 17:43:18 +01001115
1116 bool manual_PreCallValidateCreateAccelerationStructureNV(VkDevice device,
1117 const VkAccelerationStructureCreateInfoNV *pCreateInfo,
1118 const VkAllocationCallbacks *pAllocator,
1119 VkAccelerationStructureNV *pAccelerationStructure);
Jason Macnak5c954952019-07-09 15:46:12 -07001120 bool manual_PreCallValidateCmdBuildAccelerationStructureNV(VkCommandBuffer commandBuffer,
1121 const VkAccelerationStructureInfoNV *pInfo, VkBuffer instanceData,
1122 VkDeviceSize instanceOffset, VkBool32 update,
1123 VkAccelerationStructureNV dst, VkAccelerationStructureNV src,
1124 VkBuffer scratch, VkDeviceSize scratchOffset);
1125 bool manual_PreCallValidateGetAccelerationStructureHandleNV(VkDevice device, VkAccelerationStructureNV accelerationStructure,
1126 size_t dataSize, void *pData);
Peter Chen85366392019-05-14 15:20:11 -04001127 bool manual_PreCallValidateCreateRayTracingPipelinesNV(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount,
1128 const VkRayTracingPipelineCreateInfoNV *pCreateInfos,
1129 const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines);
Mike Schuchardt21638df2019-03-16 10:52:02 -07001130
1131#ifdef VK_USE_PLATFORM_WIN32_KHR
1132 bool PreCallValidateGetDeviceGroupSurfacePresentModes2EXT(VkDevice device, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo,
1133 VkDeviceGroupPresentModeFlagsKHR *pModes);
1134#endif // VK_USE_PLATFORM_WIN32_KHR
Tobias Hectorebb855f2019-07-23 12:17:33 +01001135
1136 bool manual_PreCallValidateCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo *pCreateInfo,
1137 const VkAllocationCallbacks *pAllocator, VkFramebuffer *pFramebuffer);
1138
Mark Lobodzinskiaf7c0382018-12-18 11:55:55 -07001139#include "parameter_validation.h"
1140}; // Class StatelessValidation