Mike Schuchardt | 05b028d | 2022-01-05 14:15:00 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2015-2022 The Khronos Group Inc. |
| 2 | * Copyright (c) 2015-2022 Valve Corporation |
| 3 | * Copyright (c) 2015-2022 LunarG, Inc. |
| 4 | * Copyright (C) 2015-2022 Google Inc. |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 5 | * |
| 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 | |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 24 | #include "parameter_name.h" |
| 25 | #include "vk_typemap_helper.h" |
Jeremy Gebben | 5f585ae | 2021-02-02 09:03:06 -0700 | [diff] [blame] | 26 | #include "sync_utils.h" |
sjfricke | 91d9bda | 2022-08-01 21:44:17 +0900 | [diff] [blame] | 27 | #include "cmd_buffer_state.h" |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 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 | |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 36 | static const char DECORATE_UNUSED *kVUID_PVError_RequiredParameter = "UNASSIGNED-GeneralParameterError-RequiredParameter"; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 37 | static const char DECORATE_UNUSED *kVUID_PVError_UnrecognizedValue = "UNASSIGNED-GeneralParameterError-UnrecognizedValue"; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 38 | static const char DECORATE_UNUSED *kVUID_PVError_ExtensionNotEnabled = "UNASSIGNED-GeneralParameterError-ExtensionNotEnabled"; |
Mark Lobodzinski | 2e40a13 | 2020-08-10 14:51:41 -0600 | [diff] [blame] | 39 | static const char DECORATE_UNUSED *kVUID_PVError_ApiVersionViolation = "UNASSIGNED-API-Version-Violation"; |
Mark Lobodzinski | acf4ab4 | 2020-10-30 15:30:10 -0600 | [diff] [blame] | 40 | // static const char DECORATE_UNUSED *kVUID_PVError_InvalidStructPNext = "UNASSIGNED-GeneralParameterError-InvalidStructPNext"; |
| 41 | // static const char DECORATE_UNUSED *kVUID_PVError_NONE = "UNASSIGNED-GeneralParameterError-Info"; |
| 42 | // static const char DECORATE_UNUSED *kVUID_PVError_InvalidUsage = "UNASSIGNED-GeneralParameterError-InvalidUsage"; |
| 43 | // static const char DECORATE_UNUSED *kVUID_PVError_InvalidStructSType = "UNASSIGNED-GeneralParameterError-InvalidStructSType"; |
| 44 | // static const char DECORATE_UNUSED *kVUID_PVError_ReservedParameter = "UNASSIGNED-GeneralParameterError-ReservedParameter"; |
| 45 | // static const char DECORATE_UNUSED *kVUID_PVError_DeviceLimit = "UNASSIGNED-GeneralParameterError-DeviceLimit"; |
| 46 | // static const char DECORATE_UNUSED *kVUID_PVError_FailureCode = "UNASSIGNED-GeneralParameterError-FailureCode"; |
| 47 | // static const char DECORATE_UNUSED *kVUID_PVError_DeviceFeature = "UNASSIGNED-GeneralParameterError-DeviceFeature"; |
| 48 | |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 49 | extern const uint32_t GeneratedVulkanHeaderVersion; |
| 50 | |
sfricke-samsung | d854f4c | 2021-07-03 23:25:05 -0700 | [diff] [blame] | 51 | // Some flags and enums are never used in and won't be generated by default |
| 52 | // Add to 'noautovalidity_type_exceptions' in parameter_validation_generator.py if needed |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 53 | extern const VkQueryPipelineStatisticFlags AllVkQueryPipelineStatisticFlagBits; |
| 54 | extern const VkColorComponentFlags AllVkColorComponentFlagBits; |
| 55 | extern const VkShaderStageFlags AllVkShaderStageFlagBits; |
| 56 | extern const VkQueryControlFlags AllVkQueryControlFlagBits; |
| 57 | extern const VkImageUsageFlags AllVkImageUsageFlagBits; |
Mark Lobodzinski | 876d5b5 | 2019-08-06 16:32:27 -0600 | [diff] [blame] | 58 | extern const VkSampleCountFlags AllVkSampleCountFlagBits; |
sourav parmar | a96ab1a | 2020-04-25 16:28:23 -0700 | [diff] [blame] | 59 | extern const VkBuildAccelerationStructureFlagsNV AllVkBuildAccelerationStructureFlagBitsNV; |
| 60 | extern const VkGeometryFlagsKHR AllVkGeometryFlagBitsKHR; |
Mike Schuchardt | 00e8145 | 2021-11-29 11:11:20 -0800 | [diff] [blame] | 61 | extern const VkPipelineColorBlendStateCreateFlags AllVkPipelineColorBlendStateCreateFlagBits; |
| 62 | extern const VkPipelineDepthStencilStateCreateFlags AllVkPipelineDepthStencilStateCreateFlagBits; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 63 | |
sourav parmar | a96ab1a | 2020-04-25 16:28:23 -0700 | [diff] [blame] | 64 | extern const std::vector<VkGeometryTypeKHR> AllVkGeometryTypeKHREnums; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 65 | extern const std::vector<VkCompareOp> AllVkCompareOpEnums; |
| 66 | extern const std::vector<VkStencilOp> AllVkStencilOpEnums; |
| 67 | extern const std::vector<VkBlendFactor> AllVkBlendFactorEnums; |
| 68 | extern const std::vector<VkBlendOp> AllVkBlendOpEnums; |
| 69 | extern const std::vector<VkLogicOp> AllVkLogicOpEnums; |
| 70 | extern const std::vector<VkBorderColor> AllVkBorderColorEnums; |
| 71 | extern const std::vector<VkImageLayout> AllVkImageLayoutEnums; |
Mark Lobodzinski | 876d5b5 | 2019-08-06 16:32:27 -0600 | [diff] [blame] | 72 | extern const std::vector<VkFormat> AllVkFormatEnums; |
| 73 | extern const std::vector<VkVertexInputRate> AllVkVertexInputRateEnums; |
| 74 | extern const std::vector<VkPrimitiveTopology> AllVkPrimitiveTopologyEnums; |
sourav parmar | a96ab1a | 2020-04-25 16:28:23 -0700 | [diff] [blame] | 75 | extern const std::vector<VkIndexType> AllVkIndexTypeEnums; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 76 | |
Mark Lobodzinski | 3e66ae8 | 2020-08-12 16:27:29 -0600 | [diff] [blame] | 77 | extern std::vector<std::pair<uint32_t, uint32_t>> custom_stype_info; |
| 78 | |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 79 | // String returned by string_VkStructureType for an unrecognized type. |
| 80 | const std::string UnsupportedStructureTypeString = "Unhandled VkStructureType"; |
| 81 | |
| 82 | // String returned by string_VkResult for an unrecognized type. |
| 83 | const std::string UnsupportedResultString = "Unhandled VkResult"; |
| 84 | |
| 85 | // The base value used when computing the offset for an enumeration token value that is added by an extension. |
| 86 | // When validating enumeration tokens, any value >= to this value is considered to be provided by an extension. |
| 87 | // See Appendix C.10 "Assigning Extension Token Values" from the Vulkan specification |
| 88 | const uint32_t ExtEnumBaseValue = 1000000000; |
| 89 | |
| 90 | // The value of all VK_xxx_MAX_ENUM tokens |
| 91 | const uint32_t MaxEnumValue = 0x7FFFFFFF; |
| 92 | |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 93 | class StatelessValidation : public ValidationObject { |
Petr Kraus | 4ed81e3 | 2019-09-02 23:41:19 +0200 | [diff] [blame] | 94 | public: |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 95 | VkPhysicalDeviceLimits device_limits = {}; |
Petr Kraus | 715bcc7 | 2019-08-15 17:17:33 +0200 | [diff] [blame] | 96 | safe_VkPhysicalDeviceFeatures2 physical_device_features2; |
Tony-LunarG | 6c3c545 | 2019-12-13 10:37:38 -0700 | [diff] [blame] | 97 | void *device_createinfo_pnext; |
Petr Kraus | 715bcc7 | 2019-08-15 17:17:33 +0200 | [diff] [blame] | 98 | const VkPhysicalDeviceFeatures &physical_device_features = physical_device_features2.features; |
Jeremy Gebben | cbf2286 | 2021-03-03 12:01:22 -0700 | [diff] [blame] | 99 | layer_data::unordered_map<VkPhysicalDevice, VkPhysicalDeviceProperties *> physical_device_properties_map; |
| 100 | layer_data::unordered_map<VkPhysicalDevice, layer_data::unordered_set<std::string>> device_extensions_enumerated{}; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 101 | |
Mark Lobodzinski | f27a6bc | 2019-02-04 13:00:49 -0700 | [diff] [blame] | 102 | // Override chassis read/write locks for this validation object |
| 103 | // This override takes a deferred lock. i.e. it is not acquired. |
Jeremy Gebben | 2e5b41b | 2021-10-11 16:41:49 -0600 | [diff] [blame] | 104 | ReadLockGuard ReadLock() override; |
| 105 | WriteLockGuard WriteLock() override; |
Mark Lobodzinski | f27a6bc | 2019-02-04 13:00:49 -0700 | [diff] [blame] | 106 | |
sfricke-samsung | a6c67fb | 2020-12-15 20:51:42 -0800 | [diff] [blame] | 107 | // Device extension properties -- storing properties gathered from VkPhysicalDeviceProperties2::pNext chain |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 108 | struct DeviceExtensionProperties { |
| 109 | VkPhysicalDeviceShadingRateImagePropertiesNV shading_rate_image_props; |
| 110 | VkPhysicalDeviceMeshShaderPropertiesNV mesh_shader_props; |
Jeff Bolz | 443c2ca | 2020-03-19 12:11:51 -0500 | [diff] [blame] | 111 | VkPhysicalDeviceRayTracingPropertiesNV ray_tracing_propsNV; |
sourav parmar | cd5fb18 | 2020-07-17 12:58:44 -0700 | [diff] [blame] | 112 | VkPhysicalDeviceRayTracingPipelinePropertiesKHR ray_tracing_propsKHR; |
| 113 | VkPhysicalDeviceAccelerationStructurePropertiesKHR acc_structure_props; |
Mark Lobodzinski | 953b7bc | 2019-12-19 13:50:10 -0700 | [diff] [blame] | 114 | VkPhysicalDeviceTransformFeedbackPropertiesEXT transform_feedback_props; |
Piers Daniell | cb6d803 | 2021-04-19 18:51:26 -0600 | [diff] [blame] | 115 | VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT vertex_attribute_divisor_props; |
ziga-lunarg | a283d02 | 2021-08-04 18:35:23 +0200 | [diff] [blame] | 116 | VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT blend_operation_advanced_props; |
Piers Daniell | a7f93b6 | 2021-11-20 12:32:04 -0700 | [diff] [blame] | 117 | VkPhysicalDeviceMaintenance4PropertiesKHR maintenance4_props; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 118 | }; |
| 119 | DeviceExtensionProperties phys_dev_ext_props = {}; |
| 120 | |
| 121 | struct SubpassesUsageStates { |
Jeremy Gebben | cbf2286 | 2021-03-03 12:01:22 -0700 | [diff] [blame] | 122 | layer_data::unordered_set<uint32_t> subpasses_using_color_attachment; |
| 123 | layer_data::unordered_set<uint32_t> subpasses_using_depthstencil_attachment; |
Younggwan Kim | 26b9abd | 2021-12-07 21:22:03 +0000 | [diff] [blame] | 124 | std::vector<VkSubpassDescriptionFlags> subpasses_flags; |
sjfricke | 69877a7 | 2022-08-10 09:20:01 +0900 | [diff] [blame] | 125 | uint32_t color_attachment_count; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 126 | }; |
| 127 | |
Mark Lobodzinski | f27a6bc | 2019-02-04 13:00:49 -0700 | [diff] [blame] | 128 | // Though this validation object is predominantly statless, the Framebuffer checks are greatly simplified by creating and |
| 129 | // updating a map of the renderpass usage states, and these accesses need thread protection. Use a mutex separate from the |
| 130 | // parent object's to maintain that functionality. |
Jeff Bolz | 46c0ea0 | 2019-10-09 13:06:29 -0500 | [diff] [blame] | 131 | mutable std::mutex renderpass_map_mutex; |
Jeremy Gebben | cbf2286 | 2021-03-03 12:01:22 -0700 | [diff] [blame] | 132 | layer_data::unordered_map<VkRenderPass, SubpassesUsageStates> renderpasses_states; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 133 | |
| 134 | // Constructor for stateles validation tracking |
Jeff Bolz | 165818a | 2020-05-08 11:19:03 -0500 | [diff] [blame] | 135 | StatelessValidation() : device_createinfo_pnext(nullptr) { container_type = LayerObjectTypeParameterValidation; } |
| 136 | ~StatelessValidation() { |
| 137 | if (device_createinfo_pnext) { |
| 138 | FreePnextChain(device_createinfo_pnext); |
| 139 | } |
| 140 | } |
| 141 | |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 142 | /** |
| 143 | * Validate a minimum value. |
| 144 | * |
| 145 | * Verify that the specified value is greater than the specified lower bound. |
| 146 | * |
| 147 | * @param api_name Name of API call being validated. |
| 148 | * @param parameter_name Name of parameter being validated. |
| 149 | * @param value Value to validate. |
| 150 | * @param lower_bound Lower bound value to use for validation. |
| 151 | * @return Boolean value indicating that the call should be skipped. |
| 152 | */ |
| 153 | template <typename T> |
| 154 | bool ValidateGreaterThan(const T value, const T lower_bound, const ParameterName ¶meter_name, const std::string &vuid, |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 155 | const char *api_name) const { |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 156 | bool skip_call = false; |
| 157 | |
| 158 | if (value <= lower_bound) { |
| 159 | std::ostringstream ss; |
Mark Lobodzinski | 525c129 | 2020-10-30 16:00:00 -0600 | [diff] [blame] | 160 | ss << api_name << ": parameter " << parameter_name.get_name() << " (= " << value << ") is not greater than " |
| 161 | << lower_bound; |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 162 | skip_call |= LogError(device, vuid, "%s", ss.str().c_str()); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 163 | } |
| 164 | |
| 165 | return skip_call; |
| 166 | } |
| 167 | |
| 168 | template <typename T> |
| 169 | bool ValidateGreaterThanZero(const T value, const ParameterName ¶meter_name, const std::string &vuid, |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 170 | const char *api_name) const { |
| 171 | return ValidateGreaterThan(value, T{0}, parameter_name, vuid, api_name); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 172 | } |
| 173 | /** |
| 174 | * Validate a required pointer. |
| 175 | * |
| 176 | * Verify that a required pointer is not NULL. |
| 177 | * |
| 178 | * @param apiName Name of API call being validated. |
| 179 | * @param parameterName Name of parameter being validated. |
| 180 | * @param value Pointer to validate. |
| 181 | * @return Boolean value indicating that the call should be skipped. |
| 182 | */ |
Mark Lobodzinski | bf599b9 | 2018-12-31 12:15:55 -0700 | [diff] [blame] | 183 | bool validate_required_pointer(const char *apiName, const ParameterName ¶meterName, const void *value, |
Jeff Bolz | 46c0ea0 | 2019-10-09 13:06:29 -0500 | [diff] [blame] | 184 | const std::string &vuid) const { |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 185 | bool skip_call = false; |
| 186 | |
Mike Schuchardt | f39a8dc | 2021-04-19 08:55:48 -0700 | [diff] [blame] | 187 | if (value == nullptr) { |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 188 | skip_call |= |
| 189 | LogError(device, vuid, "%s: required parameter %s specified as NULL.", apiName, parameterName.get_name().c_str()); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 190 | } |
| 191 | |
| 192 | return skip_call; |
| 193 | } |
| 194 | |
| 195 | /** |
| 196 | * Validate array count and pointer to array. |
| 197 | * |
| 198 | * Verify that required count and array parameters are not 0 or NULL. If the |
| 199 | * count parameter is not optional, verify that it is not 0. If the array |
| 200 | * parameter is NULL, and it is not optional, verify that count is 0. |
| 201 | * |
| 202 | * @param apiName Name of API call being validated. |
| 203 | * @param countName Name of count parameter. |
| 204 | * @param arrayName Name of array parameter. |
| 205 | * @param count Number of elements in the array. |
| 206 | * @param array Array to validate. |
| 207 | * @param countRequired The 'count' parameter may not be 0 when true. |
| 208 | * @param arrayRequired The 'array' parameter may not be NULL when true. |
| 209 | * @return Boolean value indicating that the call should be skipped. |
| 210 | */ |
| 211 | template <typename T1, typename T2> |
Mark Lobodzinski | bf599b9 | 2018-12-31 12:15:55 -0700 | [diff] [blame] | 212 | bool validate_array(const char *apiName, const ParameterName &countName, const ParameterName &arrayName, T1 count, |
Jeff Bolz | fdd0d85 | 2019-02-03 21:55:12 -0600 | [diff] [blame] | 213 | const T2 *array, bool countRequired, bool arrayRequired, const char *count_required_vuid, |
Jeff Bolz | 46c0ea0 | 2019-10-09 13:06:29 -0500 | [diff] [blame] | 214 | const char *array_required_vuid) const { |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 215 | bool skip_call = false; |
| 216 | |
| 217 | // Count parameters not tagged as optional cannot be 0 |
| 218 | if (countRequired && (count == 0)) { |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 219 | skip_call |= LogError(device, count_required_vuid, "%s: parameter %s must be greater than 0.", apiName, |
| 220 | countName.get_name().c_str()); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 221 | } |
| 222 | |
| 223 | // Array parameters not tagged as optional cannot be NULL, unless the count is 0 |
Mike Schuchardt | f39a8dc | 2021-04-19 08:55:48 -0700 | [diff] [blame] | 224 | if (arrayRequired && (count != 0) && (*array == nullptr)) { |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 225 | skip_call |= LogError(device, array_required_vuid, "%s: required parameter %s specified as NULL.", apiName, |
| 226 | arrayName.get_name().c_str()); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 227 | } |
| 228 | |
| 229 | return skip_call; |
| 230 | } |
| 231 | |
| 232 | /** |
| 233 | * Validate pointer to array count and pointer to array. |
| 234 | * |
| 235 | * Verify that required count and array parameters are not NULL. If count |
| 236 | * is not NULL and its value is not optional, verify that it is not 0. If the |
| 237 | * array parameter is NULL, and it is not optional, verify that count is 0. |
| 238 | * The array parameter will typically be optional for this case (where count is |
| 239 | * a pointer), allowing the caller to retrieve the available count. |
| 240 | * |
| 241 | * @param apiName Name of API call being validated. |
| 242 | * @param countName Name of count parameter. |
| 243 | * @param arrayName Name of array parameter. |
| 244 | * @param count Pointer to the number of elements in the array. |
| 245 | * @param array Array to validate. |
| 246 | * @param countPtrRequired The 'count' parameter may not be NULL when true. |
| 247 | * @param countValueRequired The '*count' value may not be 0 when true. |
| 248 | * @param arrayRequired The 'array' parameter may not be NULL when true. |
sfricke-samsung | 817d27c | 2020-12-01 22:22:56 -0800 | [diff] [blame] | 249 | * @param count_required_vuid The VUID for the '*count' parameter. |
| 250 | * @param array_required_vuid The VUID for the 'array' parameter. |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 251 | * @return Boolean value indicating that the call should be skipped. |
| 252 | */ |
| 253 | template <typename T1, typename T2> |
Mark Lobodzinski | bf599b9 | 2018-12-31 12:15:55 -0700 | [diff] [blame] | 254 | bool validate_array(const char *apiName, const ParameterName &countName, const ParameterName &arrayName, const T1 *count, |
| 255 | const T2 *array, bool countPtrRequired, bool countValueRequired, bool arrayRequired, |
Jeff Bolz | 46c0ea0 | 2019-10-09 13:06:29 -0500 | [diff] [blame] | 256 | const char *count_required_vuid, const char *array_required_vuid) const { |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 257 | bool skip_call = false; |
| 258 | |
Mike Schuchardt | f39a8dc | 2021-04-19 08:55:48 -0700 | [diff] [blame] | 259 | if (count == nullptr) { |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 260 | if (countPtrRequired) { |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 261 | skip_call |= LogError(device, kVUID_PVError_RequiredParameter, "%s: required parameter %s specified as NULL", |
| 262 | apiName, countName.get_name().c_str()); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 263 | } |
| 264 | } else { |
Mark Lobodzinski | bf599b9 | 2018-12-31 12:15:55 -0700 | [diff] [blame] | 265 | skip_call |= validate_array(apiName, countName, arrayName, *array ? (*count) : 0, &array, countValueRequired, |
| 266 | arrayRequired, count_required_vuid, array_required_vuid); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 267 | } |
| 268 | |
| 269 | return skip_call; |
| 270 | } |
| 271 | |
| 272 | /** |
| 273 | * Validate a pointer to a Vulkan structure. |
| 274 | * |
| 275 | * Verify that a required pointer to a structure is not NULL. If the pointer is |
| 276 | * not NULL, verify that each structure's sType field is set to the correct |
| 277 | * VkStructureType value. |
| 278 | * |
| 279 | * @param apiName Name of API call being validated. |
| 280 | * @param parameterName Name of struct parameter being validated. |
| 281 | * @param sTypeName Name of expected VkStructureType value. |
| 282 | * @param value Pointer to the struct to validate. |
| 283 | * @param sType VkStructureType for structure validation. |
| 284 | * @param required The parameter may not be NULL when true. |
| 285 | * @return Boolean value indicating that the call should be skipped. |
| 286 | */ |
| 287 | template <typename T> |
Mark Lobodzinski | bf599b9 | 2018-12-31 12:15:55 -0700 | [diff] [blame] | 288 | bool validate_struct_type(const char *apiName, const ParameterName ¶meterName, const char *sTypeName, const T *value, |
Jeff Bolz | 46c0ea0 | 2019-10-09 13:06:29 -0500 | [diff] [blame] | 289 | VkStructureType sType, bool required, const char *struct_vuid, const char *stype_vuid) const { |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 290 | bool skip_call = false; |
| 291 | |
Mike Schuchardt | f39a8dc | 2021-04-19 08:55:48 -0700 | [diff] [blame] | 292 | if (value == nullptr) { |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 293 | if (required) { |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 294 | skip_call |= LogError(device, struct_vuid, "%s: required parameter %s specified as NULL", apiName, |
| 295 | parameterName.get_name().c_str()); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 296 | } |
| 297 | } else if (value->sType != sType) { |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 298 | skip_call |= LogError(device, stype_vuid, "%s: parameter %s->sType must be %s.", apiName, |
| 299 | parameterName.get_name().c_str(), sTypeName); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 300 | } |
| 301 | |
| 302 | return skip_call; |
| 303 | } |
| 304 | |
| 305 | /** |
| 306 | * Validate an array of Vulkan structures |
| 307 | * |
| 308 | * Verify that required count and array parameters are not 0 or NULL. If |
| 309 | * the array contains 1 or more structures, verify that each structure's |
| 310 | * sType field is set to the correct VkStructureType value. |
| 311 | * |
| 312 | * @param apiName Name of API call being validated. |
| 313 | * @param countName Name of count parameter. |
| 314 | * @param arrayName Name of array parameter. |
| 315 | * @param sTypeName Name of expected VkStructureType value. |
| 316 | * @param count Number of elements in the array. |
| 317 | * @param array Array to validate. |
| 318 | * @param sType VkStructureType for structure validation. |
| 319 | * @param countRequired The 'count' parameter may not be 0 when true. |
| 320 | * @param arrayRequired The 'array' parameter may not be NULL when true. |
| 321 | * @return Boolean value indicating that the call should be skipped. |
| 322 | */ |
| 323 | template <typename T> |
Mark Lobodzinski | bf599b9 | 2018-12-31 12:15:55 -0700 | [diff] [blame] | 324 | bool validate_struct_type_array(const char *apiName, const ParameterName &countName, const ParameterName &arrayName, |
| 325 | const char *sTypeName, uint32_t count, const T *array, VkStructureType sType, |
Jasper St. Pierre | 6c98f8c | 2019-01-22 15:18:03 -0800 | [diff] [blame] | 326 | bool countRequired, bool arrayRequired, const char *stype_vuid, const char *param_vuid, |
Jeff Bolz | 46c0ea0 | 2019-10-09 13:06:29 -0500 | [diff] [blame] | 327 | const char *count_required_vuid) const { |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 328 | bool skip_call = false; |
| 329 | |
Mike Schuchardt | f39a8dc | 2021-04-19 08:55:48 -0700 | [diff] [blame] | 330 | if ((count == 0) || (array == nullptr)) { |
Jasper St. Pierre | 6c98f8c | 2019-01-22 15:18:03 -0800 | [diff] [blame] | 331 | skip_call |= validate_array(apiName, countName, arrayName, count, &array, countRequired, arrayRequired, |
| 332 | count_required_vuid, param_vuid); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 333 | } else { |
| 334 | // Verify that all structs in the array have the correct type |
| 335 | for (uint32_t i = 0; i < count; ++i) { |
| 336 | if (array[i].sType != sType) { |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 337 | skip_call |= LogError(device, stype_vuid, "%s: parameter %s[%d].sType must be %s", apiName, |
| 338 | arrayName.get_name().c_str(), i, sTypeName); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 339 | } |
| 340 | } |
| 341 | } |
| 342 | |
| 343 | return skip_call; |
| 344 | } |
sourav parmar | cd5fb18 | 2020-07-17 12:58:44 -0700 | [diff] [blame] | 345 | |
| 346 | /** |
| 347 | * Validate an pointer type array of Vulkan structures |
| 348 | * |
| 349 | * Verify that required count and array parameters are not 0 or NULL. If |
| 350 | * the array contains 1 or more structures, verify that each structure's |
| 351 | * sType field is set to the correct VkStructureType value. |
| 352 | * |
| 353 | * @param apiName Name of API call being validated. |
| 354 | * @param countName Name of count parameter. |
| 355 | * @param arrayName Name of array parameter. |
| 356 | * @param sTypeName Name of expected VkStructureType value. |
| 357 | * @param count Number of elements in the array. |
| 358 | * @param array Array to validate. |
| 359 | * @param sType VkStructureType for structure validation. |
| 360 | * @param countRequired The 'count' parameter may not be 0 when true. |
| 361 | * @param arrayRequired The 'array' parameter may not be NULL when true. |
| 362 | * @return Boolean value indicating that the call should be skipped. |
| 363 | */ |
Mike Schuchardt | bf67ad2 | 2020-07-06 17:29:55 -0700 | [diff] [blame] | 364 | template <typename T> |
| 365 | bool validate_struct_pointer_type_array(const char *apiName, const ParameterName &countName, const ParameterName &arrayName, |
sourav parmar | cd5fb18 | 2020-07-17 12:58:44 -0700 | [diff] [blame] | 366 | const char *sTypeName, uint32_t count, const T *array, VkStructureType sType, |
| 367 | bool countRequired, bool arrayRequired, const char *stype_vuid, const char *param_vuid, |
| 368 | const char *count_required_vuid) const { |
Mike Schuchardt | bf67ad2 | 2020-07-06 17:29:55 -0700 | [diff] [blame] | 369 | bool skip_call = false; |
| 370 | |
Mike Schuchardt | f39a8dc | 2021-04-19 08:55:48 -0700 | [diff] [blame] | 371 | if ((count == 0) || (array == nullptr)) { |
Mike Schuchardt | bf67ad2 | 2020-07-06 17:29:55 -0700 | [diff] [blame] | 372 | skip_call |= validate_array(apiName, countName, arrayName, count, &array, countRequired, arrayRequired, |
| 373 | count_required_vuid, param_vuid); |
| 374 | } else { |
| 375 | // Verify that all structs in the array have the correct type |
| 376 | for (uint32_t i = 0; i < count; ++i) { |
| 377 | if (array[i]->sType != sType) { |
| 378 | skip_call |= LogError(device, stype_vuid, "%s: parameter %s[%d]->sType must be %s", apiName, |
| 379 | arrayName.get_name().c_str(), i, sTypeName); |
| 380 | } |
| 381 | } |
| 382 | } |
| 383 | |
| 384 | return skip_call; |
| 385 | } |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 386 | |
| 387 | /** |
| 388 | * Validate an array of Vulkan structures. |
| 389 | * |
| 390 | * Verify that required count and array parameters are not NULL. If count |
| 391 | * is not NULL and its value is not optional, verify that it is not 0. |
| 392 | * If the array contains 1 or more structures, verify that each structure's |
| 393 | * sType field is set to the correct VkStructureType value. |
| 394 | * |
| 395 | * @param apiName Name of API call being validated. |
| 396 | * @param countName Name of count parameter. |
| 397 | * @param arrayName Name of array parameter. |
| 398 | * @param sTypeName Name of expected VkStructureType value. |
| 399 | * @param count Pointer to the number of elements in the array. |
| 400 | * @param array Array to validate. |
| 401 | * @param sType VkStructureType for structure validation. |
| 402 | * @param countPtrRequired The 'count' parameter may not be NULL when true. |
| 403 | * @param countValueRequired The '*count' value may not be 0 when true. |
| 404 | * @param arrayRequired The 'array' parameter may not be NULL when true. |
| 405 | * @return Boolean value indicating that the call should be skipped. |
| 406 | */ |
| 407 | template <typename T> |
Mark Lobodzinski | bf599b9 | 2018-12-31 12:15:55 -0700 | [diff] [blame] | 408 | bool validate_struct_type_array(const char *apiName, const ParameterName &countName, const ParameterName &arrayName, |
| 409 | const char *sTypeName, uint32_t *count, const T *array, VkStructureType sType, |
Jeff Bolz | fdd0d85 | 2019-02-03 21:55:12 -0600 | [diff] [blame] | 410 | bool countPtrRequired, bool countValueRequired, bool arrayRequired, const char *stype_vuid, |
Jeff Bolz | 46c0ea0 | 2019-10-09 13:06:29 -0500 | [diff] [blame] | 411 | const char *param_vuid, const char *count_required_vuid) const { |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 412 | bool skip_call = false; |
| 413 | |
Mike Schuchardt | f39a8dc | 2021-04-19 08:55:48 -0700 | [diff] [blame] | 414 | if (count == nullptr) { |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 415 | if (countPtrRequired) { |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 416 | skip_call |= LogError(device, kVUID_PVError_RequiredParameter, "%s: required parameter %s specified as NULL", |
| 417 | apiName, countName.get_name().c_str()); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 418 | } |
| 419 | } else { |
| 420 | skip_call |= validate_struct_type_array(apiName, countName, arrayName, sTypeName, (*count), array, sType, |
Mark Lobodzinski | 75a3881 | 2019-12-10 15:22:52 -0700 | [diff] [blame] | 421 | countValueRequired && (array != nullptr), arrayRequired, stype_vuid, param_vuid, |
| 422 | count_required_vuid); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 423 | } |
| 424 | |
| 425 | return skip_call; |
| 426 | } |
| 427 | |
| 428 | /** |
| 429 | * Validate a Vulkan handle. |
| 430 | * |
| 431 | * Verify that the specified handle is not VK_NULL_HANDLE. |
| 432 | * |
| 433 | * @param api_name Name of API call being validated. |
| 434 | * @param parameter_name Name of struct parameter being validated. |
| 435 | * @param value Handle to validate. |
| 436 | * @return Boolean value indicating that the call should be skipped. |
| 437 | */ |
| 438 | template <typename T> |
Jeff Bolz | 46c0ea0 | 2019-10-09 13:06:29 -0500 | [diff] [blame] | 439 | bool validate_required_handle(const char *api_name, const ParameterName ¶meter_name, T value) const { |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 440 | bool skip_call = false; |
| 441 | |
| 442 | if (value == VK_NULL_HANDLE) { |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 443 | skip_call |= LogError(device, kVUID_PVError_RequiredParameter, "%s: required parameter %s specified as VK_NULL_HANDLE", |
| 444 | api_name, parameter_name.get_name().c_str()); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 445 | } |
| 446 | |
| 447 | return skip_call; |
| 448 | } |
| 449 | |
| 450 | /** |
| 451 | * Validate an array of Vulkan handles. |
| 452 | * |
| 453 | * Verify that required count and array parameters are not NULL. If count |
| 454 | * is not NULL and its value is not optional, verify that it is not 0. |
| 455 | * If the array contains 1 or more handles, verify that no handle is set to |
| 456 | * VK_NULL_HANDLE. |
| 457 | * |
| 458 | * @note This function is only intended to validate arrays of handles when none |
| 459 | * of the handles are allowed to be VK_NULL_HANDLE. For arrays of handles |
| 460 | * that are allowed to contain VK_NULL_HANDLE, use validate_array() instead. |
| 461 | * |
| 462 | * @param api_name Name of API call being validated. |
| 463 | * @param count_name Name of count parameter. |
| 464 | * @param array_name Name of array parameter. |
| 465 | * @param count Number of elements in the array. |
| 466 | * @param array Array to validate. |
| 467 | * @param count_required The 'count' parameter may not be 0 when true. |
| 468 | * @param array_required The 'array' parameter may not be NULL when true. |
sfricke-samsung | 817d27c | 2020-12-01 22:22:56 -0800 | [diff] [blame] | 469 | * @param count_required_vuid The VUID for the '*count' parameter. |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 470 | * @return Boolean value indicating that the call should be skipped. |
| 471 | */ |
| 472 | template <typename T> |
Mark Lobodzinski | bf599b9 | 2018-12-31 12:15:55 -0700 | [diff] [blame] | 473 | bool validate_handle_array(const char *api_name, const ParameterName &count_name, const ParameterName &array_name, |
sfricke-samsung | 817d27c | 2020-12-01 22:22:56 -0800 | [diff] [blame] | 474 | uint32_t count, const T *array, bool count_required, bool array_required, |
| 475 | const char *count_required_vuid) const { |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 476 | bool skip_call = false; |
| 477 | |
Mike Schuchardt | f39a8dc | 2021-04-19 08:55:48 -0700 | [diff] [blame] | 478 | if ((count == 0) || (array == nullptr)) { |
Mark Lobodzinski | bf599b9 | 2018-12-31 12:15:55 -0700 | [diff] [blame] | 479 | skip_call |= validate_array(api_name, count_name, array_name, count, &array, count_required, array_required, |
sfricke-samsung | 817d27c | 2020-12-01 22:22:56 -0800 | [diff] [blame] | 480 | count_required_vuid, kVUIDUndefined); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 481 | } else { |
| 482 | // Verify that no handles in the array are VK_NULL_HANDLE |
| 483 | for (uint32_t i = 0; i < count; ++i) { |
| 484 | if (array[i] == VK_NULL_HANDLE) { |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 485 | skip_call |= LogError(device, kVUID_PVError_RequiredParameter, |
| 486 | "%s: required parameter %s[%d] specified as VK_NULL_HANDLE", api_name, |
| 487 | array_name.get_name().c_str(), i); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 488 | } |
| 489 | } |
| 490 | } |
| 491 | |
| 492 | return skip_call; |
| 493 | } |
| 494 | |
| 495 | /** |
| 496 | * Validate string array count and content. |
| 497 | * |
| 498 | * Verify that required count and array parameters are not 0 or NULL. If the |
| 499 | * count parameter is not optional, verify that it is not 0. If the array |
| 500 | * parameter is NULL, and it is not optional, verify that count is 0. If the |
| 501 | * array parameter is not NULL, verify that none of the strings are NULL. |
| 502 | * |
| 503 | * @param apiName Name of API call being validated. |
| 504 | * @param countName Name of count parameter. |
| 505 | * @param arrayName Name of array parameter. |
| 506 | * @param count Number of strings in the array. |
| 507 | * @param array Array of strings to validate. |
| 508 | * @param countRequired The 'count' parameter may not be 0 when true. |
| 509 | * @param arrayRequired The 'array' parameter may not be NULL when true. |
| 510 | * @return Boolean value indicating that the call should be skipped. |
| 511 | */ |
Mark Lobodzinski | bf599b9 | 2018-12-31 12:15:55 -0700 | [diff] [blame] | 512 | bool validate_string_array(const char *apiName, const ParameterName &countName, const ParameterName &arrayName, uint32_t count, |
Jeff Bolz | fdd0d85 | 2019-02-03 21:55:12 -0600 | [diff] [blame] | 513 | const char *const *array, bool countRequired, bool arrayRequired, const char *count_required_vuid, |
Jeff Bolz | 46c0ea0 | 2019-10-09 13:06:29 -0500 | [diff] [blame] | 514 | const char *array_required_vuid) const { |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 515 | bool skip_call = false; |
| 516 | |
Mike Schuchardt | f39a8dc | 2021-04-19 08:55:48 -0700 | [diff] [blame] | 517 | if ((count == 0) || (array == nullptr)) { |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 518 | skip_call |= validate_array(apiName, countName, arrayName, count, &array, countRequired, arrayRequired, |
| 519 | count_required_vuid, array_required_vuid); |
| 520 | } else { |
| 521 | // Verify that strings in the array are not NULL |
| 522 | for (uint32_t i = 0; i < count; ++i) { |
Mike Schuchardt | f39a8dc | 2021-04-19 08:55:48 -0700 | [diff] [blame] | 523 | if (array[i] == nullptr) { |
Mark Lobodzinski | 525c129 | 2020-10-30 16:00:00 -0600 | [diff] [blame] | 524 | skip_call |= LogError(device, array_required_vuid, "%s: required parameter %s[%d] specified as NULL", apiName, |
| 525 | arrayName.get_name().c_str(), i); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 526 | } |
| 527 | } |
| 528 | } |
| 529 | |
| 530 | return skip_call; |
| 531 | } |
| 532 | |
Mark Lobodzinski | 2e40a13 | 2020-08-10 14:51:41 -0600 | [diff] [blame] | 533 | // Forward declarations |
| 534 | bool CheckPromotedApiAgainstVulkanVersion(VkInstance instance, const char *api_name, const uint32_t promoted_version) const; |
| 535 | bool CheckPromotedApiAgainstVulkanVersion(VkPhysicalDevice pdev, const char *api_name, const uint32_t promoted_version) const; |
Mark Lobodzinski | bece6c1 | 2020-08-27 15:34:02 -0600 | [diff] [blame] | 536 | bool SupportedByPdev(const VkPhysicalDevice physical_device, const std::string ext_name) const; |
Mark Lobodzinski | 2e40a13 | 2020-08-10 14:51:41 -0600 | [diff] [blame] | 537 | |
Mark Lobodzinski | 3e66ae8 | 2020-08-12 16:27:29 -0600 | [diff] [blame] | 538 | bool ValidatePnextStructContents(const char *api_name, const ParameterName ¶meter_name, const VkBaseOutStructure *header, |
Nathaniel Cesario | 5f45f0e | 2021-09-09 17:44:32 -0600 | [diff] [blame] | 539 | const char *pnext_vuid, bool is_physdev_api = false, bool is_const_param = true) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 540 | |
| 541 | /** |
| 542 | * Validate a structure's pNext member. |
| 543 | * |
| 544 | * Verify that the specified pNext value points to the head of a list of |
| 545 | * allowed extension structures. If no extension structures are allowed, |
| 546 | * verify that pNext is null. |
| 547 | * |
| 548 | * @param api_name Name of API call being validated. |
| 549 | * @param parameter_name Name of parameter being validated. |
| 550 | * @param allowed_struct_names Names of allowed structs. |
| 551 | * @param next Pointer to validate. |
| 552 | * @param allowed_type_count Total number of allowed structure types. |
| 553 | * @param allowed_types Array of structure types allowed for pNext. |
| 554 | * @param header_version Version of header defining the pNext validation rules. |
| 555 | * @return Boolean value indicating that the call should be skipped. |
| 556 | */ |
Mark Lobodzinski | bf599b9 | 2018-12-31 12:15:55 -0700 | [diff] [blame] | 557 | bool validate_struct_pnext(const char *api_name, const ParameterName ¶meter_name, const char *allowed_struct_names, |
| 558 | const void *next, size_t allowed_type_count, const VkStructureType *allowed_types, |
Nathaniel Cesario | e0c387b | 2021-09-02 13:51:34 -0600 | [diff] [blame] | 559 | uint32_t header_version, const char *pnext_vuid, const char *stype_vuid, |
Nathaniel Cesario | 5f45f0e | 2021-09-09 17:44:32 -0600 | [diff] [blame] | 560 | const bool is_physdev_api = false, const bool is_const_param = true) const { |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 561 | bool skip_call = false; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 562 | |
Mike Schuchardt | f39a8dc | 2021-04-19 08:55:48 -0700 | [diff] [blame] | 563 | if (next != nullptr) { |
Jeremy Gebben | cbf2286 | 2021-03-03 12:01:22 -0700 | [diff] [blame] | 564 | layer_data::unordered_set<const void *> cycle_check; |
| 565 | layer_data::unordered_set<VkStructureType, layer_data::hash<int>> unique_stype_check; |
Jeff Bolz | fdd0d85 | 2019-02-03 21:55:12 -0600 | [diff] [blame] | 566 | |
Jeff Bolz | 6d3beaa | 2019-02-09 21:00:05 -0600 | [diff] [blame] | 567 | const char *disclaimer = |
Mark Lobodzinski | 3e66ae8 | 2020-08-12 16:27:29 -0600 | [diff] [blame] | 568 | "This error is based on the Valid Usage documentation for version %d of the Vulkan header. It is possible that " |
| 569 | "you are using a struct from a private extension or an extension that was added to a later version of the Vulkan " |
| 570 | "header, in which case the use of %s is undefined and may not work correctly with validation enabled"; |
Jeff Bolz | 6d3beaa | 2019-02-09 21:00:05 -0600 | [diff] [blame] | 571 | |
Mark Lobodzinski | 3e66ae8 | 2020-08-12 16:27:29 -0600 | [diff] [blame] | 572 | if ((allowed_type_count == 0) && (custom_stype_info.size() == 0)) { |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 573 | std::string message = "%s: value of %s must be NULL. "; |
| 574 | message += disclaimer; |
Mark Lobodzinski | 3e66ae8 | 2020-08-12 16:27:29 -0600 | [diff] [blame] | 575 | skip_call |= LogError(device, pnext_vuid, message.c_str(), api_name, parameter_name.get_name().c_str(), |
| 576 | header_version, parameter_name.get_name().c_str()); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 577 | } else { |
| 578 | const VkStructureType *start = allowed_types; |
| 579 | const VkStructureType *end = allowed_types + allowed_type_count; |
Locke | fbdd1af | 2019-04-16 15:07:23 -0600 | [diff] [blame] | 580 | const VkBaseOutStructure *current = reinterpret_cast<const VkBaseOutStructure *>(next); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 581 | |
Mike Schuchardt | f39a8dc | 2021-04-19 08:55:48 -0700 | [diff] [blame] | 582 | while (current != nullptr) { |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 583 | if (((strncmp(api_name, "vkCreateInstance", strlen(api_name)) != 0) || |
| 584 | (current->sType != VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO)) && |
| 585 | ((strncmp(api_name, "vkCreateDevice", strlen(api_name)) != 0) || |
| 586 | (current->sType != VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO))) { |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 587 | std::string type_name = string_VkStructureType(current->sType); |
Nathaniel Cesario | 78c1cdd | 2021-04-01 23:13:33 -0600 | [diff] [blame] | 588 | if (unique_stype_check.find(current->sType) != unique_stype_check.end() && |
| 589 | !IsDuplicatePnext(current->sType)) { |
sfricke-samsung | 32a2736 | 2020-02-28 09:06:42 -0800 | [diff] [blame] | 590 | // stype_vuid will only be null if there are no listed pNext and will hit disclaimer check |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 591 | std::string message = "%s: %s chain contains duplicate structure types: %s appears multiple times."; |
sfricke-samsung | 32a2736 | 2020-02-28 09:06:42 -0800 | [diff] [blame] | 592 | skip_call |= LogError(device, stype_vuid, message.c_str(), api_name, parameter_name.get_name().c_str(), |
| 593 | type_name.c_str()); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 594 | } else { |
| 595 | unique_stype_check.insert(current->sType); |
| 596 | } |
| 597 | |
Mark Lobodzinski | 3e66ae8 | 2020-08-12 16:27:29 -0600 | [diff] [blame] | 598 | // Search custom stype list -- if sType found, skip this entirely |
| 599 | bool custom = false; |
John Zulauf | 79f0658 | 2021-02-27 18:38:39 -0700 | [diff] [blame] | 600 | for (const auto &item : custom_stype_info) { |
Mark Lobodzinski | 3e66ae8 | 2020-08-12 16:27:29 -0600 | [diff] [blame] | 601 | if (item.first == current->sType) { |
| 602 | custom = true; |
| 603 | break; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 604 | } |
| 605 | } |
Mark Lobodzinski | 3e66ae8 | 2020-08-12 16:27:29 -0600 | [diff] [blame] | 606 | if (!custom) { |
| 607 | if (std::find(start, end, current->sType) == end) { |
| 608 | if (type_name.compare(UnsupportedStructureTypeString) == 0) { |
| 609 | std::string message = |
| 610 | "%s: %s chain includes a structure with unknown VkStructureType (%d); Allowed structures " |
| 611 | "are [%s]. "; |
| 612 | message += disclaimer; |
| 613 | skip_call |= LogError(device, pnext_vuid, message.c_str(), api_name, |
| 614 | parameter_name.get_name().c_str(), current->sType, allowed_struct_names, |
| 615 | header_version, parameter_name.get_name().c_str()); |
| 616 | } else { |
| 617 | std::string message = |
| 618 | "%s: %s chain includes a structure with unexpected VkStructureType %s; Allowed structures " |
| 619 | "are [%s]. "; |
| 620 | message += disclaimer; |
| 621 | skip_call |= LogError(device, pnext_vuid, message.c_str(), api_name, |
| 622 | parameter_name.get_name().c_str(), type_name.c_str(), |
| 623 | allowed_struct_names, header_version, parameter_name.get_name().c_str()); |
| 624 | } |
| 625 | } |
Nathaniel Cesario | 5f45f0e | 2021-09-09 17:44:32 -0600 | [diff] [blame] | 626 | skip_call |= ValidatePnextStructContents(api_name, parameter_name, current, pnext_vuid, is_physdev_api, |
| 627 | is_const_param); |
Mark Lobodzinski | 3e66ae8 | 2020-08-12 16:27:29 -0600 | [diff] [blame] | 628 | } |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 629 | } |
Locke | fbdd1af | 2019-04-16 15:07:23 -0600 | [diff] [blame] | 630 | current = reinterpret_cast<const VkBaseOutStructure *>(current->pNext); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 631 | } |
| 632 | } |
| 633 | } |
| 634 | |
| 635 | return skip_call; |
| 636 | } |
| 637 | |
| 638 | /** |
| 639 | * Validate a VkBool32 value. |
| 640 | * |
Mark Lobodzinski | 9d85750 | 2020-10-19 09:47:11 -0600 | [diff] [blame] | 641 | * Generate an error if a VkBool32 value is neither VK_TRUE nor VK_FALSE. |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 642 | * |
| 643 | * @param apiName Name of API call being validated. |
| 644 | * @param parameterName Name of parameter being validated. |
| 645 | * @param value Boolean value to validate. |
| 646 | * @return Boolean value indicating that the call should be skipped. |
| 647 | */ |
Jeff Bolz | 46c0ea0 | 2019-10-09 13:06:29 -0500 | [diff] [blame] | 648 | bool validate_bool32(const char *apiName, const ParameterName ¶meterName, VkBool32 value) const { |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 649 | bool skip_call = false; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 650 | if ((value != VK_TRUE) && (value != VK_FALSE)) { |
Mark Lobodzinski | 9d85750 | 2020-10-19 09:47:11 -0600 | [diff] [blame] | 651 | skip_call |= LogError(device, kVUID_PVError_UnrecognizedValue, |
| 652 | "%s: value of %s (%d) is neither VK_TRUE nor VK_FALSE. Applications MUST not pass any other " |
| 653 | "values than VK_TRUE or VK_FALSE into a Vulkan implementation where a VkBool32 is expected.", |
| 654 | apiName, parameterName.get_name().c_str(), value); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 655 | } |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 656 | return skip_call; |
| 657 | } |
| 658 | |
| 659 | /** |
Mike Schuchardt | f39a8dc | 2021-04-19 08:55:48 -0700 | [diff] [blame] | 660 | * Validate an array of VkBool32 values. |
| 661 | * |
| 662 | * Generate an error if any VkBool32 value in an array is neither VK_TRUE nor VK_FALSE. |
| 663 | * |
| 664 | * @param apiName Name of API call being validated. |
| 665 | * @param countName Name of count parameter. |
| 666 | * @param arrayName Name of array parameter. |
| 667 | * @param count Number of values in the array. |
| 668 | * @param array Array of VkBool32 values to validate. |
| 669 | * @param countRequired The 'count' parameter may not be 0 when true. |
| 670 | * @param arrayRequired The 'array' parameter may not be NULL when true. |
| 671 | * @return Boolean value indicating that the call should be skipped. |
| 672 | */ |
| 673 | bool validate_bool32_array(const char *apiName, const ParameterName &countName, const ParameterName &arrayName, uint32_t count, |
| 674 | const VkBool32 *array, bool countRequired, bool arrayRequired) const { |
| 675 | bool skip_call = false; |
| 676 | |
| 677 | if ((count == 0) || (array == nullptr)) { |
| 678 | skip_call |= validate_array(apiName, countName, arrayName, count, &array, countRequired, arrayRequired, kVUIDUndefined, |
| 679 | kVUIDUndefined); |
| 680 | } else { |
| 681 | for (uint32_t i = 0; i < count; ++i) { |
| 682 | if ((array[i] != VK_TRUE) && (array[i] != VK_FALSE)) { |
| 683 | skip_call |= |
| 684 | LogError(device, kVUID_PVError_UnrecognizedValue, |
| 685 | "%s: value of %s[%d] (%d) is neither VK_TRUE nor VK_FALSE. Applications MUST not pass any other " |
| 686 | "values than VK_TRUE or VK_FALSE into a Vulkan implementation where a VkBool32 is expected.", |
| 687 | apiName, arrayName.get_name().c_str(), i, array[i]); |
| 688 | } |
| 689 | } |
| 690 | } |
| 691 | |
| 692 | return skip_call; |
| 693 | } |
| 694 | |
| 695 | /** |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 696 | * Validate a Vulkan enumeration value. |
| 697 | * |
| 698 | * Generate a warning if an enumeration token value does not fall within the core enumeration |
| 699 | * begin and end token values, and was not added to the enumeration by an extension. Extension |
| 700 | * provided enumerations use the equation specified in Appendix C.10 of the Vulkan specification, |
| 701 | * with 1,000,000,000 as the base token value. |
| 702 | * |
| 703 | * @note This function does not expect to process enumerations defining bitmask flag bits. |
| 704 | * |
| 705 | * @param apiName Name of API call being validated. |
| 706 | * @param parameterName Name of parameter being validated. |
| 707 | * @param enumName Name of the enumeration being validated. |
| 708 | * @param valid_values The list of valid values for the enumeration. |
| 709 | * @param value Enumeration value to validate. |
| 710 | * @return Boolean value indicating that the call should be skipped. |
| 711 | */ |
| 712 | template <typename T> |
Mark Lobodzinski | bf599b9 | 2018-12-31 12:15:55 -0700 | [diff] [blame] | 713 | bool validate_ranged_enum(const char *apiName, const ParameterName ¶meterName, const char *enumName, |
Jeff Bolz | 46c0ea0 | 2019-10-09 13:06:29 -0500 | [diff] [blame] | 714 | const std::vector<T> &valid_values, T value, const char *vuid) const { |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 715 | bool skip = false; |
| 716 | |
| 717 | if (std::find(valid_values.begin(), valid_values.end(), value) == valid_values.end()) { |
| 718 | skip |= |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 719 | LogError(device, vuid, |
| 720 | "%s: value of %s (%d) does not fall within the begin..end range of the core %s enumeration tokens and is " |
| 721 | "not an extension added token.", |
| 722 | apiName, parameterName.get_name().c_str(), value, enumName); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 723 | } |
| 724 | |
| 725 | return skip; |
| 726 | } |
| 727 | |
| 728 | /** |
| 729 | * Validate an array of Vulkan enumeration value. |
| 730 | * |
| 731 | * Process all enumeration token values in the specified array and generate a warning if a value |
| 732 | * does not fall within the core enumeration begin and end token values, and was not added to |
| 733 | * the enumeration by an extension. Extension provided enumerations use the equation specified |
| 734 | * in Appendix C.10 of the Vulkan specification, with 1,000,000,000 as the base token value. |
| 735 | * |
| 736 | * @note This function does not expect to process enumerations defining bitmask flag bits. |
| 737 | * |
| 738 | * @param apiName Name of API call being validated. |
| 739 | * @param countName Name of count parameter. |
| 740 | * @param arrayName Name of array parameter. |
| 741 | * @param enumName Name of the enumeration being validated. |
| 742 | * @param valid_values The list of valid values for the enumeration. |
| 743 | * @param count Number of enumeration values in the array. |
| 744 | * @param array Array of enumeration values to validate. |
| 745 | * @param countRequired The 'count' parameter may not be 0 when true. |
| 746 | * @param arrayRequired The 'array' parameter may not be NULL when true. |
| 747 | * @return Boolean value indicating that the call should be skipped. |
| 748 | */ |
| 749 | template <typename T> |
Mark Lobodzinski | bf599b9 | 2018-12-31 12:15:55 -0700 | [diff] [blame] | 750 | bool validate_ranged_enum_array(const char *apiName, const ParameterName &countName, const ParameterName &arrayName, |
| 751 | const char *enumName, const std::vector<T> &valid_values, uint32_t count, const T *array, |
Jeff Bolz | 46c0ea0 | 2019-10-09 13:06:29 -0500 | [diff] [blame] | 752 | bool countRequired, bool arrayRequired) const { |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 753 | bool skip_call = false; |
| 754 | |
Mike Schuchardt | f39a8dc | 2021-04-19 08:55:48 -0700 | [diff] [blame] | 755 | if ((count == 0) || (array == nullptr)) { |
Mark Lobodzinski | bf599b9 | 2018-12-31 12:15:55 -0700 | [diff] [blame] | 756 | skip_call |= validate_array(apiName, countName, arrayName, count, &array, countRequired, arrayRequired, kVUIDUndefined, |
| 757 | kVUIDUndefined); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 758 | } else { |
| 759 | for (uint32_t i = 0; i < count; ++i) { |
| 760 | if (std::find(valid_values.begin(), valid_values.end(), array[i]) == valid_values.end()) { |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 761 | skip_call |= LogError(device, kVUID_PVError_UnrecognizedValue, |
| 762 | "%s: value of %s[%d] (%d) does not fall within the begin..end range of the core %s " |
| 763 | "enumeration tokens and is not an extension added token", |
| 764 | apiName, arrayName.get_name().c_str(), i, array[i], enumName); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 765 | } |
| 766 | } |
| 767 | } |
| 768 | |
| 769 | return skip_call; |
| 770 | } |
| 771 | |
Nathaniel Cesario | 45efaac | 2022-04-11 17:04:33 -0600 | [diff] [blame] | 772 | template <typename T> |
| 773 | bool validate_ranged_enum_array(const char *apiName, const char *vuid, const ParameterName &countName, |
| 774 | const ParameterName &arrayName, const char *enumName, const std::vector<T> &valid_values, |
| 775 | uint32_t count, const T *array, bool countRequired, bool arrayRequired) const { |
| 776 | bool skip_call = false; |
| 777 | |
| 778 | if ((count == 0) || (array == nullptr)) { |
| 779 | skip_call |= validate_array(apiName, countName, arrayName, count, &array, countRequired, arrayRequired, vuid, vuid); |
| 780 | } else { |
| 781 | for (uint32_t i = 0; i < count; ++i) { |
| 782 | if (std::find(valid_values.begin(), valid_values.end(), array[i]) == valid_values.end()) { |
| 783 | skip_call |= LogError(device, vuid, |
| 784 | "%s: value of %s[%d] (%d) does not fall within the begin..end range of the core %s " |
| 785 | "enumeration tokens and is not an extension added token", |
| 786 | apiName, arrayName.get_name().c_str(), i, array[i], enumName); |
| 787 | } |
| 788 | } |
| 789 | } |
| 790 | |
| 791 | return skip_call; |
| 792 | } |
| 793 | |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 794 | /** |
| 795 | * Verify that a reserved VkFlags value is zero. |
| 796 | * |
| 797 | * Verify that the specified value is zero, to check VkFlags values that are reserved for |
| 798 | * future use. |
| 799 | * |
| 800 | * @param api_name Name of API call being validated. |
| 801 | * @param parameter_name Name of parameter being validated. |
| 802 | * @param value Value to validate. |
| 803 | * @return Boolean value indicating that the call should be skipped. |
| 804 | */ |
Jeff Bolz | 46c0ea0 | 2019-10-09 13:06:29 -0500 | [diff] [blame] | 805 | bool validate_reserved_flags(const char *api_name, const ParameterName ¶meter_name, VkFlags value, const char *vuid) const { |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 806 | bool skip_call = false; |
| 807 | |
| 808 | if (value != 0) { |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 809 | skip_call |= LogError(device, vuid, "%s: parameter %s must be 0.", api_name, parameter_name.get_name().c_str()); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 810 | } |
| 811 | |
| 812 | return skip_call; |
| 813 | } |
| 814 | |
Petr Kraus | 52758be | 2019-08-12 00:53:58 +0200 | [diff] [blame] | 815 | enum FlagType { kRequiredFlags, kOptionalFlags, kRequiredSingleBit, kOptionalSingleBit }; |
| 816 | |
Jeremy Gebben | 97e718e | 2021-02-15 07:39:51 -0700 | [diff] [blame] | 817 | // helper to implement validation of both 32 bit and 64 bit flags. |
| 818 | template <typename FlagTypedef> |
| 819 | bool validate_flags_impl(const char *api_name, const ParameterName ¶meter_name, const char *flag_bits_name, |
| 820 | FlagTypedef all_flags, FlagTypedef value, const FlagType flag_type, const char *vuid, |
| 821 | const char *flags_zero_vuid = nullptr) const { |
| 822 | bool skip_call = false; |
| 823 | |
| 824 | if ((value & ~all_flags) != 0) { |
| 825 | skip_call |= LogError(device, vuid, "%s: value of %s contains flag bits that are not recognized members of %s", |
| 826 | api_name, parameter_name.get_name().c_str(), flag_bits_name); |
| 827 | } |
| 828 | |
| 829 | const bool required = flag_type == kRequiredFlags || flag_type == kRequiredSingleBit; |
| 830 | const char *zero_vuid = flag_type == kRequiredFlags ? flags_zero_vuid : vuid; |
| 831 | if (required && value == 0) { |
| 832 | skip_call |= LogError(device, zero_vuid, "%s: value of %s must not be 0.", api_name, parameter_name.get_name().c_str()); |
| 833 | } |
| 834 | |
| 835 | const auto HasMaxOneBitSet = [](const FlagTypedef f) { |
| 836 | // Decrement flips bits from right upto first 1. |
| 837 | // Rest stays same, and if there was any other 1s &ded together they would be non-zero. QED |
| 838 | return f == 0 || !(f & (f - 1)); |
| 839 | }; |
| 840 | |
| 841 | const bool is_bits_type = flag_type == kRequiredSingleBit || flag_type == kOptionalSingleBit; |
| 842 | if (is_bits_type && !HasMaxOneBitSet(value)) { |
| 843 | skip_call |= |
| 844 | LogError(device, vuid, "%s: value of %s contains multiple members of %s when only a single value is allowed", |
| 845 | api_name, parameter_name.get_name().c_str(), flag_bits_name); |
| 846 | } |
| 847 | |
| 848 | return skip_call; |
| 849 | } |
| 850 | |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 851 | /** |
Jeremy Gebben | 97e718e | 2021-02-15 07:39:51 -0700 | [diff] [blame] | 852 | * Validate a 32 bit Vulkan bitmask value. |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 853 | * |
| 854 | * Generate a warning if a value with a VkFlags derived type does not contain valid flag bits |
| 855 | * for that type. |
| 856 | * |
| 857 | * @param api_name Name of API call being validated. |
| 858 | * @param parameter_name Name of parameter being validated. |
| 859 | * @param flag_bits_name Name of the VkFlags type being validated. |
| 860 | * @param all_flags A bit mask combining all valid flag bits for the VkFlags type being validated. |
| 861 | * @param value VkFlags value to validate. |
Petr Kraus | 52758be | 2019-08-12 00:53:58 +0200 | [diff] [blame] | 862 | * @param flag_type The type of flag, like optional, or single bit. |
| 863 | * @param vuid VUID used for flag that is outside defined bits (or has more than one bit for Bits type). |
| 864 | * @param flags_zero_vuid VUID used for non-optional Flags that are zero. |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 865 | * @return Boolean value indicating that the call should be skipped. |
| 866 | */ |
Mark Lobodzinski | bf599b9 | 2018-12-31 12:15:55 -0700 | [diff] [blame] | 867 | bool validate_flags(const char *api_name, const ParameterName ¶meter_name, const char *flag_bits_name, VkFlags all_flags, |
Jeff Bolz | 46c0ea0 | 2019-10-09 13:06:29 -0500 | [diff] [blame] | 868 | VkFlags value, const FlagType flag_type, const char *vuid, const char *flags_zero_vuid = nullptr) const { |
Jeremy Gebben | 97e718e | 2021-02-15 07:39:51 -0700 | [diff] [blame] | 869 | return validate_flags_impl<VkFlags>(api_name, parameter_name, flag_bits_name, all_flags, value, flag_type, vuid, |
| 870 | flags_zero_vuid); |
| 871 | } |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 872 | |
Jeremy Gebben | 97e718e | 2021-02-15 07:39:51 -0700 | [diff] [blame] | 873 | /** |
| 874 | * Validate a 64 bit Vulkan bitmask value. |
| 875 | * |
| 876 | * Generate a warning if a value with a VkFlags64 derived type does not contain valid flag bits |
| 877 | * for that type. |
| 878 | * |
| 879 | * @param api_name Name of API call being validated. |
| 880 | * @param parameter_name Name of parameter being validated. |
| 881 | * @param flag_bits_name Name of the VkFlags64 type being validated. |
| 882 | * @param all_flags A bit mask combining all valid flag bits for the VkFlags64 type being validated. |
| 883 | * @param value VkFlags64 value to validate. |
| 884 | * @param flag_type The type of flag, like optional, or single bit. |
| 885 | * @param vuid VUID used for flag that is outside defined bits (or has more than one bit for Bits type). |
| 886 | * @param flags_zero_vuid VUID used for non-optional Flags that are zero. |
| 887 | * @return Boolean value indicating that the call should be skipped. |
| 888 | */ |
| 889 | bool validate_flags(const char *api_name, const ParameterName ¶meter_name, const char *flag_bits_name, VkFlags64 all_flags, |
| 890 | VkFlags64 value, const FlagType flag_type, const char *vuid, const char *flags_zero_vuid = nullptr) const { |
| 891 | return validate_flags_impl<VkFlags64>(api_name, parameter_name, flag_bits_name, all_flags, value, flag_type, vuid, |
| 892 | flags_zero_vuid); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 893 | } |
| 894 | |
| 895 | /** |
| 896 | * Validate an array of Vulkan bitmask values. |
| 897 | * |
| 898 | * Generate a warning if a value with a VkFlags derived type does not contain valid flag bits |
| 899 | * for that type. |
| 900 | * |
| 901 | * @param api_name Name of API call being validated. |
| 902 | * @param count_name Name of parameter being validated. |
| 903 | * @param array_name Name of parameter being validated. |
| 904 | * @param flag_bits_name Name of the VkFlags type being validated. |
| 905 | * @param all_flags A bitmask combining all valid flag bits for the VkFlags type being validated. |
| 906 | * @param count Number of VkFlags values in the array. |
| 907 | * @param array Array of VkFlags value to validate. |
| 908 | * @param count_required The 'count' parameter may not be 0 when true. |
| 909 | * @param array_required The 'array' parameter may not be NULL when true. |
| 910 | * @return Boolean value indicating that the call should be skipped. |
| 911 | */ |
Mark Lobodzinski | bf599b9 | 2018-12-31 12:15:55 -0700 | [diff] [blame] | 912 | bool validate_flags_array(const char *api_name, const ParameterName &count_name, const ParameterName &array_name, |
| 913 | const char *flag_bits_name, VkFlags all_flags, uint32_t count, const VkFlags *array, |
Jeff Bolz | 46c0ea0 | 2019-10-09 13:06:29 -0500 | [diff] [blame] | 914 | bool count_required, bool array_required) const { |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 915 | bool skip_call = false; |
| 916 | |
Mike Schuchardt | f39a8dc | 2021-04-19 08:55:48 -0700 | [diff] [blame] | 917 | if ((count == 0) || (array == nullptr)) { |
Mark Lobodzinski | bf599b9 | 2018-12-31 12:15:55 -0700 | [diff] [blame] | 918 | skip_call |= validate_array(api_name, count_name, array_name, count, &array, count_required, array_required, |
| 919 | kVUIDUndefined, kVUIDUndefined); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 920 | } else { |
| 921 | // Verify that all VkFlags values in the array |
| 922 | for (uint32_t i = 0; i < count; ++i) { |
| 923 | if (array[i] == 0) { |
| 924 | // Current XML registry logic for validity generation uses the array parameter's optional tag to determine if |
| 925 | // elements in the array are allowed be 0 |
| 926 | if (array_required) { |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 927 | skip_call |= LogError(device, kVUID_PVError_RequiredParameter, "%s: value of %s[%d] must not be 0", |
| 928 | api_name, array_name.get_name().c_str(), i); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 929 | } |
| 930 | } else if ((array[i] & (~all_flags)) != 0) { |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 931 | skip_call |= LogError(device, kVUID_PVError_UnrecognizedValue, |
| 932 | "%s: value of %s[%d] contains flag bits that are not recognized members of %s", api_name, |
| 933 | array_name.get_name().c_str(), i, flag_bits_name); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 934 | } |
| 935 | } |
| 936 | } |
| 937 | |
| 938 | return skip_call; |
| 939 | } |
| 940 | |
| 941 | template <typename ExtensionState> |
Jeff Bolz | fdd0d85 | 2019-02-03 21:55:12 -0600 | [diff] [blame] | 942 | bool validate_extension_reqs(const ExtensionState &extensions, const char *vuid, const char *extension_type, |
Jeff Bolz | 46c0ea0 | 2019-10-09 13:06:29 -0500 | [diff] [blame] | 943 | const char *extension_name) const { |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 944 | bool skip = false; |
| 945 | if (!extension_name) { |
| 946 | return skip; // Robust to invalid char * |
| 947 | } |
| 948 | auto info = ExtensionState::get_info(extension_name); |
| 949 | |
| 950 | if (!info.state) { |
| 951 | return skip; // Unknown extensions cannot be checked so report OK |
| 952 | } |
| 953 | |
| 954 | // Check against the required list in the info |
| 955 | std::vector<const char *> missing; |
Petr Kraus | bce952d | 2020-04-02 18:40:40 +0200 | [diff] [blame] | 956 | for (const auto &req : info.requirements) { |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 957 | if (!(extensions.*(req.enabled))) { |
| 958 | missing.push_back(req.name); |
| 959 | } |
| 960 | } |
| 961 | |
| 962 | // Report any missing requirements |
| 963 | if (missing.size()) { |
| 964 | std::string missing_joined_list = string_join(", ", missing); |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 965 | skip |= LogError(instance, vuid, "Missing extension%s required by the %s extension %s: %s.", |
| 966 | ((missing.size() > 1) ? "s" : ""), extension_type, extension_name, missing_joined_list.c_str()); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 967 | } |
| 968 | return skip; |
| 969 | } |
| 970 | |
| 971 | enum RenderPassCreateVersion { RENDER_PASS_VERSION_1 = 0, RENDER_PASS_VERSION_2 = 1 }; |
| 972 | |
| 973 | template <typename RenderPassCreateInfoGeneric> |
Petr Kraus | 3e52eba | 2019-07-10 01:24:10 +0200 | [diff] [blame] | 974 | bool ValidateSubpassGraphicsFlags(const debug_report_data *report_data, const RenderPassCreateInfoGeneric *pCreateInfo, |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 975 | uint32_t dependency_index, uint32_t subpass, VkPipelineStageFlags2KHR stages, |
| 976 | const char *vuid, const char *target, const char *func_name) const { |
Petr Kraus | 3e52eba | 2019-07-10 01:24:10 +0200 | [diff] [blame] | 977 | bool skip = false; |
Jeremy Gebben | 5f585ae | 2021-02-02 09:03:06 -0700 | [diff] [blame] | 978 | // make sure we consider all of the expanded and un-expanded graphics bits to be valid |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 979 | const auto kExcludeStages = VK_PIPELINE_STAGE_2_ALL_TRANSFER_BIT_KHR | VK_PIPELINE_STAGE_2_COPY_BIT_KHR | |
| 980 | VK_PIPELINE_STAGE_2_RESOLVE_BIT_KHR | VK_PIPELINE_STAGE_2_BLIT_BIT_KHR | |
| 981 | VK_PIPELINE_STAGE_2_CLEAR_BIT_KHR; |
| 982 | const auto kMetaGraphicsStages = VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT_KHR | VK_PIPELINE_STAGE_2_VERTEX_INPUT_BIT_KHR | |
| 983 | VK_PIPELINE_STAGE_2_PRE_RASTERIZATION_SHADERS_BIT_KHR; |
| 984 | const auto kGraphicsStages = |
| 985 | (sync_utils::ExpandPipelineStages(VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, VK_QUEUE_GRAPHICS_BIT) | kMetaGraphicsStages) & |
| 986 | ~kExcludeStages; |
Petr Kraus | dfd2644 | 2019-08-13 03:25:19 +0200 | [diff] [blame] | 987 | |
| 988 | const auto IsPipeline = [pCreateInfo](uint32_t subpass, const VkPipelineBindPoint stage) { |
Jeremy Gebben | 12933ef | 2021-05-12 17:16:27 -0600 | [diff] [blame] | 989 | if (subpass == VK_SUBPASS_EXTERNAL || subpass >= pCreateInfo->subpassCount) |
Petr Kraus | 3e52eba | 2019-07-10 01:24:10 +0200 | [diff] [blame] | 990 | return false; |
| 991 | else |
Petr Kraus | dfd2644 | 2019-08-13 03:25:19 +0200 | [diff] [blame] | 992 | return pCreateInfo->pSubpasses[subpass].pipelineBindPoint == stage; |
Petr Kraus | 3e52eba | 2019-07-10 01:24:10 +0200 | [diff] [blame] | 993 | }; |
| 994 | |
Petr Kraus | dfd2644 | 2019-08-13 03:25:19 +0200 | [diff] [blame] | 995 | const bool is_all_graphics_stages = (stages & ~kGraphicsStages) == 0; |
| 996 | if (IsPipeline(subpass, VK_PIPELINE_BIND_POINT_GRAPHICS) && !is_all_graphics_stages) { |
sfricke-samsung | 46fc663 | 2020-09-12 14:28:58 -0700 | [diff] [blame] | 997 | skip |= LogError(VkRenderPass(0), vuid, |
| 998 | "%s: Dependency pDependencies[%" PRIu32 |
| 999 | "] specifies a %sStageMask that contains stages (%s) that are not part " |
| 1000 | "of the Graphics pipeline, as specified by the %sSubpass (= %" PRIu32 ") in pipelineBindPoint.", |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 1001 | func_name, dependency_index, target, |
| 1002 | sync_utils::StringPipelineStageFlags(stages & ~kGraphicsStages).c_str(), target, subpass); |
Petr Kraus | 3e52eba | 2019-07-10 01:24:10 +0200 | [diff] [blame] | 1003 | } |
| 1004 | |
| 1005 | return skip; |
| 1006 | }; |
| 1007 | |
| 1008 | template <typename RenderPassCreateInfoGeneric> |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1009 | bool CreateRenderPassGeneric(VkDevice device, const RenderPassCreateInfoGeneric *pCreateInfo, |
Mark Lobodzinski | bf599b9 | 2018-12-31 12:15:55 -0700 | [diff] [blame] | 1010 | const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass, |
Jeff Bolz | 46c0ea0 | 2019-10-09 13:06:29 -0500 | [diff] [blame] | 1011 | RenderPassCreateVersion rp_version) const { |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1012 | bool skip = false; |
| 1013 | uint32_t max_color_attachments = device_limits.maxColorAttachments; |
| 1014 | bool use_rp2 = (rp_version == RENDER_PASS_VERSION_2); |
sfricke-samsung | 46fc663 | 2020-09-12 14:28:58 -0700 | [diff] [blame] | 1015 | const char *func_name = (use_rp2) ? "vkCreateRenderPass2" : "vkCreateRenderPass"; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1016 | const char *vuid; |
Tony-LunarG | b036c2f | 2019-12-05 14:38:25 -0700 | [diff] [blame] | 1017 | VkBool32 separate_depth_stencil_layouts = false; |
Mark Lobodzinski | 1f887d3 | 2020-12-30 15:31:33 -0700 | [diff] [blame] | 1018 | const auto *vulkan_12_features = LvlFindInChain<VkPhysicalDeviceVulkan12Features>(device_createinfo_pnext); |
Tony-LunarG | b036c2f | 2019-12-05 14:38:25 -0700 | [diff] [blame] | 1019 | if (vulkan_12_features) { |
| 1020 | separate_depth_stencil_layouts = vulkan_12_features->separateDepthStencilLayouts; |
| 1021 | } else { |
| 1022 | const auto *separate_depth_stencil_layouts_features = |
Mark Lobodzinski | 1f887d3 | 2020-12-30 15:31:33 -0700 | [diff] [blame] | 1023 | LvlFindInChain<VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures>(device_createinfo_pnext); |
Tony-LunarG | b036c2f | 2019-12-05 14:38:25 -0700 | [diff] [blame] | 1024 | if (separate_depth_stencil_layouts_features) |
| 1025 | separate_depth_stencil_layouts = separate_depth_stencil_layouts_features->separateDepthStencilLayouts; |
| 1026 | } |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1027 | |
| 1028 | for (uint32_t i = 0; i < pCreateInfo->attachmentCount; ++i) { |
sjfricke | 091f6f6 | 2022-05-19 14:46:37 +0900 | [diff] [blame] | 1029 | // if not null, also confirms rp2 is being used |
Piers Daniell | 4fde9b7 | 2019-11-27 16:19:46 -0700 | [diff] [blame] | 1030 | const auto *attachment_description_stencil_layout = |
Mark Lobodzinski | 1f887d3 | 2020-12-30 15:31:33 -0700 | [diff] [blame] | 1031 | (use_rp2) ? LvlFindInChain<VkAttachmentDescriptionStencilLayout>( |
sfricke-samsung | a6c67fb | 2020-12-15 20:51:42 -0800 | [diff] [blame] | 1032 | reinterpret_cast<VkAttachmentDescription2 const *>(&pCreateInfo->pAttachments[i])->pNext) |
sjfricke | 091f6f6 | 2022-05-19 14:46:37 +0900 | [diff] [blame] | 1033 | : nullptr; |
Piers Daniell | 4fde9b7 | 2019-11-27 16:19:46 -0700 | [diff] [blame] | 1034 | |
sfricke-samsung | cac6a26 | 2020-04-28 07:50:49 -0700 | [diff] [blame] | 1035 | const VkFormat attachment_format = pCreateInfo->pAttachments[i].format; |
| 1036 | const VkImageLayout initial_layout = pCreateInfo->pAttachments[i].initialLayout; |
| 1037 | const VkImageLayout final_layout = pCreateInfo->pAttachments[i].finalLayout; |
| 1038 | if (attachment_format == VK_FORMAT_UNDEFINED) { |
Mark Young | 89d4a82 | 2022-08-23 09:00:54 -0600 | [diff] [blame] | 1039 | skip |= LogError(device, "VUID-VkAttachmentDescription-format-06698", |
| 1040 | "%s: pCreateInfo->pAttachments[%" PRIu32 "].format is VK_FORMAT_UNDEFINED.", func_name, i); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1041 | } |
sfricke-samsung | cac6a26 | 2020-04-28 07:50:49 -0700 | [diff] [blame] | 1042 | if (final_layout == VK_IMAGE_LAYOUT_UNDEFINED || final_layout == VK_IMAGE_LAYOUT_PREINITIALIZED) { |
Mark Young | 89d4a82 | 2022-08-23 09:00:54 -0600 | [diff] [blame] | 1043 | skip |= LogError(device, "VUID-VkAttachmentDescription-finalLayout-00843", |
sfricke-samsung | 46fc663 | 2020-09-12 14:28:58 -0700 | [diff] [blame] | 1044 | "%s: pCreateInfo->pAttachments[%d].finalLayout must not be VK_IMAGE_LAYOUT_UNDEFINED or " |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 1045 | "VK_IMAGE_LAYOUT_PREINITIALIZED.", |
sfricke-samsung | 46fc663 | 2020-09-12 14:28:58 -0700 | [diff] [blame] | 1046 | func_name, i); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1047 | } |
Tony-LunarG | b036c2f | 2019-12-05 14:38:25 -0700 | [diff] [blame] | 1048 | if (!separate_depth_stencil_layouts) { |
sjfricke | 091f6f6 | 2022-05-19 14:46:37 +0900 | [diff] [blame] | 1049 | if (initial_layout == VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL || |
| 1050 | initial_layout == VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL || |
| 1051 | initial_layout == VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL || |
| 1052 | initial_layout == VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL) { |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 1053 | skip |= LogError( |
Mark Young | 89d4a82 | 2022-08-23 09:00:54 -0600 | [diff] [blame] | 1054 | device, "VUID-VkAttachmentDescription-separateDepthStencilLayouts-03284", |
sfricke-samsung | a6c67fb | 2020-12-15 20:51:42 -0800 | [diff] [blame] | 1055 | "%s: pCreateInfo->pAttachments[%d].initialLayout must not be VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL, " |
| 1056 | "VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL, VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL, or " |
| 1057 | "VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL", |
sfricke-samsung | 46fc663 | 2020-09-12 14:28:58 -0700 | [diff] [blame] | 1058 | func_name, i); |
Piers Daniell | 9af77cd | 2019-10-16 13:54:12 -0600 | [diff] [blame] | 1059 | } |
sfricke-samsung | a6c67fb | 2020-12-15 20:51:42 -0800 | [diff] [blame] | 1060 | if (final_layout == VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL || |
| 1061 | final_layout == VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL || |
| 1062 | final_layout == VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL || |
| 1063 | final_layout == VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL) { |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 1064 | skip |= LogError( |
Mark Young | 89d4a82 | 2022-08-23 09:00:54 -0600 | [diff] [blame] | 1065 | device, "VUID-VkAttachmentDescription-separateDepthStencilLayouts-03285", |
sfricke-samsung | a6c67fb | 2020-12-15 20:51:42 -0800 | [diff] [blame] | 1066 | "%s: pCreateInfo->pAttachments[%d].finalLayout must not be VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL, " |
| 1067 | "VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL, VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL, or " |
| 1068 | "VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL", |
sfricke-samsung | 46fc663 | 2020-09-12 14:28:58 -0700 | [diff] [blame] | 1069 | func_name, i); |
Piers Daniell | 9af77cd | 2019-10-16 13:54:12 -0600 | [diff] [blame] | 1070 | } |
| 1071 | } |
sfricke-samsung | cac6a26 | 2020-04-28 07:50:49 -0700 | [diff] [blame] | 1072 | if (!FormatIsDepthOrStencil(attachment_format)) { |
sfricke-samsung | a6c67fb | 2020-12-15 20:51:42 -0800 | [diff] [blame] | 1073 | if (initial_layout == VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL || |
| 1074 | initial_layout == VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL || |
| 1075 | initial_layout == VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL || |
| 1076 | initial_layout == VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL) { |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 1077 | skip |= LogError( |
Mark Young | 89d4a82 | 2022-08-23 09:00:54 -0600 | [diff] [blame] | 1078 | device, "VUID-VkAttachmentDescription-format-03286", |
sfricke-samsung | a6c67fb | 2020-12-15 20:51:42 -0800 | [diff] [blame] | 1079 | "%s: pCreateInfo->pAttachments[%d].initialLayout must not be VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL, " |
| 1080 | "VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL, VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL, or " |
Piers Daniell | 9af77cd | 2019-10-16 13:54:12 -0600 | [diff] [blame] | 1081 | "VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMA_KHRL", |
sfricke-samsung | 46fc663 | 2020-09-12 14:28:58 -0700 | [diff] [blame] | 1082 | func_name, i); |
Piers Daniell | 9af77cd | 2019-10-16 13:54:12 -0600 | [diff] [blame] | 1083 | } |
sfricke-samsung | a6c67fb | 2020-12-15 20:51:42 -0800 | [diff] [blame] | 1084 | if (final_layout == VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL || |
| 1085 | final_layout == VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL || |
| 1086 | final_layout == VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL || |
| 1087 | final_layout == VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL) { |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 1088 | skip |= LogError( |
Mark Young | 89d4a82 | 2022-08-23 09:00:54 -0600 | [diff] [blame] | 1089 | device, "VUID-VkAttachmentDescription-format-03287", |
sfricke-samsung | a6c67fb | 2020-12-15 20:51:42 -0800 | [diff] [blame] | 1090 | "%s: pCreateInfo->pAttachments[%d].finalLayout must not be VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL, " |
| 1091 | "VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL, VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL, or " |
| 1092 | "VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL", |
sfricke-samsung | 46fc663 | 2020-09-12 14:28:58 -0700 | [diff] [blame] | 1093 | func_name, i); |
Piers Daniell | 9af77cd | 2019-10-16 13:54:12 -0600 | [diff] [blame] | 1094 | } |
sfricke-samsung | cac6a26 | 2020-04-28 07:50:49 -0700 | [diff] [blame] | 1095 | } else if (FormatIsDepthAndStencil(attachment_format)) { |
sfricke-samsung | a6c67fb | 2020-12-15 20:51:42 -0800 | [diff] [blame] | 1096 | if (initial_layout == VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL || |
| 1097 | initial_layout == VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL) { |
Mark Young | 89d4a82 | 2022-08-23 09:00:54 -0600 | [diff] [blame] | 1098 | skip |= LogError(device, "VUID-VkAttachmentDescription-format-06906", |
sfricke-samsung | 46fc663 | 2020-09-12 14:28:58 -0700 | [diff] [blame] | 1099 | "%s: pCreateInfo->pAttachments[%d].initialLayout must not be " |
Mark Young | 89d4a82 | 2022-08-23 09:00:54 -0600 | [diff] [blame] | 1100 | "VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL or " |
sfricke-samsung | a6c67fb | 2020-12-15 20:51:42 -0800 | [diff] [blame] | 1101 | "VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL", |
sfricke-samsung | 46fc663 | 2020-09-12 14:28:58 -0700 | [diff] [blame] | 1102 | func_name, i); |
Piers Daniell | 9af77cd | 2019-10-16 13:54:12 -0600 | [diff] [blame] | 1103 | } |
sfricke-samsung | a6c67fb | 2020-12-15 20:51:42 -0800 | [diff] [blame] | 1104 | if (final_layout == VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL || |
| 1105 | final_layout == VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL) { |
Mark Young | 89d4a82 | 2022-08-23 09:00:54 -0600 | [diff] [blame] | 1106 | skip |= LogError(device, "VUID-VkAttachmentDescription-format-06907", |
sfricke-samsung | 46fc663 | 2020-09-12 14:28:58 -0700 | [diff] [blame] | 1107 | "%s: pCreateInfo->pAttachments[%d].finalLayout must not be " |
Mark Young | 89d4a82 | 2022-08-23 09:00:54 -0600 | [diff] [blame] | 1108 | "VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL or " |
| 1109 | "VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL", |
| 1110 | func_name, i); |
| 1111 | } |
| 1112 | } else if (FormatIsDepthOnly(attachment_format)) { |
| 1113 | if (initial_layout == VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL || |
| 1114 | initial_layout == VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL) { |
| 1115 | skip |= LogError(device, "VUID-VkAttachmentDescription-format-03290", |
| 1116 | "%s: pCreateInfo->pAttachments[%d].initialLayout must not be " |
| 1117 | "VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL or" |
| 1118 | "VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL", |
| 1119 | func_name, i); |
| 1120 | } |
| 1121 | if (final_layout == VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL || |
| 1122 | final_layout == VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL) { |
| 1123 | skip |= LogError(device, "VUID-VkAttachmentDescription-format-03291", |
| 1124 | "%s: pCreateInfo->pAttachments[%d].finalLayout must not be " |
| 1125 | "VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL or " |
sfricke-samsung | a6c67fb | 2020-12-15 20:51:42 -0800 | [diff] [blame] | 1126 | "VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL", |
sfricke-samsung | 46fc663 | 2020-09-12 14:28:58 -0700 | [diff] [blame] | 1127 | func_name, i); |
Piers Daniell | 9af77cd | 2019-10-16 13:54:12 -0600 | [diff] [blame] | 1128 | } |
sfricke-samsung | cac6a26 | 2020-04-28 07:50:49 -0700 | [diff] [blame] | 1129 | } else if (FormatIsStencilOnly(attachment_format)) { |
sfricke-samsung | a6c67fb | 2020-12-15 20:51:42 -0800 | [diff] [blame] | 1130 | if (initial_layout == VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL || |
| 1131 | initial_layout == VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL) { |
Mark Young | 89d4a82 | 2022-08-23 09:00:54 -0600 | [diff] [blame] | 1132 | skip |= LogError(device, "VUID-VkAttachmentDescription-format-03292", |
sfricke-samsung | 46fc663 | 2020-09-12 14:28:58 -0700 | [diff] [blame] | 1133 | "%s: pCreateInfo->pAttachments[%d].initialLayout must not be " |
Mark Young | 89d4a82 | 2022-08-23 09:00:54 -0600 | [diff] [blame] | 1134 | "VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL or" |
sfricke-samsung | a6c67fb | 2020-12-15 20:51:42 -0800 | [diff] [blame] | 1135 | "VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL", |
sfricke-samsung | 46fc663 | 2020-09-12 14:28:58 -0700 | [diff] [blame] | 1136 | func_name, i); |
Piers Daniell | 9af77cd | 2019-10-16 13:54:12 -0600 | [diff] [blame] | 1137 | } |
sfricke-samsung | a6c67fb | 2020-12-15 20:51:42 -0800 | [diff] [blame] | 1138 | if (final_layout == VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL || |
| 1139 | final_layout == VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL) { |
Mark Young | 89d4a82 | 2022-08-23 09:00:54 -0600 | [diff] [blame] | 1140 | skip |= LogError(device, "VUID-VkAttachmentDescription-format-03293", |
sfricke-samsung | 46fc663 | 2020-09-12 14:28:58 -0700 | [diff] [blame] | 1141 | "%s: pCreateInfo->pAttachments[%d].finalLayout must not be " |
Mark Young | 89d4a82 | 2022-08-23 09:00:54 -0600 | [diff] [blame] | 1142 | "VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL or " |
sfricke-samsung | 46fc663 | 2020-09-12 14:28:58 -0700 | [diff] [blame] | 1143 | "VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMA_KHRL", |
| 1144 | func_name, i); |
Piers Daniell | 9af77cd | 2019-10-16 13:54:12 -0600 | [diff] [blame] | 1145 | } |
| 1146 | } |
sjfricke | 091f6f6 | 2022-05-19 14:46:37 +0900 | [diff] [blame] | 1147 | if (attachment_description_stencil_layout) { |
Piers Daniell | 9af77cd | 2019-10-16 13:54:12 -0600 | [diff] [blame] | 1148 | if (attachment_description_stencil_layout->stencilInitialLayout == VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL || |
sfricke-samsung | a6c67fb | 2020-12-15 20:51:42 -0800 | [diff] [blame] | 1149 | attachment_description_stencil_layout->stencilInitialLayout == VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL || |
| 1150 | attachment_description_stencil_layout->stencilInitialLayout == VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL || |
Piers Daniell | 9af77cd | 2019-10-16 13:54:12 -0600 | [diff] [blame] | 1151 | attachment_description_stencil_layout->stencilInitialLayout == |
| 1152 | VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL || |
| 1153 | attachment_description_stencil_layout->stencilInitialLayout == |
| 1154 | VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL || |
| 1155 | attachment_description_stencil_layout->stencilInitialLayout == |
| 1156 | VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL || |
| 1157 | attachment_description_stencil_layout->stencilInitialLayout == |
| 1158 | VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL) { |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 1159 | skip |= LogError(device, "VUID-VkAttachmentDescriptionStencilLayout-stencilInitialLayout-03308", |
sfricke-samsung | a6c67fb | 2020-12-15 20:51:42 -0800 | [diff] [blame] | 1160 | "%s: VkAttachmentDescriptionStencilLayout.stencilInitialLayout must not be " |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 1161 | "VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, " |
sfricke-samsung | a6c67fb | 2020-12-15 20:51:42 -0800 | [diff] [blame] | 1162 | "VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL, " |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 1163 | "VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, " |
| 1164 | "VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL, " |
| 1165 | "VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL, or " |
sfricke-samsung | 46fc663 | 2020-09-12 14:28:58 -0700 | [diff] [blame] | 1166 | "VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL.", |
| 1167 | func_name); |
Piers Daniell | 9af77cd | 2019-10-16 13:54:12 -0600 | [diff] [blame] | 1168 | } |
| 1169 | if (attachment_description_stencil_layout->stencilFinalLayout == VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL || |
sfricke-samsung | a6c67fb | 2020-12-15 20:51:42 -0800 | [diff] [blame] | 1170 | attachment_description_stencil_layout->stencilFinalLayout == VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL || |
| 1171 | attachment_description_stencil_layout->stencilFinalLayout == VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL || |
Piers Daniell | 9af77cd | 2019-10-16 13:54:12 -0600 | [diff] [blame] | 1172 | attachment_description_stencil_layout->stencilFinalLayout == VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL || |
| 1173 | attachment_description_stencil_layout->stencilFinalLayout == VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL || |
| 1174 | attachment_description_stencil_layout->stencilFinalLayout == |
| 1175 | VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL || |
| 1176 | attachment_description_stencil_layout->stencilFinalLayout == |
| 1177 | VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL) { |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 1178 | skip |= LogError(device, "VUID-VkAttachmentDescriptionStencilLayout-stencilFinalLayout-03309", |
sfricke-samsung | a6c67fb | 2020-12-15 20:51:42 -0800 | [diff] [blame] | 1179 | "%s: VkAttachmentDescriptionStencilLayout.stencilFinalLayout must not be " |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 1180 | "VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, " |
sfricke-samsung | a6c67fb | 2020-12-15 20:51:42 -0800 | [diff] [blame] | 1181 | "VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL, " |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 1182 | "VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, " |
| 1183 | "VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL, " |
| 1184 | "VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL, or " |
sfricke-samsung | 46fc663 | 2020-09-12 14:28:58 -0700 | [diff] [blame] | 1185 | "VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL.", |
| 1186 | func_name); |
Piers Daniell | 9af77cd | 2019-10-16 13:54:12 -0600 | [diff] [blame] | 1187 | } |
| 1188 | if (attachment_description_stencil_layout->stencilFinalLayout == VK_IMAGE_LAYOUT_UNDEFINED || |
| 1189 | attachment_description_stencil_layout->stencilFinalLayout == VK_IMAGE_LAYOUT_PREINITIALIZED) { |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 1190 | skip |= LogError( |
| 1191 | device, "VUID-VkAttachmentDescriptionStencilLayout-stencilFinalLayout-03310", |
sfricke-samsung | a6c67fb | 2020-12-15 20:51:42 -0800 | [diff] [blame] | 1192 | "%s: VkAttachmentDescriptionStencilLayout.stencilFinalLayout must not be VK_IMAGE_LAYOUT_UNDEFINED, or " |
sfricke-samsung | 46fc663 | 2020-09-12 14:28:58 -0700 | [diff] [blame] | 1193 | "VK_IMAGE_LAYOUT_PREINITIALIZED.", |
| 1194 | func_name); |
Piers Daniell | 9af77cd | 2019-10-16 13:54:12 -0600 | [diff] [blame] | 1195 | } |
| 1196 | } |
sfricke-samsung | cac6a26 | 2020-04-28 07:50:49 -0700 | [diff] [blame] | 1197 | |
| 1198 | if (FormatIsDepthOrStencil(attachment_format)) { |
| 1199 | if (initial_layout == VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL) { |
Mark Young | 89d4a82 | 2022-08-23 09:00:54 -0600 | [diff] [blame] | 1200 | skip |= LogError(device, "VUID-VkAttachmentDescription-format-03281", |
sfricke-samsung | 46fc663 | 2020-09-12 14:28:58 -0700 | [diff] [blame] | 1201 | "%s: pCreateInfo->pAttachments[%d].initialLayout must not be " |
sfricke-samsung | cac6a26 | 2020-04-28 07:50:49 -0700 | [diff] [blame] | 1202 | "VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL when using a Depth or Stencil format", |
sfricke-samsung | 46fc663 | 2020-09-12 14:28:58 -0700 | [diff] [blame] | 1203 | func_name, i); |
sfricke-samsung | cac6a26 | 2020-04-28 07:50:49 -0700 | [diff] [blame] | 1204 | } |
| 1205 | if (final_layout == VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL) { |
Mark Young | 89d4a82 | 2022-08-23 09:00:54 -0600 | [diff] [blame] | 1206 | skip |= LogError(device, "VUID-VkAttachmentDescription-format-03283", |
sfricke-samsung | 46fc663 | 2020-09-12 14:28:58 -0700 | [diff] [blame] | 1207 | "%s: pCreateInfo->pAttachments[%d].finalLayout must not be " |
sfricke-samsung | cac6a26 | 2020-04-28 07:50:49 -0700 | [diff] [blame] | 1208 | "VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL when using a Depth or Stencil format", |
sfricke-samsung | 46fc663 | 2020-09-12 14:28:58 -0700 | [diff] [blame] | 1209 | func_name, i); |
sfricke-samsung | cac6a26 | 2020-04-28 07:50:49 -0700 | [diff] [blame] | 1210 | } |
| 1211 | } |
| 1212 | if (FormatIsColor(attachment_format)) { |
| 1213 | if (initial_layout == VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL || |
Mark Young | 89d4a82 | 2022-08-23 09:00:54 -0600 | [diff] [blame] | 1214 | initial_layout == VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL) { |
| 1215 | skip |= LogError(device, "VUID-VkAttachmentDescription-format-03280", |
sfricke-samsung | 46fc663 | 2020-09-12 14:28:58 -0700 | [diff] [blame] | 1216 | "%s: pCreateInfo->pAttachments[%d].initialLayout must not be " |
Mark Young | 89d4a82 | 2022-08-23 09:00:54 -0600 | [diff] [blame] | 1217 | "VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL or " |
| 1218 | "VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL when using a Color format", |
| 1219 | func_name, i); |
| 1220 | |
| 1221 | } else if (initial_layout == VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL || |
| 1222 | initial_layout == VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL) { |
| 1223 | skip |= LogError(device, "VUID-VkAttachmentDescription-format-06487", |
| 1224 | "%s: pCreateInfo->pAttachments[%d].initialLayout must not be " |
| 1225 | "VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL or " |
sfricke-samsung | 46fc663 | 2020-09-12 14:28:58 -0700 | [diff] [blame] | 1226 | "VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL when using a Color format", |
| 1227 | func_name, i); |
sfricke-samsung | cac6a26 | 2020-04-28 07:50:49 -0700 | [diff] [blame] | 1228 | } |
| 1229 | if (final_layout == VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL || |
Mark Young | 89d4a82 | 2022-08-23 09:00:54 -0600 | [diff] [blame] | 1230 | final_layout == VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL) { |
| 1231 | skip |= LogError(device, "VUID-VkAttachmentDescription-format-03282", |
sfricke-samsung | 46fc663 | 2020-09-12 14:28:58 -0700 | [diff] [blame] | 1232 | "%s: pCreateInfo->pAttachments[%d].finalLayout must not be " |
Mark Young | 89d4a82 | 2022-08-23 09:00:54 -0600 | [diff] [blame] | 1233 | "VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL or " |
| 1234 | "VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL when using a Color format", |
| 1235 | func_name, i); |
| 1236 | } else if (final_layout == VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL || |
| 1237 | final_layout == VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL) { |
| 1238 | skip |= LogError(device, "VUID-VkAttachmentDescription-format-06488", |
| 1239 | "%s: pCreateInfo->pAttachments[%d].finalLayout must not be " |
| 1240 | "VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL or " |
sfricke-samsung | 46fc663 | 2020-09-12 14:28:58 -0700 | [diff] [blame] | 1241 | "VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL when using a Color format", |
| 1242 | func_name, i); |
sfricke-samsung | cac6a26 | 2020-04-28 07:50:49 -0700 | [diff] [blame] | 1243 | } |
| 1244 | } |
ziga-lunarg | 8004b4a | 2022-05-11 20:15:41 +0200 | [diff] [blame] | 1245 | if (FormatIsColor(attachment_format) || FormatHasDepth(attachment_format)) { |
| 1246 | if (pCreateInfo->pAttachments[i].loadOp == VK_ATTACHMENT_LOAD_OP_LOAD && |
sjfricke | 091f6f6 | 2022-05-19 14:46:37 +0900 | [diff] [blame] | 1247 | initial_layout == VK_IMAGE_LAYOUT_UNDEFINED) { |
ziga-lunarg | 8004b4a | 2022-05-11 20:15:41 +0200 | [diff] [blame] | 1248 | skip |= LogError( |
Mark Young | 89d4a82 | 2022-08-23 09:00:54 -0600 | [diff] [blame] | 1249 | device, "VUID-VkAttachmentDescription-format-06699", |
ziga-lunarg | 8004b4a | 2022-05-11 20:15:41 +0200 | [diff] [blame] | 1250 | "%s: pCreateInfo->pAttachments[%" PRIu32 |
| 1251 | "] format is %s and loadOp is VK_ATTACHMENT_LOAD_OP_LOAD, but initialLayout is VK_IMAGE_LAYOUT_UNDEFINED.", |
sjfricke | 091f6f6 | 2022-05-19 14:46:37 +0900 | [diff] [blame] | 1252 | func_name, i, string_VkFormat(attachment_format)); |
ziga-lunarg | 8004b4a | 2022-05-11 20:15:41 +0200 | [diff] [blame] | 1253 | } |
| 1254 | } |
sjfricke | 091f6f6 | 2022-05-19 14:46:37 +0900 | [diff] [blame] | 1255 | if (FormatHasStencil(attachment_format) && pCreateInfo->pAttachments[i].stencilLoadOp == VK_ATTACHMENT_LOAD_OP_LOAD) { |
| 1256 | if (initial_layout == VK_IMAGE_LAYOUT_UNDEFINED) { |
| 1257 | if (use_rp2) { |
| 1258 | skip |= LogError(device, "VUID-VkAttachmentDescription2-pNext-06704", |
| 1259 | "%s: pCreateInfo->pAttachments[%" PRIu32 |
| 1260 | "] format includes stencil aspect and stencilLoadOp is VK_ATTACHMENT_LOAD_OP_LOAD, but " |
| 1261 | "the initialLayout is VK_IMAGE_LAYOUT_UNDEFINED.", |
| 1262 | func_name, i); |
| 1263 | } else if (!IsExtEnabled(device_extensions.vk_khr_separate_depth_stencil_layouts)) { |
ziga-lunarg | 8004b4a | 2022-05-11 20:15:41 +0200 | [diff] [blame] | 1264 | vuid = use_rp2 ? "VUID-VkAttachmentDescription2-format-06703" : "VUID-VkAttachmentDescription-format-06700"; |
| 1265 | skip |= LogError(device, vuid, |
| 1266 | "%s: pCreateInfo->pAttachments[%" PRIu32 |
| 1267 | "] format is %s and stencilLoadOp is VK_ATTACHMENT_LOAD_OP_LOAD, but initialLayout is " |
| 1268 | "VK_IMAGE_LAYOUT_UNDEFINED.", |
sjfricke | 091f6f6 | 2022-05-19 14:46:37 +0900 | [diff] [blame] | 1269 | func_name, i, string_VkFormat(attachment_format)); |
ziga-lunarg | 8004b4a | 2022-05-11 20:15:41 +0200 | [diff] [blame] | 1270 | } |
| 1271 | } |
sjfricke | 091f6f6 | 2022-05-19 14:46:37 +0900 | [diff] [blame] | 1272 | |
| 1273 | // rp2 can have seperate depth/stencil layout and need to look in pNext |
ziga-lunarg | a5a1b35 | 2022-04-08 23:48:47 +0200 | [diff] [blame] | 1274 | if (attachment_description_stencil_layout) { |
| 1275 | if (attachment_description_stencil_layout->stencilInitialLayout == VK_IMAGE_LAYOUT_UNDEFINED) { |
| 1276 | skip |= |
| 1277 | LogError(device, "VUID-VkAttachmentDescription2-pNext-06705", |
| 1278 | "%s: pCreateInfo->pAttachments[%" PRIu32 |
| 1279 | "] format includes stencil aspect and stencilLoadOp is VK_ATTACHMENT_LOAD_OP_LOAD, but " |
| 1280 | "the VkAttachmentDescriptionStencilLayout::stencilInitialLayout is VK_IMAGE_LAYOUT_UNDEFINED.", |
| 1281 | func_name, i); |
| 1282 | } |
ziga-lunarg | a5a1b35 | 2022-04-08 23:48:47 +0200 | [diff] [blame] | 1283 | } |
| 1284 | } |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1285 | } |
| 1286 | |
| 1287 | for (uint32_t i = 0; i < pCreateInfo->subpassCount; ++i) { |
| 1288 | if (pCreateInfo->pSubpasses[i].colorAttachmentCount > max_color_attachments) { |
Mike Schuchardt | 65847d9 | 2019-12-20 13:50:47 -0800 | [diff] [blame] | 1289 | vuid = use_rp2 ? "VUID-VkSubpassDescription2-colorAttachmentCount-03063" |
Mark Lobodzinski | bf599b9 | 2018-12-31 12:15:55 -0700 | [diff] [blame] | 1290 | : "VUID-VkSubpassDescription-colorAttachmentCount-00845"; |
sfricke-samsung | 46fc663 | 2020-09-12 14:28:58 -0700 | [diff] [blame] | 1291 | skip |= |
| 1292 | LogError(device, vuid, |
| 1293 | "%s: Cannot create a render pass with %d color attachments in pCreateInfo->pSubpasses[%u]. Max is %d.", |
| 1294 | func_name, pCreateInfo->pSubpasses[i].colorAttachmentCount, i, max_color_attachments); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1295 | } |
| 1296 | } |
Petr Kraus | 3e52eba | 2019-07-10 01:24:10 +0200 | [diff] [blame] | 1297 | |
| 1298 | for (uint32_t i = 0; i < pCreateInfo->dependencyCount; ++i) { |
| 1299 | const auto &dependency = pCreateInfo->pDependencies[i]; |
| 1300 | |
sfricke-samsung | 55f0195 | 2020-03-24 08:16:41 -0700 | [diff] [blame] | 1301 | // Need to check first so layer doesn't segfault from out of bound array access |
| 1302 | // src subpass bound check |
Mark Lobodzinski | f5a10b6 | 2020-03-09 13:16:13 -0600 | [diff] [blame] | 1303 | if ((dependency.srcSubpass != VK_SUBPASS_EXTERNAL) && (dependency.srcSubpass >= pCreateInfo->subpassCount)) { |
Mike Schuchardt | a9711d2 | 2022-06-30 14:03:22 -0700 | [diff] [blame] | 1304 | vuid = use_rp2 ? "VUID-VkRenderPassCreateInfo2-srcSubpass-02526" : "VUID-VkRenderPassCreateInfo-pDependencies-06866"; |
sfricke-samsung | 46fc663 | 2020-09-12 14:28:58 -0700 | [diff] [blame] | 1305 | skip |= LogError(device, vuid, |
| 1306 | "%s: pCreateInfo->pDependencies[%u].srcSubpass index (%u) has to be less than subpassCount (%u)", |
| 1307 | func_name, i, dependency.srcSubpass, pCreateInfo->subpassCount); |
Mark Lobodzinski | f5a10b6 | 2020-03-09 13:16:13 -0600 | [diff] [blame] | 1308 | } |
| 1309 | |
sfricke-samsung | 55f0195 | 2020-03-24 08:16:41 -0700 | [diff] [blame] | 1310 | // dst subpass bound check |
Mark Lobodzinski | f5a10b6 | 2020-03-09 13:16:13 -0600 | [diff] [blame] | 1311 | if ((dependency.dstSubpass != VK_SUBPASS_EXTERNAL) && (dependency.dstSubpass >= pCreateInfo->subpassCount)) { |
Mike Schuchardt | a9711d2 | 2022-06-30 14:03:22 -0700 | [diff] [blame] | 1312 | vuid = use_rp2 ? "VUID-VkRenderPassCreateInfo2-dstSubpass-02527" : "VUID-VkRenderPassCreateInfo-pDependencies-06867"; |
sfricke-samsung | 46fc663 | 2020-09-12 14:28:58 -0700 | [diff] [blame] | 1313 | skip |= LogError(device, vuid, |
| 1314 | "%s: pCreateInfo->pDependencies[%u].dstSubpass index (%u) has to be less than subpassCount (%u)", |
| 1315 | func_name, i, dependency.dstSubpass, pCreateInfo->subpassCount); |
Mark Lobodzinski | f5a10b6 | 2020-03-09 13:16:13 -0600 | [diff] [blame] | 1316 | } |
| 1317 | |
Petr Kraus | 3e52eba | 2019-07-10 01:24:10 +0200 | [diff] [blame] | 1318 | // Spec currently only supports Graphics pipeline in render pass -- so only that pipeline is currently checked |
Mike Schuchardt | 65847d9 | 2019-12-20 13:50:47 -0800 | [diff] [blame] | 1319 | vuid = use_rp2 ? "VUID-VkRenderPassCreateInfo2-pDependencies-03054" : "VUID-VkRenderPassCreateInfo-pDependencies-00837"; |
Petr Kraus | 3e52eba | 2019-07-10 01:24:10 +0200 | [diff] [blame] | 1320 | skip |= ValidateSubpassGraphicsFlags(report_data, pCreateInfo, i, dependency.srcSubpass, dependency.srcStageMask, vuid, |
sfricke-samsung | 46fc663 | 2020-09-12 14:28:58 -0700 | [diff] [blame] | 1321 | "src", func_name); |
Petr Kraus | 3e52eba | 2019-07-10 01:24:10 +0200 | [diff] [blame] | 1322 | |
Tony-LunarG | b036c2f | 2019-12-05 14:38:25 -0700 | [diff] [blame] | 1323 | vuid = use_rp2 ? "VUID-VkRenderPassCreateInfo2-pDependencies-03055" : "VUID-VkRenderPassCreateInfo-pDependencies-00838"; |
Petr Kraus | 3e52eba | 2019-07-10 01:24:10 +0200 | [diff] [blame] | 1324 | skip |= ValidateSubpassGraphicsFlags(report_data, pCreateInfo, i, dependency.dstSubpass, dependency.dstStageMask, vuid, |
sfricke-samsung | 46fc663 | 2020-09-12 14:28:58 -0700 | [diff] [blame] | 1325 | "dst", func_name); |
Petr Kraus | 3e52eba | 2019-07-10 01:24:10 +0200 | [diff] [blame] | 1326 | } |
| 1327 | |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1328 | return skip; |
| 1329 | } |
| 1330 | |
| 1331 | template <typename T> |
| 1332 | void RecordRenderPass(VkRenderPass renderPass, const T *pCreateInfo) { |
Mark Lobodzinski | f27a6bc | 2019-02-04 13:00:49 -0700 | [diff] [blame] | 1333 | std::unique_lock<std::mutex> lock(renderpass_map_mutex); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1334 | auto &renderpass_state = renderpasses_states[renderPass]; |
Mark Lobodzinski | f27a6bc | 2019-02-04 13:00:49 -0700 | [diff] [blame] | 1335 | lock.unlock(); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1336 | |
Younggwan Kim | 26b9abd | 2021-12-07 21:22:03 +0000 | [diff] [blame] | 1337 | renderpass_state.subpasses_flags.resize(pCreateInfo->subpassCount); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1338 | for (uint32_t subpass = 0; subpass < pCreateInfo->subpassCount; ++subpass) { |
| 1339 | bool uses_color = false; |
sjfricke | 69877a7 | 2022-08-10 09:20:01 +0900 | [diff] [blame] | 1340 | renderpass_state.color_attachment_count = pCreateInfo->pSubpasses[subpass].colorAttachmentCount; |
| 1341 | |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1342 | for (uint32_t i = 0; i < pCreateInfo->pSubpasses[subpass].colorAttachmentCount && !uses_color; ++i) |
| 1343 | if (pCreateInfo->pSubpasses[subpass].pColorAttachments[i].attachment != VK_ATTACHMENT_UNUSED) uses_color = true; |
| 1344 | |
| 1345 | bool uses_depthstencil = false; |
| 1346 | if (pCreateInfo->pSubpasses[subpass].pDepthStencilAttachment) |
| 1347 | if (pCreateInfo->pSubpasses[subpass].pDepthStencilAttachment->attachment != VK_ATTACHMENT_UNUSED) |
| 1348 | uses_depthstencil = true; |
| 1349 | |
| 1350 | if (uses_color) renderpass_state.subpasses_using_color_attachment.insert(subpass); |
| 1351 | if (uses_depthstencil) renderpass_state.subpasses_using_depthstencil_attachment.insert(subpass); |
Younggwan Kim | 26b9abd | 2021-12-07 21:22:03 +0000 | [diff] [blame] | 1352 | renderpass_state.subpasses_flags[subpass] = pCreateInfo->pSubpasses[subpass].flags; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1353 | } |
| 1354 | } |
| 1355 | |
Mark Lobodzinski | 21b91fe | 2020-12-03 15:44:24 -0700 | [diff] [blame] | 1356 | // Pre/PostCallRecord declarations |
| 1357 | void PostCallRecordCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo, |
| 1358 | const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass, |
| 1359 | VkResult result) override; |
Mike Schuchardt | 2df0891 | 2020-12-15 16:28:09 -0800 | [diff] [blame] | 1360 | void PostCallRecordCreateRenderPass2KHR(VkDevice device, const VkRenderPassCreateInfo2 *pCreateInfo, |
Mark Lobodzinski | 21b91fe | 2020-12-03 15:44:24 -0700 | [diff] [blame] | 1361 | const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass, |
| 1362 | VkResult result) override; |
| 1363 | void PostCallRecordDestroyRenderPass(VkDevice device, VkRenderPass renderPass, |
| 1364 | const VkAllocationCallbacks *pAllocator) override; |
Tony-LunarG | 3c287f6 | 2020-12-17 12:39:49 -0700 | [diff] [blame] | 1365 | void PostCallRecordAllocateCommandBuffers(VkDevice device, const VkCommandBufferAllocateInfo *pAllocateInfo, |
| 1366 | VkCommandBuffer *pCommandBuffers, VkResult result) override; |
| 1367 | void PostCallRecordFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, |
| 1368 | const VkCommandBuffer *pCommandBuffers) override; |
| 1369 | void PostCallRecordDestroyCommandPool(VkDevice device, VkCommandPool commandPool, |
| 1370 | const VkAllocationCallbacks *pAllocator) override; |
ziga-lunarg | 685d5d6 | 2022-05-14 00:38:06 +0200 | [diff] [blame] | 1371 | void GetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2 &pProperties) const; |
Mark Lobodzinski | 21b91fe | 2020-12-03 15:44:24 -0700 | [diff] [blame] | 1372 | void PostCallRecordCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo, |
| 1373 | const VkAllocationCallbacks *pAllocator, VkDevice *pDevice, VkResult result) override; |
| 1374 | void PostCallRecordCreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, |
| 1375 | VkInstance *pInstance, VkResult result) override; |
| 1376 | |
Nathaniel Cesario | 645a15b | 2021-01-08 22:40:21 -0700 | [diff] [blame] | 1377 | void CommonPostCallRecordEnumeratePhysicalDevice(const VkPhysicalDevice *phys_devices, const int count); |
| 1378 | void PostCallRecordEnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount, |
| 1379 | VkPhysicalDevice *pPhysicalDevices, VkResult result) override; |
| 1380 | |
| 1381 | void PostCallRecordEnumeratePhysicalDeviceGroups(VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, |
| 1382 | VkPhysicalDeviceGroupProperties *pPhysicalDeviceGroupProperties, |
| 1383 | VkResult result) override; |
| 1384 | |
Jeff Bolz | 46c0ea0 | 2019-10-09 13:06:29 -0500 | [diff] [blame] | 1385 | bool require_device_extension(bool flag, char const *function_name, char const *extension_name) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1386 | |
Jeff Bolz | 46c0ea0 | 2019-10-09 13:06:29 -0500 | [diff] [blame] | 1387 | bool validate_instance_extensions(const VkInstanceCreateInfo *pCreateInfo) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1388 | |
Tony-LunarG | 866843d | 2020-05-13 11:22:42 -0600 | [diff] [blame] | 1389 | bool validate_validation_features(const VkInstanceCreateInfo *pCreateInfo, |
| 1390 | const VkValidationFeaturesEXT *validation_features) const; |
| 1391 | |
Jeff Bolz | 46c0ea0 | 2019-10-09 13:06:29 -0500 | [diff] [blame] | 1392 | bool validate_api_version(uint32_t api_version, uint32_t effective_api_version) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1393 | |
Jeff Bolz | 46c0ea0 | 2019-10-09 13:06:29 -0500 | [diff] [blame] | 1394 | bool validate_string(const char *apiName, const ParameterName &stringName, const std::string &vuid, |
| 1395 | const char *validateString) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1396 | |
Jeff Bolz | 46c0ea0 | 2019-10-09 13:06:29 -0500 | [diff] [blame] | 1397 | bool ValidateCoarseSampleOrderCustomNV(const VkCoarseSampleOrderCustomNV *order) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1398 | |
Mark Lobodzinski | bf599b9 | 2018-12-31 12:15:55 -0700 | [diff] [blame] | 1399 | bool ValidateQueueFamilies(uint32_t queue_family_count, const uint32_t *queue_families, const char *cmd_name, |
| 1400 | const char *array_parameter_name, const std::string &unique_error_code, |
| 1401 | const std::string &valid_error_code, bool optional); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1402 | |
Mark Lobodzinski | bf599b9 | 2018-12-31 12:15:55 -0700 | [diff] [blame] | 1403 | bool ValidateDeviceQueueFamily(uint32_t queue_family, const char *cmd_name, const char *parameter_name, |
| 1404 | const std::string &error_code, bool optional); |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1405 | |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 1406 | bool ValidateGeometryTrianglesNV(const VkGeometryTrianglesNV &triangles, VkAccelerationStructureNV object_handle, |
| 1407 | const char *func_name) const; |
| 1408 | bool ValidateGeometryAABBNV(const VkGeometryAABBNV &geometry, VkAccelerationStructureNV object_handle, |
Jason Macnak | 192fa0e | 2019-07-26 15:07:16 -0700 | [diff] [blame] | 1409 | const char *func_name) const; |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 1410 | bool ValidateGeometryNV(const VkGeometryNV &geometry, VkAccelerationStructureNV object_handle, const char *func_name) const; |
| 1411 | bool ValidateAccelerationStructureInfoNV(const VkAccelerationStructureInfoNV &info, VkAccelerationStructureNV object_handle, |
Mark Lobodzinski | 17dc460 | 2020-05-29 07:48:40 -0600 | [diff] [blame] | 1412 | const char *func_nam, bool is_cmd) const; |
sfricke-samsung | 11ea8ed | 2020-01-07 22:24:56 -0800 | [diff] [blame] | 1413 | bool ValidateCreateSamplerYcbcrConversion(VkDevice device, const VkSamplerYcbcrConversionCreateInfo *pCreateInfo, |
| 1414 | const VkAllocationCallbacks *pAllocator, VkSamplerYcbcrConversion *pYcbcrConversion, |
| 1415 | const char *apiName) const; |
sfricke-samsung | f692b97 | 2020-05-02 08:00:45 -0700 | [diff] [blame] | 1416 | bool ValidateCmdDrawIndirectCount(VkCommandBuffer commandBuffer, VkDeviceSize offset, VkDeviceSize countBufferOffset, |
sjfricke | 91d9bda | 2022-08-01 21:44:17 +0900 | [diff] [blame] | 1417 | CMD_TYPE cmd_type) const; |
sfricke-samsung | f692b97 | 2020-05-02 08:00:45 -0700 | [diff] [blame] | 1418 | bool ValidateCmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, VkDeviceSize offset, VkDeviceSize countBufferOffset, |
sjfricke | 91d9bda | 2022-08-01 21:44:17 +0900 | [diff] [blame] | 1419 | CMD_TYPE cmd_type) const; |
Jason Macnak | 5c95495 | 2019-07-09 15:46:12 -0700 | [diff] [blame] | 1420 | |
sfricke-samsung | a1d0027 | 2021-03-10 21:37:41 -0800 | [diff] [blame] | 1421 | bool ValidateSwapchainCreateInfo(const char *func_name, VkSwapchainCreateInfoKHR const *pCreateInfo) const; |
| 1422 | |
Jeff Bolz | 46c0ea0 | 2019-10-09 13:06:29 -0500 | [diff] [blame] | 1423 | bool OutputExtensionError(const std::string &api_name, const std::string &extension_name) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1424 | |
Mark Lobodzinski | 21b91fe | 2020-12-03 15:44:24 -0700 | [diff] [blame] | 1425 | void PreCallRecordDestroyInstance(VkInstance instance, const VkAllocationCallbacks *pAllocator) override; |
Mark Lobodzinski | 2e40a13 | 2020-08-10 14:51:41 -0600 | [diff] [blame] | 1426 | |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1427 | bool manual_PreCallValidateCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo *pCreateInfo, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1428 | const VkAllocationCallbacks *pAllocator, VkQueryPool *pQueryPool) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1429 | |
| 1430 | bool manual_PreCallValidateCreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1431 | VkInstance *pInstance) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1432 | |
| 1433 | bool manual_PreCallValidateCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1434 | const VkAllocationCallbacks *pAllocator, VkDevice *pDevice) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1435 | |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1436 | bool manual_PreCallValidateCreateBuffer(VkDevice device, const VkBufferCreateInfo *pCreateInfo, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1437 | const VkAllocationCallbacks *pAllocator, VkBuffer *pBuffer) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1438 | |
| 1439 | bool manual_PreCallValidateCreateImage(VkDevice device, const VkImageCreateInfo *pCreateInfo, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1440 | const VkAllocationCallbacks *pAllocator, VkImage *pImage) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1441 | |
Jeff Bolz | 99e3f63 | 2020-03-24 22:59:22 -0500 | [diff] [blame] | 1442 | bool manual_PreCallValidateCreateImageView(VkDevice device, const VkImageViewCreateInfo *pCreateInfo, |
| 1443 | const VkAllocationCallbacks *pAllocator, VkImageView *pView) const; |
| 1444 | |
Jeff Bolz | 6d3beaa | 2019-02-09 21:00:05 -0600 | [diff] [blame] | 1445 | bool manual_PreCallValidateViewport(const VkViewport &viewport, const char *fn_name, const ParameterName ¶meter_name, |
Mark Lobodzinski | 5d8244a | 2020-01-23 13:00:43 -0700 | [diff] [blame] | 1446 | VkCommandBuffer object) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1447 | |
sfricke-samsung | 51303fb | 2021-05-09 19:09:13 -0700 | [diff] [blame] | 1448 | bool manual_PreCallValidateCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo *pCreateInfo, |
| 1449 | const VkAllocationCallbacks *pAllocator, |
| 1450 | VkPipelineLayout *pPipelineLayout) const; |
ziga-lunarg | c634137 | 2021-07-28 12:57:42 +0200 | [diff] [blame] | 1451 | |
| 1452 | bool ValidatePipelineShaderStageCreateInfo(const char *func_name, const char *msg, |
| 1453 | const VkPipelineShaderStageCreateInfo *pCreateInfo) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1454 | bool manual_PreCallValidateCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, |
| 1455 | const VkGraphicsPipelineCreateInfo *pCreateInfos, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1456 | const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1457 | bool manual_PreCallValidateCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, |
| 1458 | const VkComputePipelineCreateInfo *pCreateInfos, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1459 | const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1460 | |
| 1461 | bool manual_PreCallValidateCreateSampler(VkDevice device, const VkSamplerCreateInfo *pCreateInfo, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1462 | const VkAllocationCallbacks *pAllocator, VkSampler *pSampler) const; |
ziga-lunarg | 8a4d319 | 2021-10-13 19:54:19 +0200 | [diff] [blame] | 1463 | bool ValidateMutableDescriptorTypeCreateInfo(const VkDescriptorSetLayoutCreateInfo &create_info, |
Mike Schuchardt | 2d523e5 | 2022-09-15 12:25:58 -0700 | [diff] [blame^] | 1464 | const VkMutableDescriptorTypeCreateInfoEXT &mutable_create_info, |
ziga-lunarg | 8a4d319 | 2021-10-13 19:54:19 +0200 | [diff] [blame] | 1465 | const char *func_name) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1466 | bool manual_PreCallValidateCreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo *pCreateInfo, |
Mark Lobodzinski | bf599b9 | 2018-12-31 12:15:55 -0700 | [diff] [blame] | 1467 | const VkAllocationCallbacks *pAllocator, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1468 | VkDescriptorSetLayout *pSetLayout) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1469 | |
Tony-LunarG | 115f89d | 2022-06-15 10:53:22 -0600 | [diff] [blame] | 1470 | bool manual_PreCallValidateCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo *pCreateInfo, |
| 1471 | const VkAllocationCallbacks *pAllocator, VkSemaphore *pSemaphore) const; |
| 1472 | |
| 1473 | bool manual_PreCallValidateCreateEvent(VkDevice device, const VkEventCreateInfo *pCreateInfo, |
| 1474 | const VkAllocationCallbacks *pAllocator, VkEvent *pEvent) const; |
| 1475 | |
| 1476 | bool manual_PreCallValidateCreateBufferView(VkDevice device, const VkBufferViewCreateInfo *pCreateInfo, |
| 1477 | const VkAllocationCallbacks *pAllocator, VkBufferView *pBufferView) const; |
| 1478 | |
| 1479 | #ifdef VK_USE_PLATFORM_METAL_EXT |
| 1480 | bool ExportMetalObjectsPNextUtil(VkExportMetalObjectTypeFlagBitsEXT bit, const char *vuid, const char *api_call, |
| 1481 | const char *sType, const void *pNext) const; |
| 1482 | #endif // VK_USE_PLATFORM_METAL_EXT |
| 1483 | |
Jeremy Hayes | 390ff6f | 2020-02-10 13:48:57 -0700 | [diff] [blame] | 1484 | bool validate_WriteDescriptorSet(const char *vkCallingFunction, const uint32_t descriptorWriteCount, |
Mike Schuchardt | 979898a | 2022-01-11 10:46:59 -0800 | [diff] [blame] | 1485 | const VkWriteDescriptorSet *pDescriptorWrites, const bool isPushDescriptor) const; |
Mark Lobodzinski | bf599b9 | 2018-12-31 12:15:55 -0700 | [diff] [blame] | 1486 | bool manual_PreCallValidateUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount, |
| 1487 | const VkWriteDescriptorSet *pDescriptorWrites, uint32_t descriptorCopyCount, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1488 | const VkCopyDescriptorSet *pDescriptorCopies) const; |
Jason Macnak | 5c95495 | 2019-07-09 15:46:12 -0700 | [diff] [blame] | 1489 | |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1490 | bool manual_PreCallValidateFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1491 | const VkDescriptorSet *pDescriptorSets) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1492 | |
| 1493 | bool manual_PreCallValidateCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1494 | const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1495 | |
sfricke-samsung | 681ab7b | 2020-10-29 01:53:35 -0700 | [diff] [blame] | 1496 | bool manual_PreCallValidateCreateRenderPass2(VkDevice device, const VkRenderPassCreateInfo2 *pCreateInfo, |
| 1497 | const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass) const; |
| 1498 | |
Mike Schuchardt | 2df0891 | 2020-12-15 16:28:09 -0800 | [diff] [blame] | 1499 | bool manual_PreCallValidateCreateRenderPass2KHR(VkDevice device, const VkRenderPassCreateInfo2 *pCreateInfo, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1500 | const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1501 | |
| 1502 | bool manual_PreCallValidateFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1503 | const VkCommandBuffer *pCommandBuffers) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1504 | |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1505 | bool manual_PreCallValidateBeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo *pBeginInfo) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1506 | |
| 1507 | bool manual_PreCallValidateCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1508 | const VkViewport *pViewports) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1509 | |
| 1510 | bool manual_PreCallValidateCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1511 | const VkRect2D *pScissors) const; |
| 1512 | bool manual_PreCallValidateCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1513 | |
Tony-LunarG | c0c3df5 | 2020-11-20 13:47:10 -0700 | [diff] [blame] | 1514 | bool manual_PreCallValidateCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 1515 | uint32_t drawCount, uint32_t stride) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1516 | |
| 1517 | bool manual_PreCallValidateCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
Tony-LunarG | c0c3df5 | 2020-11-20 13:47:10 -0700 | [diff] [blame] | 1518 | uint32_t drawCount, uint32_t stride) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1519 | |
sfricke-samsung | f692b97 | 2020-05-02 08:00:45 -0700 | [diff] [blame] | 1520 | bool manual_PreCallValidateCmdDrawIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 1521 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, |
| 1522 | uint32_t stride) const; |
| 1523 | |
sjfricke | 91d9bda | 2022-08-01 21:44:17 +0900 | [diff] [blame] | 1524 | bool manual_PreCallValidateCmdDrawIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 1525 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, |
| 1526 | uint32_t stride) const; |
| 1527 | |
sfricke-samsung | f692b97 | 2020-05-02 08:00:45 -0700 | [diff] [blame] | 1528 | bool manual_PreCallValidateCmdDrawIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 1529 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, |
| 1530 | uint32_t stride) const; |
| 1531 | |
| 1532 | bool manual_PreCallValidateCmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 1533 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, |
| 1534 | uint32_t maxDrawCount, uint32_t stride) const; |
| 1535 | |
sjfricke | 91d9bda | 2022-08-01 21:44:17 +0900 | [diff] [blame] | 1536 | bool manual_PreCallValidateCmdDrawIndexedIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 1537 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, |
| 1538 | uint32_t maxDrawCount, uint32_t stride) const; |
| 1539 | |
sfricke-samsung | f692b97 | 2020-05-02 08:00:45 -0700 | [diff] [blame] | 1540 | bool manual_PreCallValidateCmdDrawIndexedIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 1541 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, |
| 1542 | uint32_t maxDrawCount, uint32_t stride) const; |
| 1543 | |
Tony-LunarG | 4490de4 | 2021-06-21 15:49:19 -0600 | [diff] [blame] | 1544 | bool manual_PreCallValidateCmdDrawMultiEXT(VkCommandBuffer commandBuffer, uint32_t drawCount, |
| 1545 | const VkMultiDrawInfoEXT *pVertexInfo, uint32_t instanceCount, |
| 1546 | uint32_t firstInstance, uint32_t stride) const; |
| 1547 | |
| 1548 | bool manual_PreCallValidateCmdDrawMultiIndexedEXT(VkCommandBuffer commandBuffer, uint32_t drawCount, |
| 1549 | const VkMultiDrawIndexedInfoEXT *pIndexInfo, uint32_t instanceCount, |
| 1550 | uint32_t firstInstance, uint32_t stride, const int32_t *pVertexOffset) const; |
| 1551 | |
Mark Lobodzinski | f77a4ac | 2019-06-27 15:30:51 -0600 | [diff] [blame] | 1552 | bool manual_PreCallValidateCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount, |
| 1553 | const VkClearAttachment *pAttachments, uint32_t rectCount, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1554 | const VkClearRect *pRects) const; |
Mark Lobodzinski | f77a4ac | 2019-06-27 15:30:51 -0600 | [diff] [blame] | 1555 | |
Andrew Fobel | 3abeb99 | 2020-01-20 16:33:22 -0500 | [diff] [blame] | 1556 | bool ValidateGetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice physicalDevice, |
| 1557 | const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo, |
| 1558 | VkImageFormatProperties2 *pImageFormatProperties, |
| 1559 | const char *apiName) const; |
| 1560 | bool manual_PreCallValidateGetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice physicalDevice, |
| 1561 | const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo, |
| 1562 | VkImageFormatProperties2 *pImageFormatProperties) const; |
| 1563 | bool manual_PreCallValidateGetPhysicalDeviceImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, |
| 1564 | const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo, |
| 1565 | VkImageFormatProperties2 *pImageFormatProperties) const; |
Lionel Landwerlin | 5fe5275 | 2020-07-22 08:18:14 +0300 | [diff] [blame] | 1566 | bool manual_PreCallValidateGetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, |
| 1567 | VkImageType type, VkImageTiling tiling, |
| 1568 | VkImageUsageFlags usage, VkImageCreateFlags flags, |
| 1569 | VkImageFormatProperties *pImageFormatProperties) const; |
Andrew Fobel | 3abeb99 | 2020-01-20 16:33:22 -0500 | [diff] [blame] | 1570 | |
sfricke-samsung | 3999ef6 | 2020-02-09 17:05:59 -0800 | [diff] [blame] | 1571 | bool manual_PreCallValidateCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, |
| 1572 | uint32_t regionCount, const VkBufferCopy *pRegions) const; |
| 1573 | |
Jeff Leger | 178b1e5 | 2020-10-05 12:22:23 -0400 | [diff] [blame] | 1574 | bool manual_PreCallValidateCmdCopyBuffer2KHR(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2KHR *pCopyBufferInfo) const; |
| 1575 | |
Tony-LunarG | ef03547 | 2021-11-02 10:23:33 -0600 | [diff] [blame] | 1576 | bool manual_PreCallValidateCmdCopyBuffer2(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2 *pCopyBufferInfo) const; |
| 1577 | |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1578 | bool manual_PreCallValidateCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1579 | VkDeviceSize dataSize, const void *pData) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1580 | |
| 1581 | bool manual_PreCallValidateCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1582 | VkDeviceSize size, uint32_t data) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1583 | |
| 1584 | bool manual_PreCallValidateCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1585 | const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchain) const; |
sfricke-samsung | a1d0027 | 2021-03-10 21:37:41 -0800 | [diff] [blame] | 1586 | bool manual_PreCallValidateCreateSharedSwapchainsKHR(VkDevice device, uint32_t swapchainCount, |
| 1587 | const VkSwapchainCreateInfoKHR *pCreateInfos, |
| 1588 | const VkAllocationCallbacks *pAllocator, |
| 1589 | VkSwapchainKHR *pSwapchains) const; |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1590 | bool manual_PreCallValidateQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *pPresentInfo) const; |
sfricke-samsung | 5c1b739 | 2020-12-13 22:17:15 -0800 | [diff] [blame] | 1591 | bool manual_PreCallValidateCreateDisplayModeKHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display, |
| 1592 | const VkDisplayModeCreateInfoKHR *pCreateInfo, |
| 1593 | const VkAllocationCallbacks *pAllocator, VkDisplayModeKHR *pMode) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1594 | |
| 1595 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 1596 | bool manual_PreCallValidateCreateWin32SurfaceKHR(VkInstance instance, const VkWin32SurfaceCreateInfoKHR *pCreateInfo, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1597 | const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1598 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 1599 | |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1600 | bool manual_PreCallValidateCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo *pCreateInfo, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1601 | const VkAllocationCallbacks *pAllocator, |
| 1602 | VkDescriptorPool *pDescriptorPool) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1603 | bool manual_PreCallValidateCmdDispatch(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1604 | uint32_t groupCountZ) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1605 | |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1606 | bool manual_PreCallValidateCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1607 | |
| 1608 | bool manual_PreCallValidateCmdDispatchBaseKHR(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, |
| 1609 | uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1610 | uint32_t groupCountZ) const; |
Jeremy Hayes | 390ff6f | 2020-02-10 13:48:57 -0700 | [diff] [blame] | 1611 | bool manual_PreCallValidateCmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, |
| 1612 | VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, |
| 1613 | const VkWriteDescriptorSet *pDescriptorWrites) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1614 | bool manual_PreCallValidateCmdSetExclusiveScissorNV(VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1615 | uint32_t exclusiveScissorCount, const VkRect2D *pExclusiveScissors) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1616 | bool manual_PreCallValidateCmdSetViewportShadingRatePaletteNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, |
| 1617 | uint32_t viewportCount, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1618 | const VkShadingRatePaletteNV *pShadingRatePalettes) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1619 | |
| 1620 | bool manual_PreCallValidateCmdSetCoarseSampleOrderNV(VkCommandBuffer commandBuffer, VkCoarseSampleOrderTypeNV sampleOrderType, |
| 1621 | uint32_t customSampleOrderCount, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1622 | const VkCoarseSampleOrderCustomNV *pCustomSampleOrders) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1623 | |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1624 | bool manual_PreCallValidateCmdDrawMeshTasksNV(VkCommandBuffer commandBuffer, uint32_t taskCount, uint32_t firstTask) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1625 | bool manual_PreCallValidateCmdDrawMeshTasksIndirectNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1626 | uint32_t drawCount, uint32_t stride) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1627 | |
| 1628 | bool manual_PreCallValidateCmdDrawMeshTasksIndirectCountNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 1629 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1630 | uint32_t maxDrawCount, uint32_t stride) const; |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1631 | |
| 1632 | bool manual_PreCallValidateEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char *pLayerName, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1633 | uint32_t *pPropertyCount, |
| 1634 | VkExtensionProperties *pProperties) const; |
Jeff Bolz | 7e7e6e0 | 2019-01-11 22:53:41 -0600 | [diff] [blame] | 1635 | bool manual_PreCallValidateAllocateMemory(VkDevice device, const VkMemoryAllocateInfo *pAllocateInfo, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1636 | const VkAllocationCallbacks *pAllocator, VkDeviceMemory *pMemory) const; |
Ricardo Garcia | a493597 | 2019-02-21 17:43:18 +0100 | [diff] [blame] | 1637 | |
| 1638 | bool manual_PreCallValidateCreateAccelerationStructureNV(VkDevice device, |
| 1639 | const VkAccelerationStructureCreateInfoNV *pCreateInfo, |
| 1640 | const VkAllocationCallbacks *pAllocator, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1641 | VkAccelerationStructureNV *pAccelerationStructure) const; |
Jeff Bolz | 443c2ca | 2020-03-19 12:11:51 -0500 | [diff] [blame] | 1642 | bool manual_PreCallValidateCreateAccelerationStructureKHR(VkDevice device, |
| 1643 | const VkAccelerationStructureCreateInfoKHR *pCreateInfo, |
| 1644 | const VkAllocationCallbacks *pAllocator, |
| 1645 | VkAccelerationStructureKHR *pAccelerationStructure) const; |
Jason Macnak | 5c95495 | 2019-07-09 15:46:12 -0700 | [diff] [blame] | 1646 | bool manual_PreCallValidateCmdBuildAccelerationStructureNV(VkCommandBuffer commandBuffer, |
| 1647 | const VkAccelerationStructureInfoNV *pInfo, VkBuffer instanceData, |
| 1648 | VkDeviceSize instanceOffset, VkBool32 update, |
| 1649 | VkAccelerationStructureNV dst, VkAccelerationStructureNV src, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1650 | VkBuffer scratch, VkDeviceSize scratchOffset) const; |
Jason Macnak | 5c95495 | 2019-07-09 15:46:12 -0700 | [diff] [blame] | 1651 | bool manual_PreCallValidateGetAccelerationStructureHandleNV(VkDevice device, VkAccelerationStructureNV accelerationStructure, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1652 | size_t dataSize, void *pData) const; |
sourav parmar | cd5fb18 | 2020-07-17 12:58:44 -0700 | [diff] [blame] | 1653 | |
| 1654 | bool manual_PreCallValidateCmdWriteAccelerationStructuresPropertiesNV(VkCommandBuffer commandBuffer, |
| 1655 | uint32_t accelerationStructureCount, |
| 1656 | const VkAccelerationStructureNV *pAccelerationStructures, |
| 1657 | VkQueryType queryType, VkQueryPool queryPool, |
| 1658 | uint32_t firstQuery) const; |
Peter Chen | 8536639 | 2019-05-14 15:20:11 -0400 | [diff] [blame] | 1659 | bool manual_PreCallValidateCreateRayTracingPipelinesNV(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, |
| 1660 | const VkRayTracingPipelineCreateInfoNV *pCreateInfos, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1661 | const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines) const; |
sourav parmar | cd5fb18 | 2020-07-17 12:58:44 -0700 | [diff] [blame] | 1662 | bool manual_PreCallValidateCreateRayTracingPipelinesKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, |
| 1663 | VkPipelineCache pipelineCache, uint32_t createInfoCount, |
Jeff Bolz | 443c2ca | 2020-03-19 12:11:51 -0500 | [diff] [blame] | 1664 | const VkRayTracingPipelineCreateInfoKHR *pCreateInfos, |
| 1665 | const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines) const; |
Chris Mayer | 9ded5eb | 2019-09-19 16:33:26 +0200 | [diff] [blame] | 1666 | bool manual_PreCallValidateCmdSetViewportWScalingNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1667 | uint32_t viewportCount, |
| 1668 | const VkViewportWScalingNV *pViewportWScalings) const; |
Mike Schuchardt | 21638df | 2019-03-16 10:52:02 -0700 | [diff] [blame] | 1669 | |
| 1670 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 1671 | bool PreCallValidateGetDeviceGroupSurfacePresentModes2EXT(VkDevice device, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, |
Jamie Madill | aa076da | 2020-12-22 15:34:34 -0500 | [diff] [blame] | 1672 | VkDeviceGroupPresentModeFlagsKHR *pModes) const override; |
Mike Schuchardt | 21638df | 2019-03-16 10:52:02 -0700 | [diff] [blame] | 1673 | #endif // VK_USE_PLATFORM_WIN32_KHR |
Tobias Hector | ebb855f | 2019-07-23 12:17:33 +0100 | [diff] [blame] | 1674 | |
| 1675 | bool manual_PreCallValidateCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo *pCreateInfo, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1676 | const VkAllocationCallbacks *pAllocator, VkFramebuffer *pFramebuffer) const; |
Tobias Hector | ebb855f | 2019-07-23 12:17:33 +0100 | [diff] [blame] | 1677 | |
Jeff Bolz | 8125a8b | 2019-08-16 16:29:45 -0500 | [diff] [blame] | 1678 | bool manual_PreCallValidateCmdSetLineStippleEXT(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1679 | uint16_t lineStipplePattern) const; |
Piers Daniell | 8fd03f5 | 2019-08-21 12:07:53 -0600 | [diff] [blame] | 1680 | |
| 1681 | bool manual_PreCallValidateCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1682 | VkIndexType indexType) const; |
sfricke-samsung | 4ada8d4 | 2020-02-09 17:43:11 -0800 | [diff] [blame] | 1683 | bool manual_PreCallValidateCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, |
| 1684 | const VkBuffer *pBuffers, const VkDeviceSize *pOffsets) const; |
Piers Daniell | 8fd03f5 | 2019-08-21 12:07:53 -0600 | [diff] [blame] | 1685 | |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1686 | bool manual_PreCallValidateSetDebugUtilsObjectNameEXT(VkDevice device, const VkDebugUtilsObjectNameInfoEXT *pNameInfo) const; |
Mark Lobodzinski | 8498840 | 2019-09-11 15:27:30 -0600 | [diff] [blame] | 1687 | |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1688 | bool manual_PreCallValidateSetDebugUtilsObjectTagEXT(VkDevice device, const VkDebugUtilsObjectTagInfoEXT *pTagInfo) const; |
Mark Lobodzinski | 8498840 | 2019-09-11 15:27:30 -0600 | [diff] [blame] | 1689 | |
Petr Kraus | 3d72039 | 2019-11-13 02:52:39 +0100 | [diff] [blame] | 1690 | bool manual_PreCallValidateAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, |
| 1691 | VkSemaphore semaphore, VkFence fence, uint32_t *pImageIndex) const; |
| 1692 | |
| 1693 | bool manual_PreCallValidateAcquireNextImage2KHR(VkDevice device, const VkAcquireNextImageInfoKHR *pAcquireInfo, |
| 1694 | uint32_t *pImageIndex) const; |
| 1695 | |
Jeremy Hayes | 9bda85a | 2020-05-21 16:36:17 -0600 | [diff] [blame] | 1696 | bool manual_PreCallValidateCmdBindTransformFeedbackBuffersEXT(VkCommandBuffer commandBuffer, uint32_t firstBinding, |
| 1697 | uint32_t bindingCount, const VkBuffer *pBuffers, |
| 1698 | const VkDeviceSize *pOffsets, const VkDeviceSize *pSizes) const; |
| 1699 | |
| 1700 | bool manual_PreCallValidateCmdBeginTransformFeedbackEXT(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, |
| 1701 | uint32_t counterBufferCount, const VkBuffer *pCounterBuffers, |
| 1702 | const VkDeviceSize *pCounterBufferOffsets) const; |
| 1703 | |
| 1704 | bool manual_PreCallValidateCmdEndTransformFeedbackEXT(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, |
| 1705 | uint32_t counterBufferCount, const VkBuffer *pCounterBuffers, |
| 1706 | const VkDeviceSize *pCounterBufferOffsets) const; |
| 1707 | |
Mark Lobodzinski | 953b7bc | 2019-12-19 13:50:10 -0700 | [diff] [blame] | 1708 | bool manual_PreCallValidateCmdDrawIndirectByteCountEXT(VkCommandBuffer commandBuffer, uint32_t instanceCount, |
| 1709 | uint32_t firstInstance, VkBuffer counterBuffer, |
| 1710 | VkDeviceSize counterBufferOffset, uint32_t counterOffset, |
| 1711 | uint32_t vertexStride) const; |
Jeremy Hayes | 9bda85a | 2020-05-21 16:36:17 -0600 | [diff] [blame] | 1712 | |
sfricke-samsung | 11ea8ed | 2020-01-07 22:24:56 -0800 | [diff] [blame] | 1713 | bool manual_PreCallValidateCreateSamplerYcbcrConversion(VkDevice device, const VkSamplerYcbcrConversionCreateInfo *pCreateInfo, |
| 1714 | const VkAllocationCallbacks *pAllocator, |
| 1715 | VkSamplerYcbcrConversion *pYcbcrConversion) const; |
| 1716 | bool manual_PreCallValidateCreateSamplerYcbcrConversionKHR(VkDevice device, |
| 1717 | const VkSamplerYcbcrConversionCreateInfo *pCreateInfo, |
| 1718 | const VkAllocationCallbacks *pAllocator, |
| 1719 | VkSamplerYcbcrConversion *pYcbcrConversion) const; |
sfricke-samsung | 1708a8c | 2020-02-10 00:35:06 -0800 | [diff] [blame] | 1720 | bool manual_PreCallValidateImportSemaphoreFdKHR(VkDevice device, |
| 1721 | const VkImportSemaphoreFdInfoKHR *pImportSemaphoreFdInfo) const; |
sourav parmar | a96ab1a | 2020-04-25 16:28:23 -0700 | [diff] [blame] | 1722 | |
sourav parmar | cd5fb18 | 2020-07-17 12:58:44 -0700 | [diff] [blame] | 1723 | bool manual_PreCallValidateCopyAccelerationStructureToMemoryKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, |
sourav parmar | a96ab1a | 2020-04-25 16:28:23 -0700 | [diff] [blame] | 1724 | const VkCopyAccelerationStructureToMemoryInfoKHR *pInfo) const; |
| 1725 | |
| 1726 | bool manual_PreCallValidateCmdCopyAccelerationStructureToMemoryKHR( |
| 1727 | VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureToMemoryInfoKHR *pInfo) const; |
| 1728 | |
sourav parmar | cd5fb18 | 2020-07-17 12:58:44 -0700 | [diff] [blame] | 1729 | bool manual_PreCallValidateCopyAccelerationStructureKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, |
| 1730 | const VkCopyAccelerationStructureInfoKHR *pInfo) const; |
sourav parmar | a96ab1a | 2020-04-25 16:28:23 -0700 | [diff] [blame] | 1731 | |
| 1732 | bool manual_PreCallValidateCmdCopyAccelerationStructureKHR(VkCommandBuffer commandBuffer, |
| 1733 | const VkCopyAccelerationStructureInfoKHR *pInfo) const; |
| 1734 | bool ValidateCopyAccelerationStructureInfoKHR(const VkCopyAccelerationStructureInfoKHR *pInfo, const char *api_name) const; |
| 1735 | bool ValidateCopyMemoryToAccelerationStructureInfoKHR(const VkCopyMemoryToAccelerationStructureInfoKHR *pInfo, |
Mark Lobodzinski | aad69e4 | 2020-05-12 08:44:21 -0600 | [diff] [blame] | 1736 | const char *api_name, bool is_cmd = false) const; |
sourav parmar | a96ab1a | 2020-04-25 16:28:23 -0700 | [diff] [blame] | 1737 | |
sourav parmar | cd5fb18 | 2020-07-17 12:58:44 -0700 | [diff] [blame] | 1738 | bool manual_PreCallValidateCopyMemoryToAccelerationStructureKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, |
sourav parmar | a96ab1a | 2020-04-25 16:28:23 -0700 | [diff] [blame] | 1739 | const VkCopyMemoryToAccelerationStructureInfoKHR *pInfo) const; |
| 1740 | bool manual_PreCallValidateCmdCopyMemoryToAccelerationStructureKHR( |
| 1741 | VkCommandBuffer commandBuffer, const VkCopyMemoryToAccelerationStructureInfoKHR *pInfo) const; |
sfricke-samsung | f692b97 | 2020-05-02 08:00:45 -0700 | [diff] [blame] | 1742 | |
sourav parmar | 83c31b1 | 2020-05-06 12:30:54 -0700 | [diff] [blame] | 1743 | bool manual_PreCallValidateCmdWriteAccelerationStructuresPropertiesKHR( |
| 1744 | VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount, |
| 1745 | const VkAccelerationStructureKHR *pAccelerationStructures, VkQueryType queryType, VkQueryPool queryPool, |
| 1746 | uint32_t firstQuery) const; |
| 1747 | bool manual_PreCallValidateWriteAccelerationStructuresPropertiesKHR(VkDevice device, uint32_t accelerationStructureCount, |
| 1748 | const VkAccelerationStructureKHR *pAccelerationStructures, |
| 1749 | VkQueryType queryType, size_t dataSize, void *pData, |
| 1750 | size_t stride) const; |
| 1751 | bool manual_PreCallValidateGetRayTracingCaptureReplayShaderGroupHandlesKHR(VkDevice device, VkPipeline pipeline, |
| 1752 | uint32_t firstGroup, uint32_t groupCount, |
| 1753 | size_t dataSize, void *pData) const; |
| 1754 | |
| 1755 | bool manual_PreCallValidateCmdTraceRaysKHR(VkCommandBuffer commandBuffer, |
sourav parmar | cd5fb18 | 2020-07-17 12:58:44 -0700 | [diff] [blame] | 1756 | const VkStridedDeviceAddressRegionKHR *pRaygenShaderBindingTable, |
| 1757 | const VkStridedDeviceAddressRegionKHR *pMissShaderBindingTable, |
| 1758 | const VkStridedDeviceAddressRegionKHR *pHitShaderBindingTable, |
| 1759 | const VkStridedDeviceAddressRegionKHR *pCallableShaderBindingTable, uint32_t width, |
sourav parmar | 83c31b1 | 2020-05-06 12:30:54 -0700 | [diff] [blame] | 1760 | uint32_t height, uint32_t depth) const; |
| 1761 | |
| 1762 | bool manual_PreCallValidateCmdTraceRaysIndirectKHR(VkCommandBuffer commandBuffer, |
sourav parmar | cd5fb18 | 2020-07-17 12:58:44 -0700 | [diff] [blame] | 1763 | const VkStridedDeviceAddressRegionKHR *pRaygenShaderBindingTable, |
| 1764 | const VkStridedDeviceAddressRegionKHR *pMissShaderBindingTable, |
| 1765 | const VkStridedDeviceAddressRegionKHR *pHitShaderBindingTable, |
| 1766 | const VkStridedDeviceAddressRegionKHR *pCallableShaderBindingTable, |
| 1767 | VkDeviceAddress indirectDeviceAddress) const; |
sourav parmar | 83c31b1 | 2020-05-06 12:30:54 -0700 | [diff] [blame] | 1768 | |
sfricke-samsung | f91881c | 2022-03-31 01:12:00 -0500 | [diff] [blame] | 1769 | bool manual_PreCallValidateCmdTraceRaysIndirect2KHR(VkCommandBuffer commandBuffer, VkDeviceAddress indirectDeviceAddress) const; |
| 1770 | |
sourav parmar | 83c31b1 | 2020-05-06 12:30:54 -0700 | [diff] [blame] | 1771 | bool manual_PreCallValidateCmdTraceRaysNV(VkCommandBuffer commandBuffer, VkBuffer raygenShaderBindingTableBuffer, |
| 1772 | VkDeviceSize raygenShaderBindingOffset, VkBuffer missShaderBindingTableBuffer, |
| 1773 | VkDeviceSize missShaderBindingOffset, VkDeviceSize missShaderBindingStride, |
| 1774 | VkBuffer hitShaderBindingTableBuffer, VkDeviceSize hitShaderBindingOffset, |
| 1775 | VkDeviceSize hitShaderBindingStride, VkBuffer callableShaderBindingTableBuffer, |
| 1776 | VkDeviceSize callableShaderBindingOffset, VkDeviceSize callableShaderBindingStride, |
| 1777 | uint32_t width, uint32_t height, uint32_t depth) const; |
| 1778 | |
sourav parmar | cd5fb18 | 2020-07-17 12:58:44 -0700 | [diff] [blame] | 1779 | bool manual_PreCallValidateCmdBuildAccelerationStructuresIndirectKHR(VkCommandBuffer commandBuffer, uint32_t infoCount, |
| 1780 | const VkAccelerationStructureBuildGeometryInfoKHR *pInfos, |
| 1781 | const VkDeviceAddress *pIndirectDeviceAddresses, |
| 1782 | const uint32_t *pIndirectStrides, |
| 1783 | const uint32_t *const *ppMaxPrimitiveCounts) const; |
sourav parmar | 83c31b1 | 2020-05-06 12:30:54 -0700 | [diff] [blame] | 1784 | |
| 1785 | bool manual_PreCallValidateGetDeviceAccelerationStructureCompatibilityKHR( |
sourav parmar | cd5fb18 | 2020-07-17 12:58:44 -0700 | [diff] [blame] | 1786 | VkDevice device, const VkAccelerationStructureVersionInfoKHR *pVersionInfo, |
| 1787 | VkAccelerationStructureCompatibilityKHR *pCompatibility) const; |
Tony-LunarG | 3f953ba | 2021-10-15 15:35:39 -0600 | [diff] [blame] | 1788 | bool ValidateCmdSetViewportWithCount(VkCommandBuffer commandBuffer, uint32_t viewportCount, const VkViewport *pViewports, |
| 1789 | bool is_ext) const; |
Piers Daniell | 39842ee | 2020-07-10 16:42:33 -0600 | [diff] [blame] | 1790 | bool manual_PreCallValidateCmdSetViewportWithCountEXT(VkCommandBuffer commandBuffer, uint32_t viewportCount, |
| 1791 | const VkViewport *pViewports) const; |
Tony-LunarG | 3f953ba | 2021-10-15 15:35:39 -0600 | [diff] [blame] | 1792 | bool manual_PreCallValidateCmdSetViewportWithCount(VkCommandBuffer commandBuffer, uint32_t viewportCount, |
| 1793 | const VkViewport *pViewports) const; |
| 1794 | |
| 1795 | bool ValidateCmdSetScissorWithCount(VkCommandBuffer commandBuffer, uint32_t scissorCount, const VkRect2D *pScissors, |
| 1796 | bool is_ext) const; |
Piers Daniell | 39842ee | 2020-07-10 16:42:33 -0600 | [diff] [blame] | 1797 | bool manual_PreCallValidateCmdSetScissorWithCountEXT(VkCommandBuffer commandBuffer, uint32_t scissorCount, |
| 1798 | const VkRect2D *pScissors) const; |
Tony-LunarG | 3f953ba | 2021-10-15 15:35:39 -0600 | [diff] [blame] | 1799 | bool manual_PreCallValidateCmdSetScissorWithCount(VkCommandBuffer commandBuffer, uint32_t scissorCount, |
| 1800 | const VkRect2D *pScissors) const; |
| 1801 | bool ValidateCmdBindVertexBuffers2(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, |
| 1802 | const VkBuffer *pBuffers, const VkDeviceSize *pOffsets, const VkDeviceSize *pSizes, |
| 1803 | const VkDeviceSize *pStrides, bool is_2ext) const; |
Piers Daniell | 39842ee | 2020-07-10 16:42:33 -0600 | [diff] [blame] | 1804 | bool manual_PreCallValidateCmdBindVertexBuffers2EXT(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, |
| 1805 | const VkBuffer *pBuffers, const VkDeviceSize *pOffsets, |
| 1806 | const VkDeviceSize *pSizes, const VkDeviceSize *pStrides) const; |
Tony-LunarG | 3f953ba | 2021-10-15 15:35:39 -0600 | [diff] [blame] | 1807 | bool manual_PreCallValidateCmdBindVertexBuffers2(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, |
| 1808 | const VkBuffer *pBuffers, const VkDeviceSize *pOffsets, |
| 1809 | const VkDeviceSize *pSizes, const VkDeviceSize *pStrides) const; |
sourav parmar | cd5fb18 | 2020-07-17 12:58:44 -0700 | [diff] [blame] | 1810 | bool ValidateAccelerationStructureBuildGeometryInfoKHR(const VkAccelerationStructureBuildGeometryInfoKHR *pInfos, |
| 1811 | uint32_t infoCount, const char *api_name) const; |
| 1812 | bool manual_PreCallValidateCmdBuildAccelerationStructuresKHR( |
| 1813 | VkCommandBuffer commandBuffer, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR *pInfos, |
| 1814 | const VkAccelerationStructureBuildRangeInfoKHR *const *ppBuildRangeInfos) const; |
| 1815 | |
| 1816 | bool manual_PreCallValidateBuildAccelerationStructuresKHR( |
| 1817 | VkDevice device, VkDeferredOperationKHR deferredOperation, uint32_t infoCount, |
| 1818 | const VkAccelerationStructureBuildGeometryInfoKHR *pInfos, |
| 1819 | const VkAccelerationStructureBuildRangeInfoKHR *const *ppBuildRangeInfos) const; |
| 1820 | |
| 1821 | bool manual_PreCallValidateGetAccelerationStructureBuildSizesKHR(VkDevice device, VkAccelerationStructureBuildTypeKHR buildType, |
| 1822 | const VkAccelerationStructureBuildGeometryInfoKHR *pBuildInfo, |
| 1823 | const uint32_t *pMaxPrimitiveCounts, |
| 1824 | VkAccelerationStructureBuildSizesInfoKHR *pSizeInfo) const; |
| 1825 | |
Piers Daniell | cb6d803 | 2021-04-19 18:51:26 -0600 | [diff] [blame] | 1826 | bool manual_PreCallValidateCmdSetVertexInputEXT( |
| 1827 | VkCommandBuffer commandBuffer, uint32_t vertexBindingDescriptionCount, |
| 1828 | const VkVertexInputBindingDescription2EXT *pVertexBindingDescriptions, uint32_t vertexAttributeDescriptionCount, |
| 1829 | const VkVertexInputAttributeDescription2EXT *pVertexAttributeDescriptions) const; |
sfricke-samsung | 51303fb | 2021-05-09 19:09:13 -0700 | [diff] [blame] | 1830 | |
| 1831 | bool manual_PreCallValidateCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout, |
| 1832 | VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, |
| 1833 | const void *pValues) const; |
ziga-lunarg | b1dd8a2 | 2021-07-15 17:47:19 +0200 | [diff] [blame] | 1834 | |
| 1835 | bool manual_PreCallValidateMergePipelineCaches(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, |
| 1836 | const VkPipelineCache *pSrcCaches) const; |
| 1837 | |
Nathaniel Cesario | 298d3cb | 2021-08-03 13:49:02 -0600 | [diff] [blame] | 1838 | bool manual_PreCallValidateCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, |
| 1839 | const VkClearColorValue *pColor, uint32_t rangeCount, |
| 1840 | const VkImageSubresourceRange *pRanges) const; |
| 1841 | |
| 1842 | bool ValidateCmdBeginRenderPass(const char *const func_name, const VkRenderPassBeginInfo *const rp_begin) const; |
| 1843 | bool manual_PreCallValidateCmdBeginRenderPass(VkCommandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, |
| 1844 | VkSubpassContents) const; |
| 1845 | bool manual_PreCallValidateCmdBeginRenderPass2KHR(VkCommandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, |
| 1846 | const VkSubpassBeginInfo *) const; |
| 1847 | bool manual_PreCallValidateCmdBeginRenderPass2(VkCommandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, |
| 1848 | const VkSubpassBeginInfo *) const; |
| 1849 | |
ziga-lunarg | c7bb56a | 2021-08-10 09:28:52 +0200 | [diff] [blame] | 1850 | bool manual_PreCallValidateCmdSetDiscardRectangleEXT(VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, |
| 1851 | uint32_t discardRectangleCount, const VkRect2D *pDiscardRectangles) const; |
ziga-lunarg | 3c37dfb | 2021-08-24 12:51:07 +0200 | [diff] [blame] | 1852 | bool manual_PreCallValidateGetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, |
ziga-lunarg | cf340c4 | 2021-08-19 00:13:38 +0200 | [diff] [blame] | 1853 | size_t dataSize, void *pData, VkDeviceSize stride, |
| 1854 | VkQueryResultFlags flags) const; |
| 1855 | bool manual_PreCallValidateCmdBeginConditionalRenderingEXT( |
| 1856 | VkCommandBuffer commandBuffer, const VkConditionalRenderingBeginInfoEXT *pConditionalRenderingBegin) const; |
ziga-lunarg | c7bb56a | 2021-08-10 09:28:52 +0200 | [diff] [blame] | 1857 | |
ziga-lunarg | 50f8e6b | 2021-12-18 20:24:35 +0100 | [diff] [blame] | 1858 | bool ValidateDeviceImageMemoryRequirements(VkDevice device, const VkDeviceImageMemoryRequirementsKHR *pInfo, |
| 1859 | const char *func_name) const; |
| 1860 | |
Mike Schuchardt | 05b028d | 2022-01-05 14:15:00 -0800 | [diff] [blame] | 1861 | bool manual_PreCallValidateGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, |
| 1862 | uint32_t *pSurfaceFormatCount, |
| 1863 | VkSurfaceFormatKHR *pSurfaceFormats) const; |
| 1864 | |
| 1865 | bool manual_PreCallValidateGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, |
| 1866 | uint32_t *pPresentModeCount, |
| 1867 | VkPresentModeKHR *pPresentModes) const; |
| 1868 | |
| 1869 | bool manual_PreCallValidateGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physicalDevice, |
| 1870 | const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, |
| 1871 | VkSurfaceCapabilities2KHR *pSurfaceCapabilities) const; |
| 1872 | |
| 1873 | bool manual_PreCallValidateGetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice, |
| 1874 | const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, |
| 1875 | uint32_t *pSurfaceFormatCount, |
| 1876 | VkSurfaceFormat2KHR *pSurfaceFormats) const; |
| 1877 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 1878 | bool manual_PreCallValidateGetPhysicalDeviceSurfacePresentModes2EXT(VkPhysicalDevice physicalDevice, |
| 1879 | const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, |
| 1880 | uint32_t *pPresentModeCount, |
| 1881 | VkPresentModeKHR *pPresentModes) const; |
| 1882 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 1883 | |
ziga-lunarg | 50f8e6b | 2021-12-18 20:24:35 +0100 | [diff] [blame] | 1884 | bool manual_PreCallValidateGetDeviceImageMemoryRequirementsKHR(VkDevice device, const VkDeviceImageMemoryRequirements *pInfo, |
| 1885 | VkMemoryRequirements2 *pMemoryRequirements) const; |
| 1886 | bool manual_PreCallValidateGetDeviceImageSparseMemoryRequirementsKHR( |
| 1887 | VkDevice device, const VkDeviceImageMemoryRequirements *pInfo, uint32_t *pSparseMemoryRequirementCount, |
| 1888 | VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements) const; |
| 1889 | |
Tony-LunarG | 115f89d | 2022-06-15 10:53:22 -0600 | [diff] [blame] | 1890 | #ifdef VK_USE_PLATFORM_METAL_EXT |
| 1891 | bool manual_PreCallValidateExportMetalObjectsEXT(VkDevice device, VkExportMetalObjectsInfoEXT *pMetalObjectsInfo) const; |
| 1892 | #endif // VK_USE_PLATFORM_METAL_EXT |
| 1893 | |
Mark Lobodzinski | af7c038 | 2018-12-18 11:55:55 -0700 | [diff] [blame] | 1894 | #include "parameter_validation.h" |
| 1895 | }; // Class StatelessValidation |