• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 // This file is ***GENERATED***.  Do Not Edit.
3 // See layer_chassis_generator.py for modifications.
4 
5 /* Copyright (c) 2015-2019 The Khronos Group Inc.
6  * Copyright (c) 2015-2019 Valve Corporation
7  * Copyright (c) 2015-2019 LunarG, Inc.
8  * Copyright (c) 2015-2019 Google Inc.
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  *     http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  * Author: Mark Lobodzinski <mark@lunarg.com>
23  */
24 
25 
26 #include <string.h>
27 #include <mutex>
28 
29 #define VALIDATION_ERROR_MAP_IMPL
30 
31 #include "chassis.h"
32 #include "layer_chassis_dispatch.h"
33 
34 std::unordered_map<void*, ValidationObject*> layer_data_map;
35 
36 // Global unique object identifier.
37 std::atomic<uint64_t> global_unique_id(1ULL);
38 // Map uniqueID to actual object handle. Accesses to the map itself are
39 // internally synchronized.
40 vl_concurrent_unordered_map<uint64_t, uint64_t, 4> unique_id_mapping;
41 
42 // TODO: This variable controls handle wrapping -- in the future it should be hooked
43 //       up to the new VALIDATION_FEATURES extension. Temporarily, control with a compile-time flag.
44 #if defined(LAYER_CHASSIS_CAN_WRAP_HANDLES)
45 bool wrap_handles = true;
46 #else
47 bool wrap_handles = false;
48 #endif
49 
50 // Set layer name -- Khronos layer name overrides any other defined names
51 #if BUILD_KHRONOS_VALIDATION
52 #define OBJECT_LAYER_NAME "VK_LAYER_KHRONOS_validation"
53 #define OBJECT_LAYER_DESCRIPTION "khronos_validation"
54 #elif BUILD_OBJECT_TRACKER
55 #define OBJECT_LAYER_NAME "VK_LAYER_LUNARG_object_tracker"
56 #define OBJECT_LAYER_DESCRIPTION "lunarg_object_tracker"
57 #elif BUILD_THREAD_SAFETY
58 #define OBJECT_LAYER_NAME "VK_LAYER_GOOGLE_threading"
59 #define OBJECT_LAYER_DESCRIPTION "google_thread_checker"
60 #elif BUILD_PARAMETER_VALIDATION
61 #define OBJECT_LAYER_NAME "VK_LAYER_LUNARG_parameter_validation"
62 #define OBJECT_LAYER_DESCRIPTION "lunarg_parameter_validation"
63 #elif BUILD_CORE_VALIDATION
64 #define OBJECT_LAYER_NAME "VK_LAYER_LUNARG_core_validation"
65 #define OBJECT_LAYER_DESCRIPTION "lunarg_core_validation"
66 #else
67 #define OBJECT_LAYER_NAME "VK_LAYER_GOOGLE_unique_objects"
68 #define OBJECT_LAYER_DESCRIPTION "lunarg_unique_objects"
69 #endif
70 
71 // Include layer validation object definitions
72 #if BUILD_OBJECT_TRACKER
73 #include "object_lifetime_validation.h"
74 #endif
75 #if BUILD_THREAD_SAFETY
76 #include "thread_safety.h"
77 #endif
78 #if BUILD_PARAMETER_VALIDATION
79 #include "stateless_validation.h"
80 #endif
81 #if BUILD_CORE_VALIDATION
82 #include "core_validation.h"
83 #endif
84 #if BUILD_BEST_PRACTICES
85 #include "best_practices.h"
86 #endif
87 
88 namespace vulkan_layer_chassis {
89 
90 using std::unordered_map;
91 
92 static const VkLayerProperties global_layer = {
93     OBJECT_LAYER_NAME, VK_LAYER_API_VERSION, 1, "LunarG validation Layer",
94 };
95 
96 static const VkExtensionProperties instance_extensions[] = {{VK_EXT_DEBUG_REPORT_EXTENSION_NAME, VK_EXT_DEBUG_REPORT_SPEC_VERSION},
97                                                             {VK_EXT_DEBUG_UTILS_EXTENSION_NAME, VK_EXT_DEBUG_UTILS_SPEC_VERSION}};
98 static const VkExtensionProperties device_extensions[] = {
99     {VK_EXT_VALIDATION_CACHE_EXTENSION_NAME, VK_EXT_VALIDATION_CACHE_SPEC_VERSION},
100     {VK_EXT_DEBUG_MARKER_EXTENSION_NAME, VK_EXT_DEBUG_MARKER_SPEC_VERSION},
101 };
102 
103 typedef struct {
104     bool is_instance_api;
105     void* funcptr;
106 } function_data;
107 
108 extern const std::unordered_map<std::string, function_data> name_to_funcptr_map;
109 
110 // Manually written functions
111 
112 // Check enabled instance extensions against supported instance extension whitelist
InstanceExtensionWhitelist(ValidationObject * layer_data,const VkInstanceCreateInfo * pCreateInfo,VkInstance instance)113 static void InstanceExtensionWhitelist(ValidationObject *layer_data, const VkInstanceCreateInfo *pCreateInfo, VkInstance instance) {
114     for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) {
115         // Check for recognized instance extensions
116         if (!white_list(pCreateInfo->ppEnabledExtensionNames[i], kInstanceExtensionNames)) {
117             log_msg(layer_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
118                     kVUIDUndefined,
119                     "Instance Extension %s is not supported by this layer.  Using this extension may adversely affect validation "
120                     "results and/or produce undefined behavior.",
121                     pCreateInfo->ppEnabledExtensionNames[i]);
122         }
123     }
124 }
125 
126 // Check enabled device extensions against supported device extension whitelist
DeviceExtensionWhitelist(ValidationObject * layer_data,const VkDeviceCreateInfo * pCreateInfo,VkDevice device)127 static void DeviceExtensionWhitelist(ValidationObject *layer_data, const VkDeviceCreateInfo *pCreateInfo, VkDevice device) {
128     for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) {
129         // Check for recognized device extensions
130         if (!white_list(pCreateInfo->ppEnabledExtensionNames[i], kDeviceExtensionNames)) {
131             log_msg(layer_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
132                     kVUIDUndefined,
133                     "Device Extension %s is not supported by this layer.  Using this extension may adversely affect validation "
134                     "results and/or produce undefined behavior.",
135                     pCreateInfo->ppEnabledExtensionNames[i]);
136         }
137     }
138 }
139 
140 
141 // Process validation features, flags and settings specified through extensions, a layer settings file, or environment variables
142 
143 static const std::unordered_map<std::string, VkValidationFeatureDisableEXT> VkValFeatureDisableLookup = {
144     {"VK_VALIDATION_FEATURE_DISABLE_SHADERS_EXT", VK_VALIDATION_FEATURE_DISABLE_SHADERS_EXT},
145     {"VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT},
146     {"VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT", VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT},
147     {"VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT", VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT},
148     {"VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT", VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT},
149     {"VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT},
150     {"VK_VALIDATION_FEATURE_DISABLE_ALL_EXT", VK_VALIDATION_FEATURE_DISABLE_ALL_EXT},
151 };
152 
153 static const std::unordered_map<std::string, VkValidationFeatureEnableEXT> VkValFeatureEnableLookup = {
154     {"VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT", VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT},
155     {"VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT", VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT},
156 };
157 
158 static const std::unordered_map<std::string, VkValidationFeatureEnable> VkValFeatureEnableLookup2 = {
159     {"VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES", VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES},
160 };
161 
162 static const std::unordered_map<std::string, ValidationCheckDisables> ValidationDisableLookup = {
163     {"VALIDATION_CHECK_DISABLE_COMMAND_BUFFER_STATE", VALIDATION_CHECK_DISABLE_COMMAND_BUFFER_STATE},
164     {"VALIDATION_CHECK_DISABLE_OBJECT_IN_USE", VALIDATION_CHECK_DISABLE_OBJECT_IN_USE},
165     {"VALIDATION_CHECK_DISABLE_IDLE_DESCRIPTOR_SET", VALIDATION_CHECK_DISABLE_IDLE_DESCRIPTOR_SET},
166     {"VALIDATION_CHECK_DISABLE_PUSH_CONSTANT_RANGE", VALIDATION_CHECK_DISABLE_PUSH_CONSTANT_RANGE},
167     {"VALIDATION_CHECK_DISABLE_QUERY_VALIDATION", VALIDATION_CHECK_DISABLE_QUERY_VALIDATION},
168     {"VALIDATION_CHECK_DISABLE_IMAGE_LAYOUT_VALIDATION", VALIDATION_CHECK_DISABLE_IMAGE_LAYOUT_VALIDATION},
169 };
170 
171 // Set the local disable flag for the appropriate VALIDATION_CHECK_DISABLE enum
SetValidationDisable(CHECK_DISABLED * disable_data,const ValidationCheckDisables disable_id)172 void SetValidationDisable(CHECK_DISABLED* disable_data, const ValidationCheckDisables disable_id) {
173     switch (disable_id) {
174         case VALIDATION_CHECK_DISABLE_COMMAND_BUFFER_STATE:
175             disable_data->command_buffer_state = true;
176             break;
177         case VALIDATION_CHECK_DISABLE_OBJECT_IN_USE:
178             disable_data->object_in_use = true;
179             break;
180         case VALIDATION_CHECK_DISABLE_IDLE_DESCRIPTOR_SET:
181             disable_data->idle_descriptor_set = true;
182             break;
183         case VALIDATION_CHECK_DISABLE_PUSH_CONSTANT_RANGE:
184             disable_data->push_constant_range = true;
185             break;
186         case VALIDATION_CHECK_DISABLE_QUERY_VALIDATION:
187             disable_data->query_validation = true;
188             break;
189         case VALIDATION_CHECK_DISABLE_IMAGE_LAYOUT_VALIDATION:
190             disable_data->image_layout_validation = true;
191             break;
192         default:
193             assert(true);
194     }
195 }
196 
197 // Set the local disable flag for a single VK_VALIDATION_FEATURE_DISABLE_* flag
SetValidationFeatureDisable(CHECK_DISABLED * disable_data,const VkValidationFeatureDisableEXT feature_disable)198 void SetValidationFeatureDisable(CHECK_DISABLED* disable_data, const VkValidationFeatureDisableEXT feature_disable) {
199     switch (feature_disable) {
200         case VK_VALIDATION_FEATURE_DISABLE_SHADERS_EXT:
201             disable_data->shader_validation = true;
202             break;
203         case VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT:
204             disable_data->thread_safety = true;
205             break;
206         case VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT:
207             disable_data->stateless_checks = true;
208             break;
209         case VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT:
210             disable_data->object_tracking = true;
211             break;
212         case VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT:
213             disable_data->core_checks = true;
214             break;
215         case VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT:
216             disable_data->handle_wrapping = true;
217             break;
218         case VK_VALIDATION_FEATURE_DISABLE_ALL_EXT:
219             // Set all disabled flags to true
220             disable_data->SetAll(true);
221             break;
222         default:
223             break;
224     }
225 }
226 
227 // Set the local enable flag for a single VK_VALIDATION_FEATURE_ENABLE_* flag
SetValidationFeatureEnable(CHECK_ENABLED * enable_data,const VkValidationFeatureEnableEXT feature_enable)228 void SetValidationFeatureEnable(CHECK_ENABLED *enable_data, const VkValidationFeatureEnableEXT feature_enable) {
229     switch (feature_enable) {
230         case VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT:
231             enable_data->gpu_validation = true;
232             break;
233         case VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT:
234             enable_data->gpu_validation_reserve_binding_slot = true;
235             break;
236         default:
237             break;
238     }
239 }
240 
SetValidationFeatureEnable(CHECK_ENABLED * enable_data,const VkValidationFeatureEnable feature_enable)241 void SetValidationFeatureEnable(CHECK_ENABLED *enable_data, const VkValidationFeatureEnable feature_enable) {
242     switch(feature_enable) {
243         case VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES:
244             enable_data->best_practices = true;
245             break;
246         default:
247             break;
248     }
249 }
250 
251 // Set the local disable flag for settings specified through the VK_EXT_validation_flags extension
SetValidationFlags(CHECK_DISABLED * disables,const VkValidationFlagsEXT * val_flags_struct)252 void SetValidationFlags(CHECK_DISABLED* disables, const VkValidationFlagsEXT* val_flags_struct) {
253     for (uint32_t i = 0; i < val_flags_struct->disabledValidationCheckCount; ++i) {
254         switch (val_flags_struct->pDisabledValidationChecks[i]) {
255             case VK_VALIDATION_CHECK_SHADERS_EXT:
256                 disables->shader_validation = true;
257                 break;
258             case VK_VALIDATION_CHECK_ALL_EXT:
259                 // Set all disabled flags to true
260                 disables->SetAll(true);
261                 break;
262             default:
263                 break;
264         }
265     }
266 }
267 
268 // Process Validation Features flags specified through the ValidationFeature extension
SetValidationFeatures(CHECK_DISABLED * disable_data,CHECK_ENABLED * enable_data,const VkValidationFeaturesEXT * val_features_struct)269 void SetValidationFeatures(CHECK_DISABLED *disable_data, CHECK_ENABLED *enable_data,
270                            const VkValidationFeaturesEXT *val_features_struct) {
271     for (uint32_t i = 0; i < val_features_struct->disabledValidationFeatureCount; ++i) {
272         SetValidationFeatureDisable(disable_data, val_features_struct->pDisabledValidationFeatures[i]);
273     }
274     for (uint32_t i = 0; i < val_features_struct->enabledValidationFeatureCount; ++i) {
275         SetValidationFeatureEnable(enable_data, val_features_struct->pEnabledValidationFeatures[i]);
276     }
277 }
278 
279 // Given a string representation of a list of enable enum values, call the appropriate setter function
SetLocalEnableSetting(std::string list_of_enables,std::string delimiter,CHECK_ENABLED * enables)280 void SetLocalEnableSetting(std::string list_of_enables, std::string delimiter, CHECK_ENABLED* enables) {
281     size_t pos = 0;
282     std::string token;
283     while (list_of_enables.length() != 0) {
284         pos = list_of_enables.find(delimiter);
285         if (pos != std::string::npos) {
286             token = list_of_enables.substr(0, pos);
287         } else {
288             pos = list_of_enables.length() - delimiter.length();
289             token = list_of_enables;
290         }
291         if (token.find("VK_VALIDATION_FEATURE_ENABLE_") != std::string::npos) {
292             auto result = VkValFeatureEnableLookup.find(token);
293             if (result != VkValFeatureEnableLookup.end()) {
294                 SetValidationFeatureEnable(enables, result->second);
295             } else {
296                 auto result2 = VkValFeatureEnableLookup2.find(token);
297                 if (result2 != VkValFeatureEnableLookup2.end()) {
298                     SetValidationFeatureEnable(enables, result2->second);
299                 }
300             }
301         }
302         list_of_enables.erase(0, pos + delimiter.length());
303     }
304 }
305 
306 // Given a string representation of a list of disable enum values, call the appropriate setter function
SetLocalDisableSetting(std::string list_of_disables,std::string delimiter,CHECK_DISABLED * disables)307 void SetLocalDisableSetting(std::string list_of_disables, std::string delimiter, CHECK_DISABLED* disables) {
308     size_t pos = 0;
309     std::string token;
310     while (list_of_disables.length() != 0) {
311         pos = list_of_disables.find(delimiter);
312         if (pos != std::string::npos) {
313             token = list_of_disables.substr(0, pos);
314         } else {
315             pos = list_of_disables.length() - delimiter.length();
316             token = list_of_disables;
317         }
318         if (token.find("VK_VALIDATION_FEATURE_DISABLE_") != std::string::npos) {
319             auto result = VkValFeatureDisableLookup.find(token);
320             if (result != VkValFeatureDisableLookup.end()) {
321                 SetValidationFeatureDisable(disables, result->second);
322             }
323         }
324         if (token.find("VALIDATION_CHECK_DISABLE_") != std::string::npos) {
325             auto result = ValidationDisableLookup.find(token);
326             if (result != ValidationDisableLookup.end()) {
327                 SetValidationDisable(disables, result->second);
328             }
329         }
330         list_of_disables.erase(0, pos + delimiter.length());
331     }
332 }
333 
334 // Process enables and disables set though the vk_layer_settings.txt config file or through an environment variable
ProcessConfigAndEnvSettings(const char * layer_description,CHECK_ENABLED * enables,CHECK_DISABLED * disables)335 void ProcessConfigAndEnvSettings(const char* layer_description, CHECK_ENABLED* enables, CHECK_DISABLED* disables) {
336     std::string enable_key = layer_description;
337     std::string disable_key = layer_description;
338     enable_key.append(".enables");
339     disable_key.append(".disables");
340     std::string list_of_config_enables = getLayerOption(enable_key.c_str());
341     std::string list_of_env_enables = GetLayerEnvVar("VK_LAYER_ENABLES");
342     std::string list_of_config_disables = getLayerOption(disable_key.c_str());
343     std::string list_of_env_disables = GetLayerEnvVar("VK_LAYER_DISABLES");
344 #if defined(_WIN32)
345     std::string env_delimiter = ";";
346 #else
347     std::string env_delimiter = ":";
348 #endif
349     SetLocalEnableSetting(list_of_config_enables, ",", enables);
350     SetLocalEnableSetting(list_of_env_enables, env_delimiter, enables);
351     SetLocalDisableSetting(list_of_config_disables, ",", disables);
352     SetLocalDisableSetting(list_of_env_disables, env_delimiter, disables);
353 }
354 
355 
356 // Non-code-generated chassis API functions
357 
GetDeviceProcAddr(VkDevice device,const char * funcName)358 VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL GetDeviceProcAddr(VkDevice device, const char *funcName) {
359     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
360     if (!ApiParentExtensionEnabled(funcName, &layer_data->device_extensions)) {
361         return nullptr;
362     }
363     const auto &item = name_to_funcptr_map.find(funcName);
364     if (item != name_to_funcptr_map.end()) {
365         if (item->second.is_instance_api) {
366             return nullptr;
367         } else {
368             return reinterpret_cast<PFN_vkVoidFunction>(item->second.funcptr);
369         }
370     }
371     auto &table = layer_data->device_dispatch_table;
372     if (!table.GetDeviceProcAddr) return nullptr;
373     return table.GetDeviceProcAddr(device, funcName);
374 }
375 
GetInstanceProcAddr(VkInstance instance,const char * funcName)376 VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL GetInstanceProcAddr(VkInstance instance, const char *funcName) {
377     const auto &item = name_to_funcptr_map.find(funcName);
378     if (item != name_to_funcptr_map.end()) {
379         return reinterpret_cast<PFN_vkVoidFunction>(item->second.funcptr);
380     }
381     auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map);
382     auto &table = layer_data->instance_dispatch_table;
383     if (!table.GetInstanceProcAddr) return nullptr;
384     return table.GetInstanceProcAddr(instance, funcName);
385 }
386 
EnumerateInstanceLayerProperties(uint32_t * pCount,VkLayerProperties * pProperties)387 VKAPI_ATTR VkResult VKAPI_CALL EnumerateInstanceLayerProperties(uint32_t *pCount, VkLayerProperties *pProperties) {
388     return util_GetLayerProperties(1, &global_layer, pCount, pProperties);
389 }
390 
EnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice,uint32_t * pCount,VkLayerProperties * pProperties)391 VKAPI_ATTR VkResult VKAPI_CALL EnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t *pCount,
392                                                               VkLayerProperties *pProperties) {
393     return util_GetLayerProperties(1, &global_layer, pCount, pProperties);
394 }
395 
EnumerateInstanceExtensionProperties(const char * pLayerName,uint32_t * pCount,VkExtensionProperties * pProperties)396 VKAPI_ATTR VkResult VKAPI_CALL EnumerateInstanceExtensionProperties(const char *pLayerName, uint32_t *pCount,
397                                                                     VkExtensionProperties *pProperties) {
398     if (pLayerName && !strcmp(pLayerName, global_layer.layerName))
399         return util_GetExtensionProperties(ARRAY_SIZE(instance_extensions), instance_extensions, pCount, pProperties);
400 
401     return VK_ERROR_LAYER_NOT_PRESENT;
402 }
403 
EnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice,const char * pLayerName,uint32_t * pCount,VkExtensionProperties * pProperties)404 VKAPI_ATTR VkResult VKAPI_CALL EnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char *pLayerName,
405                                                                   uint32_t *pCount, VkExtensionProperties *pProperties) {
406     if (pLayerName && !strcmp(pLayerName, global_layer.layerName)) return util_GetExtensionProperties(ARRAY_SIZE(device_extensions), device_extensions, pCount, pProperties);
407     assert(physicalDevice);
408     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
409     return layer_data->instance_dispatch_table.EnumerateDeviceExtensionProperties(physicalDevice, pLayerName, pCount, pProperties);
410 }
411 
CreateInstance(const VkInstanceCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkInstance * pInstance)412 VKAPI_ATTR VkResult VKAPI_CALL CreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator,
413                                               VkInstance *pInstance) {
414     VkLayerInstanceCreateInfo* chain_info = get_chain_info(pCreateInfo, VK_LAYER_LINK_INFO);
415 
416     assert(chain_info->u.pLayerInfo);
417     PFN_vkGetInstanceProcAddr fpGetInstanceProcAddr = chain_info->u.pLayerInfo->pfnNextGetInstanceProcAddr;
418     PFN_vkCreateInstance fpCreateInstance = (PFN_vkCreateInstance)fpGetInstanceProcAddr(NULL, "vkCreateInstance");
419     if (fpCreateInstance == NULL) return VK_ERROR_INITIALIZATION_FAILED;
420     chain_info->u.pLayerInfo = chain_info->u.pLayerInfo->pNext;
421     uint32_t specified_version = (pCreateInfo->pApplicationInfo ? pCreateInfo->pApplicationInfo->apiVersion : VK_API_VERSION_1_0);
422     uint32_t api_version = (specified_version < VK_API_VERSION_1_1) ? VK_API_VERSION_1_0 : VK_API_VERSION_1_1;
423 
424     CHECK_ENABLED local_enables {};
425     CHECK_DISABLED local_disables {};
426     const auto *validation_features_ext = lvl_find_in_chain<VkValidationFeaturesEXT>(pCreateInfo->pNext);
427     if (validation_features_ext) {
428         SetValidationFeatures(&local_disables, &local_enables, validation_features_ext);
429     }
430     const auto *validation_flags_ext = lvl_find_in_chain<VkValidationFlagsEXT>(pCreateInfo->pNext);
431     if (validation_flags_ext) {
432         SetValidationFlags(&local_disables, validation_flags_ext);
433     }
434     ProcessConfigAndEnvSettings(OBJECT_LAYER_DESCRIPTION, &local_enables, &local_disables);
435 
436     // Create temporary dispatch vector for pre-calls until instance is created
437     std::vector<ValidationObject*> local_object_dispatch;
438     // Add VOs to dispatch vector. Order here will be the validation dispatch order!
439 #if BUILD_THREAD_SAFETY
440     auto thread_checker = new ThreadSafety;
441     if (!local_disables.thread_safety) {
442         local_object_dispatch.emplace_back(thread_checker);
443     }
444     thread_checker->container_type = LayerObjectTypeThreading;
445     thread_checker->api_version = api_version;
446 #endif
447 #if BUILD_PARAMETER_VALIDATION
448     auto parameter_validation = new StatelessValidation;
449     if (!local_disables.stateless_checks) {
450         local_object_dispatch.emplace_back(parameter_validation);
451     }
452     parameter_validation->container_type = LayerObjectTypeParameterValidation;
453     parameter_validation->api_version = api_version;
454 #endif
455 #if BUILD_OBJECT_TRACKER
456     auto object_tracker = new ObjectLifetimes;
457     if (!local_disables.object_tracking) {
458         local_object_dispatch.emplace_back(object_tracker);
459     }
460     object_tracker->container_type = LayerObjectTypeObjectTracker;
461     object_tracker->api_version = api_version;
462 #endif
463 #if BUILD_CORE_VALIDATION
464     auto core_checks = new CoreChecks;
465     if (!local_disables.core_checks) {
466         local_object_dispatch.emplace_back(core_checks);
467     }
468     core_checks->container_type = LayerObjectTypeCoreValidation;
469     core_checks->api_version = api_version;
470 #endif
471 #if BUILD_BEST_PRACTICES
472     auto best_practices = new BestPractices;
473     if (local_enables.best_practices) {
474         local_object_dispatch.emplace_back(best_practices);
475     }
476     best_practices->container_type = LayerObjectTypeBestPractices;
477     best_practices->api_version = api_version;
478 #endif
479 
480     // If handle wrapping is disabled via the ValidationFeatures extension, override build flag
481     if (local_disables.handle_wrapping) {
482         wrap_handles = false;
483     }
484 
485     // Init dispatch array and call registration functions
486     for (auto intercept : local_object_dispatch) {
487         intercept->PreCallValidateCreateInstance(pCreateInfo, pAllocator, pInstance);
488     }
489     for (auto intercept : local_object_dispatch) {
490         intercept->PreCallRecordCreateInstance(pCreateInfo, pAllocator, pInstance);
491     }
492 
493     VkResult result = fpCreateInstance(pCreateInfo, pAllocator, pInstance);
494     if (result != VK_SUCCESS) return result;
495 
496     auto framework = GetLayerDataPtr(get_dispatch_key(*pInstance), layer_data_map);
497 
498     framework->object_dispatch = local_object_dispatch;
499     framework->container_type = LayerObjectTypeInstance;
500     framework->disabled = local_disables;
501     framework->enabled = local_enables;
502 
503     framework->instance = *pInstance;
504     layer_init_instance_dispatch_table(*pInstance, &framework->instance_dispatch_table, fpGetInstanceProcAddr);
505     framework->report_data = debug_utils_create_instance(&framework->instance_dispatch_table, *pInstance, pCreateInfo->enabledExtensionCount,
506                                                          pCreateInfo->ppEnabledExtensionNames);
507     framework->api_version = api_version;
508     framework->instance_extensions.InitFromInstanceCreateInfo(specified_version, pCreateInfo);
509 
510     layer_debug_messenger_actions(framework->report_data, framework->logging_messenger, pAllocator, OBJECT_LAYER_DESCRIPTION);
511 
512 #if BUILD_OBJECT_TRACKER
513     object_tracker->report_data = framework->report_data;
514     object_tracker->instance_dispatch_table = framework->instance_dispatch_table;
515     object_tracker->enabled = framework->enabled;
516     object_tracker->disabled = framework->disabled;
517 #endif
518 #if BUILD_THREAD_SAFETY
519     thread_checker->report_data = framework->report_data;
520     thread_checker->instance_dispatch_table = framework->instance_dispatch_table;
521     thread_checker->enabled = framework->enabled;
522     thread_checker->disabled = framework->disabled;
523 #endif
524 #if BUILD_PARAMETER_VALIDATION
525     parameter_validation->report_data = framework->report_data;
526     parameter_validation->instance_dispatch_table = framework->instance_dispatch_table;
527     parameter_validation->enabled = framework->enabled;
528     parameter_validation->disabled = framework->disabled;
529 #endif
530 #if BUILD_CORE_VALIDATION
531     core_checks->report_data = framework->report_data;
532     core_checks->instance_dispatch_table = framework->instance_dispatch_table;
533     core_checks->instance = *pInstance;
534     core_checks->enabled = framework->enabled;
535     core_checks->disabled = framework->disabled;
536     core_checks->instance_state = core_checks;
537 #endif
538 #if BUILD_BEST_PRACTICES
539     best_practices->report_data = framework->report_data;
540     best_practices->instance_dispatch_table = framework->instance_dispatch_table;
541     best_practices->enabled = framework->enabled;
542     best_practices->disabled = framework->disabled;
543 #endif
544 
545     for (auto intercept : framework->object_dispatch) {
546         intercept->PostCallRecordCreateInstance(pCreateInfo, pAllocator, pInstance, result);
547     }
548 
549     InstanceExtensionWhitelist(framework, pCreateInfo, *pInstance);
550 
551     return result;
552 }
553 
DestroyInstance(VkInstance instance,const VkAllocationCallbacks * pAllocator)554 VKAPI_ATTR void VKAPI_CALL DestroyInstance(VkInstance instance, const VkAllocationCallbacks *pAllocator) {
555     dispatch_key key = get_dispatch_key(instance);
556     auto layer_data = GetLayerDataPtr(key, layer_data_map);
557     for (auto intercept : layer_data->object_dispatch) {
558         auto lock = intercept->write_lock();
559         intercept->PreCallValidateDestroyInstance(instance, pAllocator);
560     }
561     for (auto intercept : layer_data->object_dispatch) {
562         auto lock = intercept->write_lock();
563         intercept->PreCallRecordDestroyInstance(instance, pAllocator);
564     }
565 
566     layer_data->instance_dispatch_table.DestroyInstance(instance, pAllocator);
567 
568     for (auto intercept : layer_data->object_dispatch) {
569         auto lock = intercept->write_lock();
570         intercept->PostCallRecordDestroyInstance(instance, pAllocator);
571     }
572     // Clean up logging callback, if any
573     while (layer_data->logging_messenger.size() > 0) {
574         VkDebugUtilsMessengerEXT messenger = layer_data->logging_messenger.back();
575         layer_destroy_messenger_callback(layer_data->report_data, messenger, pAllocator);
576         layer_data->logging_messenger.pop_back();
577     }
578     while (layer_data->logging_callback.size() > 0) {
579         VkDebugReportCallbackEXT callback = layer_data->logging_callback.back();
580         layer_destroy_report_callback(layer_data->report_data, callback, pAllocator);
581         layer_data->logging_callback.pop_back();
582     }
583 
584     layer_debug_utils_destroy_instance(layer_data->report_data);
585 
586     for (auto item = layer_data->object_dispatch.begin(); item != layer_data->object_dispatch.end(); item++) {
587         delete *item;
588     }
589     FreeLayerDataPtr(key, layer_data_map);
590 }
591 
CreateDevice(VkPhysicalDevice gpu,const VkDeviceCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkDevice * pDevice)592 VKAPI_ATTR VkResult VKAPI_CALL CreateDevice(VkPhysicalDevice gpu, const VkDeviceCreateInfo *pCreateInfo,
593                                             const VkAllocationCallbacks *pAllocator, VkDevice *pDevice) {
594     VkLayerDeviceCreateInfo *chain_info = get_chain_info(pCreateInfo, VK_LAYER_LINK_INFO);
595 
596     auto instance_interceptor = GetLayerDataPtr(get_dispatch_key(gpu), layer_data_map);
597 
598     PFN_vkGetInstanceProcAddr fpGetInstanceProcAddr = chain_info->u.pLayerInfo->pfnNextGetInstanceProcAddr;
599     PFN_vkGetDeviceProcAddr fpGetDeviceProcAddr = chain_info->u.pLayerInfo->pfnNextGetDeviceProcAddr;
600     PFN_vkCreateDevice fpCreateDevice = (PFN_vkCreateDevice)fpGetInstanceProcAddr(instance_interceptor->instance, "vkCreateDevice");
601     if (fpCreateDevice == NULL) {
602         return VK_ERROR_INITIALIZATION_FAILED;
603     }
604     chain_info->u.pLayerInfo = chain_info->u.pLayerInfo->pNext;
605 
606     // Get physical device limits for device
607     VkPhysicalDeviceProperties device_properties = {};
608     instance_interceptor->instance_dispatch_table.GetPhysicalDeviceProperties(gpu, &device_properties);
609 
610     // Setup the validation tables based on the application API version from the instance and the capabilities of the device driver
611     uint32_t effective_api_version = std::min(device_properties.apiVersion, instance_interceptor->api_version);
612 
613     DeviceExtensions device_extensions = {};
614     device_extensions.InitFromDeviceCreateInfo(&instance_interceptor->instance_extensions, effective_api_version, pCreateInfo);
615     for (auto item : instance_interceptor->object_dispatch) {
616         item->device_extensions = device_extensions;
617     }
618 
619     safe_VkDeviceCreateInfo modified_create_info(pCreateInfo);
620 
621     bool skip = false;
622     for (auto intercept : instance_interceptor->object_dispatch) {
623         auto lock = intercept->write_lock();
624         skip |= intercept->PreCallValidateCreateDevice(gpu, pCreateInfo, pAllocator, pDevice);
625         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
626     }
627     for (auto intercept : instance_interceptor->object_dispatch) {
628         auto lock = intercept->write_lock();
629         intercept->PreCallRecordCreateDevice(gpu, pCreateInfo, pAllocator, pDevice, &modified_create_info);
630     }
631 
632     VkResult result = fpCreateDevice(gpu, reinterpret_cast<VkDeviceCreateInfo *>(&modified_create_info), pAllocator, pDevice);
633     if (result != VK_SUCCESS) {
634         return result;
635     }
636 
637     auto device_interceptor = GetLayerDataPtr(get_dispatch_key(*pDevice), layer_data_map);
638     device_interceptor->container_type = LayerObjectTypeDevice;
639 
640     // Save local info in device object
641     device_interceptor->phys_dev_properties.properties = device_properties;
642     device_interceptor->api_version = device_interceptor->device_extensions.InitFromDeviceCreateInfo(
643         &instance_interceptor->instance_extensions, effective_api_version, pCreateInfo);
644     device_interceptor->device_extensions = device_extensions;
645 
646     layer_init_device_dispatch_table(*pDevice, &device_interceptor->device_dispatch_table, fpGetDeviceProcAddr);
647 
648     device_interceptor->device = *pDevice;
649     device_interceptor->physical_device = gpu;
650     device_interceptor->instance = instance_interceptor->instance;
651     device_interceptor->report_data = layer_debug_utils_create_device(instance_interceptor->report_data, *pDevice);
652 
653     // Note that this defines the order in which the layer validation objects are called
654 #if BUILD_THREAD_SAFETY
655     auto thread_safety = new ThreadSafety;
656     thread_safety->container_type = LayerObjectTypeThreading;
657     if (!instance_interceptor->disabled.thread_safety) {
658         device_interceptor->object_dispatch.emplace_back(thread_safety);
659     }
660 #endif
661 #if BUILD_PARAMETER_VALIDATION
662     auto stateless_validation = new StatelessValidation;
663     stateless_validation->container_type = LayerObjectTypeParameterValidation;
664     if (!instance_interceptor->disabled.stateless_checks) {
665         device_interceptor->object_dispatch.emplace_back(stateless_validation);
666     }
667 #endif
668 #if BUILD_OBJECT_TRACKER
669     auto object_tracker = new ObjectLifetimes;
670     object_tracker->container_type = LayerObjectTypeObjectTracker;
671     if (!instance_interceptor->disabled.object_tracking) {
672         device_interceptor->object_dispatch.emplace_back(object_tracker);
673     }
674 #endif
675 #if BUILD_CORE_VALIDATION
676     auto core_checks = new CoreChecks;
677     core_checks->container_type = LayerObjectTypeCoreValidation;
678     core_checks->instance_state = reinterpret_cast<CoreChecks *>(
679         core_checks->GetValidationObject(instance_interceptor->object_dispatch, LayerObjectTypeCoreValidation));
680     if (!instance_interceptor->disabled.core_checks) {
681         device_interceptor->object_dispatch.emplace_back(core_checks);
682     }
683 #endif
684 #if BUILD_BEST_PRACTICES
685     auto best_practices = new BestPractices;
686     best_practices->container_type = LayerObjectTypeBestPractices;
687     if (instance_interceptor->enabled.best_practices) {
688         device_interceptor->object_dispatch.emplace_back(best_practices);
689     }
690 #endif
691 
692     // Set per-intercept common data items
693     for (auto dev_intercept : device_interceptor->object_dispatch) {
694         dev_intercept->device = *pDevice;
695         dev_intercept->physical_device = gpu;
696         dev_intercept->instance = instance_interceptor->instance;
697         dev_intercept->report_data = device_interceptor->report_data;
698         dev_intercept->device_dispatch_table = device_interceptor->device_dispatch_table;
699         dev_intercept->api_version = device_interceptor->api_version;
700         dev_intercept->disabled = instance_interceptor->disabled;
701         dev_intercept->enabled = instance_interceptor->enabled;
702         dev_intercept->instance_dispatch_table = instance_interceptor->instance_dispatch_table;
703         dev_intercept->instance_extensions = instance_interceptor->instance_extensions;
704         dev_intercept->device_extensions = device_interceptor->device_extensions;
705     }
706 
707     for (auto intercept : instance_interceptor->object_dispatch) {
708         auto lock = intercept->write_lock();
709         intercept->PostCallRecordCreateDevice(gpu, pCreateInfo, pAllocator, pDevice, result);
710     }
711 
712     DeviceExtensionWhitelist(device_interceptor, pCreateInfo, *pDevice);
713 
714     return result;
715 }
716 
DestroyDevice(VkDevice device,const VkAllocationCallbacks * pAllocator)717 VKAPI_ATTR void VKAPI_CALL DestroyDevice(VkDevice device, const VkAllocationCallbacks *pAllocator) {
718     dispatch_key key = get_dispatch_key(device);
719     auto layer_data = GetLayerDataPtr(key, layer_data_map);
720     for (auto intercept : layer_data->object_dispatch) {
721         auto lock = intercept->write_lock();
722         intercept->PreCallValidateDestroyDevice(device, pAllocator);
723     }
724     for (auto intercept : layer_data->object_dispatch) {
725         auto lock = intercept->write_lock();
726         intercept->PreCallRecordDestroyDevice(device, pAllocator);
727     }
728     layer_debug_utils_destroy_device(device);
729 
730     layer_data->device_dispatch_table.DestroyDevice(device, pAllocator);
731 
732     for (auto intercept : layer_data->object_dispatch) {
733         auto lock = intercept->write_lock();
734         intercept->PostCallRecordDestroyDevice(device, pAllocator);
735     }
736 
737     for (auto item = layer_data->object_dispatch.begin(); item != layer_data->object_dispatch.end(); item++) {
738         delete *item;
739     }
740     FreeLayerDataPtr(key, layer_data_map);
741 }
742 
743 
744 // Special-case APIs for which core_validation needs custom parameter lists and/or modifies parameters
745 
CreateGraphicsPipelines(VkDevice device,VkPipelineCache pipelineCache,uint32_t createInfoCount,const VkGraphicsPipelineCreateInfo * pCreateInfos,const VkAllocationCallbacks * pAllocator,VkPipeline * pPipelines)746 VKAPI_ATTR VkResult VKAPI_CALL CreateGraphicsPipelines(
747     VkDevice                                    device,
748     VkPipelineCache                             pipelineCache,
749     uint32_t                                    createInfoCount,
750     const VkGraphicsPipelineCreateInfo*         pCreateInfos,
751     const VkAllocationCallbacks*                pAllocator,
752     VkPipeline*                                 pPipelines) {
753     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
754     bool skip = false;
755 
756 #ifdef BUILD_CORE_VALIDATION
757         create_graphics_pipeline_api_state cgpl_state{};
758 #else
759         struct create_graphics_pipeline_api_state {
760             const VkGraphicsPipelineCreateInfo* pCreateInfos;
761         } cgpl_state;
762 #endif
763     cgpl_state.pCreateInfos = pCreateInfos;
764 
765     for (auto intercept : layer_data->object_dispatch) {
766         auto lock = intercept->write_lock();
767         skip |= intercept->PreCallValidateCreateGraphicsPipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines, &cgpl_state);
768         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
769     }
770     for (auto intercept : layer_data->object_dispatch) {
771         auto lock = intercept->write_lock();
772         intercept->PreCallRecordCreateGraphicsPipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines, &cgpl_state);
773     }
774 
775     VkResult result = DispatchCreateGraphicsPipelines(device, pipelineCache, createInfoCount, cgpl_state.pCreateInfos, pAllocator, pPipelines);
776 
777     for (auto intercept : layer_data->object_dispatch) {
778         auto lock = intercept->write_lock();
779         intercept->PostCallRecordCreateGraphicsPipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines, result, &cgpl_state);
780     }
781     return result;
782 }
783 
784 // This API saves some core_validation pipeline state state on the stack for performance purposes
CreateComputePipelines(VkDevice device,VkPipelineCache pipelineCache,uint32_t createInfoCount,const VkComputePipelineCreateInfo * pCreateInfos,const VkAllocationCallbacks * pAllocator,VkPipeline * pPipelines)785 VKAPI_ATTR VkResult VKAPI_CALL CreateComputePipelines(
786     VkDevice                                    device,
787     VkPipelineCache                             pipelineCache,
788     uint32_t                                    createInfoCount,
789     const VkComputePipelineCreateInfo*          pCreateInfos,
790     const VkAllocationCallbacks*                pAllocator,
791     VkPipeline*                                 pPipelines) {
792     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
793     bool skip = false;
794 
795 #ifdef BUILD_CORE_VALIDATION
796     create_compute_pipeline_api_state ccpl_state{};
797 #else
798     struct create_compute_pipeline_api_state {
799         const VkComputePipelineCreateInfo* pCreateInfos;
800     } ccpl_state;
801 #endif
802     ccpl_state.pCreateInfos = pCreateInfos;
803 
804     for (auto intercept : layer_data->object_dispatch) {
805         auto lock = intercept->write_lock();
806         skip |= intercept->PreCallValidateCreateComputePipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines, &ccpl_state);
807         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
808     }
809     for (auto intercept : layer_data->object_dispatch) {
810         auto lock = intercept->write_lock();
811         intercept->PreCallRecordCreateComputePipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines, &ccpl_state);
812     }
813     VkResult result = DispatchCreateComputePipelines(device, pipelineCache, createInfoCount, ccpl_state.pCreateInfos, pAllocator, pPipelines);
814     for (auto intercept : layer_data->object_dispatch) {
815         auto lock = intercept->write_lock();
816         intercept->PostCallRecordCreateComputePipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines, result, &ccpl_state);
817     }
818     return result;
819 }
820 
CreateRayTracingPipelinesNV(VkDevice device,VkPipelineCache pipelineCache,uint32_t createInfoCount,const VkRayTracingPipelineCreateInfoNV * pCreateInfos,const VkAllocationCallbacks * pAllocator,VkPipeline * pPipelines)821 VKAPI_ATTR VkResult VKAPI_CALL CreateRayTracingPipelinesNV(
822     VkDevice                                    device,
823     VkPipelineCache                             pipelineCache,
824     uint32_t                                    createInfoCount,
825     const VkRayTracingPipelineCreateInfoNV*     pCreateInfos,
826     const VkAllocationCallbacks*                pAllocator,
827     VkPipeline*                                 pPipelines) {
828     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
829     bool skip = false;
830 
831 #ifdef BUILD_CORE_VALIDATION
832     create_ray_tracing_pipeline_api_state crtpl_state{};
833 #else
834     struct create_ray_tracing_pipeline_api_state {
835         const VkRayTracingPipelineCreateInfoNV* pCreateInfos;
836     } crtpl_state;
837 #endif
838     crtpl_state.pCreateInfos = pCreateInfos;
839 
840     for (auto intercept : layer_data->object_dispatch) {
841         auto lock = intercept->write_lock();
842         skip |= intercept->PreCallValidateCreateRayTracingPipelinesNV(device, pipelineCache, createInfoCount, pCreateInfos,
843                                                                       pAllocator, pPipelines, &crtpl_state);
844         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
845     }
846     for (auto intercept : layer_data->object_dispatch) {
847         auto lock = intercept->write_lock();
848         intercept->PreCallRecordCreateRayTracingPipelinesNV(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator,
849                                                             pPipelines, &crtpl_state);
850     }
851     VkResult result = DispatchCreateRayTracingPipelinesNV(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines);
852     for (auto intercept : layer_data->object_dispatch) {
853         auto lock = intercept->write_lock();
854         intercept->PostCallRecordCreateRayTracingPipelinesNV(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator,
855                                                              pPipelines, result, &crtpl_state);
856     }
857     return result;
858 }
859 
860 // This API needs the ability to modify a down-chain parameter
CreatePipelineLayout(VkDevice device,const VkPipelineLayoutCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkPipelineLayout * pPipelineLayout)861 VKAPI_ATTR VkResult VKAPI_CALL CreatePipelineLayout(
862     VkDevice                                    device,
863     const VkPipelineLayoutCreateInfo*           pCreateInfo,
864     const VkAllocationCallbacks*                pAllocator,
865     VkPipelineLayout*                           pPipelineLayout) {
866     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
867     bool skip = false;
868 
869 #ifndef BUILD_CORE_VALIDATION
870     struct create_pipeline_layout_api_state {
871         VkPipelineLayoutCreateInfo modified_create_info;
872     };
873 #endif
874     create_pipeline_layout_api_state cpl_state{};
875     cpl_state.modified_create_info = *pCreateInfo;
876 
877     for (auto intercept : layer_data->object_dispatch) {
878         auto lock = intercept->write_lock();
879         skip |= intercept->PreCallValidateCreatePipelineLayout(device, pCreateInfo, pAllocator, pPipelineLayout);
880         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
881     }
882     for (auto intercept : layer_data->object_dispatch) {
883         auto lock = intercept->write_lock();
884         intercept->PreCallRecordCreatePipelineLayout(device, pCreateInfo, pAllocator, pPipelineLayout, &cpl_state);
885     }
886     VkResult result = DispatchCreatePipelineLayout(device, &cpl_state.modified_create_info, pAllocator, pPipelineLayout);
887     for (auto intercept : layer_data->object_dispatch) {
888         auto lock = intercept->write_lock();
889         intercept->PostCallRecordCreatePipelineLayout(device, pCreateInfo, pAllocator, pPipelineLayout, result);
890     }
891     return result;
892 }
893 
894 // This API needs some local stack data for performance reasons and also may modify a parameter
CreateShaderModule(VkDevice device,const VkShaderModuleCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkShaderModule * pShaderModule)895 VKAPI_ATTR VkResult VKAPI_CALL CreateShaderModule(
896     VkDevice                                    device,
897     const VkShaderModuleCreateInfo*             pCreateInfo,
898     const VkAllocationCallbacks*                pAllocator,
899     VkShaderModule*                             pShaderModule) {
900     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
901     bool skip = false;
902 
903 #ifndef BUILD_CORE_VALIDATION
904     struct create_shader_module_api_state {
905         VkShaderModuleCreateInfo instrumented_create_info;
906     };
907 #endif
908     create_shader_module_api_state csm_state{};
909     csm_state.instrumented_create_info = *pCreateInfo;
910 
911     for (auto intercept : layer_data->object_dispatch) {
912         auto lock = intercept->write_lock();
913         skip |= intercept->PreCallValidateCreateShaderModule(device, pCreateInfo, pAllocator, pShaderModule, &csm_state);
914         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
915     }
916     for (auto intercept : layer_data->object_dispatch) {
917         auto lock = intercept->write_lock();
918         intercept->PreCallRecordCreateShaderModule(device, pCreateInfo, pAllocator, pShaderModule, &csm_state);
919     }
920     VkResult result = DispatchCreateShaderModule(device, &csm_state.instrumented_create_info, pAllocator, pShaderModule);
921     for (auto intercept : layer_data->object_dispatch) {
922         auto lock = intercept->write_lock();
923         intercept->PostCallRecordCreateShaderModule(device, pCreateInfo, pAllocator, pShaderModule, result, &csm_state);
924     }
925     return result;
926 }
927 
AllocateDescriptorSets(VkDevice device,const VkDescriptorSetAllocateInfo * pAllocateInfo,VkDescriptorSet * pDescriptorSets)928 VKAPI_ATTR VkResult VKAPI_CALL AllocateDescriptorSets(
929     VkDevice                                    device,
930     const VkDescriptorSetAllocateInfo*          pAllocateInfo,
931     VkDescriptorSet*                            pDescriptorSets) {
932     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
933     bool skip = false;
934 
935 #ifdef BUILD_CORE_VALIDATION
936     cvdescriptorset::AllocateDescriptorSetsData ads_state(pAllocateInfo->descriptorSetCount);
937 #else
938     struct ads_state {} ads_state;
939 #endif
940 
941     for (auto intercept : layer_data->object_dispatch) {
942         auto lock = intercept->write_lock();
943         skip |= intercept->PreCallValidateAllocateDescriptorSets(device, pAllocateInfo, pDescriptorSets, &ads_state);
944         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
945     }
946     for (auto intercept : layer_data->object_dispatch) {
947         auto lock = intercept->write_lock();
948         intercept->PreCallRecordAllocateDescriptorSets(device, pAllocateInfo, pDescriptorSets);
949     }
950     VkResult result = DispatchAllocateDescriptorSets(device, pAllocateInfo, pDescriptorSets);
951     for (auto intercept : layer_data->object_dispatch) {
952         auto lock = intercept->write_lock();
953         intercept->PostCallRecordAllocateDescriptorSets(device, pAllocateInfo, pDescriptorSets, result, &ads_state);
954     }
955     return result;
956 }
957 
958 
959 
960 
961 
962 // ValidationCache APIs do not dispatch
963 
CreateValidationCacheEXT(VkDevice device,const VkValidationCacheCreateInfoEXT * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkValidationCacheEXT * pValidationCache)964 VKAPI_ATTR VkResult VKAPI_CALL CreateValidationCacheEXT(
965     VkDevice                                    device,
966     const VkValidationCacheCreateInfoEXT*       pCreateInfo,
967     const VkAllocationCallbacks*                pAllocator,
968     VkValidationCacheEXT*                       pValidationCache) {
969     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
970     VkResult result = VK_SUCCESS;
971 
972     ValidationObject *validation_data = layer_data->GetValidationObject(layer_data->object_dispatch, LayerObjectTypeCoreValidation);
973     if (validation_data) {
974         auto lock = validation_data->write_lock();
975         result = validation_data->CoreLayerCreateValidationCacheEXT(device, pCreateInfo, pAllocator, pValidationCache);
976     }
977     return result;
978 }
979 
DestroyValidationCacheEXT(VkDevice device,VkValidationCacheEXT validationCache,const VkAllocationCallbacks * pAllocator)980 VKAPI_ATTR void VKAPI_CALL DestroyValidationCacheEXT(
981     VkDevice                                    device,
982     VkValidationCacheEXT                        validationCache,
983     const VkAllocationCallbacks*                pAllocator) {
984     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
985 
986     ValidationObject *validation_data = layer_data->GetValidationObject(layer_data->object_dispatch, LayerObjectTypeCoreValidation);
987     if (validation_data) {
988         auto lock = validation_data->write_lock();
989         validation_data->CoreLayerDestroyValidationCacheEXT(device, validationCache, pAllocator);
990     }
991 }
992 
MergeValidationCachesEXT(VkDevice device,VkValidationCacheEXT dstCache,uint32_t srcCacheCount,const VkValidationCacheEXT * pSrcCaches)993 VKAPI_ATTR VkResult VKAPI_CALL MergeValidationCachesEXT(
994     VkDevice                                    device,
995     VkValidationCacheEXT                        dstCache,
996     uint32_t                                    srcCacheCount,
997     const VkValidationCacheEXT*                 pSrcCaches) {
998     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
999     VkResult result = VK_SUCCESS;
1000 
1001     ValidationObject *validation_data = layer_data->GetValidationObject(layer_data->object_dispatch, LayerObjectTypeCoreValidation);
1002     if (validation_data) {
1003         auto lock = validation_data->write_lock();
1004         result = validation_data->CoreLayerMergeValidationCachesEXT(device, dstCache, srcCacheCount, pSrcCaches);
1005     }
1006     return result;
1007 }
1008 
GetValidationCacheDataEXT(VkDevice device,VkValidationCacheEXT validationCache,size_t * pDataSize,void * pData)1009 VKAPI_ATTR VkResult VKAPI_CALL GetValidationCacheDataEXT(
1010     VkDevice                                    device,
1011     VkValidationCacheEXT                        validationCache,
1012     size_t*                                     pDataSize,
1013     void*                                       pData) {
1014     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
1015     VkResult result = VK_SUCCESS;
1016 
1017     ValidationObject *validation_data = layer_data->GetValidationObject(layer_data->object_dispatch, LayerObjectTypeCoreValidation);
1018     if (validation_data) {
1019         auto lock = validation_data->write_lock();
1020         result = validation_data->CoreLayerGetValidationCacheDataEXT(device, validationCache, pDataSize, pData);
1021     }
1022     return result;
1023 
1024 }
1025 
1026 
EnumeratePhysicalDevices(VkInstance instance,uint32_t * pPhysicalDeviceCount,VkPhysicalDevice * pPhysicalDevices)1027 VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDevices(
1028     VkInstance                                  instance,
1029     uint32_t*                                   pPhysicalDeviceCount,
1030     VkPhysicalDevice*                           pPhysicalDevices) {
1031     auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map);
1032     bool skip = false;
1033     for (auto intercept : layer_data->object_dispatch) {
1034         auto lock = intercept->write_lock();
1035         skip |= intercept->PreCallValidateEnumeratePhysicalDevices(instance, pPhysicalDeviceCount, pPhysicalDevices);
1036         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
1037     }
1038     for (auto intercept : layer_data->object_dispatch) {
1039         auto lock = intercept->write_lock();
1040         intercept->PreCallRecordEnumeratePhysicalDevices(instance, pPhysicalDeviceCount, pPhysicalDevices);
1041     }
1042     VkResult result = DispatchEnumeratePhysicalDevices(instance, pPhysicalDeviceCount, pPhysicalDevices);
1043     for (auto intercept : layer_data->object_dispatch) {
1044         auto lock = intercept->write_lock();
1045         intercept->PostCallRecordEnumeratePhysicalDevices(instance, pPhysicalDeviceCount, pPhysicalDevices, result);
1046     }
1047     return result;
1048 }
1049 
GetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice,VkPhysicalDeviceFeatures * pFeatures)1050 VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFeatures(
1051     VkPhysicalDevice                            physicalDevice,
1052     VkPhysicalDeviceFeatures*                   pFeatures) {
1053     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
1054     bool skip = false;
1055     for (auto intercept : layer_data->object_dispatch) {
1056         auto lock = intercept->write_lock();
1057         skip |= intercept->PreCallValidateGetPhysicalDeviceFeatures(physicalDevice, pFeatures);
1058         if (skip) return;
1059     }
1060     for (auto intercept : layer_data->object_dispatch) {
1061         auto lock = intercept->write_lock();
1062         intercept->PreCallRecordGetPhysicalDeviceFeatures(physicalDevice, pFeatures);
1063     }
1064     DispatchGetPhysicalDeviceFeatures(physicalDevice, pFeatures);
1065     for (auto intercept : layer_data->object_dispatch) {
1066         auto lock = intercept->write_lock();
1067         intercept->PostCallRecordGetPhysicalDeviceFeatures(physicalDevice, pFeatures);
1068     }
1069 }
1070 
GetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice,VkFormat format,VkFormatProperties * pFormatProperties)1071 VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFormatProperties(
1072     VkPhysicalDevice                            physicalDevice,
1073     VkFormat                                    format,
1074     VkFormatProperties*                         pFormatProperties) {
1075     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
1076     bool skip = false;
1077     for (auto intercept : layer_data->object_dispatch) {
1078         auto lock = intercept->write_lock();
1079         skip |= intercept->PreCallValidateGetPhysicalDeviceFormatProperties(physicalDevice, format, pFormatProperties);
1080         if (skip) return;
1081     }
1082     for (auto intercept : layer_data->object_dispatch) {
1083         auto lock = intercept->write_lock();
1084         intercept->PreCallRecordGetPhysicalDeviceFormatProperties(physicalDevice, format, pFormatProperties);
1085     }
1086     DispatchGetPhysicalDeviceFormatProperties(physicalDevice, format, pFormatProperties);
1087     for (auto intercept : layer_data->object_dispatch) {
1088         auto lock = intercept->write_lock();
1089         intercept->PostCallRecordGetPhysicalDeviceFormatProperties(physicalDevice, format, pFormatProperties);
1090     }
1091 }
1092 
GetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice,VkFormat format,VkImageType type,VkImageTiling tiling,VkImageUsageFlags usage,VkImageCreateFlags flags,VkImageFormatProperties * pImageFormatProperties)1093 VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceImageFormatProperties(
1094     VkPhysicalDevice                            physicalDevice,
1095     VkFormat                                    format,
1096     VkImageType                                 type,
1097     VkImageTiling                               tiling,
1098     VkImageUsageFlags                           usage,
1099     VkImageCreateFlags                          flags,
1100     VkImageFormatProperties*                    pImageFormatProperties) {
1101     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
1102     bool skip = false;
1103     for (auto intercept : layer_data->object_dispatch) {
1104         auto lock = intercept->write_lock();
1105         skip |= intercept->PreCallValidateGetPhysicalDeviceImageFormatProperties(physicalDevice, format, type, tiling, usage, flags, pImageFormatProperties);
1106         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
1107     }
1108     for (auto intercept : layer_data->object_dispatch) {
1109         auto lock = intercept->write_lock();
1110         intercept->PreCallRecordGetPhysicalDeviceImageFormatProperties(physicalDevice, format, type, tiling, usage, flags, pImageFormatProperties);
1111     }
1112     VkResult result = DispatchGetPhysicalDeviceImageFormatProperties(physicalDevice, format, type, tiling, usage, flags, pImageFormatProperties);
1113     for (auto intercept : layer_data->object_dispatch) {
1114         auto lock = intercept->write_lock();
1115         intercept->PostCallRecordGetPhysicalDeviceImageFormatProperties(physicalDevice, format, type, tiling, usage, flags, pImageFormatProperties, result);
1116     }
1117     return result;
1118 }
1119 
GetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice,VkPhysicalDeviceProperties * pProperties)1120 VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceProperties(
1121     VkPhysicalDevice                            physicalDevice,
1122     VkPhysicalDeviceProperties*                 pProperties) {
1123     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
1124     bool skip = false;
1125     for (auto intercept : layer_data->object_dispatch) {
1126         auto lock = intercept->write_lock();
1127         skip |= intercept->PreCallValidateGetPhysicalDeviceProperties(physicalDevice, pProperties);
1128         if (skip) return;
1129     }
1130     for (auto intercept : layer_data->object_dispatch) {
1131         auto lock = intercept->write_lock();
1132         intercept->PreCallRecordGetPhysicalDeviceProperties(physicalDevice, pProperties);
1133     }
1134     DispatchGetPhysicalDeviceProperties(physicalDevice, pProperties);
1135     for (auto intercept : layer_data->object_dispatch) {
1136         auto lock = intercept->write_lock();
1137         intercept->PostCallRecordGetPhysicalDeviceProperties(physicalDevice, pProperties);
1138     }
1139 }
1140 
GetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice,uint32_t * pQueueFamilyPropertyCount,VkQueueFamilyProperties * pQueueFamilyProperties)1141 VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceQueueFamilyProperties(
1142     VkPhysicalDevice                            physicalDevice,
1143     uint32_t*                                   pQueueFamilyPropertyCount,
1144     VkQueueFamilyProperties*                    pQueueFamilyProperties) {
1145     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
1146     bool skip = false;
1147     for (auto intercept : layer_data->object_dispatch) {
1148         auto lock = intercept->write_lock();
1149         skip |= intercept->PreCallValidateGetPhysicalDeviceQueueFamilyProperties(physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties);
1150         if (skip) return;
1151     }
1152     for (auto intercept : layer_data->object_dispatch) {
1153         auto lock = intercept->write_lock();
1154         intercept->PreCallRecordGetPhysicalDeviceQueueFamilyProperties(physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties);
1155     }
1156     DispatchGetPhysicalDeviceQueueFamilyProperties(physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties);
1157     for (auto intercept : layer_data->object_dispatch) {
1158         auto lock = intercept->write_lock();
1159         intercept->PostCallRecordGetPhysicalDeviceQueueFamilyProperties(physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties);
1160     }
1161 }
1162 
GetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice,VkPhysicalDeviceMemoryProperties * pMemoryProperties)1163 VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceMemoryProperties(
1164     VkPhysicalDevice                            physicalDevice,
1165     VkPhysicalDeviceMemoryProperties*           pMemoryProperties) {
1166     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
1167     bool skip = false;
1168     for (auto intercept : layer_data->object_dispatch) {
1169         auto lock = intercept->write_lock();
1170         skip |= intercept->PreCallValidateGetPhysicalDeviceMemoryProperties(physicalDevice, pMemoryProperties);
1171         if (skip) return;
1172     }
1173     for (auto intercept : layer_data->object_dispatch) {
1174         auto lock = intercept->write_lock();
1175         intercept->PreCallRecordGetPhysicalDeviceMemoryProperties(physicalDevice, pMemoryProperties);
1176     }
1177     DispatchGetPhysicalDeviceMemoryProperties(physicalDevice, pMemoryProperties);
1178     for (auto intercept : layer_data->object_dispatch) {
1179         auto lock = intercept->write_lock();
1180         intercept->PostCallRecordGetPhysicalDeviceMemoryProperties(physicalDevice, pMemoryProperties);
1181     }
1182 }
1183 
GetDeviceQueue(VkDevice device,uint32_t queueFamilyIndex,uint32_t queueIndex,VkQueue * pQueue)1184 VKAPI_ATTR void VKAPI_CALL GetDeviceQueue(
1185     VkDevice                                    device,
1186     uint32_t                                    queueFamilyIndex,
1187     uint32_t                                    queueIndex,
1188     VkQueue*                                    pQueue) {
1189     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
1190     bool skip = false;
1191     for (auto intercept : layer_data->object_dispatch) {
1192         auto lock = intercept->write_lock();
1193         skip |= intercept->PreCallValidateGetDeviceQueue(device, queueFamilyIndex, queueIndex, pQueue);
1194         if (skip) return;
1195     }
1196     for (auto intercept : layer_data->object_dispatch) {
1197         auto lock = intercept->write_lock();
1198         intercept->PreCallRecordGetDeviceQueue(device, queueFamilyIndex, queueIndex, pQueue);
1199     }
1200     DispatchGetDeviceQueue(device, queueFamilyIndex, queueIndex, pQueue);
1201     for (auto intercept : layer_data->object_dispatch) {
1202         auto lock = intercept->write_lock();
1203         intercept->PostCallRecordGetDeviceQueue(device, queueFamilyIndex, queueIndex, pQueue);
1204     }
1205 }
1206 
QueueSubmit(VkQueue queue,uint32_t submitCount,const VkSubmitInfo * pSubmits,VkFence fence)1207 VKAPI_ATTR VkResult VKAPI_CALL QueueSubmit(
1208     VkQueue                                     queue,
1209     uint32_t                                    submitCount,
1210     const VkSubmitInfo*                         pSubmits,
1211     VkFence                                     fence) {
1212     auto layer_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map);
1213     bool skip = false;
1214     for (auto intercept : layer_data->object_dispatch) {
1215         auto lock = intercept->write_lock();
1216         skip |= intercept->PreCallValidateQueueSubmit(queue, submitCount, pSubmits, fence);
1217         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
1218     }
1219     for (auto intercept : layer_data->object_dispatch) {
1220         auto lock = intercept->write_lock();
1221         intercept->PreCallRecordQueueSubmit(queue, submitCount, pSubmits, fence);
1222     }
1223     VkResult result = DispatchQueueSubmit(queue, submitCount, pSubmits, fence);
1224     for (auto intercept : layer_data->object_dispatch) {
1225         auto lock = intercept->write_lock();
1226         intercept->PostCallRecordQueueSubmit(queue, submitCount, pSubmits, fence, result);
1227     }
1228     return result;
1229 }
1230 
QueueWaitIdle(VkQueue queue)1231 VKAPI_ATTR VkResult VKAPI_CALL QueueWaitIdle(
1232     VkQueue                                     queue) {
1233     auto layer_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map);
1234     bool skip = false;
1235     for (auto intercept : layer_data->object_dispatch) {
1236         auto lock = intercept->write_lock();
1237         skip |= intercept->PreCallValidateQueueWaitIdle(queue);
1238         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
1239     }
1240     for (auto intercept : layer_data->object_dispatch) {
1241         auto lock = intercept->write_lock();
1242         intercept->PreCallRecordQueueWaitIdle(queue);
1243     }
1244     VkResult result = DispatchQueueWaitIdle(queue);
1245     for (auto intercept : layer_data->object_dispatch) {
1246         auto lock = intercept->write_lock();
1247         intercept->PostCallRecordQueueWaitIdle(queue, result);
1248     }
1249     return result;
1250 }
1251 
DeviceWaitIdle(VkDevice device)1252 VKAPI_ATTR VkResult VKAPI_CALL DeviceWaitIdle(
1253     VkDevice                                    device) {
1254     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
1255     bool skip = false;
1256     for (auto intercept : layer_data->object_dispatch) {
1257         auto lock = intercept->write_lock();
1258         skip |= intercept->PreCallValidateDeviceWaitIdle(device);
1259         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
1260     }
1261     for (auto intercept : layer_data->object_dispatch) {
1262         auto lock = intercept->write_lock();
1263         intercept->PreCallRecordDeviceWaitIdle(device);
1264     }
1265     VkResult result = DispatchDeviceWaitIdle(device);
1266     for (auto intercept : layer_data->object_dispatch) {
1267         auto lock = intercept->write_lock();
1268         intercept->PostCallRecordDeviceWaitIdle(device, result);
1269     }
1270     return result;
1271 }
1272 
AllocateMemory(VkDevice device,const VkMemoryAllocateInfo * pAllocateInfo,const VkAllocationCallbacks * pAllocator,VkDeviceMemory * pMemory)1273 VKAPI_ATTR VkResult VKAPI_CALL AllocateMemory(
1274     VkDevice                                    device,
1275     const VkMemoryAllocateInfo*                 pAllocateInfo,
1276     const VkAllocationCallbacks*                pAllocator,
1277     VkDeviceMemory*                             pMemory) {
1278     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
1279     bool skip = false;
1280     for (auto intercept : layer_data->object_dispatch) {
1281         auto lock = intercept->write_lock();
1282         skip |= intercept->PreCallValidateAllocateMemory(device, pAllocateInfo, pAllocator, pMemory);
1283         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
1284     }
1285     for (auto intercept : layer_data->object_dispatch) {
1286         auto lock = intercept->write_lock();
1287         intercept->PreCallRecordAllocateMemory(device, pAllocateInfo, pAllocator, pMemory);
1288     }
1289     VkResult result = DispatchAllocateMemory(device, pAllocateInfo, pAllocator, pMemory);
1290     for (auto intercept : layer_data->object_dispatch) {
1291         auto lock = intercept->write_lock();
1292         intercept->PostCallRecordAllocateMemory(device, pAllocateInfo, pAllocator, pMemory, result);
1293     }
1294     return result;
1295 }
1296 
FreeMemory(VkDevice device,VkDeviceMemory memory,const VkAllocationCallbacks * pAllocator)1297 VKAPI_ATTR void VKAPI_CALL FreeMemory(
1298     VkDevice                                    device,
1299     VkDeviceMemory                              memory,
1300     const VkAllocationCallbacks*                pAllocator) {
1301     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
1302     bool skip = false;
1303     for (auto intercept : layer_data->object_dispatch) {
1304         auto lock = intercept->write_lock();
1305         skip |= intercept->PreCallValidateFreeMemory(device, memory, pAllocator);
1306         if (skip) return;
1307     }
1308     for (auto intercept : layer_data->object_dispatch) {
1309         auto lock = intercept->write_lock();
1310         intercept->PreCallRecordFreeMemory(device, memory, pAllocator);
1311     }
1312     DispatchFreeMemory(device, memory, pAllocator);
1313     for (auto intercept : layer_data->object_dispatch) {
1314         auto lock = intercept->write_lock();
1315         intercept->PostCallRecordFreeMemory(device, memory, pAllocator);
1316     }
1317 }
1318 
MapMemory(VkDevice device,VkDeviceMemory memory,VkDeviceSize offset,VkDeviceSize size,VkMemoryMapFlags flags,void ** ppData)1319 VKAPI_ATTR VkResult VKAPI_CALL MapMemory(
1320     VkDevice                                    device,
1321     VkDeviceMemory                              memory,
1322     VkDeviceSize                                offset,
1323     VkDeviceSize                                size,
1324     VkMemoryMapFlags                            flags,
1325     void**                                      ppData) {
1326     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
1327     bool skip = false;
1328     for (auto intercept : layer_data->object_dispatch) {
1329         auto lock = intercept->write_lock();
1330         skip |= intercept->PreCallValidateMapMemory(device, memory, offset, size, flags, ppData);
1331         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
1332     }
1333     for (auto intercept : layer_data->object_dispatch) {
1334         auto lock = intercept->write_lock();
1335         intercept->PreCallRecordMapMemory(device, memory, offset, size, flags, ppData);
1336     }
1337     VkResult result = DispatchMapMemory(device, memory, offset, size, flags, ppData);
1338     for (auto intercept : layer_data->object_dispatch) {
1339         auto lock = intercept->write_lock();
1340         intercept->PostCallRecordMapMemory(device, memory, offset, size, flags, ppData, result);
1341     }
1342     return result;
1343 }
1344 
UnmapMemory(VkDevice device,VkDeviceMemory memory)1345 VKAPI_ATTR void VKAPI_CALL UnmapMemory(
1346     VkDevice                                    device,
1347     VkDeviceMemory                              memory) {
1348     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
1349     bool skip = false;
1350     for (auto intercept : layer_data->object_dispatch) {
1351         auto lock = intercept->write_lock();
1352         skip |= intercept->PreCallValidateUnmapMemory(device, memory);
1353         if (skip) return;
1354     }
1355     for (auto intercept : layer_data->object_dispatch) {
1356         auto lock = intercept->write_lock();
1357         intercept->PreCallRecordUnmapMemory(device, memory);
1358     }
1359     DispatchUnmapMemory(device, memory);
1360     for (auto intercept : layer_data->object_dispatch) {
1361         auto lock = intercept->write_lock();
1362         intercept->PostCallRecordUnmapMemory(device, memory);
1363     }
1364 }
1365 
FlushMappedMemoryRanges(VkDevice device,uint32_t memoryRangeCount,const VkMappedMemoryRange * pMemoryRanges)1366 VKAPI_ATTR VkResult VKAPI_CALL FlushMappedMemoryRanges(
1367     VkDevice                                    device,
1368     uint32_t                                    memoryRangeCount,
1369     const VkMappedMemoryRange*                  pMemoryRanges) {
1370     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
1371     bool skip = false;
1372     for (auto intercept : layer_data->object_dispatch) {
1373         auto lock = intercept->write_lock();
1374         skip |= intercept->PreCallValidateFlushMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges);
1375         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
1376     }
1377     for (auto intercept : layer_data->object_dispatch) {
1378         auto lock = intercept->write_lock();
1379         intercept->PreCallRecordFlushMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges);
1380     }
1381     VkResult result = DispatchFlushMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges);
1382     for (auto intercept : layer_data->object_dispatch) {
1383         auto lock = intercept->write_lock();
1384         intercept->PostCallRecordFlushMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges, result);
1385     }
1386     return result;
1387 }
1388 
InvalidateMappedMemoryRanges(VkDevice device,uint32_t memoryRangeCount,const VkMappedMemoryRange * pMemoryRanges)1389 VKAPI_ATTR VkResult VKAPI_CALL InvalidateMappedMemoryRanges(
1390     VkDevice                                    device,
1391     uint32_t                                    memoryRangeCount,
1392     const VkMappedMemoryRange*                  pMemoryRanges) {
1393     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
1394     bool skip = false;
1395     for (auto intercept : layer_data->object_dispatch) {
1396         auto lock = intercept->write_lock();
1397         skip |= intercept->PreCallValidateInvalidateMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges);
1398         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
1399     }
1400     for (auto intercept : layer_data->object_dispatch) {
1401         auto lock = intercept->write_lock();
1402         intercept->PreCallRecordInvalidateMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges);
1403     }
1404     VkResult result = DispatchInvalidateMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges);
1405     for (auto intercept : layer_data->object_dispatch) {
1406         auto lock = intercept->write_lock();
1407         intercept->PostCallRecordInvalidateMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges, result);
1408     }
1409     return result;
1410 }
1411 
GetDeviceMemoryCommitment(VkDevice device,VkDeviceMemory memory,VkDeviceSize * pCommittedMemoryInBytes)1412 VKAPI_ATTR void VKAPI_CALL GetDeviceMemoryCommitment(
1413     VkDevice                                    device,
1414     VkDeviceMemory                              memory,
1415     VkDeviceSize*                               pCommittedMemoryInBytes) {
1416     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
1417     bool skip = false;
1418     for (auto intercept : layer_data->object_dispatch) {
1419         auto lock = intercept->write_lock();
1420         skip |= intercept->PreCallValidateGetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes);
1421         if (skip) return;
1422     }
1423     for (auto intercept : layer_data->object_dispatch) {
1424         auto lock = intercept->write_lock();
1425         intercept->PreCallRecordGetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes);
1426     }
1427     DispatchGetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes);
1428     for (auto intercept : layer_data->object_dispatch) {
1429         auto lock = intercept->write_lock();
1430         intercept->PostCallRecordGetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes);
1431     }
1432 }
1433 
BindBufferMemory(VkDevice device,VkBuffer buffer,VkDeviceMemory memory,VkDeviceSize memoryOffset)1434 VKAPI_ATTR VkResult VKAPI_CALL BindBufferMemory(
1435     VkDevice                                    device,
1436     VkBuffer                                    buffer,
1437     VkDeviceMemory                              memory,
1438     VkDeviceSize                                memoryOffset) {
1439     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
1440     bool skip = false;
1441     for (auto intercept : layer_data->object_dispatch) {
1442         auto lock = intercept->write_lock();
1443         skip |= intercept->PreCallValidateBindBufferMemory(device, buffer, memory, memoryOffset);
1444         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
1445     }
1446     for (auto intercept : layer_data->object_dispatch) {
1447         auto lock = intercept->write_lock();
1448         intercept->PreCallRecordBindBufferMemory(device, buffer, memory, memoryOffset);
1449     }
1450     VkResult result = DispatchBindBufferMemory(device, buffer, memory, memoryOffset);
1451     for (auto intercept : layer_data->object_dispatch) {
1452         auto lock = intercept->write_lock();
1453         intercept->PostCallRecordBindBufferMemory(device, buffer, memory, memoryOffset, result);
1454     }
1455     return result;
1456 }
1457 
BindImageMemory(VkDevice device,VkImage image,VkDeviceMemory memory,VkDeviceSize memoryOffset)1458 VKAPI_ATTR VkResult VKAPI_CALL BindImageMemory(
1459     VkDevice                                    device,
1460     VkImage                                     image,
1461     VkDeviceMemory                              memory,
1462     VkDeviceSize                                memoryOffset) {
1463     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
1464     bool skip = false;
1465     for (auto intercept : layer_data->object_dispatch) {
1466         auto lock = intercept->write_lock();
1467         skip |= intercept->PreCallValidateBindImageMemory(device, image, memory, memoryOffset);
1468         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
1469     }
1470     for (auto intercept : layer_data->object_dispatch) {
1471         auto lock = intercept->write_lock();
1472         intercept->PreCallRecordBindImageMemory(device, image, memory, memoryOffset);
1473     }
1474     VkResult result = DispatchBindImageMemory(device, image, memory, memoryOffset);
1475     for (auto intercept : layer_data->object_dispatch) {
1476         auto lock = intercept->write_lock();
1477         intercept->PostCallRecordBindImageMemory(device, image, memory, memoryOffset, result);
1478     }
1479     return result;
1480 }
1481 
GetBufferMemoryRequirements(VkDevice device,VkBuffer buffer,VkMemoryRequirements * pMemoryRequirements)1482 VKAPI_ATTR void VKAPI_CALL GetBufferMemoryRequirements(
1483     VkDevice                                    device,
1484     VkBuffer                                    buffer,
1485     VkMemoryRequirements*                       pMemoryRequirements) {
1486     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
1487     bool skip = false;
1488     for (auto intercept : layer_data->object_dispatch) {
1489         auto lock = intercept->write_lock();
1490         skip |= intercept->PreCallValidateGetBufferMemoryRequirements(device, buffer, pMemoryRequirements);
1491         if (skip) return;
1492     }
1493     for (auto intercept : layer_data->object_dispatch) {
1494         auto lock = intercept->write_lock();
1495         intercept->PreCallRecordGetBufferMemoryRequirements(device, buffer, pMemoryRequirements);
1496     }
1497     DispatchGetBufferMemoryRequirements(device, buffer, pMemoryRequirements);
1498     for (auto intercept : layer_data->object_dispatch) {
1499         auto lock = intercept->write_lock();
1500         intercept->PostCallRecordGetBufferMemoryRequirements(device, buffer, pMemoryRequirements);
1501     }
1502 }
1503 
GetImageMemoryRequirements(VkDevice device,VkImage image,VkMemoryRequirements * pMemoryRequirements)1504 VKAPI_ATTR void VKAPI_CALL GetImageMemoryRequirements(
1505     VkDevice                                    device,
1506     VkImage                                     image,
1507     VkMemoryRequirements*                       pMemoryRequirements) {
1508     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
1509     bool skip = false;
1510     for (auto intercept : layer_data->object_dispatch) {
1511         auto lock = intercept->write_lock();
1512         skip |= intercept->PreCallValidateGetImageMemoryRequirements(device, image, pMemoryRequirements);
1513         if (skip) return;
1514     }
1515     for (auto intercept : layer_data->object_dispatch) {
1516         auto lock = intercept->write_lock();
1517         intercept->PreCallRecordGetImageMemoryRequirements(device, image, pMemoryRequirements);
1518     }
1519     DispatchGetImageMemoryRequirements(device, image, pMemoryRequirements);
1520     for (auto intercept : layer_data->object_dispatch) {
1521         auto lock = intercept->write_lock();
1522         intercept->PostCallRecordGetImageMemoryRequirements(device, image, pMemoryRequirements);
1523     }
1524 }
1525 
GetImageSparseMemoryRequirements(VkDevice device,VkImage image,uint32_t * pSparseMemoryRequirementCount,VkSparseImageMemoryRequirements * pSparseMemoryRequirements)1526 VKAPI_ATTR void VKAPI_CALL GetImageSparseMemoryRequirements(
1527     VkDevice                                    device,
1528     VkImage                                     image,
1529     uint32_t*                                   pSparseMemoryRequirementCount,
1530     VkSparseImageMemoryRequirements*            pSparseMemoryRequirements) {
1531     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
1532     bool skip = false;
1533     for (auto intercept : layer_data->object_dispatch) {
1534         auto lock = intercept->write_lock();
1535         skip |= intercept->PreCallValidateGetImageSparseMemoryRequirements(device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements);
1536         if (skip) return;
1537     }
1538     for (auto intercept : layer_data->object_dispatch) {
1539         auto lock = intercept->write_lock();
1540         intercept->PreCallRecordGetImageSparseMemoryRequirements(device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements);
1541     }
1542     DispatchGetImageSparseMemoryRequirements(device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements);
1543     for (auto intercept : layer_data->object_dispatch) {
1544         auto lock = intercept->write_lock();
1545         intercept->PostCallRecordGetImageSparseMemoryRequirements(device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements);
1546     }
1547 }
1548 
GetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice,VkFormat format,VkImageType type,VkSampleCountFlagBits samples,VkImageUsageFlags usage,VkImageTiling tiling,uint32_t * pPropertyCount,VkSparseImageFormatProperties * pProperties)1549 VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceSparseImageFormatProperties(
1550     VkPhysicalDevice                            physicalDevice,
1551     VkFormat                                    format,
1552     VkImageType                                 type,
1553     VkSampleCountFlagBits                       samples,
1554     VkImageUsageFlags                           usage,
1555     VkImageTiling                               tiling,
1556     uint32_t*                                   pPropertyCount,
1557     VkSparseImageFormatProperties*              pProperties) {
1558     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
1559     bool skip = false;
1560     for (auto intercept : layer_data->object_dispatch) {
1561         auto lock = intercept->write_lock();
1562         skip |= intercept->PreCallValidateGetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, pPropertyCount, pProperties);
1563         if (skip) return;
1564     }
1565     for (auto intercept : layer_data->object_dispatch) {
1566         auto lock = intercept->write_lock();
1567         intercept->PreCallRecordGetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, pPropertyCount, pProperties);
1568     }
1569     DispatchGetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, pPropertyCount, pProperties);
1570     for (auto intercept : layer_data->object_dispatch) {
1571         auto lock = intercept->write_lock();
1572         intercept->PostCallRecordGetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, pPropertyCount, pProperties);
1573     }
1574 }
1575 
QueueBindSparse(VkQueue queue,uint32_t bindInfoCount,const VkBindSparseInfo * pBindInfo,VkFence fence)1576 VKAPI_ATTR VkResult VKAPI_CALL QueueBindSparse(
1577     VkQueue                                     queue,
1578     uint32_t                                    bindInfoCount,
1579     const VkBindSparseInfo*                     pBindInfo,
1580     VkFence                                     fence) {
1581     auto layer_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map);
1582     bool skip = false;
1583     for (auto intercept : layer_data->object_dispatch) {
1584         auto lock = intercept->write_lock();
1585         skip |= intercept->PreCallValidateQueueBindSparse(queue, bindInfoCount, pBindInfo, fence);
1586         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
1587     }
1588     for (auto intercept : layer_data->object_dispatch) {
1589         auto lock = intercept->write_lock();
1590         intercept->PreCallRecordQueueBindSparse(queue, bindInfoCount, pBindInfo, fence);
1591     }
1592     VkResult result = DispatchQueueBindSparse(queue, bindInfoCount, pBindInfo, fence);
1593     for (auto intercept : layer_data->object_dispatch) {
1594         auto lock = intercept->write_lock();
1595         intercept->PostCallRecordQueueBindSparse(queue, bindInfoCount, pBindInfo, fence, result);
1596     }
1597     return result;
1598 }
1599 
CreateFence(VkDevice device,const VkFenceCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkFence * pFence)1600 VKAPI_ATTR VkResult VKAPI_CALL CreateFence(
1601     VkDevice                                    device,
1602     const VkFenceCreateInfo*                    pCreateInfo,
1603     const VkAllocationCallbacks*                pAllocator,
1604     VkFence*                                    pFence) {
1605     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
1606     bool skip = false;
1607     for (auto intercept : layer_data->object_dispatch) {
1608         auto lock = intercept->write_lock();
1609         skip |= intercept->PreCallValidateCreateFence(device, pCreateInfo, pAllocator, pFence);
1610         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
1611     }
1612     for (auto intercept : layer_data->object_dispatch) {
1613         auto lock = intercept->write_lock();
1614         intercept->PreCallRecordCreateFence(device, pCreateInfo, pAllocator, pFence);
1615     }
1616     VkResult result = DispatchCreateFence(device, pCreateInfo, pAllocator, pFence);
1617     for (auto intercept : layer_data->object_dispatch) {
1618         auto lock = intercept->write_lock();
1619         intercept->PostCallRecordCreateFence(device, pCreateInfo, pAllocator, pFence, result);
1620     }
1621     return result;
1622 }
1623 
DestroyFence(VkDevice device,VkFence fence,const VkAllocationCallbacks * pAllocator)1624 VKAPI_ATTR void VKAPI_CALL DestroyFence(
1625     VkDevice                                    device,
1626     VkFence                                     fence,
1627     const VkAllocationCallbacks*                pAllocator) {
1628     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
1629     bool skip = false;
1630     for (auto intercept : layer_data->object_dispatch) {
1631         auto lock = intercept->write_lock();
1632         skip |= intercept->PreCallValidateDestroyFence(device, fence, pAllocator);
1633         if (skip) return;
1634     }
1635     for (auto intercept : layer_data->object_dispatch) {
1636         auto lock = intercept->write_lock();
1637         intercept->PreCallRecordDestroyFence(device, fence, pAllocator);
1638     }
1639     DispatchDestroyFence(device, fence, pAllocator);
1640     for (auto intercept : layer_data->object_dispatch) {
1641         auto lock = intercept->write_lock();
1642         intercept->PostCallRecordDestroyFence(device, fence, pAllocator);
1643     }
1644 }
1645 
ResetFences(VkDevice device,uint32_t fenceCount,const VkFence * pFences)1646 VKAPI_ATTR VkResult VKAPI_CALL ResetFences(
1647     VkDevice                                    device,
1648     uint32_t                                    fenceCount,
1649     const VkFence*                              pFences) {
1650     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
1651     bool skip = false;
1652     for (auto intercept : layer_data->object_dispatch) {
1653         auto lock = intercept->write_lock();
1654         skip |= intercept->PreCallValidateResetFences(device, fenceCount, pFences);
1655         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
1656     }
1657     for (auto intercept : layer_data->object_dispatch) {
1658         auto lock = intercept->write_lock();
1659         intercept->PreCallRecordResetFences(device, fenceCount, pFences);
1660     }
1661     VkResult result = DispatchResetFences(device, fenceCount, pFences);
1662     for (auto intercept : layer_data->object_dispatch) {
1663         auto lock = intercept->write_lock();
1664         intercept->PostCallRecordResetFences(device, fenceCount, pFences, result);
1665     }
1666     return result;
1667 }
1668 
GetFenceStatus(VkDevice device,VkFence fence)1669 VKAPI_ATTR VkResult VKAPI_CALL GetFenceStatus(
1670     VkDevice                                    device,
1671     VkFence                                     fence) {
1672     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
1673     bool skip = false;
1674     for (auto intercept : layer_data->object_dispatch) {
1675         auto lock = intercept->write_lock();
1676         skip |= intercept->PreCallValidateGetFenceStatus(device, fence);
1677         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
1678     }
1679     for (auto intercept : layer_data->object_dispatch) {
1680         auto lock = intercept->write_lock();
1681         intercept->PreCallRecordGetFenceStatus(device, fence);
1682     }
1683     VkResult result = DispatchGetFenceStatus(device, fence);
1684     for (auto intercept : layer_data->object_dispatch) {
1685         auto lock = intercept->write_lock();
1686         intercept->PostCallRecordGetFenceStatus(device, fence, result);
1687     }
1688     return result;
1689 }
1690 
WaitForFences(VkDevice device,uint32_t fenceCount,const VkFence * pFences,VkBool32 waitAll,uint64_t timeout)1691 VKAPI_ATTR VkResult VKAPI_CALL WaitForFences(
1692     VkDevice                                    device,
1693     uint32_t                                    fenceCount,
1694     const VkFence*                              pFences,
1695     VkBool32                                    waitAll,
1696     uint64_t                                    timeout) {
1697     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
1698     bool skip = false;
1699     for (auto intercept : layer_data->object_dispatch) {
1700         auto lock = intercept->write_lock();
1701         skip |= intercept->PreCallValidateWaitForFences(device, fenceCount, pFences, waitAll, timeout);
1702         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
1703     }
1704     for (auto intercept : layer_data->object_dispatch) {
1705         auto lock = intercept->write_lock();
1706         intercept->PreCallRecordWaitForFences(device, fenceCount, pFences, waitAll, timeout);
1707     }
1708     VkResult result = DispatchWaitForFences(device, fenceCount, pFences, waitAll, timeout);
1709     for (auto intercept : layer_data->object_dispatch) {
1710         auto lock = intercept->write_lock();
1711         intercept->PostCallRecordWaitForFences(device, fenceCount, pFences, waitAll, timeout, result);
1712     }
1713     return result;
1714 }
1715 
CreateSemaphore(VkDevice device,const VkSemaphoreCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkSemaphore * pSemaphore)1716 VKAPI_ATTR VkResult VKAPI_CALL CreateSemaphore(
1717     VkDevice                                    device,
1718     const VkSemaphoreCreateInfo*                pCreateInfo,
1719     const VkAllocationCallbacks*                pAllocator,
1720     VkSemaphore*                                pSemaphore) {
1721     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
1722     bool skip = false;
1723     for (auto intercept : layer_data->object_dispatch) {
1724         auto lock = intercept->write_lock();
1725         skip |= intercept->PreCallValidateCreateSemaphore(device, pCreateInfo, pAllocator, pSemaphore);
1726         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
1727     }
1728     for (auto intercept : layer_data->object_dispatch) {
1729         auto lock = intercept->write_lock();
1730         intercept->PreCallRecordCreateSemaphore(device, pCreateInfo, pAllocator, pSemaphore);
1731     }
1732     VkResult result = DispatchCreateSemaphore(device, pCreateInfo, pAllocator, pSemaphore);
1733     for (auto intercept : layer_data->object_dispatch) {
1734         auto lock = intercept->write_lock();
1735         intercept->PostCallRecordCreateSemaphore(device, pCreateInfo, pAllocator, pSemaphore, result);
1736     }
1737     return result;
1738 }
1739 
DestroySemaphore(VkDevice device,VkSemaphore semaphore,const VkAllocationCallbacks * pAllocator)1740 VKAPI_ATTR void VKAPI_CALL DestroySemaphore(
1741     VkDevice                                    device,
1742     VkSemaphore                                 semaphore,
1743     const VkAllocationCallbacks*                pAllocator) {
1744     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
1745     bool skip = false;
1746     for (auto intercept : layer_data->object_dispatch) {
1747         auto lock = intercept->write_lock();
1748         skip |= intercept->PreCallValidateDestroySemaphore(device, semaphore, pAllocator);
1749         if (skip) return;
1750     }
1751     for (auto intercept : layer_data->object_dispatch) {
1752         auto lock = intercept->write_lock();
1753         intercept->PreCallRecordDestroySemaphore(device, semaphore, pAllocator);
1754     }
1755     DispatchDestroySemaphore(device, semaphore, pAllocator);
1756     for (auto intercept : layer_data->object_dispatch) {
1757         auto lock = intercept->write_lock();
1758         intercept->PostCallRecordDestroySemaphore(device, semaphore, pAllocator);
1759     }
1760 }
1761 
CreateEvent(VkDevice device,const VkEventCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkEvent * pEvent)1762 VKAPI_ATTR VkResult VKAPI_CALL CreateEvent(
1763     VkDevice                                    device,
1764     const VkEventCreateInfo*                    pCreateInfo,
1765     const VkAllocationCallbacks*                pAllocator,
1766     VkEvent*                                    pEvent) {
1767     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
1768     bool skip = false;
1769     for (auto intercept : layer_data->object_dispatch) {
1770         auto lock = intercept->write_lock();
1771         skip |= intercept->PreCallValidateCreateEvent(device, pCreateInfo, pAllocator, pEvent);
1772         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
1773     }
1774     for (auto intercept : layer_data->object_dispatch) {
1775         auto lock = intercept->write_lock();
1776         intercept->PreCallRecordCreateEvent(device, pCreateInfo, pAllocator, pEvent);
1777     }
1778     VkResult result = DispatchCreateEvent(device, pCreateInfo, pAllocator, pEvent);
1779     for (auto intercept : layer_data->object_dispatch) {
1780         auto lock = intercept->write_lock();
1781         intercept->PostCallRecordCreateEvent(device, pCreateInfo, pAllocator, pEvent, result);
1782     }
1783     return result;
1784 }
1785 
DestroyEvent(VkDevice device,VkEvent event,const VkAllocationCallbacks * pAllocator)1786 VKAPI_ATTR void VKAPI_CALL DestroyEvent(
1787     VkDevice                                    device,
1788     VkEvent                                     event,
1789     const VkAllocationCallbacks*                pAllocator) {
1790     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
1791     bool skip = false;
1792     for (auto intercept : layer_data->object_dispatch) {
1793         auto lock = intercept->write_lock();
1794         skip |= intercept->PreCallValidateDestroyEvent(device, event, pAllocator);
1795         if (skip) return;
1796     }
1797     for (auto intercept : layer_data->object_dispatch) {
1798         auto lock = intercept->write_lock();
1799         intercept->PreCallRecordDestroyEvent(device, event, pAllocator);
1800     }
1801     DispatchDestroyEvent(device, event, pAllocator);
1802     for (auto intercept : layer_data->object_dispatch) {
1803         auto lock = intercept->write_lock();
1804         intercept->PostCallRecordDestroyEvent(device, event, pAllocator);
1805     }
1806 }
1807 
GetEventStatus(VkDevice device,VkEvent event)1808 VKAPI_ATTR VkResult VKAPI_CALL GetEventStatus(
1809     VkDevice                                    device,
1810     VkEvent                                     event) {
1811     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
1812     bool skip = false;
1813     for (auto intercept : layer_data->object_dispatch) {
1814         auto lock = intercept->write_lock();
1815         skip |= intercept->PreCallValidateGetEventStatus(device, event);
1816         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
1817     }
1818     for (auto intercept : layer_data->object_dispatch) {
1819         auto lock = intercept->write_lock();
1820         intercept->PreCallRecordGetEventStatus(device, event);
1821     }
1822     VkResult result = DispatchGetEventStatus(device, event);
1823     for (auto intercept : layer_data->object_dispatch) {
1824         auto lock = intercept->write_lock();
1825         intercept->PostCallRecordGetEventStatus(device, event, result);
1826     }
1827     return result;
1828 }
1829 
SetEvent(VkDevice device,VkEvent event)1830 VKAPI_ATTR VkResult VKAPI_CALL SetEvent(
1831     VkDevice                                    device,
1832     VkEvent                                     event) {
1833     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
1834     bool skip = false;
1835     for (auto intercept : layer_data->object_dispatch) {
1836         auto lock = intercept->write_lock();
1837         skip |= intercept->PreCallValidateSetEvent(device, event);
1838         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
1839     }
1840     for (auto intercept : layer_data->object_dispatch) {
1841         auto lock = intercept->write_lock();
1842         intercept->PreCallRecordSetEvent(device, event);
1843     }
1844     VkResult result = DispatchSetEvent(device, event);
1845     for (auto intercept : layer_data->object_dispatch) {
1846         auto lock = intercept->write_lock();
1847         intercept->PostCallRecordSetEvent(device, event, result);
1848     }
1849     return result;
1850 }
1851 
ResetEvent(VkDevice device,VkEvent event)1852 VKAPI_ATTR VkResult VKAPI_CALL ResetEvent(
1853     VkDevice                                    device,
1854     VkEvent                                     event) {
1855     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
1856     bool skip = false;
1857     for (auto intercept : layer_data->object_dispatch) {
1858         auto lock = intercept->write_lock();
1859         skip |= intercept->PreCallValidateResetEvent(device, event);
1860         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
1861     }
1862     for (auto intercept : layer_data->object_dispatch) {
1863         auto lock = intercept->write_lock();
1864         intercept->PreCallRecordResetEvent(device, event);
1865     }
1866     VkResult result = DispatchResetEvent(device, event);
1867     for (auto intercept : layer_data->object_dispatch) {
1868         auto lock = intercept->write_lock();
1869         intercept->PostCallRecordResetEvent(device, event, result);
1870     }
1871     return result;
1872 }
1873 
CreateQueryPool(VkDevice device,const VkQueryPoolCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkQueryPool * pQueryPool)1874 VKAPI_ATTR VkResult VKAPI_CALL CreateQueryPool(
1875     VkDevice                                    device,
1876     const VkQueryPoolCreateInfo*                pCreateInfo,
1877     const VkAllocationCallbacks*                pAllocator,
1878     VkQueryPool*                                pQueryPool) {
1879     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
1880     bool skip = false;
1881     for (auto intercept : layer_data->object_dispatch) {
1882         auto lock = intercept->write_lock();
1883         skip |= intercept->PreCallValidateCreateQueryPool(device, pCreateInfo, pAllocator, pQueryPool);
1884         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
1885     }
1886     for (auto intercept : layer_data->object_dispatch) {
1887         auto lock = intercept->write_lock();
1888         intercept->PreCallRecordCreateQueryPool(device, pCreateInfo, pAllocator, pQueryPool);
1889     }
1890     VkResult result = DispatchCreateQueryPool(device, pCreateInfo, pAllocator, pQueryPool);
1891     for (auto intercept : layer_data->object_dispatch) {
1892         auto lock = intercept->write_lock();
1893         intercept->PostCallRecordCreateQueryPool(device, pCreateInfo, pAllocator, pQueryPool, result);
1894     }
1895     return result;
1896 }
1897 
DestroyQueryPool(VkDevice device,VkQueryPool queryPool,const VkAllocationCallbacks * pAllocator)1898 VKAPI_ATTR void VKAPI_CALL DestroyQueryPool(
1899     VkDevice                                    device,
1900     VkQueryPool                                 queryPool,
1901     const VkAllocationCallbacks*                pAllocator) {
1902     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
1903     bool skip = false;
1904     for (auto intercept : layer_data->object_dispatch) {
1905         auto lock = intercept->write_lock();
1906         skip |= intercept->PreCallValidateDestroyQueryPool(device, queryPool, pAllocator);
1907         if (skip) return;
1908     }
1909     for (auto intercept : layer_data->object_dispatch) {
1910         auto lock = intercept->write_lock();
1911         intercept->PreCallRecordDestroyQueryPool(device, queryPool, pAllocator);
1912     }
1913     DispatchDestroyQueryPool(device, queryPool, pAllocator);
1914     for (auto intercept : layer_data->object_dispatch) {
1915         auto lock = intercept->write_lock();
1916         intercept->PostCallRecordDestroyQueryPool(device, queryPool, pAllocator);
1917     }
1918 }
1919 
GetQueryPoolResults(VkDevice device,VkQueryPool queryPool,uint32_t firstQuery,uint32_t queryCount,size_t dataSize,void * pData,VkDeviceSize stride,VkQueryResultFlags flags)1920 VKAPI_ATTR VkResult VKAPI_CALL GetQueryPoolResults(
1921     VkDevice                                    device,
1922     VkQueryPool                                 queryPool,
1923     uint32_t                                    firstQuery,
1924     uint32_t                                    queryCount,
1925     size_t                                      dataSize,
1926     void*                                       pData,
1927     VkDeviceSize                                stride,
1928     VkQueryResultFlags                          flags) {
1929     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
1930     bool skip = false;
1931     for (auto intercept : layer_data->object_dispatch) {
1932         auto lock = intercept->write_lock();
1933         skip |= intercept->PreCallValidateGetQueryPoolResults(device, queryPool, firstQuery, queryCount, dataSize, pData, stride, flags);
1934         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
1935     }
1936     for (auto intercept : layer_data->object_dispatch) {
1937         auto lock = intercept->write_lock();
1938         intercept->PreCallRecordGetQueryPoolResults(device, queryPool, firstQuery, queryCount, dataSize, pData, stride, flags);
1939     }
1940     VkResult result = DispatchGetQueryPoolResults(device, queryPool, firstQuery, queryCount, dataSize, pData, stride, flags);
1941     for (auto intercept : layer_data->object_dispatch) {
1942         auto lock = intercept->write_lock();
1943         intercept->PostCallRecordGetQueryPoolResults(device, queryPool, firstQuery, queryCount, dataSize, pData, stride, flags, result);
1944     }
1945     return result;
1946 }
1947 
CreateBuffer(VkDevice device,const VkBufferCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkBuffer * pBuffer)1948 VKAPI_ATTR VkResult VKAPI_CALL CreateBuffer(
1949     VkDevice                                    device,
1950     const VkBufferCreateInfo*                   pCreateInfo,
1951     const VkAllocationCallbacks*                pAllocator,
1952     VkBuffer*                                   pBuffer) {
1953     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
1954     bool skip = false;
1955     for (auto intercept : layer_data->object_dispatch) {
1956         auto lock = intercept->write_lock();
1957         skip |= intercept->PreCallValidateCreateBuffer(device, pCreateInfo, pAllocator, pBuffer);
1958         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
1959     }
1960     for (auto intercept : layer_data->object_dispatch) {
1961         auto lock = intercept->write_lock();
1962         intercept->PreCallRecordCreateBuffer(device, pCreateInfo, pAllocator, pBuffer);
1963     }
1964     VkResult result = DispatchCreateBuffer(device, pCreateInfo, pAllocator, pBuffer);
1965     for (auto intercept : layer_data->object_dispatch) {
1966         auto lock = intercept->write_lock();
1967         intercept->PostCallRecordCreateBuffer(device, pCreateInfo, pAllocator, pBuffer, result);
1968     }
1969     return result;
1970 }
1971 
DestroyBuffer(VkDevice device,VkBuffer buffer,const VkAllocationCallbacks * pAllocator)1972 VKAPI_ATTR void VKAPI_CALL DestroyBuffer(
1973     VkDevice                                    device,
1974     VkBuffer                                    buffer,
1975     const VkAllocationCallbacks*                pAllocator) {
1976     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
1977     bool skip = false;
1978     for (auto intercept : layer_data->object_dispatch) {
1979         auto lock = intercept->write_lock();
1980         skip |= intercept->PreCallValidateDestroyBuffer(device, buffer, pAllocator);
1981         if (skip) return;
1982     }
1983     for (auto intercept : layer_data->object_dispatch) {
1984         auto lock = intercept->write_lock();
1985         intercept->PreCallRecordDestroyBuffer(device, buffer, pAllocator);
1986     }
1987     DispatchDestroyBuffer(device, buffer, pAllocator);
1988     for (auto intercept : layer_data->object_dispatch) {
1989         auto lock = intercept->write_lock();
1990         intercept->PostCallRecordDestroyBuffer(device, buffer, pAllocator);
1991     }
1992 }
1993 
CreateBufferView(VkDevice device,const VkBufferViewCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkBufferView * pView)1994 VKAPI_ATTR VkResult VKAPI_CALL CreateBufferView(
1995     VkDevice                                    device,
1996     const VkBufferViewCreateInfo*               pCreateInfo,
1997     const VkAllocationCallbacks*                pAllocator,
1998     VkBufferView*                               pView) {
1999     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2000     bool skip = false;
2001     for (auto intercept : layer_data->object_dispatch) {
2002         auto lock = intercept->write_lock();
2003         skip |= intercept->PreCallValidateCreateBufferView(device, pCreateInfo, pAllocator, pView);
2004         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
2005     }
2006     for (auto intercept : layer_data->object_dispatch) {
2007         auto lock = intercept->write_lock();
2008         intercept->PreCallRecordCreateBufferView(device, pCreateInfo, pAllocator, pView);
2009     }
2010     VkResult result = DispatchCreateBufferView(device, pCreateInfo, pAllocator, pView);
2011     for (auto intercept : layer_data->object_dispatch) {
2012         auto lock = intercept->write_lock();
2013         intercept->PostCallRecordCreateBufferView(device, pCreateInfo, pAllocator, pView, result);
2014     }
2015     return result;
2016 }
2017 
DestroyBufferView(VkDevice device,VkBufferView bufferView,const VkAllocationCallbacks * pAllocator)2018 VKAPI_ATTR void VKAPI_CALL DestroyBufferView(
2019     VkDevice                                    device,
2020     VkBufferView                                bufferView,
2021     const VkAllocationCallbacks*                pAllocator) {
2022     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2023     bool skip = false;
2024     for (auto intercept : layer_data->object_dispatch) {
2025         auto lock = intercept->write_lock();
2026         skip |= intercept->PreCallValidateDestroyBufferView(device, bufferView, pAllocator);
2027         if (skip) return;
2028     }
2029     for (auto intercept : layer_data->object_dispatch) {
2030         auto lock = intercept->write_lock();
2031         intercept->PreCallRecordDestroyBufferView(device, bufferView, pAllocator);
2032     }
2033     DispatchDestroyBufferView(device, bufferView, pAllocator);
2034     for (auto intercept : layer_data->object_dispatch) {
2035         auto lock = intercept->write_lock();
2036         intercept->PostCallRecordDestroyBufferView(device, bufferView, pAllocator);
2037     }
2038 }
2039 
CreateImage(VkDevice device,const VkImageCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkImage * pImage)2040 VKAPI_ATTR VkResult VKAPI_CALL CreateImage(
2041     VkDevice                                    device,
2042     const VkImageCreateInfo*                    pCreateInfo,
2043     const VkAllocationCallbacks*                pAllocator,
2044     VkImage*                                    pImage) {
2045     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2046     bool skip = false;
2047     for (auto intercept : layer_data->object_dispatch) {
2048         auto lock = intercept->write_lock();
2049         skip |= intercept->PreCallValidateCreateImage(device, pCreateInfo, pAllocator, pImage);
2050         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
2051     }
2052     for (auto intercept : layer_data->object_dispatch) {
2053         auto lock = intercept->write_lock();
2054         intercept->PreCallRecordCreateImage(device, pCreateInfo, pAllocator, pImage);
2055     }
2056     VkResult result = DispatchCreateImage(device, pCreateInfo, pAllocator, pImage);
2057     for (auto intercept : layer_data->object_dispatch) {
2058         auto lock = intercept->write_lock();
2059         intercept->PostCallRecordCreateImage(device, pCreateInfo, pAllocator, pImage, result);
2060     }
2061     return result;
2062 }
2063 
DestroyImage(VkDevice device,VkImage image,const VkAllocationCallbacks * pAllocator)2064 VKAPI_ATTR void VKAPI_CALL DestroyImage(
2065     VkDevice                                    device,
2066     VkImage                                     image,
2067     const VkAllocationCallbacks*                pAllocator) {
2068     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2069     bool skip = false;
2070     for (auto intercept : layer_data->object_dispatch) {
2071         auto lock = intercept->write_lock();
2072         skip |= intercept->PreCallValidateDestroyImage(device, image, pAllocator);
2073         if (skip) return;
2074     }
2075     for (auto intercept : layer_data->object_dispatch) {
2076         auto lock = intercept->write_lock();
2077         intercept->PreCallRecordDestroyImage(device, image, pAllocator);
2078     }
2079     DispatchDestroyImage(device, image, pAllocator);
2080     for (auto intercept : layer_data->object_dispatch) {
2081         auto lock = intercept->write_lock();
2082         intercept->PostCallRecordDestroyImage(device, image, pAllocator);
2083     }
2084 }
2085 
GetImageSubresourceLayout(VkDevice device,VkImage image,const VkImageSubresource * pSubresource,VkSubresourceLayout * pLayout)2086 VKAPI_ATTR void VKAPI_CALL GetImageSubresourceLayout(
2087     VkDevice                                    device,
2088     VkImage                                     image,
2089     const VkImageSubresource*                   pSubresource,
2090     VkSubresourceLayout*                        pLayout) {
2091     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2092     bool skip = false;
2093     for (auto intercept : layer_data->object_dispatch) {
2094         auto lock = intercept->write_lock();
2095         skip |= intercept->PreCallValidateGetImageSubresourceLayout(device, image, pSubresource, pLayout);
2096         if (skip) return;
2097     }
2098     for (auto intercept : layer_data->object_dispatch) {
2099         auto lock = intercept->write_lock();
2100         intercept->PreCallRecordGetImageSubresourceLayout(device, image, pSubresource, pLayout);
2101     }
2102     DispatchGetImageSubresourceLayout(device, image, pSubresource, pLayout);
2103     for (auto intercept : layer_data->object_dispatch) {
2104         auto lock = intercept->write_lock();
2105         intercept->PostCallRecordGetImageSubresourceLayout(device, image, pSubresource, pLayout);
2106     }
2107 }
2108 
CreateImageView(VkDevice device,const VkImageViewCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkImageView * pView)2109 VKAPI_ATTR VkResult VKAPI_CALL CreateImageView(
2110     VkDevice                                    device,
2111     const VkImageViewCreateInfo*                pCreateInfo,
2112     const VkAllocationCallbacks*                pAllocator,
2113     VkImageView*                                pView) {
2114     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2115     bool skip = false;
2116     for (auto intercept : layer_data->object_dispatch) {
2117         auto lock = intercept->write_lock();
2118         skip |= intercept->PreCallValidateCreateImageView(device, pCreateInfo, pAllocator, pView);
2119         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
2120     }
2121     for (auto intercept : layer_data->object_dispatch) {
2122         auto lock = intercept->write_lock();
2123         intercept->PreCallRecordCreateImageView(device, pCreateInfo, pAllocator, pView);
2124     }
2125     VkResult result = DispatchCreateImageView(device, pCreateInfo, pAllocator, pView);
2126     for (auto intercept : layer_data->object_dispatch) {
2127         auto lock = intercept->write_lock();
2128         intercept->PostCallRecordCreateImageView(device, pCreateInfo, pAllocator, pView, result);
2129     }
2130     return result;
2131 }
2132 
DestroyImageView(VkDevice device,VkImageView imageView,const VkAllocationCallbacks * pAllocator)2133 VKAPI_ATTR void VKAPI_CALL DestroyImageView(
2134     VkDevice                                    device,
2135     VkImageView                                 imageView,
2136     const VkAllocationCallbacks*                pAllocator) {
2137     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2138     bool skip = false;
2139     for (auto intercept : layer_data->object_dispatch) {
2140         auto lock = intercept->write_lock();
2141         skip |= intercept->PreCallValidateDestroyImageView(device, imageView, pAllocator);
2142         if (skip) return;
2143     }
2144     for (auto intercept : layer_data->object_dispatch) {
2145         auto lock = intercept->write_lock();
2146         intercept->PreCallRecordDestroyImageView(device, imageView, pAllocator);
2147     }
2148     DispatchDestroyImageView(device, imageView, pAllocator);
2149     for (auto intercept : layer_data->object_dispatch) {
2150         auto lock = intercept->write_lock();
2151         intercept->PostCallRecordDestroyImageView(device, imageView, pAllocator);
2152     }
2153 }
2154 
DestroyShaderModule(VkDevice device,VkShaderModule shaderModule,const VkAllocationCallbacks * pAllocator)2155 VKAPI_ATTR void VKAPI_CALL DestroyShaderModule(
2156     VkDevice                                    device,
2157     VkShaderModule                              shaderModule,
2158     const VkAllocationCallbacks*                pAllocator) {
2159     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2160     bool skip = false;
2161     for (auto intercept : layer_data->object_dispatch) {
2162         auto lock = intercept->write_lock();
2163         skip |= intercept->PreCallValidateDestroyShaderModule(device, shaderModule, pAllocator);
2164         if (skip) return;
2165     }
2166     for (auto intercept : layer_data->object_dispatch) {
2167         auto lock = intercept->write_lock();
2168         intercept->PreCallRecordDestroyShaderModule(device, shaderModule, pAllocator);
2169     }
2170     DispatchDestroyShaderModule(device, shaderModule, pAllocator);
2171     for (auto intercept : layer_data->object_dispatch) {
2172         auto lock = intercept->write_lock();
2173         intercept->PostCallRecordDestroyShaderModule(device, shaderModule, pAllocator);
2174     }
2175 }
2176 
CreatePipelineCache(VkDevice device,const VkPipelineCacheCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkPipelineCache * pPipelineCache)2177 VKAPI_ATTR VkResult VKAPI_CALL CreatePipelineCache(
2178     VkDevice                                    device,
2179     const VkPipelineCacheCreateInfo*            pCreateInfo,
2180     const VkAllocationCallbacks*                pAllocator,
2181     VkPipelineCache*                            pPipelineCache) {
2182     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2183     bool skip = false;
2184     for (auto intercept : layer_data->object_dispatch) {
2185         auto lock = intercept->write_lock();
2186         skip |= intercept->PreCallValidateCreatePipelineCache(device, pCreateInfo, pAllocator, pPipelineCache);
2187         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
2188     }
2189     for (auto intercept : layer_data->object_dispatch) {
2190         auto lock = intercept->write_lock();
2191         intercept->PreCallRecordCreatePipelineCache(device, pCreateInfo, pAllocator, pPipelineCache);
2192     }
2193     VkResult result = DispatchCreatePipelineCache(device, pCreateInfo, pAllocator, pPipelineCache);
2194     for (auto intercept : layer_data->object_dispatch) {
2195         auto lock = intercept->write_lock();
2196         intercept->PostCallRecordCreatePipelineCache(device, pCreateInfo, pAllocator, pPipelineCache, result);
2197     }
2198     return result;
2199 }
2200 
DestroyPipelineCache(VkDevice device,VkPipelineCache pipelineCache,const VkAllocationCallbacks * pAllocator)2201 VKAPI_ATTR void VKAPI_CALL DestroyPipelineCache(
2202     VkDevice                                    device,
2203     VkPipelineCache                             pipelineCache,
2204     const VkAllocationCallbacks*                pAllocator) {
2205     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2206     bool skip = false;
2207     for (auto intercept : layer_data->object_dispatch) {
2208         auto lock = intercept->write_lock();
2209         skip |= intercept->PreCallValidateDestroyPipelineCache(device, pipelineCache, pAllocator);
2210         if (skip) return;
2211     }
2212     for (auto intercept : layer_data->object_dispatch) {
2213         auto lock = intercept->write_lock();
2214         intercept->PreCallRecordDestroyPipelineCache(device, pipelineCache, pAllocator);
2215     }
2216     DispatchDestroyPipelineCache(device, pipelineCache, pAllocator);
2217     for (auto intercept : layer_data->object_dispatch) {
2218         auto lock = intercept->write_lock();
2219         intercept->PostCallRecordDestroyPipelineCache(device, pipelineCache, pAllocator);
2220     }
2221 }
2222 
GetPipelineCacheData(VkDevice device,VkPipelineCache pipelineCache,size_t * pDataSize,void * pData)2223 VKAPI_ATTR VkResult VKAPI_CALL GetPipelineCacheData(
2224     VkDevice                                    device,
2225     VkPipelineCache                             pipelineCache,
2226     size_t*                                     pDataSize,
2227     void*                                       pData) {
2228     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2229     bool skip = false;
2230     for (auto intercept : layer_data->object_dispatch) {
2231         auto lock = intercept->write_lock();
2232         skip |= intercept->PreCallValidateGetPipelineCacheData(device, pipelineCache, pDataSize, pData);
2233         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
2234     }
2235     for (auto intercept : layer_data->object_dispatch) {
2236         auto lock = intercept->write_lock();
2237         intercept->PreCallRecordGetPipelineCacheData(device, pipelineCache, pDataSize, pData);
2238     }
2239     VkResult result = DispatchGetPipelineCacheData(device, pipelineCache, pDataSize, pData);
2240     for (auto intercept : layer_data->object_dispatch) {
2241         auto lock = intercept->write_lock();
2242         intercept->PostCallRecordGetPipelineCacheData(device, pipelineCache, pDataSize, pData, result);
2243     }
2244     return result;
2245 }
2246 
MergePipelineCaches(VkDevice device,VkPipelineCache dstCache,uint32_t srcCacheCount,const VkPipelineCache * pSrcCaches)2247 VKAPI_ATTR VkResult VKAPI_CALL MergePipelineCaches(
2248     VkDevice                                    device,
2249     VkPipelineCache                             dstCache,
2250     uint32_t                                    srcCacheCount,
2251     const VkPipelineCache*                      pSrcCaches) {
2252     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2253     bool skip = false;
2254     for (auto intercept : layer_data->object_dispatch) {
2255         auto lock = intercept->write_lock();
2256         skip |= intercept->PreCallValidateMergePipelineCaches(device, dstCache, srcCacheCount, pSrcCaches);
2257         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
2258     }
2259     for (auto intercept : layer_data->object_dispatch) {
2260         auto lock = intercept->write_lock();
2261         intercept->PreCallRecordMergePipelineCaches(device, dstCache, srcCacheCount, pSrcCaches);
2262     }
2263     VkResult result = DispatchMergePipelineCaches(device, dstCache, srcCacheCount, pSrcCaches);
2264     for (auto intercept : layer_data->object_dispatch) {
2265         auto lock = intercept->write_lock();
2266         intercept->PostCallRecordMergePipelineCaches(device, dstCache, srcCacheCount, pSrcCaches, result);
2267     }
2268     return result;
2269 }
2270 
DestroyPipeline(VkDevice device,VkPipeline pipeline,const VkAllocationCallbacks * pAllocator)2271 VKAPI_ATTR void VKAPI_CALL DestroyPipeline(
2272     VkDevice                                    device,
2273     VkPipeline                                  pipeline,
2274     const VkAllocationCallbacks*                pAllocator) {
2275     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2276     bool skip = false;
2277     for (auto intercept : layer_data->object_dispatch) {
2278         auto lock = intercept->write_lock();
2279         skip |= intercept->PreCallValidateDestroyPipeline(device, pipeline, pAllocator);
2280         if (skip) return;
2281     }
2282     for (auto intercept : layer_data->object_dispatch) {
2283         auto lock = intercept->write_lock();
2284         intercept->PreCallRecordDestroyPipeline(device, pipeline, pAllocator);
2285     }
2286     DispatchDestroyPipeline(device, pipeline, pAllocator);
2287     for (auto intercept : layer_data->object_dispatch) {
2288         auto lock = intercept->write_lock();
2289         intercept->PostCallRecordDestroyPipeline(device, pipeline, pAllocator);
2290     }
2291 }
2292 
DestroyPipelineLayout(VkDevice device,VkPipelineLayout pipelineLayout,const VkAllocationCallbacks * pAllocator)2293 VKAPI_ATTR void VKAPI_CALL DestroyPipelineLayout(
2294     VkDevice                                    device,
2295     VkPipelineLayout                            pipelineLayout,
2296     const VkAllocationCallbacks*                pAllocator) {
2297     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2298     bool skip = false;
2299     for (auto intercept : layer_data->object_dispatch) {
2300         auto lock = intercept->write_lock();
2301         skip |= intercept->PreCallValidateDestroyPipelineLayout(device, pipelineLayout, pAllocator);
2302         if (skip) return;
2303     }
2304     for (auto intercept : layer_data->object_dispatch) {
2305         auto lock = intercept->write_lock();
2306         intercept->PreCallRecordDestroyPipelineLayout(device, pipelineLayout, pAllocator);
2307     }
2308     DispatchDestroyPipelineLayout(device, pipelineLayout, pAllocator);
2309     for (auto intercept : layer_data->object_dispatch) {
2310         auto lock = intercept->write_lock();
2311         intercept->PostCallRecordDestroyPipelineLayout(device, pipelineLayout, pAllocator);
2312     }
2313 }
2314 
CreateSampler(VkDevice device,const VkSamplerCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkSampler * pSampler)2315 VKAPI_ATTR VkResult VKAPI_CALL CreateSampler(
2316     VkDevice                                    device,
2317     const VkSamplerCreateInfo*                  pCreateInfo,
2318     const VkAllocationCallbacks*                pAllocator,
2319     VkSampler*                                  pSampler) {
2320     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2321     bool skip = false;
2322     for (auto intercept : layer_data->object_dispatch) {
2323         auto lock = intercept->write_lock();
2324         skip |= intercept->PreCallValidateCreateSampler(device, pCreateInfo, pAllocator, pSampler);
2325         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
2326     }
2327     for (auto intercept : layer_data->object_dispatch) {
2328         auto lock = intercept->write_lock();
2329         intercept->PreCallRecordCreateSampler(device, pCreateInfo, pAllocator, pSampler);
2330     }
2331     VkResult result = DispatchCreateSampler(device, pCreateInfo, pAllocator, pSampler);
2332     for (auto intercept : layer_data->object_dispatch) {
2333         auto lock = intercept->write_lock();
2334         intercept->PostCallRecordCreateSampler(device, pCreateInfo, pAllocator, pSampler, result);
2335     }
2336     return result;
2337 }
2338 
DestroySampler(VkDevice device,VkSampler sampler,const VkAllocationCallbacks * pAllocator)2339 VKAPI_ATTR void VKAPI_CALL DestroySampler(
2340     VkDevice                                    device,
2341     VkSampler                                   sampler,
2342     const VkAllocationCallbacks*                pAllocator) {
2343     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2344     bool skip = false;
2345     for (auto intercept : layer_data->object_dispatch) {
2346         auto lock = intercept->write_lock();
2347         skip |= intercept->PreCallValidateDestroySampler(device, sampler, pAllocator);
2348         if (skip) return;
2349     }
2350     for (auto intercept : layer_data->object_dispatch) {
2351         auto lock = intercept->write_lock();
2352         intercept->PreCallRecordDestroySampler(device, sampler, pAllocator);
2353     }
2354     DispatchDestroySampler(device, sampler, pAllocator);
2355     for (auto intercept : layer_data->object_dispatch) {
2356         auto lock = intercept->write_lock();
2357         intercept->PostCallRecordDestroySampler(device, sampler, pAllocator);
2358     }
2359 }
2360 
CreateDescriptorSetLayout(VkDevice device,const VkDescriptorSetLayoutCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkDescriptorSetLayout * pSetLayout)2361 VKAPI_ATTR VkResult VKAPI_CALL CreateDescriptorSetLayout(
2362     VkDevice                                    device,
2363     const VkDescriptorSetLayoutCreateInfo*      pCreateInfo,
2364     const VkAllocationCallbacks*                pAllocator,
2365     VkDescriptorSetLayout*                      pSetLayout) {
2366     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2367     bool skip = false;
2368     for (auto intercept : layer_data->object_dispatch) {
2369         auto lock = intercept->write_lock();
2370         skip |= intercept->PreCallValidateCreateDescriptorSetLayout(device, pCreateInfo, pAllocator, pSetLayout);
2371         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
2372     }
2373     for (auto intercept : layer_data->object_dispatch) {
2374         auto lock = intercept->write_lock();
2375         intercept->PreCallRecordCreateDescriptorSetLayout(device, pCreateInfo, pAllocator, pSetLayout);
2376     }
2377     VkResult result = DispatchCreateDescriptorSetLayout(device, pCreateInfo, pAllocator, pSetLayout);
2378     for (auto intercept : layer_data->object_dispatch) {
2379         auto lock = intercept->write_lock();
2380         intercept->PostCallRecordCreateDescriptorSetLayout(device, pCreateInfo, pAllocator, pSetLayout, result);
2381     }
2382     return result;
2383 }
2384 
DestroyDescriptorSetLayout(VkDevice device,VkDescriptorSetLayout descriptorSetLayout,const VkAllocationCallbacks * pAllocator)2385 VKAPI_ATTR void VKAPI_CALL DestroyDescriptorSetLayout(
2386     VkDevice                                    device,
2387     VkDescriptorSetLayout                       descriptorSetLayout,
2388     const VkAllocationCallbacks*                pAllocator) {
2389     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2390     bool skip = false;
2391     for (auto intercept : layer_data->object_dispatch) {
2392         auto lock = intercept->write_lock();
2393         skip |= intercept->PreCallValidateDestroyDescriptorSetLayout(device, descriptorSetLayout, pAllocator);
2394         if (skip) return;
2395     }
2396     for (auto intercept : layer_data->object_dispatch) {
2397         auto lock = intercept->write_lock();
2398         intercept->PreCallRecordDestroyDescriptorSetLayout(device, descriptorSetLayout, pAllocator);
2399     }
2400     DispatchDestroyDescriptorSetLayout(device, descriptorSetLayout, pAllocator);
2401     for (auto intercept : layer_data->object_dispatch) {
2402         auto lock = intercept->write_lock();
2403         intercept->PostCallRecordDestroyDescriptorSetLayout(device, descriptorSetLayout, pAllocator);
2404     }
2405 }
2406 
CreateDescriptorPool(VkDevice device,const VkDescriptorPoolCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkDescriptorPool * pDescriptorPool)2407 VKAPI_ATTR VkResult VKAPI_CALL CreateDescriptorPool(
2408     VkDevice                                    device,
2409     const VkDescriptorPoolCreateInfo*           pCreateInfo,
2410     const VkAllocationCallbacks*                pAllocator,
2411     VkDescriptorPool*                           pDescriptorPool) {
2412     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2413     bool skip = false;
2414     for (auto intercept : layer_data->object_dispatch) {
2415         auto lock = intercept->write_lock();
2416         skip |= intercept->PreCallValidateCreateDescriptorPool(device, pCreateInfo, pAllocator, pDescriptorPool);
2417         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
2418     }
2419     for (auto intercept : layer_data->object_dispatch) {
2420         auto lock = intercept->write_lock();
2421         intercept->PreCallRecordCreateDescriptorPool(device, pCreateInfo, pAllocator, pDescriptorPool);
2422     }
2423     VkResult result = DispatchCreateDescriptorPool(device, pCreateInfo, pAllocator, pDescriptorPool);
2424     for (auto intercept : layer_data->object_dispatch) {
2425         auto lock = intercept->write_lock();
2426         intercept->PostCallRecordCreateDescriptorPool(device, pCreateInfo, pAllocator, pDescriptorPool, result);
2427     }
2428     return result;
2429 }
2430 
DestroyDescriptorPool(VkDevice device,VkDescriptorPool descriptorPool,const VkAllocationCallbacks * pAllocator)2431 VKAPI_ATTR void VKAPI_CALL DestroyDescriptorPool(
2432     VkDevice                                    device,
2433     VkDescriptorPool                            descriptorPool,
2434     const VkAllocationCallbacks*                pAllocator) {
2435     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2436     bool skip = false;
2437     for (auto intercept : layer_data->object_dispatch) {
2438         auto lock = intercept->write_lock();
2439         skip |= intercept->PreCallValidateDestroyDescriptorPool(device, descriptorPool, pAllocator);
2440         if (skip) return;
2441     }
2442     for (auto intercept : layer_data->object_dispatch) {
2443         auto lock = intercept->write_lock();
2444         intercept->PreCallRecordDestroyDescriptorPool(device, descriptorPool, pAllocator);
2445     }
2446     DispatchDestroyDescriptorPool(device, descriptorPool, pAllocator);
2447     for (auto intercept : layer_data->object_dispatch) {
2448         auto lock = intercept->write_lock();
2449         intercept->PostCallRecordDestroyDescriptorPool(device, descriptorPool, pAllocator);
2450     }
2451 }
2452 
ResetDescriptorPool(VkDevice device,VkDescriptorPool descriptorPool,VkDescriptorPoolResetFlags flags)2453 VKAPI_ATTR VkResult VKAPI_CALL ResetDescriptorPool(
2454     VkDevice                                    device,
2455     VkDescriptorPool                            descriptorPool,
2456     VkDescriptorPoolResetFlags                  flags) {
2457     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2458     bool skip = false;
2459     for (auto intercept : layer_data->object_dispatch) {
2460         auto lock = intercept->write_lock();
2461         skip |= intercept->PreCallValidateResetDescriptorPool(device, descriptorPool, flags);
2462         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
2463     }
2464     for (auto intercept : layer_data->object_dispatch) {
2465         auto lock = intercept->write_lock();
2466         intercept->PreCallRecordResetDescriptorPool(device, descriptorPool, flags);
2467     }
2468     VkResult result = DispatchResetDescriptorPool(device, descriptorPool, flags);
2469     for (auto intercept : layer_data->object_dispatch) {
2470         auto lock = intercept->write_lock();
2471         intercept->PostCallRecordResetDescriptorPool(device, descriptorPool, flags, result);
2472     }
2473     return result;
2474 }
2475 
FreeDescriptorSets(VkDevice device,VkDescriptorPool descriptorPool,uint32_t descriptorSetCount,const VkDescriptorSet * pDescriptorSets)2476 VKAPI_ATTR VkResult VKAPI_CALL FreeDescriptorSets(
2477     VkDevice                                    device,
2478     VkDescriptorPool                            descriptorPool,
2479     uint32_t                                    descriptorSetCount,
2480     const VkDescriptorSet*                      pDescriptorSets) {
2481     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2482     bool skip = false;
2483     for (auto intercept : layer_data->object_dispatch) {
2484         auto lock = intercept->write_lock();
2485         skip |= intercept->PreCallValidateFreeDescriptorSets(device, descriptorPool, descriptorSetCount, pDescriptorSets);
2486         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
2487     }
2488     for (auto intercept : layer_data->object_dispatch) {
2489         auto lock = intercept->write_lock();
2490         intercept->PreCallRecordFreeDescriptorSets(device, descriptorPool, descriptorSetCount, pDescriptorSets);
2491     }
2492     VkResult result = DispatchFreeDescriptorSets(device, descriptorPool, descriptorSetCount, pDescriptorSets);
2493     for (auto intercept : layer_data->object_dispatch) {
2494         auto lock = intercept->write_lock();
2495         intercept->PostCallRecordFreeDescriptorSets(device, descriptorPool, descriptorSetCount, pDescriptorSets, result);
2496     }
2497     return result;
2498 }
2499 
UpdateDescriptorSets(VkDevice device,uint32_t descriptorWriteCount,const VkWriteDescriptorSet * pDescriptorWrites,uint32_t descriptorCopyCount,const VkCopyDescriptorSet * pDescriptorCopies)2500 VKAPI_ATTR void VKAPI_CALL UpdateDescriptorSets(
2501     VkDevice                                    device,
2502     uint32_t                                    descriptorWriteCount,
2503     const VkWriteDescriptorSet*                 pDescriptorWrites,
2504     uint32_t                                    descriptorCopyCount,
2505     const VkCopyDescriptorSet*                  pDescriptorCopies) {
2506     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2507     bool skip = false;
2508     for (auto intercept : layer_data->object_dispatch) {
2509         auto lock = intercept->write_lock();
2510         skip |= intercept->PreCallValidateUpdateDescriptorSets(device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, pDescriptorCopies);
2511         if (skip) return;
2512     }
2513     for (auto intercept : layer_data->object_dispatch) {
2514         auto lock = intercept->write_lock();
2515         intercept->PreCallRecordUpdateDescriptorSets(device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, pDescriptorCopies);
2516     }
2517     DispatchUpdateDescriptorSets(device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, pDescriptorCopies);
2518     for (auto intercept : layer_data->object_dispatch) {
2519         auto lock = intercept->write_lock();
2520         intercept->PostCallRecordUpdateDescriptorSets(device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, pDescriptorCopies);
2521     }
2522 }
2523 
CreateFramebuffer(VkDevice device,const VkFramebufferCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkFramebuffer * pFramebuffer)2524 VKAPI_ATTR VkResult VKAPI_CALL CreateFramebuffer(
2525     VkDevice                                    device,
2526     const VkFramebufferCreateInfo*              pCreateInfo,
2527     const VkAllocationCallbacks*                pAllocator,
2528     VkFramebuffer*                              pFramebuffer) {
2529     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2530     bool skip = false;
2531     for (auto intercept : layer_data->object_dispatch) {
2532         auto lock = intercept->write_lock();
2533         skip |= intercept->PreCallValidateCreateFramebuffer(device, pCreateInfo, pAllocator, pFramebuffer);
2534         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
2535     }
2536     for (auto intercept : layer_data->object_dispatch) {
2537         auto lock = intercept->write_lock();
2538         intercept->PreCallRecordCreateFramebuffer(device, pCreateInfo, pAllocator, pFramebuffer);
2539     }
2540     VkResult result = DispatchCreateFramebuffer(device, pCreateInfo, pAllocator, pFramebuffer);
2541     for (auto intercept : layer_data->object_dispatch) {
2542         auto lock = intercept->write_lock();
2543         intercept->PostCallRecordCreateFramebuffer(device, pCreateInfo, pAllocator, pFramebuffer, result);
2544     }
2545     return result;
2546 }
2547 
DestroyFramebuffer(VkDevice device,VkFramebuffer framebuffer,const VkAllocationCallbacks * pAllocator)2548 VKAPI_ATTR void VKAPI_CALL DestroyFramebuffer(
2549     VkDevice                                    device,
2550     VkFramebuffer                               framebuffer,
2551     const VkAllocationCallbacks*                pAllocator) {
2552     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2553     bool skip = false;
2554     for (auto intercept : layer_data->object_dispatch) {
2555         auto lock = intercept->write_lock();
2556         skip |= intercept->PreCallValidateDestroyFramebuffer(device, framebuffer, pAllocator);
2557         if (skip) return;
2558     }
2559     for (auto intercept : layer_data->object_dispatch) {
2560         auto lock = intercept->write_lock();
2561         intercept->PreCallRecordDestroyFramebuffer(device, framebuffer, pAllocator);
2562     }
2563     DispatchDestroyFramebuffer(device, framebuffer, pAllocator);
2564     for (auto intercept : layer_data->object_dispatch) {
2565         auto lock = intercept->write_lock();
2566         intercept->PostCallRecordDestroyFramebuffer(device, framebuffer, pAllocator);
2567     }
2568 }
2569 
CreateRenderPass(VkDevice device,const VkRenderPassCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkRenderPass * pRenderPass)2570 VKAPI_ATTR VkResult VKAPI_CALL CreateRenderPass(
2571     VkDevice                                    device,
2572     const VkRenderPassCreateInfo*               pCreateInfo,
2573     const VkAllocationCallbacks*                pAllocator,
2574     VkRenderPass*                               pRenderPass) {
2575     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2576     bool skip = false;
2577     for (auto intercept : layer_data->object_dispatch) {
2578         auto lock = intercept->write_lock();
2579         skip |= intercept->PreCallValidateCreateRenderPass(device, pCreateInfo, pAllocator, pRenderPass);
2580         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
2581     }
2582     for (auto intercept : layer_data->object_dispatch) {
2583         auto lock = intercept->write_lock();
2584         intercept->PreCallRecordCreateRenderPass(device, pCreateInfo, pAllocator, pRenderPass);
2585     }
2586     VkResult result = DispatchCreateRenderPass(device, pCreateInfo, pAllocator, pRenderPass);
2587     for (auto intercept : layer_data->object_dispatch) {
2588         auto lock = intercept->write_lock();
2589         intercept->PostCallRecordCreateRenderPass(device, pCreateInfo, pAllocator, pRenderPass, result);
2590     }
2591     return result;
2592 }
2593 
DestroyRenderPass(VkDevice device,VkRenderPass renderPass,const VkAllocationCallbacks * pAllocator)2594 VKAPI_ATTR void VKAPI_CALL DestroyRenderPass(
2595     VkDevice                                    device,
2596     VkRenderPass                                renderPass,
2597     const VkAllocationCallbacks*                pAllocator) {
2598     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2599     bool skip = false;
2600     for (auto intercept : layer_data->object_dispatch) {
2601         auto lock = intercept->write_lock();
2602         skip |= intercept->PreCallValidateDestroyRenderPass(device, renderPass, pAllocator);
2603         if (skip) return;
2604     }
2605     for (auto intercept : layer_data->object_dispatch) {
2606         auto lock = intercept->write_lock();
2607         intercept->PreCallRecordDestroyRenderPass(device, renderPass, pAllocator);
2608     }
2609     DispatchDestroyRenderPass(device, renderPass, pAllocator);
2610     for (auto intercept : layer_data->object_dispatch) {
2611         auto lock = intercept->write_lock();
2612         intercept->PostCallRecordDestroyRenderPass(device, renderPass, pAllocator);
2613     }
2614 }
2615 
GetRenderAreaGranularity(VkDevice device,VkRenderPass renderPass,VkExtent2D * pGranularity)2616 VKAPI_ATTR void VKAPI_CALL GetRenderAreaGranularity(
2617     VkDevice                                    device,
2618     VkRenderPass                                renderPass,
2619     VkExtent2D*                                 pGranularity) {
2620     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2621     bool skip = false;
2622     for (auto intercept : layer_data->object_dispatch) {
2623         auto lock = intercept->write_lock();
2624         skip |= intercept->PreCallValidateGetRenderAreaGranularity(device, renderPass, pGranularity);
2625         if (skip) return;
2626     }
2627     for (auto intercept : layer_data->object_dispatch) {
2628         auto lock = intercept->write_lock();
2629         intercept->PreCallRecordGetRenderAreaGranularity(device, renderPass, pGranularity);
2630     }
2631     DispatchGetRenderAreaGranularity(device, renderPass, pGranularity);
2632     for (auto intercept : layer_data->object_dispatch) {
2633         auto lock = intercept->write_lock();
2634         intercept->PostCallRecordGetRenderAreaGranularity(device, renderPass, pGranularity);
2635     }
2636 }
2637 
CreateCommandPool(VkDevice device,const VkCommandPoolCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkCommandPool * pCommandPool)2638 VKAPI_ATTR VkResult VKAPI_CALL CreateCommandPool(
2639     VkDevice                                    device,
2640     const VkCommandPoolCreateInfo*              pCreateInfo,
2641     const VkAllocationCallbacks*                pAllocator,
2642     VkCommandPool*                              pCommandPool) {
2643     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2644     bool skip = false;
2645     for (auto intercept : layer_data->object_dispatch) {
2646         auto lock = intercept->write_lock();
2647         skip |= intercept->PreCallValidateCreateCommandPool(device, pCreateInfo, pAllocator, pCommandPool);
2648         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
2649     }
2650     for (auto intercept : layer_data->object_dispatch) {
2651         auto lock = intercept->write_lock();
2652         intercept->PreCallRecordCreateCommandPool(device, pCreateInfo, pAllocator, pCommandPool);
2653     }
2654     VkResult result = DispatchCreateCommandPool(device, pCreateInfo, pAllocator, pCommandPool);
2655     for (auto intercept : layer_data->object_dispatch) {
2656         auto lock = intercept->write_lock();
2657         intercept->PostCallRecordCreateCommandPool(device, pCreateInfo, pAllocator, pCommandPool, result);
2658     }
2659     return result;
2660 }
2661 
DestroyCommandPool(VkDevice device,VkCommandPool commandPool,const VkAllocationCallbacks * pAllocator)2662 VKAPI_ATTR void VKAPI_CALL DestroyCommandPool(
2663     VkDevice                                    device,
2664     VkCommandPool                               commandPool,
2665     const VkAllocationCallbacks*                pAllocator) {
2666     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2667     bool skip = false;
2668     for (auto intercept : layer_data->object_dispatch) {
2669         auto lock = intercept->write_lock();
2670         skip |= intercept->PreCallValidateDestroyCommandPool(device, commandPool, pAllocator);
2671         if (skip) return;
2672     }
2673     for (auto intercept : layer_data->object_dispatch) {
2674         auto lock = intercept->write_lock();
2675         intercept->PreCallRecordDestroyCommandPool(device, commandPool, pAllocator);
2676     }
2677     DispatchDestroyCommandPool(device, commandPool, pAllocator);
2678     for (auto intercept : layer_data->object_dispatch) {
2679         auto lock = intercept->write_lock();
2680         intercept->PostCallRecordDestroyCommandPool(device, commandPool, pAllocator);
2681     }
2682 }
2683 
ResetCommandPool(VkDevice device,VkCommandPool commandPool,VkCommandPoolResetFlags flags)2684 VKAPI_ATTR VkResult VKAPI_CALL ResetCommandPool(
2685     VkDevice                                    device,
2686     VkCommandPool                               commandPool,
2687     VkCommandPoolResetFlags                     flags) {
2688     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2689     bool skip = false;
2690     for (auto intercept : layer_data->object_dispatch) {
2691         auto lock = intercept->write_lock();
2692         skip |= intercept->PreCallValidateResetCommandPool(device, commandPool, flags);
2693         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
2694     }
2695     for (auto intercept : layer_data->object_dispatch) {
2696         auto lock = intercept->write_lock();
2697         intercept->PreCallRecordResetCommandPool(device, commandPool, flags);
2698     }
2699     VkResult result = DispatchResetCommandPool(device, commandPool, flags);
2700     for (auto intercept : layer_data->object_dispatch) {
2701         auto lock = intercept->write_lock();
2702         intercept->PostCallRecordResetCommandPool(device, commandPool, flags, result);
2703     }
2704     return result;
2705 }
2706 
AllocateCommandBuffers(VkDevice device,const VkCommandBufferAllocateInfo * pAllocateInfo,VkCommandBuffer * pCommandBuffers)2707 VKAPI_ATTR VkResult VKAPI_CALL AllocateCommandBuffers(
2708     VkDevice                                    device,
2709     const VkCommandBufferAllocateInfo*          pAllocateInfo,
2710     VkCommandBuffer*                            pCommandBuffers) {
2711     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2712     bool skip = false;
2713     for (auto intercept : layer_data->object_dispatch) {
2714         auto lock = intercept->write_lock();
2715         skip |= intercept->PreCallValidateAllocateCommandBuffers(device, pAllocateInfo, pCommandBuffers);
2716         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
2717     }
2718     for (auto intercept : layer_data->object_dispatch) {
2719         auto lock = intercept->write_lock();
2720         intercept->PreCallRecordAllocateCommandBuffers(device, pAllocateInfo, pCommandBuffers);
2721     }
2722     VkResult result = DispatchAllocateCommandBuffers(device, pAllocateInfo, pCommandBuffers);
2723     for (auto intercept : layer_data->object_dispatch) {
2724         auto lock = intercept->write_lock();
2725         intercept->PostCallRecordAllocateCommandBuffers(device, pAllocateInfo, pCommandBuffers, result);
2726     }
2727     return result;
2728 }
2729 
FreeCommandBuffers(VkDevice device,VkCommandPool commandPool,uint32_t commandBufferCount,const VkCommandBuffer * pCommandBuffers)2730 VKAPI_ATTR void VKAPI_CALL FreeCommandBuffers(
2731     VkDevice                                    device,
2732     VkCommandPool                               commandPool,
2733     uint32_t                                    commandBufferCount,
2734     const VkCommandBuffer*                      pCommandBuffers) {
2735     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
2736     bool skip = false;
2737     for (auto intercept : layer_data->object_dispatch) {
2738         auto lock = intercept->write_lock();
2739         skip |= intercept->PreCallValidateFreeCommandBuffers(device, commandPool, commandBufferCount, pCommandBuffers);
2740         if (skip) return;
2741     }
2742     for (auto intercept : layer_data->object_dispatch) {
2743         auto lock = intercept->write_lock();
2744         intercept->PreCallRecordFreeCommandBuffers(device, commandPool, commandBufferCount, pCommandBuffers);
2745     }
2746     DispatchFreeCommandBuffers(device, commandPool, commandBufferCount, pCommandBuffers);
2747     for (auto intercept : layer_data->object_dispatch) {
2748         auto lock = intercept->write_lock();
2749         intercept->PostCallRecordFreeCommandBuffers(device, commandPool, commandBufferCount, pCommandBuffers);
2750     }
2751 }
2752 
BeginCommandBuffer(VkCommandBuffer commandBuffer,const VkCommandBufferBeginInfo * pBeginInfo)2753 VKAPI_ATTR VkResult VKAPI_CALL BeginCommandBuffer(
2754     VkCommandBuffer                             commandBuffer,
2755     const VkCommandBufferBeginInfo*             pBeginInfo) {
2756     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
2757     bool skip = false;
2758     for (auto intercept : layer_data->object_dispatch) {
2759         auto lock = intercept->write_lock();
2760         skip |= intercept->PreCallValidateBeginCommandBuffer(commandBuffer, pBeginInfo);
2761         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
2762     }
2763     for (auto intercept : layer_data->object_dispatch) {
2764         auto lock = intercept->write_lock();
2765         intercept->PreCallRecordBeginCommandBuffer(commandBuffer, pBeginInfo);
2766     }
2767     VkResult result = DispatchBeginCommandBuffer(commandBuffer, pBeginInfo);
2768     for (auto intercept : layer_data->object_dispatch) {
2769         auto lock = intercept->write_lock();
2770         intercept->PostCallRecordBeginCommandBuffer(commandBuffer, pBeginInfo, result);
2771     }
2772     return result;
2773 }
2774 
EndCommandBuffer(VkCommandBuffer commandBuffer)2775 VKAPI_ATTR VkResult VKAPI_CALL EndCommandBuffer(
2776     VkCommandBuffer                             commandBuffer) {
2777     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
2778     bool skip = false;
2779     for (auto intercept : layer_data->object_dispatch) {
2780         auto lock = intercept->write_lock();
2781         skip |= intercept->PreCallValidateEndCommandBuffer(commandBuffer);
2782         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
2783     }
2784     for (auto intercept : layer_data->object_dispatch) {
2785         auto lock = intercept->write_lock();
2786         intercept->PreCallRecordEndCommandBuffer(commandBuffer);
2787     }
2788     VkResult result = DispatchEndCommandBuffer(commandBuffer);
2789     for (auto intercept : layer_data->object_dispatch) {
2790         auto lock = intercept->write_lock();
2791         intercept->PostCallRecordEndCommandBuffer(commandBuffer, result);
2792     }
2793     return result;
2794 }
2795 
ResetCommandBuffer(VkCommandBuffer commandBuffer,VkCommandBufferResetFlags flags)2796 VKAPI_ATTR VkResult VKAPI_CALL ResetCommandBuffer(
2797     VkCommandBuffer                             commandBuffer,
2798     VkCommandBufferResetFlags                   flags) {
2799     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
2800     bool skip = false;
2801     for (auto intercept : layer_data->object_dispatch) {
2802         auto lock = intercept->write_lock();
2803         skip |= intercept->PreCallValidateResetCommandBuffer(commandBuffer, flags);
2804         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
2805     }
2806     for (auto intercept : layer_data->object_dispatch) {
2807         auto lock = intercept->write_lock();
2808         intercept->PreCallRecordResetCommandBuffer(commandBuffer, flags);
2809     }
2810     VkResult result = DispatchResetCommandBuffer(commandBuffer, flags);
2811     for (auto intercept : layer_data->object_dispatch) {
2812         auto lock = intercept->write_lock();
2813         intercept->PostCallRecordResetCommandBuffer(commandBuffer, flags, result);
2814     }
2815     return result;
2816 }
2817 
CmdBindPipeline(VkCommandBuffer commandBuffer,VkPipelineBindPoint pipelineBindPoint,VkPipeline pipeline)2818 VKAPI_ATTR void VKAPI_CALL CmdBindPipeline(
2819     VkCommandBuffer                             commandBuffer,
2820     VkPipelineBindPoint                         pipelineBindPoint,
2821     VkPipeline                                  pipeline) {
2822     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
2823     bool skip = false;
2824     for (auto intercept : layer_data->object_dispatch) {
2825         auto lock = intercept->write_lock();
2826         skip |= intercept->PreCallValidateCmdBindPipeline(commandBuffer, pipelineBindPoint, pipeline);
2827         if (skip) return;
2828     }
2829     for (auto intercept : layer_data->object_dispatch) {
2830         auto lock = intercept->write_lock();
2831         intercept->PreCallRecordCmdBindPipeline(commandBuffer, pipelineBindPoint, pipeline);
2832     }
2833     DispatchCmdBindPipeline(commandBuffer, pipelineBindPoint, pipeline);
2834     for (auto intercept : layer_data->object_dispatch) {
2835         auto lock = intercept->write_lock();
2836         intercept->PostCallRecordCmdBindPipeline(commandBuffer, pipelineBindPoint, pipeline);
2837     }
2838 }
2839 
CmdSetViewport(VkCommandBuffer commandBuffer,uint32_t firstViewport,uint32_t viewportCount,const VkViewport * pViewports)2840 VKAPI_ATTR void VKAPI_CALL CmdSetViewport(
2841     VkCommandBuffer                             commandBuffer,
2842     uint32_t                                    firstViewport,
2843     uint32_t                                    viewportCount,
2844     const VkViewport*                           pViewports) {
2845     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
2846     bool skip = false;
2847     for (auto intercept : layer_data->object_dispatch) {
2848         auto lock = intercept->write_lock();
2849         skip |= intercept->PreCallValidateCmdSetViewport(commandBuffer, firstViewport, viewportCount, pViewports);
2850         if (skip) return;
2851     }
2852     for (auto intercept : layer_data->object_dispatch) {
2853         auto lock = intercept->write_lock();
2854         intercept->PreCallRecordCmdSetViewport(commandBuffer, firstViewport, viewportCount, pViewports);
2855     }
2856     DispatchCmdSetViewport(commandBuffer, firstViewport, viewportCount, pViewports);
2857     for (auto intercept : layer_data->object_dispatch) {
2858         auto lock = intercept->write_lock();
2859         intercept->PostCallRecordCmdSetViewport(commandBuffer, firstViewport, viewportCount, pViewports);
2860     }
2861 }
2862 
CmdSetScissor(VkCommandBuffer commandBuffer,uint32_t firstScissor,uint32_t scissorCount,const VkRect2D * pScissors)2863 VKAPI_ATTR void VKAPI_CALL CmdSetScissor(
2864     VkCommandBuffer                             commandBuffer,
2865     uint32_t                                    firstScissor,
2866     uint32_t                                    scissorCount,
2867     const VkRect2D*                             pScissors) {
2868     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
2869     bool skip = false;
2870     for (auto intercept : layer_data->object_dispatch) {
2871         auto lock = intercept->write_lock();
2872         skip |= intercept->PreCallValidateCmdSetScissor(commandBuffer, firstScissor, scissorCount, pScissors);
2873         if (skip) return;
2874     }
2875     for (auto intercept : layer_data->object_dispatch) {
2876         auto lock = intercept->write_lock();
2877         intercept->PreCallRecordCmdSetScissor(commandBuffer, firstScissor, scissorCount, pScissors);
2878     }
2879     DispatchCmdSetScissor(commandBuffer, firstScissor, scissorCount, pScissors);
2880     for (auto intercept : layer_data->object_dispatch) {
2881         auto lock = intercept->write_lock();
2882         intercept->PostCallRecordCmdSetScissor(commandBuffer, firstScissor, scissorCount, pScissors);
2883     }
2884 }
2885 
CmdSetLineWidth(VkCommandBuffer commandBuffer,float lineWidth)2886 VKAPI_ATTR void VKAPI_CALL CmdSetLineWidth(
2887     VkCommandBuffer                             commandBuffer,
2888     float                                       lineWidth) {
2889     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
2890     bool skip = false;
2891     for (auto intercept : layer_data->object_dispatch) {
2892         auto lock = intercept->write_lock();
2893         skip |= intercept->PreCallValidateCmdSetLineWidth(commandBuffer, lineWidth);
2894         if (skip) return;
2895     }
2896     for (auto intercept : layer_data->object_dispatch) {
2897         auto lock = intercept->write_lock();
2898         intercept->PreCallRecordCmdSetLineWidth(commandBuffer, lineWidth);
2899     }
2900     DispatchCmdSetLineWidth(commandBuffer, lineWidth);
2901     for (auto intercept : layer_data->object_dispatch) {
2902         auto lock = intercept->write_lock();
2903         intercept->PostCallRecordCmdSetLineWidth(commandBuffer, lineWidth);
2904     }
2905 }
2906 
CmdSetDepthBias(VkCommandBuffer commandBuffer,float depthBiasConstantFactor,float depthBiasClamp,float depthBiasSlopeFactor)2907 VKAPI_ATTR void VKAPI_CALL CmdSetDepthBias(
2908     VkCommandBuffer                             commandBuffer,
2909     float                                       depthBiasConstantFactor,
2910     float                                       depthBiasClamp,
2911     float                                       depthBiasSlopeFactor) {
2912     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
2913     bool skip = false;
2914     for (auto intercept : layer_data->object_dispatch) {
2915         auto lock = intercept->write_lock();
2916         skip |= intercept->PreCallValidateCmdSetDepthBias(commandBuffer, depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor);
2917         if (skip) return;
2918     }
2919     for (auto intercept : layer_data->object_dispatch) {
2920         auto lock = intercept->write_lock();
2921         intercept->PreCallRecordCmdSetDepthBias(commandBuffer, depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor);
2922     }
2923     DispatchCmdSetDepthBias(commandBuffer, depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor);
2924     for (auto intercept : layer_data->object_dispatch) {
2925         auto lock = intercept->write_lock();
2926         intercept->PostCallRecordCmdSetDepthBias(commandBuffer, depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor);
2927     }
2928 }
2929 
CmdSetBlendConstants(VkCommandBuffer commandBuffer,const float blendConstants[4])2930 VKAPI_ATTR void VKAPI_CALL CmdSetBlendConstants(
2931     VkCommandBuffer                             commandBuffer,
2932     const float                                 blendConstants[4]) {
2933     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
2934     bool skip = false;
2935     for (auto intercept : layer_data->object_dispatch) {
2936         auto lock = intercept->write_lock();
2937         skip |= intercept->PreCallValidateCmdSetBlendConstants(commandBuffer, blendConstants);
2938         if (skip) return;
2939     }
2940     for (auto intercept : layer_data->object_dispatch) {
2941         auto lock = intercept->write_lock();
2942         intercept->PreCallRecordCmdSetBlendConstants(commandBuffer, blendConstants);
2943     }
2944     DispatchCmdSetBlendConstants(commandBuffer, blendConstants);
2945     for (auto intercept : layer_data->object_dispatch) {
2946         auto lock = intercept->write_lock();
2947         intercept->PostCallRecordCmdSetBlendConstants(commandBuffer, blendConstants);
2948     }
2949 }
2950 
CmdSetDepthBounds(VkCommandBuffer commandBuffer,float minDepthBounds,float maxDepthBounds)2951 VKAPI_ATTR void VKAPI_CALL CmdSetDepthBounds(
2952     VkCommandBuffer                             commandBuffer,
2953     float                                       minDepthBounds,
2954     float                                       maxDepthBounds) {
2955     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
2956     bool skip = false;
2957     for (auto intercept : layer_data->object_dispatch) {
2958         auto lock = intercept->write_lock();
2959         skip |= intercept->PreCallValidateCmdSetDepthBounds(commandBuffer, minDepthBounds, maxDepthBounds);
2960         if (skip) return;
2961     }
2962     for (auto intercept : layer_data->object_dispatch) {
2963         auto lock = intercept->write_lock();
2964         intercept->PreCallRecordCmdSetDepthBounds(commandBuffer, minDepthBounds, maxDepthBounds);
2965     }
2966     DispatchCmdSetDepthBounds(commandBuffer, minDepthBounds, maxDepthBounds);
2967     for (auto intercept : layer_data->object_dispatch) {
2968         auto lock = intercept->write_lock();
2969         intercept->PostCallRecordCmdSetDepthBounds(commandBuffer, minDepthBounds, maxDepthBounds);
2970     }
2971 }
2972 
CmdSetStencilCompareMask(VkCommandBuffer commandBuffer,VkStencilFaceFlags faceMask,uint32_t compareMask)2973 VKAPI_ATTR void VKAPI_CALL CmdSetStencilCompareMask(
2974     VkCommandBuffer                             commandBuffer,
2975     VkStencilFaceFlags                          faceMask,
2976     uint32_t                                    compareMask) {
2977     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
2978     bool skip = false;
2979     for (auto intercept : layer_data->object_dispatch) {
2980         auto lock = intercept->write_lock();
2981         skip |= intercept->PreCallValidateCmdSetStencilCompareMask(commandBuffer, faceMask, compareMask);
2982         if (skip) return;
2983     }
2984     for (auto intercept : layer_data->object_dispatch) {
2985         auto lock = intercept->write_lock();
2986         intercept->PreCallRecordCmdSetStencilCompareMask(commandBuffer, faceMask, compareMask);
2987     }
2988     DispatchCmdSetStencilCompareMask(commandBuffer, faceMask, compareMask);
2989     for (auto intercept : layer_data->object_dispatch) {
2990         auto lock = intercept->write_lock();
2991         intercept->PostCallRecordCmdSetStencilCompareMask(commandBuffer, faceMask, compareMask);
2992     }
2993 }
2994 
CmdSetStencilWriteMask(VkCommandBuffer commandBuffer,VkStencilFaceFlags faceMask,uint32_t writeMask)2995 VKAPI_ATTR void VKAPI_CALL CmdSetStencilWriteMask(
2996     VkCommandBuffer                             commandBuffer,
2997     VkStencilFaceFlags                          faceMask,
2998     uint32_t                                    writeMask) {
2999     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3000     bool skip = false;
3001     for (auto intercept : layer_data->object_dispatch) {
3002         auto lock = intercept->write_lock();
3003         skip |= intercept->PreCallValidateCmdSetStencilWriteMask(commandBuffer, faceMask, writeMask);
3004         if (skip) return;
3005     }
3006     for (auto intercept : layer_data->object_dispatch) {
3007         auto lock = intercept->write_lock();
3008         intercept->PreCallRecordCmdSetStencilWriteMask(commandBuffer, faceMask, writeMask);
3009     }
3010     DispatchCmdSetStencilWriteMask(commandBuffer, faceMask, writeMask);
3011     for (auto intercept : layer_data->object_dispatch) {
3012         auto lock = intercept->write_lock();
3013         intercept->PostCallRecordCmdSetStencilWriteMask(commandBuffer, faceMask, writeMask);
3014     }
3015 }
3016 
CmdSetStencilReference(VkCommandBuffer commandBuffer,VkStencilFaceFlags faceMask,uint32_t reference)3017 VKAPI_ATTR void VKAPI_CALL CmdSetStencilReference(
3018     VkCommandBuffer                             commandBuffer,
3019     VkStencilFaceFlags                          faceMask,
3020     uint32_t                                    reference) {
3021     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3022     bool skip = false;
3023     for (auto intercept : layer_data->object_dispatch) {
3024         auto lock = intercept->write_lock();
3025         skip |= intercept->PreCallValidateCmdSetStencilReference(commandBuffer, faceMask, reference);
3026         if (skip) return;
3027     }
3028     for (auto intercept : layer_data->object_dispatch) {
3029         auto lock = intercept->write_lock();
3030         intercept->PreCallRecordCmdSetStencilReference(commandBuffer, faceMask, reference);
3031     }
3032     DispatchCmdSetStencilReference(commandBuffer, faceMask, reference);
3033     for (auto intercept : layer_data->object_dispatch) {
3034         auto lock = intercept->write_lock();
3035         intercept->PostCallRecordCmdSetStencilReference(commandBuffer, faceMask, reference);
3036     }
3037 }
3038 
CmdBindDescriptorSets(VkCommandBuffer commandBuffer,VkPipelineBindPoint pipelineBindPoint,VkPipelineLayout layout,uint32_t firstSet,uint32_t descriptorSetCount,const VkDescriptorSet * pDescriptorSets,uint32_t dynamicOffsetCount,const uint32_t * pDynamicOffsets)3039 VKAPI_ATTR void VKAPI_CALL CmdBindDescriptorSets(
3040     VkCommandBuffer                             commandBuffer,
3041     VkPipelineBindPoint                         pipelineBindPoint,
3042     VkPipelineLayout                            layout,
3043     uint32_t                                    firstSet,
3044     uint32_t                                    descriptorSetCount,
3045     const VkDescriptorSet*                      pDescriptorSets,
3046     uint32_t                                    dynamicOffsetCount,
3047     const uint32_t*                             pDynamicOffsets) {
3048     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3049     bool skip = false;
3050     for (auto intercept : layer_data->object_dispatch) {
3051         auto lock = intercept->write_lock();
3052         skip |= intercept->PreCallValidateCmdBindDescriptorSets(commandBuffer, pipelineBindPoint, layout, firstSet, descriptorSetCount, pDescriptorSets, dynamicOffsetCount, pDynamicOffsets);
3053         if (skip) return;
3054     }
3055     for (auto intercept : layer_data->object_dispatch) {
3056         auto lock = intercept->write_lock();
3057         intercept->PreCallRecordCmdBindDescriptorSets(commandBuffer, pipelineBindPoint, layout, firstSet, descriptorSetCount, pDescriptorSets, dynamicOffsetCount, pDynamicOffsets);
3058     }
3059     DispatchCmdBindDescriptorSets(commandBuffer, pipelineBindPoint, layout, firstSet, descriptorSetCount, pDescriptorSets, dynamicOffsetCount, pDynamicOffsets);
3060     for (auto intercept : layer_data->object_dispatch) {
3061         auto lock = intercept->write_lock();
3062         intercept->PostCallRecordCmdBindDescriptorSets(commandBuffer, pipelineBindPoint, layout, firstSet, descriptorSetCount, pDescriptorSets, dynamicOffsetCount, pDynamicOffsets);
3063     }
3064 }
3065 
CmdBindIndexBuffer(VkCommandBuffer commandBuffer,VkBuffer buffer,VkDeviceSize offset,VkIndexType indexType)3066 VKAPI_ATTR void VKAPI_CALL CmdBindIndexBuffer(
3067     VkCommandBuffer                             commandBuffer,
3068     VkBuffer                                    buffer,
3069     VkDeviceSize                                offset,
3070     VkIndexType                                 indexType) {
3071     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3072     bool skip = false;
3073     for (auto intercept : layer_data->object_dispatch) {
3074         auto lock = intercept->write_lock();
3075         skip |= intercept->PreCallValidateCmdBindIndexBuffer(commandBuffer, buffer, offset, indexType);
3076         if (skip) return;
3077     }
3078     for (auto intercept : layer_data->object_dispatch) {
3079         auto lock = intercept->write_lock();
3080         intercept->PreCallRecordCmdBindIndexBuffer(commandBuffer, buffer, offset, indexType);
3081     }
3082     DispatchCmdBindIndexBuffer(commandBuffer, buffer, offset, indexType);
3083     for (auto intercept : layer_data->object_dispatch) {
3084         auto lock = intercept->write_lock();
3085         intercept->PostCallRecordCmdBindIndexBuffer(commandBuffer, buffer, offset, indexType);
3086     }
3087 }
3088 
CmdBindVertexBuffers(VkCommandBuffer commandBuffer,uint32_t firstBinding,uint32_t bindingCount,const VkBuffer * pBuffers,const VkDeviceSize * pOffsets)3089 VKAPI_ATTR void VKAPI_CALL CmdBindVertexBuffers(
3090     VkCommandBuffer                             commandBuffer,
3091     uint32_t                                    firstBinding,
3092     uint32_t                                    bindingCount,
3093     const VkBuffer*                             pBuffers,
3094     const VkDeviceSize*                         pOffsets) {
3095     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3096     bool skip = false;
3097     for (auto intercept : layer_data->object_dispatch) {
3098         auto lock = intercept->write_lock();
3099         skip |= intercept->PreCallValidateCmdBindVertexBuffers(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets);
3100         if (skip) return;
3101     }
3102     for (auto intercept : layer_data->object_dispatch) {
3103         auto lock = intercept->write_lock();
3104         intercept->PreCallRecordCmdBindVertexBuffers(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets);
3105     }
3106     DispatchCmdBindVertexBuffers(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets);
3107     for (auto intercept : layer_data->object_dispatch) {
3108         auto lock = intercept->write_lock();
3109         intercept->PostCallRecordCmdBindVertexBuffers(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets);
3110     }
3111 }
3112 
CmdDraw(VkCommandBuffer commandBuffer,uint32_t vertexCount,uint32_t instanceCount,uint32_t firstVertex,uint32_t firstInstance)3113 VKAPI_ATTR void VKAPI_CALL CmdDraw(
3114     VkCommandBuffer                             commandBuffer,
3115     uint32_t                                    vertexCount,
3116     uint32_t                                    instanceCount,
3117     uint32_t                                    firstVertex,
3118     uint32_t                                    firstInstance) {
3119     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3120     bool skip = false;
3121     for (auto intercept : layer_data->object_dispatch) {
3122         auto lock = intercept->write_lock();
3123         skip |= intercept->PreCallValidateCmdDraw(commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance);
3124         if (skip) return;
3125     }
3126     for (auto intercept : layer_data->object_dispatch) {
3127         auto lock = intercept->write_lock();
3128         intercept->PreCallRecordCmdDraw(commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance);
3129     }
3130     DispatchCmdDraw(commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance);
3131     for (auto intercept : layer_data->object_dispatch) {
3132         auto lock = intercept->write_lock();
3133         intercept->PostCallRecordCmdDraw(commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance);
3134     }
3135 }
3136 
CmdDrawIndexed(VkCommandBuffer commandBuffer,uint32_t indexCount,uint32_t instanceCount,uint32_t firstIndex,int32_t vertexOffset,uint32_t firstInstance)3137 VKAPI_ATTR void VKAPI_CALL CmdDrawIndexed(
3138     VkCommandBuffer                             commandBuffer,
3139     uint32_t                                    indexCount,
3140     uint32_t                                    instanceCount,
3141     uint32_t                                    firstIndex,
3142     int32_t                                     vertexOffset,
3143     uint32_t                                    firstInstance) {
3144     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3145     bool skip = false;
3146     for (auto intercept : layer_data->object_dispatch) {
3147         auto lock = intercept->write_lock();
3148         skip |= intercept->PreCallValidateCmdDrawIndexed(commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance);
3149         if (skip) return;
3150     }
3151     for (auto intercept : layer_data->object_dispatch) {
3152         auto lock = intercept->write_lock();
3153         intercept->PreCallRecordCmdDrawIndexed(commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance);
3154     }
3155     DispatchCmdDrawIndexed(commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance);
3156     for (auto intercept : layer_data->object_dispatch) {
3157         auto lock = intercept->write_lock();
3158         intercept->PostCallRecordCmdDrawIndexed(commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance);
3159     }
3160 }
3161 
CmdDrawIndirect(VkCommandBuffer commandBuffer,VkBuffer buffer,VkDeviceSize offset,uint32_t drawCount,uint32_t stride)3162 VKAPI_ATTR void VKAPI_CALL CmdDrawIndirect(
3163     VkCommandBuffer                             commandBuffer,
3164     VkBuffer                                    buffer,
3165     VkDeviceSize                                offset,
3166     uint32_t                                    drawCount,
3167     uint32_t                                    stride) {
3168     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3169     bool skip = false;
3170     for (auto intercept : layer_data->object_dispatch) {
3171         auto lock = intercept->write_lock();
3172         skip |= intercept->PreCallValidateCmdDrawIndirect(commandBuffer, buffer, offset, drawCount, stride);
3173         if (skip) return;
3174     }
3175     for (auto intercept : layer_data->object_dispatch) {
3176         auto lock = intercept->write_lock();
3177         intercept->PreCallRecordCmdDrawIndirect(commandBuffer, buffer, offset, drawCount, stride);
3178     }
3179     DispatchCmdDrawIndirect(commandBuffer, buffer, offset, drawCount, stride);
3180     for (auto intercept : layer_data->object_dispatch) {
3181         auto lock = intercept->write_lock();
3182         intercept->PostCallRecordCmdDrawIndirect(commandBuffer, buffer, offset, drawCount, stride);
3183     }
3184 }
3185 
CmdDrawIndexedIndirect(VkCommandBuffer commandBuffer,VkBuffer buffer,VkDeviceSize offset,uint32_t drawCount,uint32_t stride)3186 VKAPI_ATTR void VKAPI_CALL CmdDrawIndexedIndirect(
3187     VkCommandBuffer                             commandBuffer,
3188     VkBuffer                                    buffer,
3189     VkDeviceSize                                offset,
3190     uint32_t                                    drawCount,
3191     uint32_t                                    stride) {
3192     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3193     bool skip = false;
3194     for (auto intercept : layer_data->object_dispatch) {
3195         auto lock = intercept->write_lock();
3196         skip |= intercept->PreCallValidateCmdDrawIndexedIndirect(commandBuffer, buffer, offset, drawCount, stride);
3197         if (skip) return;
3198     }
3199     for (auto intercept : layer_data->object_dispatch) {
3200         auto lock = intercept->write_lock();
3201         intercept->PreCallRecordCmdDrawIndexedIndirect(commandBuffer, buffer, offset, drawCount, stride);
3202     }
3203     DispatchCmdDrawIndexedIndirect(commandBuffer, buffer, offset, drawCount, stride);
3204     for (auto intercept : layer_data->object_dispatch) {
3205         auto lock = intercept->write_lock();
3206         intercept->PostCallRecordCmdDrawIndexedIndirect(commandBuffer, buffer, offset, drawCount, stride);
3207     }
3208 }
3209 
CmdDispatch(VkCommandBuffer commandBuffer,uint32_t groupCountX,uint32_t groupCountY,uint32_t groupCountZ)3210 VKAPI_ATTR void VKAPI_CALL CmdDispatch(
3211     VkCommandBuffer                             commandBuffer,
3212     uint32_t                                    groupCountX,
3213     uint32_t                                    groupCountY,
3214     uint32_t                                    groupCountZ) {
3215     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3216     bool skip = false;
3217     for (auto intercept : layer_data->object_dispatch) {
3218         auto lock = intercept->write_lock();
3219         skip |= intercept->PreCallValidateCmdDispatch(commandBuffer, groupCountX, groupCountY, groupCountZ);
3220         if (skip) return;
3221     }
3222     for (auto intercept : layer_data->object_dispatch) {
3223         auto lock = intercept->write_lock();
3224         intercept->PreCallRecordCmdDispatch(commandBuffer, groupCountX, groupCountY, groupCountZ);
3225     }
3226     DispatchCmdDispatch(commandBuffer, groupCountX, groupCountY, groupCountZ);
3227     for (auto intercept : layer_data->object_dispatch) {
3228         auto lock = intercept->write_lock();
3229         intercept->PostCallRecordCmdDispatch(commandBuffer, groupCountX, groupCountY, groupCountZ);
3230     }
3231 }
3232 
CmdDispatchIndirect(VkCommandBuffer commandBuffer,VkBuffer buffer,VkDeviceSize offset)3233 VKAPI_ATTR void VKAPI_CALL CmdDispatchIndirect(
3234     VkCommandBuffer                             commandBuffer,
3235     VkBuffer                                    buffer,
3236     VkDeviceSize                                offset) {
3237     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3238     bool skip = false;
3239     for (auto intercept : layer_data->object_dispatch) {
3240         auto lock = intercept->write_lock();
3241         skip |= intercept->PreCallValidateCmdDispatchIndirect(commandBuffer, buffer, offset);
3242         if (skip) return;
3243     }
3244     for (auto intercept : layer_data->object_dispatch) {
3245         auto lock = intercept->write_lock();
3246         intercept->PreCallRecordCmdDispatchIndirect(commandBuffer, buffer, offset);
3247     }
3248     DispatchCmdDispatchIndirect(commandBuffer, buffer, offset);
3249     for (auto intercept : layer_data->object_dispatch) {
3250         auto lock = intercept->write_lock();
3251         intercept->PostCallRecordCmdDispatchIndirect(commandBuffer, buffer, offset);
3252     }
3253 }
3254 
CmdCopyBuffer(VkCommandBuffer commandBuffer,VkBuffer srcBuffer,VkBuffer dstBuffer,uint32_t regionCount,const VkBufferCopy * pRegions)3255 VKAPI_ATTR void VKAPI_CALL CmdCopyBuffer(
3256     VkCommandBuffer                             commandBuffer,
3257     VkBuffer                                    srcBuffer,
3258     VkBuffer                                    dstBuffer,
3259     uint32_t                                    regionCount,
3260     const VkBufferCopy*                         pRegions) {
3261     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3262     bool skip = false;
3263     for (auto intercept : layer_data->object_dispatch) {
3264         auto lock = intercept->write_lock();
3265         skip |= intercept->PreCallValidateCmdCopyBuffer(commandBuffer, srcBuffer, dstBuffer, regionCount, pRegions);
3266         if (skip) return;
3267     }
3268     for (auto intercept : layer_data->object_dispatch) {
3269         auto lock = intercept->write_lock();
3270         intercept->PreCallRecordCmdCopyBuffer(commandBuffer, srcBuffer, dstBuffer, regionCount, pRegions);
3271     }
3272     DispatchCmdCopyBuffer(commandBuffer, srcBuffer, dstBuffer, regionCount, pRegions);
3273     for (auto intercept : layer_data->object_dispatch) {
3274         auto lock = intercept->write_lock();
3275         intercept->PostCallRecordCmdCopyBuffer(commandBuffer, srcBuffer, dstBuffer, regionCount, pRegions);
3276     }
3277 }
3278 
CmdCopyImage(VkCommandBuffer commandBuffer,VkImage srcImage,VkImageLayout srcImageLayout,VkImage dstImage,VkImageLayout dstImageLayout,uint32_t regionCount,const VkImageCopy * pRegions)3279 VKAPI_ATTR void VKAPI_CALL CmdCopyImage(
3280     VkCommandBuffer                             commandBuffer,
3281     VkImage                                     srcImage,
3282     VkImageLayout                               srcImageLayout,
3283     VkImage                                     dstImage,
3284     VkImageLayout                               dstImageLayout,
3285     uint32_t                                    regionCount,
3286     const VkImageCopy*                          pRegions) {
3287     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3288     bool skip = false;
3289     for (auto intercept : layer_data->object_dispatch) {
3290         auto lock = intercept->write_lock();
3291         skip |= intercept->PreCallValidateCmdCopyImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions);
3292         if (skip) return;
3293     }
3294     for (auto intercept : layer_data->object_dispatch) {
3295         auto lock = intercept->write_lock();
3296         intercept->PreCallRecordCmdCopyImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions);
3297     }
3298     DispatchCmdCopyImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions);
3299     for (auto intercept : layer_data->object_dispatch) {
3300         auto lock = intercept->write_lock();
3301         intercept->PostCallRecordCmdCopyImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions);
3302     }
3303 }
3304 
CmdBlitImage(VkCommandBuffer commandBuffer,VkImage srcImage,VkImageLayout srcImageLayout,VkImage dstImage,VkImageLayout dstImageLayout,uint32_t regionCount,const VkImageBlit * pRegions,VkFilter filter)3305 VKAPI_ATTR void VKAPI_CALL CmdBlitImage(
3306     VkCommandBuffer                             commandBuffer,
3307     VkImage                                     srcImage,
3308     VkImageLayout                               srcImageLayout,
3309     VkImage                                     dstImage,
3310     VkImageLayout                               dstImageLayout,
3311     uint32_t                                    regionCount,
3312     const VkImageBlit*                          pRegions,
3313     VkFilter                                    filter) {
3314     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3315     bool skip = false;
3316     for (auto intercept : layer_data->object_dispatch) {
3317         auto lock = intercept->write_lock();
3318         skip |= intercept->PreCallValidateCmdBlitImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions, filter);
3319         if (skip) return;
3320     }
3321     for (auto intercept : layer_data->object_dispatch) {
3322         auto lock = intercept->write_lock();
3323         intercept->PreCallRecordCmdBlitImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions, filter);
3324     }
3325     DispatchCmdBlitImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions, filter);
3326     for (auto intercept : layer_data->object_dispatch) {
3327         auto lock = intercept->write_lock();
3328         intercept->PostCallRecordCmdBlitImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions, filter);
3329     }
3330 }
3331 
CmdCopyBufferToImage(VkCommandBuffer commandBuffer,VkBuffer srcBuffer,VkImage dstImage,VkImageLayout dstImageLayout,uint32_t regionCount,const VkBufferImageCopy * pRegions)3332 VKAPI_ATTR void VKAPI_CALL CmdCopyBufferToImage(
3333     VkCommandBuffer                             commandBuffer,
3334     VkBuffer                                    srcBuffer,
3335     VkImage                                     dstImage,
3336     VkImageLayout                               dstImageLayout,
3337     uint32_t                                    regionCount,
3338     const VkBufferImageCopy*                    pRegions) {
3339     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3340     bool skip = false;
3341     for (auto intercept : layer_data->object_dispatch) {
3342         auto lock = intercept->write_lock();
3343         skip |= intercept->PreCallValidateCmdCopyBufferToImage(commandBuffer, srcBuffer, dstImage, dstImageLayout, regionCount, pRegions);
3344         if (skip) return;
3345     }
3346     for (auto intercept : layer_data->object_dispatch) {
3347         auto lock = intercept->write_lock();
3348         intercept->PreCallRecordCmdCopyBufferToImage(commandBuffer, srcBuffer, dstImage, dstImageLayout, regionCount, pRegions);
3349     }
3350     DispatchCmdCopyBufferToImage(commandBuffer, srcBuffer, dstImage, dstImageLayout, regionCount, pRegions);
3351     for (auto intercept : layer_data->object_dispatch) {
3352         auto lock = intercept->write_lock();
3353         intercept->PostCallRecordCmdCopyBufferToImage(commandBuffer, srcBuffer, dstImage, dstImageLayout, regionCount, pRegions);
3354     }
3355 }
3356 
CmdCopyImageToBuffer(VkCommandBuffer commandBuffer,VkImage srcImage,VkImageLayout srcImageLayout,VkBuffer dstBuffer,uint32_t regionCount,const VkBufferImageCopy * pRegions)3357 VKAPI_ATTR void VKAPI_CALL CmdCopyImageToBuffer(
3358     VkCommandBuffer                             commandBuffer,
3359     VkImage                                     srcImage,
3360     VkImageLayout                               srcImageLayout,
3361     VkBuffer                                    dstBuffer,
3362     uint32_t                                    regionCount,
3363     const VkBufferImageCopy*                    pRegions) {
3364     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3365     bool skip = false;
3366     for (auto intercept : layer_data->object_dispatch) {
3367         auto lock = intercept->write_lock();
3368         skip |= intercept->PreCallValidateCmdCopyImageToBuffer(commandBuffer, srcImage, srcImageLayout, dstBuffer, regionCount, pRegions);
3369         if (skip) return;
3370     }
3371     for (auto intercept : layer_data->object_dispatch) {
3372         auto lock = intercept->write_lock();
3373         intercept->PreCallRecordCmdCopyImageToBuffer(commandBuffer, srcImage, srcImageLayout, dstBuffer, regionCount, pRegions);
3374     }
3375     DispatchCmdCopyImageToBuffer(commandBuffer, srcImage, srcImageLayout, dstBuffer, regionCount, pRegions);
3376     for (auto intercept : layer_data->object_dispatch) {
3377         auto lock = intercept->write_lock();
3378         intercept->PostCallRecordCmdCopyImageToBuffer(commandBuffer, srcImage, srcImageLayout, dstBuffer, regionCount, pRegions);
3379     }
3380 }
3381 
CmdUpdateBuffer(VkCommandBuffer commandBuffer,VkBuffer dstBuffer,VkDeviceSize dstOffset,VkDeviceSize dataSize,const void * pData)3382 VKAPI_ATTR void VKAPI_CALL CmdUpdateBuffer(
3383     VkCommandBuffer                             commandBuffer,
3384     VkBuffer                                    dstBuffer,
3385     VkDeviceSize                                dstOffset,
3386     VkDeviceSize                                dataSize,
3387     const void*                                 pData) {
3388     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3389     bool skip = false;
3390     for (auto intercept : layer_data->object_dispatch) {
3391         auto lock = intercept->write_lock();
3392         skip |= intercept->PreCallValidateCmdUpdateBuffer(commandBuffer, dstBuffer, dstOffset, dataSize, pData);
3393         if (skip) return;
3394     }
3395     for (auto intercept : layer_data->object_dispatch) {
3396         auto lock = intercept->write_lock();
3397         intercept->PreCallRecordCmdUpdateBuffer(commandBuffer, dstBuffer, dstOffset, dataSize, pData);
3398     }
3399     DispatchCmdUpdateBuffer(commandBuffer, dstBuffer, dstOffset, dataSize, pData);
3400     for (auto intercept : layer_data->object_dispatch) {
3401         auto lock = intercept->write_lock();
3402         intercept->PostCallRecordCmdUpdateBuffer(commandBuffer, dstBuffer, dstOffset, dataSize, pData);
3403     }
3404 }
3405 
CmdFillBuffer(VkCommandBuffer commandBuffer,VkBuffer dstBuffer,VkDeviceSize dstOffset,VkDeviceSize size,uint32_t data)3406 VKAPI_ATTR void VKAPI_CALL CmdFillBuffer(
3407     VkCommandBuffer                             commandBuffer,
3408     VkBuffer                                    dstBuffer,
3409     VkDeviceSize                                dstOffset,
3410     VkDeviceSize                                size,
3411     uint32_t                                    data) {
3412     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3413     bool skip = false;
3414     for (auto intercept : layer_data->object_dispatch) {
3415         auto lock = intercept->write_lock();
3416         skip |= intercept->PreCallValidateCmdFillBuffer(commandBuffer, dstBuffer, dstOffset, size, data);
3417         if (skip) return;
3418     }
3419     for (auto intercept : layer_data->object_dispatch) {
3420         auto lock = intercept->write_lock();
3421         intercept->PreCallRecordCmdFillBuffer(commandBuffer, dstBuffer, dstOffset, size, data);
3422     }
3423     DispatchCmdFillBuffer(commandBuffer, dstBuffer, dstOffset, size, data);
3424     for (auto intercept : layer_data->object_dispatch) {
3425         auto lock = intercept->write_lock();
3426         intercept->PostCallRecordCmdFillBuffer(commandBuffer, dstBuffer, dstOffset, size, data);
3427     }
3428 }
3429 
CmdClearColorImage(VkCommandBuffer commandBuffer,VkImage image,VkImageLayout imageLayout,const VkClearColorValue * pColor,uint32_t rangeCount,const VkImageSubresourceRange * pRanges)3430 VKAPI_ATTR void VKAPI_CALL CmdClearColorImage(
3431     VkCommandBuffer                             commandBuffer,
3432     VkImage                                     image,
3433     VkImageLayout                               imageLayout,
3434     const VkClearColorValue*                    pColor,
3435     uint32_t                                    rangeCount,
3436     const VkImageSubresourceRange*              pRanges) {
3437     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3438     bool skip = false;
3439     for (auto intercept : layer_data->object_dispatch) {
3440         auto lock = intercept->write_lock();
3441         skip |= intercept->PreCallValidateCmdClearColorImage(commandBuffer, image, imageLayout, pColor, rangeCount, pRanges);
3442         if (skip) return;
3443     }
3444     for (auto intercept : layer_data->object_dispatch) {
3445         auto lock = intercept->write_lock();
3446         intercept->PreCallRecordCmdClearColorImage(commandBuffer, image, imageLayout, pColor, rangeCount, pRanges);
3447     }
3448     DispatchCmdClearColorImage(commandBuffer, image, imageLayout, pColor, rangeCount, pRanges);
3449     for (auto intercept : layer_data->object_dispatch) {
3450         auto lock = intercept->write_lock();
3451         intercept->PostCallRecordCmdClearColorImage(commandBuffer, image, imageLayout, pColor, rangeCount, pRanges);
3452     }
3453 }
3454 
CmdClearDepthStencilImage(VkCommandBuffer commandBuffer,VkImage image,VkImageLayout imageLayout,const VkClearDepthStencilValue * pDepthStencil,uint32_t rangeCount,const VkImageSubresourceRange * pRanges)3455 VKAPI_ATTR void VKAPI_CALL CmdClearDepthStencilImage(
3456     VkCommandBuffer                             commandBuffer,
3457     VkImage                                     image,
3458     VkImageLayout                               imageLayout,
3459     const VkClearDepthStencilValue*             pDepthStencil,
3460     uint32_t                                    rangeCount,
3461     const VkImageSubresourceRange*              pRanges) {
3462     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3463     bool skip = false;
3464     for (auto intercept : layer_data->object_dispatch) {
3465         auto lock = intercept->write_lock();
3466         skip |= intercept->PreCallValidateCmdClearDepthStencilImage(commandBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges);
3467         if (skip) return;
3468     }
3469     for (auto intercept : layer_data->object_dispatch) {
3470         auto lock = intercept->write_lock();
3471         intercept->PreCallRecordCmdClearDepthStencilImage(commandBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges);
3472     }
3473     DispatchCmdClearDepthStencilImage(commandBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges);
3474     for (auto intercept : layer_data->object_dispatch) {
3475         auto lock = intercept->write_lock();
3476         intercept->PostCallRecordCmdClearDepthStencilImage(commandBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges);
3477     }
3478 }
3479 
CmdClearAttachments(VkCommandBuffer commandBuffer,uint32_t attachmentCount,const VkClearAttachment * pAttachments,uint32_t rectCount,const VkClearRect * pRects)3480 VKAPI_ATTR void VKAPI_CALL CmdClearAttachments(
3481     VkCommandBuffer                             commandBuffer,
3482     uint32_t                                    attachmentCount,
3483     const VkClearAttachment*                    pAttachments,
3484     uint32_t                                    rectCount,
3485     const VkClearRect*                          pRects) {
3486     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3487     bool skip = false;
3488     for (auto intercept : layer_data->object_dispatch) {
3489         auto lock = intercept->write_lock();
3490         skip |= intercept->PreCallValidateCmdClearAttachments(commandBuffer, attachmentCount, pAttachments, rectCount, pRects);
3491         if (skip) return;
3492     }
3493     for (auto intercept : layer_data->object_dispatch) {
3494         auto lock = intercept->write_lock();
3495         intercept->PreCallRecordCmdClearAttachments(commandBuffer, attachmentCount, pAttachments, rectCount, pRects);
3496     }
3497     DispatchCmdClearAttachments(commandBuffer, attachmentCount, pAttachments, rectCount, pRects);
3498     for (auto intercept : layer_data->object_dispatch) {
3499         auto lock = intercept->write_lock();
3500         intercept->PostCallRecordCmdClearAttachments(commandBuffer, attachmentCount, pAttachments, rectCount, pRects);
3501     }
3502 }
3503 
CmdResolveImage(VkCommandBuffer commandBuffer,VkImage srcImage,VkImageLayout srcImageLayout,VkImage dstImage,VkImageLayout dstImageLayout,uint32_t regionCount,const VkImageResolve * pRegions)3504 VKAPI_ATTR void VKAPI_CALL CmdResolveImage(
3505     VkCommandBuffer                             commandBuffer,
3506     VkImage                                     srcImage,
3507     VkImageLayout                               srcImageLayout,
3508     VkImage                                     dstImage,
3509     VkImageLayout                               dstImageLayout,
3510     uint32_t                                    regionCount,
3511     const VkImageResolve*                       pRegions) {
3512     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3513     bool skip = false;
3514     for (auto intercept : layer_data->object_dispatch) {
3515         auto lock = intercept->write_lock();
3516         skip |= intercept->PreCallValidateCmdResolveImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions);
3517         if (skip) return;
3518     }
3519     for (auto intercept : layer_data->object_dispatch) {
3520         auto lock = intercept->write_lock();
3521         intercept->PreCallRecordCmdResolveImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions);
3522     }
3523     DispatchCmdResolveImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions);
3524     for (auto intercept : layer_data->object_dispatch) {
3525         auto lock = intercept->write_lock();
3526         intercept->PostCallRecordCmdResolveImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions);
3527     }
3528 }
3529 
CmdSetEvent(VkCommandBuffer commandBuffer,VkEvent event,VkPipelineStageFlags stageMask)3530 VKAPI_ATTR void VKAPI_CALL CmdSetEvent(
3531     VkCommandBuffer                             commandBuffer,
3532     VkEvent                                     event,
3533     VkPipelineStageFlags                        stageMask) {
3534     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3535     bool skip = false;
3536     for (auto intercept : layer_data->object_dispatch) {
3537         auto lock = intercept->write_lock();
3538         skip |= intercept->PreCallValidateCmdSetEvent(commandBuffer, event, stageMask);
3539         if (skip) return;
3540     }
3541     for (auto intercept : layer_data->object_dispatch) {
3542         auto lock = intercept->write_lock();
3543         intercept->PreCallRecordCmdSetEvent(commandBuffer, event, stageMask);
3544     }
3545     DispatchCmdSetEvent(commandBuffer, event, stageMask);
3546     for (auto intercept : layer_data->object_dispatch) {
3547         auto lock = intercept->write_lock();
3548         intercept->PostCallRecordCmdSetEvent(commandBuffer, event, stageMask);
3549     }
3550 }
3551 
CmdResetEvent(VkCommandBuffer commandBuffer,VkEvent event,VkPipelineStageFlags stageMask)3552 VKAPI_ATTR void VKAPI_CALL CmdResetEvent(
3553     VkCommandBuffer                             commandBuffer,
3554     VkEvent                                     event,
3555     VkPipelineStageFlags                        stageMask) {
3556     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3557     bool skip = false;
3558     for (auto intercept : layer_data->object_dispatch) {
3559         auto lock = intercept->write_lock();
3560         skip |= intercept->PreCallValidateCmdResetEvent(commandBuffer, event, stageMask);
3561         if (skip) return;
3562     }
3563     for (auto intercept : layer_data->object_dispatch) {
3564         auto lock = intercept->write_lock();
3565         intercept->PreCallRecordCmdResetEvent(commandBuffer, event, stageMask);
3566     }
3567     DispatchCmdResetEvent(commandBuffer, event, stageMask);
3568     for (auto intercept : layer_data->object_dispatch) {
3569         auto lock = intercept->write_lock();
3570         intercept->PostCallRecordCmdResetEvent(commandBuffer, event, stageMask);
3571     }
3572 }
3573 
CmdWaitEvents(VkCommandBuffer commandBuffer,uint32_t eventCount,const VkEvent * pEvents,VkPipelineStageFlags srcStageMask,VkPipelineStageFlags dstStageMask,uint32_t memoryBarrierCount,const VkMemoryBarrier * pMemoryBarriers,uint32_t bufferMemoryBarrierCount,const VkBufferMemoryBarrier * pBufferMemoryBarriers,uint32_t imageMemoryBarrierCount,const VkImageMemoryBarrier * pImageMemoryBarriers)3574 VKAPI_ATTR void VKAPI_CALL CmdWaitEvents(
3575     VkCommandBuffer                             commandBuffer,
3576     uint32_t                                    eventCount,
3577     const VkEvent*                              pEvents,
3578     VkPipelineStageFlags                        srcStageMask,
3579     VkPipelineStageFlags                        dstStageMask,
3580     uint32_t                                    memoryBarrierCount,
3581     const VkMemoryBarrier*                      pMemoryBarriers,
3582     uint32_t                                    bufferMemoryBarrierCount,
3583     const VkBufferMemoryBarrier*                pBufferMemoryBarriers,
3584     uint32_t                                    imageMemoryBarrierCount,
3585     const VkImageMemoryBarrier*                 pImageMemoryBarriers) {
3586     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3587     bool skip = false;
3588     for (auto intercept : layer_data->object_dispatch) {
3589         auto lock = intercept->write_lock();
3590         skip |= intercept->PreCallValidateCmdWaitEvents(commandBuffer, eventCount, pEvents, srcStageMask, dstStageMask, memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount, pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers);
3591         if (skip) return;
3592     }
3593     for (auto intercept : layer_data->object_dispatch) {
3594         auto lock = intercept->write_lock();
3595         intercept->PreCallRecordCmdWaitEvents(commandBuffer, eventCount, pEvents, srcStageMask, dstStageMask, memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount, pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers);
3596     }
3597     DispatchCmdWaitEvents(commandBuffer, eventCount, pEvents, srcStageMask, dstStageMask, memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount, pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers);
3598     for (auto intercept : layer_data->object_dispatch) {
3599         auto lock = intercept->write_lock();
3600         intercept->PostCallRecordCmdWaitEvents(commandBuffer, eventCount, pEvents, srcStageMask, dstStageMask, memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount, pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers);
3601     }
3602 }
3603 
CmdPipelineBarrier(VkCommandBuffer commandBuffer,VkPipelineStageFlags srcStageMask,VkPipelineStageFlags dstStageMask,VkDependencyFlags dependencyFlags,uint32_t memoryBarrierCount,const VkMemoryBarrier * pMemoryBarriers,uint32_t bufferMemoryBarrierCount,const VkBufferMemoryBarrier * pBufferMemoryBarriers,uint32_t imageMemoryBarrierCount,const VkImageMemoryBarrier * pImageMemoryBarriers)3604 VKAPI_ATTR void VKAPI_CALL CmdPipelineBarrier(
3605     VkCommandBuffer                             commandBuffer,
3606     VkPipelineStageFlags                        srcStageMask,
3607     VkPipelineStageFlags                        dstStageMask,
3608     VkDependencyFlags                           dependencyFlags,
3609     uint32_t                                    memoryBarrierCount,
3610     const VkMemoryBarrier*                      pMemoryBarriers,
3611     uint32_t                                    bufferMemoryBarrierCount,
3612     const VkBufferMemoryBarrier*                pBufferMemoryBarriers,
3613     uint32_t                                    imageMemoryBarrierCount,
3614     const VkImageMemoryBarrier*                 pImageMemoryBarriers) {
3615     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3616     bool skip = false;
3617     for (auto intercept : layer_data->object_dispatch) {
3618         auto lock = intercept->write_lock();
3619         skip |= intercept->PreCallValidateCmdPipelineBarrier(commandBuffer, srcStageMask, dstStageMask, dependencyFlags, memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount, pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers);
3620         if (skip) return;
3621     }
3622     for (auto intercept : layer_data->object_dispatch) {
3623         auto lock = intercept->write_lock();
3624         intercept->PreCallRecordCmdPipelineBarrier(commandBuffer, srcStageMask, dstStageMask, dependencyFlags, memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount, pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers);
3625     }
3626     DispatchCmdPipelineBarrier(commandBuffer, srcStageMask, dstStageMask, dependencyFlags, memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount, pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers);
3627     for (auto intercept : layer_data->object_dispatch) {
3628         auto lock = intercept->write_lock();
3629         intercept->PostCallRecordCmdPipelineBarrier(commandBuffer, srcStageMask, dstStageMask, dependencyFlags, memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount, pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers);
3630     }
3631 }
3632 
CmdBeginQuery(VkCommandBuffer commandBuffer,VkQueryPool queryPool,uint32_t query,VkQueryControlFlags flags)3633 VKAPI_ATTR void VKAPI_CALL CmdBeginQuery(
3634     VkCommandBuffer                             commandBuffer,
3635     VkQueryPool                                 queryPool,
3636     uint32_t                                    query,
3637     VkQueryControlFlags                         flags) {
3638     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3639     bool skip = false;
3640     for (auto intercept : layer_data->object_dispatch) {
3641         auto lock = intercept->write_lock();
3642         skip |= intercept->PreCallValidateCmdBeginQuery(commandBuffer, queryPool, query, flags);
3643         if (skip) return;
3644     }
3645     for (auto intercept : layer_data->object_dispatch) {
3646         auto lock = intercept->write_lock();
3647         intercept->PreCallRecordCmdBeginQuery(commandBuffer, queryPool, query, flags);
3648     }
3649     DispatchCmdBeginQuery(commandBuffer, queryPool, query, flags);
3650     for (auto intercept : layer_data->object_dispatch) {
3651         auto lock = intercept->write_lock();
3652         intercept->PostCallRecordCmdBeginQuery(commandBuffer, queryPool, query, flags);
3653     }
3654 }
3655 
CmdEndQuery(VkCommandBuffer commandBuffer,VkQueryPool queryPool,uint32_t query)3656 VKAPI_ATTR void VKAPI_CALL CmdEndQuery(
3657     VkCommandBuffer                             commandBuffer,
3658     VkQueryPool                                 queryPool,
3659     uint32_t                                    query) {
3660     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3661     bool skip = false;
3662     for (auto intercept : layer_data->object_dispatch) {
3663         auto lock = intercept->write_lock();
3664         skip |= intercept->PreCallValidateCmdEndQuery(commandBuffer, queryPool, query);
3665         if (skip) return;
3666     }
3667     for (auto intercept : layer_data->object_dispatch) {
3668         auto lock = intercept->write_lock();
3669         intercept->PreCallRecordCmdEndQuery(commandBuffer, queryPool, query);
3670     }
3671     DispatchCmdEndQuery(commandBuffer, queryPool, query);
3672     for (auto intercept : layer_data->object_dispatch) {
3673         auto lock = intercept->write_lock();
3674         intercept->PostCallRecordCmdEndQuery(commandBuffer, queryPool, query);
3675     }
3676 }
3677 
CmdResetQueryPool(VkCommandBuffer commandBuffer,VkQueryPool queryPool,uint32_t firstQuery,uint32_t queryCount)3678 VKAPI_ATTR void VKAPI_CALL CmdResetQueryPool(
3679     VkCommandBuffer                             commandBuffer,
3680     VkQueryPool                                 queryPool,
3681     uint32_t                                    firstQuery,
3682     uint32_t                                    queryCount) {
3683     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3684     bool skip = false;
3685     for (auto intercept : layer_data->object_dispatch) {
3686         auto lock = intercept->write_lock();
3687         skip |= intercept->PreCallValidateCmdResetQueryPool(commandBuffer, queryPool, firstQuery, queryCount);
3688         if (skip) return;
3689     }
3690     for (auto intercept : layer_data->object_dispatch) {
3691         auto lock = intercept->write_lock();
3692         intercept->PreCallRecordCmdResetQueryPool(commandBuffer, queryPool, firstQuery, queryCount);
3693     }
3694     DispatchCmdResetQueryPool(commandBuffer, queryPool, firstQuery, queryCount);
3695     for (auto intercept : layer_data->object_dispatch) {
3696         auto lock = intercept->write_lock();
3697         intercept->PostCallRecordCmdResetQueryPool(commandBuffer, queryPool, firstQuery, queryCount);
3698     }
3699 }
3700 
CmdWriteTimestamp(VkCommandBuffer commandBuffer,VkPipelineStageFlagBits pipelineStage,VkQueryPool queryPool,uint32_t query)3701 VKAPI_ATTR void VKAPI_CALL CmdWriteTimestamp(
3702     VkCommandBuffer                             commandBuffer,
3703     VkPipelineStageFlagBits                     pipelineStage,
3704     VkQueryPool                                 queryPool,
3705     uint32_t                                    query) {
3706     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3707     bool skip = false;
3708     for (auto intercept : layer_data->object_dispatch) {
3709         auto lock = intercept->write_lock();
3710         skip |= intercept->PreCallValidateCmdWriteTimestamp(commandBuffer, pipelineStage, queryPool, query);
3711         if (skip) return;
3712     }
3713     for (auto intercept : layer_data->object_dispatch) {
3714         auto lock = intercept->write_lock();
3715         intercept->PreCallRecordCmdWriteTimestamp(commandBuffer, pipelineStage, queryPool, query);
3716     }
3717     DispatchCmdWriteTimestamp(commandBuffer, pipelineStage, queryPool, query);
3718     for (auto intercept : layer_data->object_dispatch) {
3719         auto lock = intercept->write_lock();
3720         intercept->PostCallRecordCmdWriteTimestamp(commandBuffer, pipelineStage, queryPool, query);
3721     }
3722 }
3723 
CmdCopyQueryPoolResults(VkCommandBuffer commandBuffer,VkQueryPool queryPool,uint32_t firstQuery,uint32_t queryCount,VkBuffer dstBuffer,VkDeviceSize dstOffset,VkDeviceSize stride,VkQueryResultFlags flags)3724 VKAPI_ATTR void VKAPI_CALL CmdCopyQueryPoolResults(
3725     VkCommandBuffer                             commandBuffer,
3726     VkQueryPool                                 queryPool,
3727     uint32_t                                    firstQuery,
3728     uint32_t                                    queryCount,
3729     VkBuffer                                    dstBuffer,
3730     VkDeviceSize                                dstOffset,
3731     VkDeviceSize                                stride,
3732     VkQueryResultFlags                          flags) {
3733     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3734     bool skip = false;
3735     for (auto intercept : layer_data->object_dispatch) {
3736         auto lock = intercept->write_lock();
3737         skip |= intercept->PreCallValidateCmdCopyQueryPoolResults(commandBuffer, queryPool, firstQuery, queryCount, dstBuffer, dstOffset, stride, flags);
3738         if (skip) return;
3739     }
3740     for (auto intercept : layer_data->object_dispatch) {
3741         auto lock = intercept->write_lock();
3742         intercept->PreCallRecordCmdCopyQueryPoolResults(commandBuffer, queryPool, firstQuery, queryCount, dstBuffer, dstOffset, stride, flags);
3743     }
3744     DispatchCmdCopyQueryPoolResults(commandBuffer, queryPool, firstQuery, queryCount, dstBuffer, dstOffset, stride, flags);
3745     for (auto intercept : layer_data->object_dispatch) {
3746         auto lock = intercept->write_lock();
3747         intercept->PostCallRecordCmdCopyQueryPoolResults(commandBuffer, queryPool, firstQuery, queryCount, dstBuffer, dstOffset, stride, flags);
3748     }
3749 }
3750 
CmdPushConstants(VkCommandBuffer commandBuffer,VkPipelineLayout layout,VkShaderStageFlags stageFlags,uint32_t offset,uint32_t size,const void * pValues)3751 VKAPI_ATTR void VKAPI_CALL CmdPushConstants(
3752     VkCommandBuffer                             commandBuffer,
3753     VkPipelineLayout                            layout,
3754     VkShaderStageFlags                          stageFlags,
3755     uint32_t                                    offset,
3756     uint32_t                                    size,
3757     const void*                                 pValues) {
3758     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3759     bool skip = false;
3760     for (auto intercept : layer_data->object_dispatch) {
3761         auto lock = intercept->write_lock();
3762         skip |= intercept->PreCallValidateCmdPushConstants(commandBuffer, layout, stageFlags, offset, size, pValues);
3763         if (skip) return;
3764     }
3765     for (auto intercept : layer_data->object_dispatch) {
3766         auto lock = intercept->write_lock();
3767         intercept->PreCallRecordCmdPushConstants(commandBuffer, layout, stageFlags, offset, size, pValues);
3768     }
3769     DispatchCmdPushConstants(commandBuffer, layout, stageFlags, offset, size, pValues);
3770     for (auto intercept : layer_data->object_dispatch) {
3771         auto lock = intercept->write_lock();
3772         intercept->PostCallRecordCmdPushConstants(commandBuffer, layout, stageFlags, offset, size, pValues);
3773     }
3774 }
3775 
CmdBeginRenderPass(VkCommandBuffer commandBuffer,const VkRenderPassBeginInfo * pRenderPassBegin,VkSubpassContents contents)3776 VKAPI_ATTR void VKAPI_CALL CmdBeginRenderPass(
3777     VkCommandBuffer                             commandBuffer,
3778     const VkRenderPassBeginInfo*                pRenderPassBegin,
3779     VkSubpassContents                           contents) {
3780     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3781     bool skip = false;
3782     for (auto intercept : layer_data->object_dispatch) {
3783         auto lock = intercept->write_lock();
3784         skip |= intercept->PreCallValidateCmdBeginRenderPass(commandBuffer, pRenderPassBegin, contents);
3785         if (skip) return;
3786     }
3787     for (auto intercept : layer_data->object_dispatch) {
3788         auto lock = intercept->write_lock();
3789         intercept->PreCallRecordCmdBeginRenderPass(commandBuffer, pRenderPassBegin, contents);
3790     }
3791     DispatchCmdBeginRenderPass(commandBuffer, pRenderPassBegin, contents);
3792     for (auto intercept : layer_data->object_dispatch) {
3793         auto lock = intercept->write_lock();
3794         intercept->PostCallRecordCmdBeginRenderPass(commandBuffer, pRenderPassBegin, contents);
3795     }
3796 }
3797 
CmdNextSubpass(VkCommandBuffer commandBuffer,VkSubpassContents contents)3798 VKAPI_ATTR void VKAPI_CALL CmdNextSubpass(
3799     VkCommandBuffer                             commandBuffer,
3800     VkSubpassContents                           contents) {
3801     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3802     bool skip = false;
3803     for (auto intercept : layer_data->object_dispatch) {
3804         auto lock = intercept->write_lock();
3805         skip |= intercept->PreCallValidateCmdNextSubpass(commandBuffer, contents);
3806         if (skip) return;
3807     }
3808     for (auto intercept : layer_data->object_dispatch) {
3809         auto lock = intercept->write_lock();
3810         intercept->PreCallRecordCmdNextSubpass(commandBuffer, contents);
3811     }
3812     DispatchCmdNextSubpass(commandBuffer, contents);
3813     for (auto intercept : layer_data->object_dispatch) {
3814         auto lock = intercept->write_lock();
3815         intercept->PostCallRecordCmdNextSubpass(commandBuffer, contents);
3816     }
3817 }
3818 
CmdEndRenderPass(VkCommandBuffer commandBuffer)3819 VKAPI_ATTR void VKAPI_CALL CmdEndRenderPass(
3820     VkCommandBuffer                             commandBuffer) {
3821     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3822     bool skip = false;
3823     for (auto intercept : layer_data->object_dispatch) {
3824         auto lock = intercept->write_lock();
3825         skip |= intercept->PreCallValidateCmdEndRenderPass(commandBuffer);
3826         if (skip) return;
3827     }
3828     for (auto intercept : layer_data->object_dispatch) {
3829         auto lock = intercept->write_lock();
3830         intercept->PreCallRecordCmdEndRenderPass(commandBuffer);
3831     }
3832     DispatchCmdEndRenderPass(commandBuffer);
3833     for (auto intercept : layer_data->object_dispatch) {
3834         auto lock = intercept->write_lock();
3835         intercept->PostCallRecordCmdEndRenderPass(commandBuffer);
3836     }
3837 }
3838 
CmdExecuteCommands(VkCommandBuffer commandBuffer,uint32_t commandBufferCount,const VkCommandBuffer * pCommandBuffers)3839 VKAPI_ATTR void VKAPI_CALL CmdExecuteCommands(
3840     VkCommandBuffer                             commandBuffer,
3841     uint32_t                                    commandBufferCount,
3842     const VkCommandBuffer*                      pCommandBuffers) {
3843     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3844     bool skip = false;
3845     for (auto intercept : layer_data->object_dispatch) {
3846         auto lock = intercept->write_lock();
3847         skip |= intercept->PreCallValidateCmdExecuteCommands(commandBuffer, commandBufferCount, pCommandBuffers);
3848         if (skip) return;
3849     }
3850     for (auto intercept : layer_data->object_dispatch) {
3851         auto lock = intercept->write_lock();
3852         intercept->PreCallRecordCmdExecuteCommands(commandBuffer, commandBufferCount, pCommandBuffers);
3853     }
3854     DispatchCmdExecuteCommands(commandBuffer, commandBufferCount, pCommandBuffers);
3855     for (auto intercept : layer_data->object_dispatch) {
3856         auto lock = intercept->write_lock();
3857         intercept->PostCallRecordCmdExecuteCommands(commandBuffer, commandBufferCount, pCommandBuffers);
3858     }
3859 }
3860 
3861 
BindBufferMemory2(VkDevice device,uint32_t bindInfoCount,const VkBindBufferMemoryInfo * pBindInfos)3862 VKAPI_ATTR VkResult VKAPI_CALL BindBufferMemory2(
3863     VkDevice                                    device,
3864     uint32_t                                    bindInfoCount,
3865     const VkBindBufferMemoryInfo*               pBindInfos) {
3866     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
3867     bool skip = false;
3868     for (auto intercept : layer_data->object_dispatch) {
3869         auto lock = intercept->write_lock();
3870         skip |= intercept->PreCallValidateBindBufferMemory2(device, bindInfoCount, pBindInfos);
3871         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
3872     }
3873     for (auto intercept : layer_data->object_dispatch) {
3874         auto lock = intercept->write_lock();
3875         intercept->PreCallRecordBindBufferMemory2(device, bindInfoCount, pBindInfos);
3876     }
3877     VkResult result = DispatchBindBufferMemory2(device, bindInfoCount, pBindInfos);
3878     for (auto intercept : layer_data->object_dispatch) {
3879         auto lock = intercept->write_lock();
3880         intercept->PostCallRecordBindBufferMemory2(device, bindInfoCount, pBindInfos, result);
3881     }
3882     return result;
3883 }
3884 
BindImageMemory2(VkDevice device,uint32_t bindInfoCount,const VkBindImageMemoryInfo * pBindInfos)3885 VKAPI_ATTR VkResult VKAPI_CALL BindImageMemory2(
3886     VkDevice                                    device,
3887     uint32_t                                    bindInfoCount,
3888     const VkBindImageMemoryInfo*                pBindInfos) {
3889     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
3890     bool skip = false;
3891     for (auto intercept : layer_data->object_dispatch) {
3892         auto lock = intercept->write_lock();
3893         skip |= intercept->PreCallValidateBindImageMemory2(device, bindInfoCount, pBindInfos);
3894         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
3895     }
3896     for (auto intercept : layer_data->object_dispatch) {
3897         auto lock = intercept->write_lock();
3898         intercept->PreCallRecordBindImageMemory2(device, bindInfoCount, pBindInfos);
3899     }
3900     VkResult result = DispatchBindImageMemory2(device, bindInfoCount, pBindInfos);
3901     for (auto intercept : layer_data->object_dispatch) {
3902         auto lock = intercept->write_lock();
3903         intercept->PostCallRecordBindImageMemory2(device, bindInfoCount, pBindInfos, result);
3904     }
3905     return result;
3906 }
3907 
GetDeviceGroupPeerMemoryFeatures(VkDevice device,uint32_t heapIndex,uint32_t localDeviceIndex,uint32_t remoteDeviceIndex,VkPeerMemoryFeatureFlags * pPeerMemoryFeatures)3908 VKAPI_ATTR void VKAPI_CALL GetDeviceGroupPeerMemoryFeatures(
3909     VkDevice                                    device,
3910     uint32_t                                    heapIndex,
3911     uint32_t                                    localDeviceIndex,
3912     uint32_t                                    remoteDeviceIndex,
3913     VkPeerMemoryFeatureFlags*                   pPeerMemoryFeatures) {
3914     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
3915     bool skip = false;
3916     for (auto intercept : layer_data->object_dispatch) {
3917         auto lock = intercept->write_lock();
3918         skip |= intercept->PreCallValidateGetDeviceGroupPeerMemoryFeatures(device, heapIndex, localDeviceIndex, remoteDeviceIndex, pPeerMemoryFeatures);
3919         if (skip) return;
3920     }
3921     for (auto intercept : layer_data->object_dispatch) {
3922         auto lock = intercept->write_lock();
3923         intercept->PreCallRecordGetDeviceGroupPeerMemoryFeatures(device, heapIndex, localDeviceIndex, remoteDeviceIndex, pPeerMemoryFeatures);
3924     }
3925     DispatchGetDeviceGroupPeerMemoryFeatures(device, heapIndex, localDeviceIndex, remoteDeviceIndex, pPeerMemoryFeatures);
3926     for (auto intercept : layer_data->object_dispatch) {
3927         auto lock = intercept->write_lock();
3928         intercept->PostCallRecordGetDeviceGroupPeerMemoryFeatures(device, heapIndex, localDeviceIndex, remoteDeviceIndex, pPeerMemoryFeatures);
3929     }
3930 }
3931 
CmdSetDeviceMask(VkCommandBuffer commandBuffer,uint32_t deviceMask)3932 VKAPI_ATTR void VKAPI_CALL CmdSetDeviceMask(
3933     VkCommandBuffer                             commandBuffer,
3934     uint32_t                                    deviceMask) {
3935     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3936     bool skip = false;
3937     for (auto intercept : layer_data->object_dispatch) {
3938         auto lock = intercept->write_lock();
3939         skip |= intercept->PreCallValidateCmdSetDeviceMask(commandBuffer, deviceMask);
3940         if (skip) return;
3941     }
3942     for (auto intercept : layer_data->object_dispatch) {
3943         auto lock = intercept->write_lock();
3944         intercept->PreCallRecordCmdSetDeviceMask(commandBuffer, deviceMask);
3945     }
3946     DispatchCmdSetDeviceMask(commandBuffer, deviceMask);
3947     for (auto intercept : layer_data->object_dispatch) {
3948         auto lock = intercept->write_lock();
3949         intercept->PostCallRecordCmdSetDeviceMask(commandBuffer, deviceMask);
3950     }
3951 }
3952 
CmdDispatchBase(VkCommandBuffer commandBuffer,uint32_t baseGroupX,uint32_t baseGroupY,uint32_t baseGroupZ,uint32_t groupCountX,uint32_t groupCountY,uint32_t groupCountZ)3953 VKAPI_ATTR void VKAPI_CALL CmdDispatchBase(
3954     VkCommandBuffer                             commandBuffer,
3955     uint32_t                                    baseGroupX,
3956     uint32_t                                    baseGroupY,
3957     uint32_t                                    baseGroupZ,
3958     uint32_t                                    groupCountX,
3959     uint32_t                                    groupCountY,
3960     uint32_t                                    groupCountZ) {
3961     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
3962     bool skip = false;
3963     for (auto intercept : layer_data->object_dispatch) {
3964         auto lock = intercept->write_lock();
3965         skip |= intercept->PreCallValidateCmdDispatchBase(commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ);
3966         if (skip) return;
3967     }
3968     for (auto intercept : layer_data->object_dispatch) {
3969         auto lock = intercept->write_lock();
3970         intercept->PreCallRecordCmdDispatchBase(commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ);
3971     }
3972     DispatchCmdDispatchBase(commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ);
3973     for (auto intercept : layer_data->object_dispatch) {
3974         auto lock = intercept->write_lock();
3975         intercept->PostCallRecordCmdDispatchBase(commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ);
3976     }
3977 }
3978 
EnumeratePhysicalDeviceGroups(VkInstance instance,uint32_t * pPhysicalDeviceGroupCount,VkPhysicalDeviceGroupProperties * pPhysicalDeviceGroupProperties)3979 VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDeviceGroups(
3980     VkInstance                                  instance,
3981     uint32_t*                                   pPhysicalDeviceGroupCount,
3982     VkPhysicalDeviceGroupProperties*            pPhysicalDeviceGroupProperties) {
3983     auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map);
3984     bool skip = false;
3985     for (auto intercept : layer_data->object_dispatch) {
3986         auto lock = intercept->write_lock();
3987         skip |= intercept->PreCallValidateEnumeratePhysicalDeviceGroups(instance, pPhysicalDeviceGroupCount, pPhysicalDeviceGroupProperties);
3988         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
3989     }
3990     for (auto intercept : layer_data->object_dispatch) {
3991         auto lock = intercept->write_lock();
3992         intercept->PreCallRecordEnumeratePhysicalDeviceGroups(instance, pPhysicalDeviceGroupCount, pPhysicalDeviceGroupProperties);
3993     }
3994     VkResult result = DispatchEnumeratePhysicalDeviceGroups(instance, pPhysicalDeviceGroupCount, pPhysicalDeviceGroupProperties);
3995     for (auto intercept : layer_data->object_dispatch) {
3996         auto lock = intercept->write_lock();
3997         intercept->PostCallRecordEnumeratePhysicalDeviceGroups(instance, pPhysicalDeviceGroupCount, pPhysicalDeviceGroupProperties, result);
3998     }
3999     return result;
4000 }
4001 
GetImageMemoryRequirements2(VkDevice device,const VkImageMemoryRequirementsInfo2 * pInfo,VkMemoryRequirements2 * pMemoryRequirements)4002 VKAPI_ATTR void VKAPI_CALL GetImageMemoryRequirements2(
4003     VkDevice                                    device,
4004     const VkImageMemoryRequirementsInfo2*       pInfo,
4005     VkMemoryRequirements2*                      pMemoryRequirements) {
4006     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
4007     bool skip = false;
4008     for (auto intercept : layer_data->object_dispatch) {
4009         auto lock = intercept->write_lock();
4010         skip |= intercept->PreCallValidateGetImageMemoryRequirements2(device, pInfo, pMemoryRequirements);
4011         if (skip) return;
4012     }
4013     for (auto intercept : layer_data->object_dispatch) {
4014         auto lock = intercept->write_lock();
4015         intercept->PreCallRecordGetImageMemoryRequirements2(device, pInfo, pMemoryRequirements);
4016     }
4017     DispatchGetImageMemoryRequirements2(device, pInfo, pMemoryRequirements);
4018     for (auto intercept : layer_data->object_dispatch) {
4019         auto lock = intercept->write_lock();
4020         intercept->PostCallRecordGetImageMemoryRequirements2(device, pInfo, pMemoryRequirements);
4021     }
4022 }
4023 
GetBufferMemoryRequirements2(VkDevice device,const VkBufferMemoryRequirementsInfo2 * pInfo,VkMemoryRequirements2 * pMemoryRequirements)4024 VKAPI_ATTR void VKAPI_CALL GetBufferMemoryRequirements2(
4025     VkDevice                                    device,
4026     const VkBufferMemoryRequirementsInfo2*      pInfo,
4027     VkMemoryRequirements2*                      pMemoryRequirements) {
4028     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
4029     bool skip = false;
4030     for (auto intercept : layer_data->object_dispatch) {
4031         auto lock = intercept->write_lock();
4032         skip |= intercept->PreCallValidateGetBufferMemoryRequirements2(device, pInfo, pMemoryRequirements);
4033         if (skip) return;
4034     }
4035     for (auto intercept : layer_data->object_dispatch) {
4036         auto lock = intercept->write_lock();
4037         intercept->PreCallRecordGetBufferMemoryRequirements2(device, pInfo, pMemoryRequirements);
4038     }
4039     DispatchGetBufferMemoryRequirements2(device, pInfo, pMemoryRequirements);
4040     for (auto intercept : layer_data->object_dispatch) {
4041         auto lock = intercept->write_lock();
4042         intercept->PostCallRecordGetBufferMemoryRequirements2(device, pInfo, pMemoryRequirements);
4043     }
4044 }
4045 
GetImageSparseMemoryRequirements2(VkDevice device,const VkImageSparseMemoryRequirementsInfo2 * pInfo,uint32_t * pSparseMemoryRequirementCount,VkSparseImageMemoryRequirements2 * pSparseMemoryRequirements)4046 VKAPI_ATTR void VKAPI_CALL GetImageSparseMemoryRequirements2(
4047     VkDevice                                    device,
4048     const VkImageSparseMemoryRequirementsInfo2* pInfo,
4049     uint32_t*                                   pSparseMemoryRequirementCount,
4050     VkSparseImageMemoryRequirements2*           pSparseMemoryRequirements) {
4051     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
4052     bool skip = false;
4053     for (auto intercept : layer_data->object_dispatch) {
4054         auto lock = intercept->write_lock();
4055         skip |= intercept->PreCallValidateGetImageSparseMemoryRequirements2(device, pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements);
4056         if (skip) return;
4057     }
4058     for (auto intercept : layer_data->object_dispatch) {
4059         auto lock = intercept->write_lock();
4060         intercept->PreCallRecordGetImageSparseMemoryRequirements2(device, pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements);
4061     }
4062     DispatchGetImageSparseMemoryRequirements2(device, pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements);
4063     for (auto intercept : layer_data->object_dispatch) {
4064         auto lock = intercept->write_lock();
4065         intercept->PostCallRecordGetImageSparseMemoryRequirements2(device, pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements);
4066     }
4067 }
4068 
GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,VkPhysicalDeviceFeatures2 * pFeatures)4069 VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFeatures2(
4070     VkPhysicalDevice                            physicalDevice,
4071     VkPhysicalDeviceFeatures2*                  pFeatures) {
4072     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
4073     bool skip = false;
4074     for (auto intercept : layer_data->object_dispatch) {
4075         auto lock = intercept->write_lock();
4076         skip |= intercept->PreCallValidateGetPhysicalDeviceFeatures2(physicalDevice, pFeatures);
4077         if (skip) return;
4078     }
4079     for (auto intercept : layer_data->object_dispatch) {
4080         auto lock = intercept->write_lock();
4081         intercept->PreCallRecordGetPhysicalDeviceFeatures2(physicalDevice, pFeatures);
4082     }
4083     DispatchGetPhysicalDeviceFeatures2(physicalDevice, pFeatures);
4084     for (auto intercept : layer_data->object_dispatch) {
4085         auto lock = intercept->write_lock();
4086         intercept->PostCallRecordGetPhysicalDeviceFeatures2(physicalDevice, pFeatures);
4087     }
4088 }
4089 
GetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice,VkPhysicalDeviceProperties2 * pProperties)4090 VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceProperties2(
4091     VkPhysicalDevice                            physicalDevice,
4092     VkPhysicalDeviceProperties2*                pProperties) {
4093     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
4094     bool skip = false;
4095     for (auto intercept : layer_data->object_dispatch) {
4096         auto lock = intercept->write_lock();
4097         skip |= intercept->PreCallValidateGetPhysicalDeviceProperties2(physicalDevice, pProperties);
4098         if (skip) return;
4099     }
4100     for (auto intercept : layer_data->object_dispatch) {
4101         auto lock = intercept->write_lock();
4102         intercept->PreCallRecordGetPhysicalDeviceProperties2(physicalDevice, pProperties);
4103     }
4104     DispatchGetPhysicalDeviceProperties2(physicalDevice, pProperties);
4105     for (auto intercept : layer_data->object_dispatch) {
4106         auto lock = intercept->write_lock();
4107         intercept->PostCallRecordGetPhysicalDeviceProperties2(physicalDevice, pProperties);
4108     }
4109 }
4110 
GetPhysicalDeviceFormatProperties2(VkPhysicalDevice physicalDevice,VkFormat format,VkFormatProperties2 * pFormatProperties)4111 VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFormatProperties2(
4112     VkPhysicalDevice                            physicalDevice,
4113     VkFormat                                    format,
4114     VkFormatProperties2*                        pFormatProperties) {
4115     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
4116     bool skip = false;
4117     for (auto intercept : layer_data->object_dispatch) {
4118         auto lock = intercept->write_lock();
4119         skip |= intercept->PreCallValidateGetPhysicalDeviceFormatProperties2(physicalDevice, format, pFormatProperties);
4120         if (skip) return;
4121     }
4122     for (auto intercept : layer_data->object_dispatch) {
4123         auto lock = intercept->write_lock();
4124         intercept->PreCallRecordGetPhysicalDeviceFormatProperties2(physicalDevice, format, pFormatProperties);
4125     }
4126     DispatchGetPhysicalDeviceFormatProperties2(physicalDevice, format, pFormatProperties);
4127     for (auto intercept : layer_data->object_dispatch) {
4128         auto lock = intercept->write_lock();
4129         intercept->PostCallRecordGetPhysicalDeviceFormatProperties2(physicalDevice, format, pFormatProperties);
4130     }
4131 }
4132 
GetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice physicalDevice,const VkPhysicalDeviceImageFormatInfo2 * pImageFormatInfo,VkImageFormatProperties2 * pImageFormatProperties)4133 VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceImageFormatProperties2(
4134     VkPhysicalDevice                            physicalDevice,
4135     const VkPhysicalDeviceImageFormatInfo2*     pImageFormatInfo,
4136     VkImageFormatProperties2*                   pImageFormatProperties) {
4137     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
4138     bool skip = false;
4139     for (auto intercept : layer_data->object_dispatch) {
4140         auto lock = intercept->write_lock();
4141         skip |= intercept->PreCallValidateGetPhysicalDeviceImageFormatProperties2(physicalDevice, pImageFormatInfo, pImageFormatProperties);
4142         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
4143     }
4144     for (auto intercept : layer_data->object_dispatch) {
4145         auto lock = intercept->write_lock();
4146         intercept->PreCallRecordGetPhysicalDeviceImageFormatProperties2(physicalDevice, pImageFormatInfo, pImageFormatProperties);
4147     }
4148     VkResult result = DispatchGetPhysicalDeviceImageFormatProperties2(physicalDevice, pImageFormatInfo, pImageFormatProperties);
4149     for (auto intercept : layer_data->object_dispatch) {
4150         auto lock = intercept->write_lock();
4151         intercept->PostCallRecordGetPhysicalDeviceImageFormatProperties2(physicalDevice, pImageFormatInfo, pImageFormatProperties, result);
4152     }
4153     return result;
4154 }
4155 
GetPhysicalDeviceQueueFamilyProperties2(VkPhysicalDevice physicalDevice,uint32_t * pQueueFamilyPropertyCount,VkQueueFamilyProperties2 * pQueueFamilyProperties)4156 VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceQueueFamilyProperties2(
4157     VkPhysicalDevice                            physicalDevice,
4158     uint32_t*                                   pQueueFamilyPropertyCount,
4159     VkQueueFamilyProperties2*                   pQueueFamilyProperties) {
4160     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
4161     bool skip = false;
4162     for (auto intercept : layer_data->object_dispatch) {
4163         auto lock = intercept->write_lock();
4164         skip |= intercept->PreCallValidateGetPhysicalDeviceQueueFamilyProperties2(physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties);
4165         if (skip) return;
4166     }
4167     for (auto intercept : layer_data->object_dispatch) {
4168         auto lock = intercept->write_lock();
4169         intercept->PreCallRecordGetPhysicalDeviceQueueFamilyProperties2(physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties);
4170     }
4171     DispatchGetPhysicalDeviceQueueFamilyProperties2(physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties);
4172     for (auto intercept : layer_data->object_dispatch) {
4173         auto lock = intercept->write_lock();
4174         intercept->PostCallRecordGetPhysicalDeviceQueueFamilyProperties2(physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties);
4175     }
4176 }
4177 
GetPhysicalDeviceMemoryProperties2(VkPhysicalDevice physicalDevice,VkPhysicalDeviceMemoryProperties2 * pMemoryProperties)4178 VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceMemoryProperties2(
4179     VkPhysicalDevice                            physicalDevice,
4180     VkPhysicalDeviceMemoryProperties2*          pMemoryProperties) {
4181     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
4182     bool skip = false;
4183     for (auto intercept : layer_data->object_dispatch) {
4184         auto lock = intercept->write_lock();
4185         skip |= intercept->PreCallValidateGetPhysicalDeviceMemoryProperties2(physicalDevice, pMemoryProperties);
4186         if (skip) return;
4187     }
4188     for (auto intercept : layer_data->object_dispatch) {
4189         auto lock = intercept->write_lock();
4190         intercept->PreCallRecordGetPhysicalDeviceMemoryProperties2(physicalDevice, pMemoryProperties);
4191     }
4192     DispatchGetPhysicalDeviceMemoryProperties2(physicalDevice, pMemoryProperties);
4193     for (auto intercept : layer_data->object_dispatch) {
4194         auto lock = intercept->write_lock();
4195         intercept->PostCallRecordGetPhysicalDeviceMemoryProperties2(physicalDevice, pMemoryProperties);
4196     }
4197 }
4198 
GetPhysicalDeviceSparseImageFormatProperties2(VkPhysicalDevice physicalDevice,const VkPhysicalDeviceSparseImageFormatInfo2 * pFormatInfo,uint32_t * pPropertyCount,VkSparseImageFormatProperties2 * pProperties)4199 VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceSparseImageFormatProperties2(
4200     VkPhysicalDevice                            physicalDevice,
4201     const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo,
4202     uint32_t*                                   pPropertyCount,
4203     VkSparseImageFormatProperties2*             pProperties) {
4204     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
4205     bool skip = false;
4206     for (auto intercept : layer_data->object_dispatch) {
4207         auto lock = intercept->write_lock();
4208         skip |= intercept->PreCallValidateGetPhysicalDeviceSparseImageFormatProperties2(physicalDevice, pFormatInfo, pPropertyCount, pProperties);
4209         if (skip) return;
4210     }
4211     for (auto intercept : layer_data->object_dispatch) {
4212         auto lock = intercept->write_lock();
4213         intercept->PreCallRecordGetPhysicalDeviceSparseImageFormatProperties2(physicalDevice, pFormatInfo, pPropertyCount, pProperties);
4214     }
4215     DispatchGetPhysicalDeviceSparseImageFormatProperties2(physicalDevice, pFormatInfo, pPropertyCount, pProperties);
4216     for (auto intercept : layer_data->object_dispatch) {
4217         auto lock = intercept->write_lock();
4218         intercept->PostCallRecordGetPhysicalDeviceSparseImageFormatProperties2(physicalDevice, pFormatInfo, pPropertyCount, pProperties);
4219     }
4220 }
4221 
TrimCommandPool(VkDevice device,VkCommandPool commandPool,VkCommandPoolTrimFlags flags)4222 VKAPI_ATTR void VKAPI_CALL TrimCommandPool(
4223     VkDevice                                    device,
4224     VkCommandPool                               commandPool,
4225     VkCommandPoolTrimFlags                      flags) {
4226     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
4227     bool skip = false;
4228     for (auto intercept : layer_data->object_dispatch) {
4229         auto lock = intercept->write_lock();
4230         skip |= intercept->PreCallValidateTrimCommandPool(device, commandPool, flags);
4231         if (skip) return;
4232     }
4233     for (auto intercept : layer_data->object_dispatch) {
4234         auto lock = intercept->write_lock();
4235         intercept->PreCallRecordTrimCommandPool(device, commandPool, flags);
4236     }
4237     DispatchTrimCommandPool(device, commandPool, flags);
4238     for (auto intercept : layer_data->object_dispatch) {
4239         auto lock = intercept->write_lock();
4240         intercept->PostCallRecordTrimCommandPool(device, commandPool, flags);
4241     }
4242 }
4243 
GetDeviceQueue2(VkDevice device,const VkDeviceQueueInfo2 * pQueueInfo,VkQueue * pQueue)4244 VKAPI_ATTR void VKAPI_CALL GetDeviceQueue2(
4245     VkDevice                                    device,
4246     const VkDeviceQueueInfo2*                   pQueueInfo,
4247     VkQueue*                                    pQueue) {
4248     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
4249     bool skip = false;
4250     for (auto intercept : layer_data->object_dispatch) {
4251         auto lock = intercept->write_lock();
4252         skip |= intercept->PreCallValidateGetDeviceQueue2(device, pQueueInfo, pQueue);
4253         if (skip) return;
4254     }
4255     for (auto intercept : layer_data->object_dispatch) {
4256         auto lock = intercept->write_lock();
4257         intercept->PreCallRecordGetDeviceQueue2(device, pQueueInfo, pQueue);
4258     }
4259     DispatchGetDeviceQueue2(device, pQueueInfo, pQueue);
4260     for (auto intercept : layer_data->object_dispatch) {
4261         auto lock = intercept->write_lock();
4262         intercept->PostCallRecordGetDeviceQueue2(device, pQueueInfo, pQueue);
4263     }
4264 }
4265 
CreateSamplerYcbcrConversion(VkDevice device,const VkSamplerYcbcrConversionCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkSamplerYcbcrConversion * pYcbcrConversion)4266 VKAPI_ATTR VkResult VKAPI_CALL CreateSamplerYcbcrConversion(
4267     VkDevice                                    device,
4268     const VkSamplerYcbcrConversionCreateInfo*   pCreateInfo,
4269     const VkAllocationCallbacks*                pAllocator,
4270     VkSamplerYcbcrConversion*                   pYcbcrConversion) {
4271     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
4272     bool skip = false;
4273     for (auto intercept : layer_data->object_dispatch) {
4274         auto lock = intercept->write_lock();
4275         skip |= intercept->PreCallValidateCreateSamplerYcbcrConversion(device, pCreateInfo, pAllocator, pYcbcrConversion);
4276         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
4277     }
4278     for (auto intercept : layer_data->object_dispatch) {
4279         auto lock = intercept->write_lock();
4280         intercept->PreCallRecordCreateSamplerYcbcrConversion(device, pCreateInfo, pAllocator, pYcbcrConversion);
4281     }
4282     VkResult result = DispatchCreateSamplerYcbcrConversion(device, pCreateInfo, pAllocator, pYcbcrConversion);
4283     for (auto intercept : layer_data->object_dispatch) {
4284         auto lock = intercept->write_lock();
4285         intercept->PostCallRecordCreateSamplerYcbcrConversion(device, pCreateInfo, pAllocator, pYcbcrConversion, result);
4286     }
4287     return result;
4288 }
4289 
DestroySamplerYcbcrConversion(VkDevice device,VkSamplerYcbcrConversion ycbcrConversion,const VkAllocationCallbacks * pAllocator)4290 VKAPI_ATTR void VKAPI_CALL DestroySamplerYcbcrConversion(
4291     VkDevice                                    device,
4292     VkSamplerYcbcrConversion                    ycbcrConversion,
4293     const VkAllocationCallbacks*                pAllocator) {
4294     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
4295     bool skip = false;
4296     for (auto intercept : layer_data->object_dispatch) {
4297         auto lock = intercept->write_lock();
4298         skip |= intercept->PreCallValidateDestroySamplerYcbcrConversion(device, ycbcrConversion, pAllocator);
4299         if (skip) return;
4300     }
4301     for (auto intercept : layer_data->object_dispatch) {
4302         auto lock = intercept->write_lock();
4303         intercept->PreCallRecordDestroySamplerYcbcrConversion(device, ycbcrConversion, pAllocator);
4304     }
4305     DispatchDestroySamplerYcbcrConversion(device, ycbcrConversion, pAllocator);
4306     for (auto intercept : layer_data->object_dispatch) {
4307         auto lock = intercept->write_lock();
4308         intercept->PostCallRecordDestroySamplerYcbcrConversion(device, ycbcrConversion, pAllocator);
4309     }
4310 }
4311 
CreateDescriptorUpdateTemplate(VkDevice device,const VkDescriptorUpdateTemplateCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkDescriptorUpdateTemplate * pDescriptorUpdateTemplate)4312 VKAPI_ATTR VkResult VKAPI_CALL CreateDescriptorUpdateTemplate(
4313     VkDevice                                    device,
4314     const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
4315     const VkAllocationCallbacks*                pAllocator,
4316     VkDescriptorUpdateTemplate*                 pDescriptorUpdateTemplate) {
4317     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
4318     bool skip = false;
4319     for (auto intercept : layer_data->object_dispatch) {
4320         auto lock = intercept->write_lock();
4321         skip |= intercept->PreCallValidateCreateDescriptorUpdateTemplate(device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate);
4322         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
4323     }
4324     for (auto intercept : layer_data->object_dispatch) {
4325         auto lock = intercept->write_lock();
4326         intercept->PreCallRecordCreateDescriptorUpdateTemplate(device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate);
4327     }
4328     VkResult result = DispatchCreateDescriptorUpdateTemplate(device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate);
4329     for (auto intercept : layer_data->object_dispatch) {
4330         auto lock = intercept->write_lock();
4331         intercept->PostCallRecordCreateDescriptorUpdateTemplate(device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate, result);
4332     }
4333     return result;
4334 }
4335 
DestroyDescriptorUpdateTemplate(VkDevice device,VkDescriptorUpdateTemplate descriptorUpdateTemplate,const VkAllocationCallbacks * pAllocator)4336 VKAPI_ATTR void VKAPI_CALL DestroyDescriptorUpdateTemplate(
4337     VkDevice                                    device,
4338     VkDescriptorUpdateTemplate                  descriptorUpdateTemplate,
4339     const VkAllocationCallbacks*                pAllocator) {
4340     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
4341     bool skip = false;
4342     for (auto intercept : layer_data->object_dispatch) {
4343         auto lock = intercept->write_lock();
4344         skip |= intercept->PreCallValidateDestroyDescriptorUpdateTemplate(device, descriptorUpdateTemplate, pAllocator);
4345         if (skip) return;
4346     }
4347     for (auto intercept : layer_data->object_dispatch) {
4348         auto lock = intercept->write_lock();
4349         intercept->PreCallRecordDestroyDescriptorUpdateTemplate(device, descriptorUpdateTemplate, pAllocator);
4350     }
4351     DispatchDestroyDescriptorUpdateTemplate(device, descriptorUpdateTemplate, pAllocator);
4352     for (auto intercept : layer_data->object_dispatch) {
4353         auto lock = intercept->write_lock();
4354         intercept->PostCallRecordDestroyDescriptorUpdateTemplate(device, descriptorUpdateTemplate, pAllocator);
4355     }
4356 }
4357 
UpdateDescriptorSetWithTemplate(VkDevice device,VkDescriptorSet descriptorSet,VkDescriptorUpdateTemplate descriptorUpdateTemplate,const void * pData)4358 VKAPI_ATTR void VKAPI_CALL UpdateDescriptorSetWithTemplate(
4359     VkDevice                                    device,
4360     VkDescriptorSet                             descriptorSet,
4361     VkDescriptorUpdateTemplate                  descriptorUpdateTemplate,
4362     const void*                                 pData) {
4363     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
4364     bool skip = false;
4365     for (auto intercept : layer_data->object_dispatch) {
4366         auto lock = intercept->write_lock();
4367         skip |= intercept->PreCallValidateUpdateDescriptorSetWithTemplate(device, descriptorSet, descriptorUpdateTemplate, pData);
4368         if (skip) return;
4369     }
4370     for (auto intercept : layer_data->object_dispatch) {
4371         auto lock = intercept->write_lock();
4372         intercept->PreCallRecordUpdateDescriptorSetWithTemplate(device, descriptorSet, descriptorUpdateTemplate, pData);
4373     }
4374     DispatchUpdateDescriptorSetWithTemplate(device, descriptorSet, descriptorUpdateTemplate, pData);
4375     for (auto intercept : layer_data->object_dispatch) {
4376         auto lock = intercept->write_lock();
4377         intercept->PostCallRecordUpdateDescriptorSetWithTemplate(device, descriptorSet, descriptorUpdateTemplate, pData);
4378     }
4379 }
4380 
GetPhysicalDeviceExternalBufferProperties(VkPhysicalDevice physicalDevice,const VkPhysicalDeviceExternalBufferInfo * pExternalBufferInfo,VkExternalBufferProperties * pExternalBufferProperties)4381 VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalBufferProperties(
4382     VkPhysicalDevice                            physicalDevice,
4383     const VkPhysicalDeviceExternalBufferInfo*   pExternalBufferInfo,
4384     VkExternalBufferProperties*                 pExternalBufferProperties) {
4385     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
4386     bool skip = false;
4387     for (auto intercept : layer_data->object_dispatch) {
4388         auto lock = intercept->write_lock();
4389         skip |= intercept->PreCallValidateGetPhysicalDeviceExternalBufferProperties(physicalDevice, pExternalBufferInfo, pExternalBufferProperties);
4390         if (skip) return;
4391     }
4392     for (auto intercept : layer_data->object_dispatch) {
4393         auto lock = intercept->write_lock();
4394         intercept->PreCallRecordGetPhysicalDeviceExternalBufferProperties(physicalDevice, pExternalBufferInfo, pExternalBufferProperties);
4395     }
4396     DispatchGetPhysicalDeviceExternalBufferProperties(physicalDevice, pExternalBufferInfo, pExternalBufferProperties);
4397     for (auto intercept : layer_data->object_dispatch) {
4398         auto lock = intercept->write_lock();
4399         intercept->PostCallRecordGetPhysicalDeviceExternalBufferProperties(physicalDevice, pExternalBufferInfo, pExternalBufferProperties);
4400     }
4401 }
4402 
GetPhysicalDeviceExternalFenceProperties(VkPhysicalDevice physicalDevice,const VkPhysicalDeviceExternalFenceInfo * pExternalFenceInfo,VkExternalFenceProperties * pExternalFenceProperties)4403 VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalFenceProperties(
4404     VkPhysicalDevice                            physicalDevice,
4405     const VkPhysicalDeviceExternalFenceInfo*    pExternalFenceInfo,
4406     VkExternalFenceProperties*                  pExternalFenceProperties) {
4407     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
4408     bool skip = false;
4409     for (auto intercept : layer_data->object_dispatch) {
4410         auto lock = intercept->write_lock();
4411         skip |= intercept->PreCallValidateGetPhysicalDeviceExternalFenceProperties(physicalDevice, pExternalFenceInfo, pExternalFenceProperties);
4412         if (skip) return;
4413     }
4414     for (auto intercept : layer_data->object_dispatch) {
4415         auto lock = intercept->write_lock();
4416         intercept->PreCallRecordGetPhysicalDeviceExternalFenceProperties(physicalDevice, pExternalFenceInfo, pExternalFenceProperties);
4417     }
4418     DispatchGetPhysicalDeviceExternalFenceProperties(physicalDevice, pExternalFenceInfo, pExternalFenceProperties);
4419     for (auto intercept : layer_data->object_dispatch) {
4420         auto lock = intercept->write_lock();
4421         intercept->PostCallRecordGetPhysicalDeviceExternalFenceProperties(physicalDevice, pExternalFenceInfo, pExternalFenceProperties);
4422     }
4423 }
4424 
GetPhysicalDeviceExternalSemaphoreProperties(VkPhysicalDevice physicalDevice,const VkPhysicalDeviceExternalSemaphoreInfo * pExternalSemaphoreInfo,VkExternalSemaphoreProperties * pExternalSemaphoreProperties)4425 VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalSemaphoreProperties(
4426     VkPhysicalDevice                            physicalDevice,
4427     const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo,
4428     VkExternalSemaphoreProperties*              pExternalSemaphoreProperties) {
4429     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
4430     bool skip = false;
4431     for (auto intercept : layer_data->object_dispatch) {
4432         auto lock = intercept->write_lock();
4433         skip |= intercept->PreCallValidateGetPhysicalDeviceExternalSemaphoreProperties(physicalDevice, pExternalSemaphoreInfo, pExternalSemaphoreProperties);
4434         if (skip) return;
4435     }
4436     for (auto intercept : layer_data->object_dispatch) {
4437         auto lock = intercept->write_lock();
4438         intercept->PreCallRecordGetPhysicalDeviceExternalSemaphoreProperties(physicalDevice, pExternalSemaphoreInfo, pExternalSemaphoreProperties);
4439     }
4440     DispatchGetPhysicalDeviceExternalSemaphoreProperties(physicalDevice, pExternalSemaphoreInfo, pExternalSemaphoreProperties);
4441     for (auto intercept : layer_data->object_dispatch) {
4442         auto lock = intercept->write_lock();
4443         intercept->PostCallRecordGetPhysicalDeviceExternalSemaphoreProperties(physicalDevice, pExternalSemaphoreInfo, pExternalSemaphoreProperties);
4444     }
4445 }
4446 
GetDescriptorSetLayoutSupport(VkDevice device,const VkDescriptorSetLayoutCreateInfo * pCreateInfo,VkDescriptorSetLayoutSupport * pSupport)4447 VKAPI_ATTR void VKAPI_CALL GetDescriptorSetLayoutSupport(
4448     VkDevice                                    device,
4449     const VkDescriptorSetLayoutCreateInfo*      pCreateInfo,
4450     VkDescriptorSetLayoutSupport*               pSupport) {
4451     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
4452     bool skip = false;
4453     for (auto intercept : layer_data->object_dispatch) {
4454         auto lock = intercept->write_lock();
4455         skip |= intercept->PreCallValidateGetDescriptorSetLayoutSupport(device, pCreateInfo, pSupport);
4456         if (skip) return;
4457     }
4458     for (auto intercept : layer_data->object_dispatch) {
4459         auto lock = intercept->write_lock();
4460         intercept->PreCallRecordGetDescriptorSetLayoutSupport(device, pCreateInfo, pSupport);
4461     }
4462     DispatchGetDescriptorSetLayoutSupport(device, pCreateInfo, pSupport);
4463     for (auto intercept : layer_data->object_dispatch) {
4464         auto lock = intercept->write_lock();
4465         intercept->PostCallRecordGetDescriptorSetLayoutSupport(device, pCreateInfo, pSupport);
4466     }
4467 }
4468 
4469 
DestroySurfaceKHR(VkInstance instance,VkSurfaceKHR surface,const VkAllocationCallbacks * pAllocator)4470 VKAPI_ATTR void VKAPI_CALL DestroySurfaceKHR(
4471     VkInstance                                  instance,
4472     VkSurfaceKHR                                surface,
4473     const VkAllocationCallbacks*                pAllocator) {
4474     auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map);
4475     bool skip = false;
4476     for (auto intercept : layer_data->object_dispatch) {
4477         auto lock = intercept->write_lock();
4478         skip |= intercept->PreCallValidateDestroySurfaceKHR(instance, surface, pAllocator);
4479         if (skip) return;
4480     }
4481     for (auto intercept : layer_data->object_dispatch) {
4482         auto lock = intercept->write_lock();
4483         intercept->PreCallRecordDestroySurfaceKHR(instance, surface, pAllocator);
4484     }
4485     DispatchDestroySurfaceKHR(instance, surface, pAllocator);
4486     for (auto intercept : layer_data->object_dispatch) {
4487         auto lock = intercept->write_lock();
4488         intercept->PostCallRecordDestroySurfaceKHR(instance, surface, pAllocator);
4489     }
4490 }
4491 
GetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice,uint32_t queueFamilyIndex,VkSurfaceKHR surface,VkBool32 * pSupported)4492 VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceSupportKHR(
4493     VkPhysicalDevice                            physicalDevice,
4494     uint32_t                                    queueFamilyIndex,
4495     VkSurfaceKHR                                surface,
4496     VkBool32*                                   pSupported) {
4497     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
4498     bool skip = false;
4499     for (auto intercept : layer_data->object_dispatch) {
4500         auto lock = intercept->write_lock();
4501         skip |= intercept->PreCallValidateGetPhysicalDeviceSurfaceSupportKHR(physicalDevice, queueFamilyIndex, surface, pSupported);
4502         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
4503     }
4504     for (auto intercept : layer_data->object_dispatch) {
4505         auto lock = intercept->write_lock();
4506         intercept->PreCallRecordGetPhysicalDeviceSurfaceSupportKHR(physicalDevice, queueFamilyIndex, surface, pSupported);
4507     }
4508     VkResult result = DispatchGetPhysicalDeviceSurfaceSupportKHR(physicalDevice, queueFamilyIndex, surface, pSupported);
4509     for (auto intercept : layer_data->object_dispatch) {
4510         auto lock = intercept->write_lock();
4511         intercept->PostCallRecordGetPhysicalDeviceSurfaceSupportKHR(physicalDevice, queueFamilyIndex, surface, pSupported, result);
4512     }
4513     return result;
4514 }
4515 
GetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice,VkSurfaceKHR surface,VkSurfaceCapabilitiesKHR * pSurfaceCapabilities)4516 VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceCapabilitiesKHR(
4517     VkPhysicalDevice                            physicalDevice,
4518     VkSurfaceKHR                                surface,
4519     VkSurfaceCapabilitiesKHR*                   pSurfaceCapabilities) {
4520     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
4521     bool skip = false;
4522     for (auto intercept : layer_data->object_dispatch) {
4523         auto lock = intercept->write_lock();
4524         skip |= intercept->PreCallValidateGetPhysicalDeviceSurfaceCapabilitiesKHR(physicalDevice, surface, pSurfaceCapabilities);
4525         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
4526     }
4527     for (auto intercept : layer_data->object_dispatch) {
4528         auto lock = intercept->write_lock();
4529         intercept->PreCallRecordGetPhysicalDeviceSurfaceCapabilitiesKHR(physicalDevice, surface, pSurfaceCapabilities);
4530     }
4531     VkResult result = DispatchGetPhysicalDeviceSurfaceCapabilitiesKHR(physicalDevice, surface, pSurfaceCapabilities);
4532     for (auto intercept : layer_data->object_dispatch) {
4533         auto lock = intercept->write_lock();
4534         intercept->PostCallRecordGetPhysicalDeviceSurfaceCapabilitiesKHR(physicalDevice, surface, pSurfaceCapabilities, result);
4535     }
4536     return result;
4537 }
4538 
GetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice,VkSurfaceKHR surface,uint32_t * pSurfaceFormatCount,VkSurfaceFormatKHR * pSurfaceFormats)4539 VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceFormatsKHR(
4540     VkPhysicalDevice                            physicalDevice,
4541     VkSurfaceKHR                                surface,
4542     uint32_t*                                   pSurfaceFormatCount,
4543     VkSurfaceFormatKHR*                         pSurfaceFormats) {
4544     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
4545     bool skip = false;
4546     for (auto intercept : layer_data->object_dispatch) {
4547         auto lock = intercept->write_lock();
4548         skip |= intercept->PreCallValidateGetPhysicalDeviceSurfaceFormatsKHR(physicalDevice, surface, pSurfaceFormatCount, pSurfaceFormats);
4549         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
4550     }
4551     for (auto intercept : layer_data->object_dispatch) {
4552         auto lock = intercept->write_lock();
4553         intercept->PreCallRecordGetPhysicalDeviceSurfaceFormatsKHR(physicalDevice, surface, pSurfaceFormatCount, pSurfaceFormats);
4554     }
4555     VkResult result = DispatchGetPhysicalDeviceSurfaceFormatsKHR(physicalDevice, surface, pSurfaceFormatCount, pSurfaceFormats);
4556     for (auto intercept : layer_data->object_dispatch) {
4557         auto lock = intercept->write_lock();
4558         intercept->PostCallRecordGetPhysicalDeviceSurfaceFormatsKHR(physicalDevice, surface, pSurfaceFormatCount, pSurfaceFormats, result);
4559     }
4560     return result;
4561 }
4562 
GetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice,VkSurfaceKHR surface,uint32_t * pPresentModeCount,VkPresentModeKHR * pPresentModes)4563 VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfacePresentModesKHR(
4564     VkPhysicalDevice                            physicalDevice,
4565     VkSurfaceKHR                                surface,
4566     uint32_t*                                   pPresentModeCount,
4567     VkPresentModeKHR*                           pPresentModes) {
4568     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
4569     bool skip = false;
4570     for (auto intercept : layer_data->object_dispatch) {
4571         auto lock = intercept->write_lock();
4572         skip |= intercept->PreCallValidateGetPhysicalDeviceSurfacePresentModesKHR(physicalDevice, surface, pPresentModeCount, pPresentModes);
4573         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
4574     }
4575     for (auto intercept : layer_data->object_dispatch) {
4576         auto lock = intercept->write_lock();
4577         intercept->PreCallRecordGetPhysicalDeviceSurfacePresentModesKHR(physicalDevice, surface, pPresentModeCount, pPresentModes);
4578     }
4579     VkResult result = DispatchGetPhysicalDeviceSurfacePresentModesKHR(physicalDevice, surface, pPresentModeCount, pPresentModes);
4580     for (auto intercept : layer_data->object_dispatch) {
4581         auto lock = intercept->write_lock();
4582         intercept->PostCallRecordGetPhysicalDeviceSurfacePresentModesKHR(physicalDevice, surface, pPresentModeCount, pPresentModes, result);
4583     }
4584     return result;
4585 }
4586 
4587 
CreateSwapchainKHR(VkDevice device,const VkSwapchainCreateInfoKHR * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkSwapchainKHR * pSwapchain)4588 VKAPI_ATTR VkResult VKAPI_CALL CreateSwapchainKHR(
4589     VkDevice                                    device,
4590     const VkSwapchainCreateInfoKHR*             pCreateInfo,
4591     const VkAllocationCallbacks*                pAllocator,
4592     VkSwapchainKHR*                             pSwapchain) {
4593     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
4594     bool skip = false;
4595     for (auto intercept : layer_data->object_dispatch) {
4596         auto lock = intercept->write_lock();
4597         skip |= intercept->PreCallValidateCreateSwapchainKHR(device, pCreateInfo, pAllocator, pSwapchain);
4598         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
4599     }
4600     for (auto intercept : layer_data->object_dispatch) {
4601         auto lock = intercept->write_lock();
4602         intercept->PreCallRecordCreateSwapchainKHR(device, pCreateInfo, pAllocator, pSwapchain);
4603     }
4604     VkResult result = DispatchCreateSwapchainKHR(device, pCreateInfo, pAllocator, pSwapchain);
4605     for (auto intercept : layer_data->object_dispatch) {
4606         auto lock = intercept->write_lock();
4607         intercept->PostCallRecordCreateSwapchainKHR(device, pCreateInfo, pAllocator, pSwapchain, result);
4608     }
4609     return result;
4610 }
4611 
DestroySwapchainKHR(VkDevice device,VkSwapchainKHR swapchain,const VkAllocationCallbacks * pAllocator)4612 VKAPI_ATTR void VKAPI_CALL DestroySwapchainKHR(
4613     VkDevice                                    device,
4614     VkSwapchainKHR                              swapchain,
4615     const VkAllocationCallbacks*                pAllocator) {
4616     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
4617     bool skip = false;
4618     for (auto intercept : layer_data->object_dispatch) {
4619         auto lock = intercept->write_lock();
4620         skip |= intercept->PreCallValidateDestroySwapchainKHR(device, swapchain, pAllocator);
4621         if (skip) return;
4622     }
4623     for (auto intercept : layer_data->object_dispatch) {
4624         auto lock = intercept->write_lock();
4625         intercept->PreCallRecordDestroySwapchainKHR(device, swapchain, pAllocator);
4626     }
4627     DispatchDestroySwapchainKHR(device, swapchain, pAllocator);
4628     for (auto intercept : layer_data->object_dispatch) {
4629         auto lock = intercept->write_lock();
4630         intercept->PostCallRecordDestroySwapchainKHR(device, swapchain, pAllocator);
4631     }
4632 }
4633 
GetSwapchainImagesKHR(VkDevice device,VkSwapchainKHR swapchain,uint32_t * pSwapchainImageCount,VkImage * pSwapchainImages)4634 VKAPI_ATTR VkResult VKAPI_CALL GetSwapchainImagesKHR(
4635     VkDevice                                    device,
4636     VkSwapchainKHR                              swapchain,
4637     uint32_t*                                   pSwapchainImageCount,
4638     VkImage*                                    pSwapchainImages) {
4639     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
4640     bool skip = false;
4641     for (auto intercept : layer_data->object_dispatch) {
4642         auto lock = intercept->write_lock();
4643         skip |= intercept->PreCallValidateGetSwapchainImagesKHR(device, swapchain, pSwapchainImageCount, pSwapchainImages);
4644         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
4645     }
4646     for (auto intercept : layer_data->object_dispatch) {
4647         auto lock = intercept->write_lock();
4648         intercept->PreCallRecordGetSwapchainImagesKHR(device, swapchain, pSwapchainImageCount, pSwapchainImages);
4649     }
4650     VkResult result = DispatchGetSwapchainImagesKHR(device, swapchain, pSwapchainImageCount, pSwapchainImages);
4651     for (auto intercept : layer_data->object_dispatch) {
4652         auto lock = intercept->write_lock();
4653         intercept->PostCallRecordGetSwapchainImagesKHR(device, swapchain, pSwapchainImageCount, pSwapchainImages, result);
4654     }
4655     return result;
4656 }
4657 
AcquireNextImageKHR(VkDevice device,VkSwapchainKHR swapchain,uint64_t timeout,VkSemaphore semaphore,VkFence fence,uint32_t * pImageIndex)4658 VKAPI_ATTR VkResult VKAPI_CALL AcquireNextImageKHR(
4659     VkDevice                                    device,
4660     VkSwapchainKHR                              swapchain,
4661     uint64_t                                    timeout,
4662     VkSemaphore                                 semaphore,
4663     VkFence                                     fence,
4664     uint32_t*                                   pImageIndex) {
4665     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
4666     bool skip = false;
4667     for (auto intercept : layer_data->object_dispatch) {
4668         auto lock = intercept->write_lock();
4669         skip |= intercept->PreCallValidateAcquireNextImageKHR(device, swapchain, timeout, semaphore, fence, pImageIndex);
4670         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
4671     }
4672     for (auto intercept : layer_data->object_dispatch) {
4673         auto lock = intercept->write_lock();
4674         intercept->PreCallRecordAcquireNextImageKHR(device, swapchain, timeout, semaphore, fence, pImageIndex);
4675     }
4676     VkResult result = DispatchAcquireNextImageKHR(device, swapchain, timeout, semaphore, fence, pImageIndex);
4677     for (auto intercept : layer_data->object_dispatch) {
4678         auto lock = intercept->write_lock();
4679         intercept->PostCallRecordAcquireNextImageKHR(device, swapchain, timeout, semaphore, fence, pImageIndex, result);
4680     }
4681     return result;
4682 }
4683 
QueuePresentKHR(VkQueue queue,const VkPresentInfoKHR * pPresentInfo)4684 VKAPI_ATTR VkResult VKAPI_CALL QueuePresentKHR(
4685     VkQueue                                     queue,
4686     const VkPresentInfoKHR*                     pPresentInfo) {
4687     auto layer_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map);
4688     bool skip = false;
4689     for (auto intercept : layer_data->object_dispatch) {
4690         auto lock = intercept->write_lock();
4691         skip |= intercept->PreCallValidateQueuePresentKHR(queue, pPresentInfo);
4692         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
4693     }
4694     for (auto intercept : layer_data->object_dispatch) {
4695         auto lock = intercept->write_lock();
4696         intercept->PreCallRecordQueuePresentKHR(queue, pPresentInfo);
4697     }
4698     VkResult result = DispatchQueuePresentKHR(queue, pPresentInfo);
4699     for (auto intercept : layer_data->object_dispatch) {
4700         auto lock = intercept->write_lock();
4701         intercept->PostCallRecordQueuePresentKHR(queue, pPresentInfo, result);
4702     }
4703     return result;
4704 }
4705 
GetDeviceGroupPresentCapabilitiesKHR(VkDevice device,VkDeviceGroupPresentCapabilitiesKHR * pDeviceGroupPresentCapabilities)4706 VKAPI_ATTR VkResult VKAPI_CALL GetDeviceGroupPresentCapabilitiesKHR(
4707     VkDevice                                    device,
4708     VkDeviceGroupPresentCapabilitiesKHR*        pDeviceGroupPresentCapabilities) {
4709     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
4710     bool skip = false;
4711     for (auto intercept : layer_data->object_dispatch) {
4712         auto lock = intercept->write_lock();
4713         skip |= intercept->PreCallValidateGetDeviceGroupPresentCapabilitiesKHR(device, pDeviceGroupPresentCapabilities);
4714         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
4715     }
4716     for (auto intercept : layer_data->object_dispatch) {
4717         auto lock = intercept->write_lock();
4718         intercept->PreCallRecordGetDeviceGroupPresentCapabilitiesKHR(device, pDeviceGroupPresentCapabilities);
4719     }
4720     VkResult result = DispatchGetDeviceGroupPresentCapabilitiesKHR(device, pDeviceGroupPresentCapabilities);
4721     for (auto intercept : layer_data->object_dispatch) {
4722         auto lock = intercept->write_lock();
4723         intercept->PostCallRecordGetDeviceGroupPresentCapabilitiesKHR(device, pDeviceGroupPresentCapabilities, result);
4724     }
4725     return result;
4726 }
4727 
GetDeviceGroupSurfacePresentModesKHR(VkDevice device,VkSurfaceKHR surface,VkDeviceGroupPresentModeFlagsKHR * pModes)4728 VKAPI_ATTR VkResult VKAPI_CALL GetDeviceGroupSurfacePresentModesKHR(
4729     VkDevice                                    device,
4730     VkSurfaceKHR                                surface,
4731     VkDeviceGroupPresentModeFlagsKHR*           pModes) {
4732     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
4733     bool skip = false;
4734     for (auto intercept : layer_data->object_dispatch) {
4735         auto lock = intercept->write_lock();
4736         skip |= intercept->PreCallValidateGetDeviceGroupSurfacePresentModesKHR(device, surface, pModes);
4737         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
4738     }
4739     for (auto intercept : layer_data->object_dispatch) {
4740         auto lock = intercept->write_lock();
4741         intercept->PreCallRecordGetDeviceGroupSurfacePresentModesKHR(device, surface, pModes);
4742     }
4743     VkResult result = DispatchGetDeviceGroupSurfacePresentModesKHR(device, surface, pModes);
4744     for (auto intercept : layer_data->object_dispatch) {
4745         auto lock = intercept->write_lock();
4746         intercept->PostCallRecordGetDeviceGroupSurfacePresentModesKHR(device, surface, pModes, result);
4747     }
4748     return result;
4749 }
4750 
GetPhysicalDevicePresentRectanglesKHR(VkPhysicalDevice physicalDevice,VkSurfaceKHR surface,uint32_t * pRectCount,VkRect2D * pRects)4751 VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDevicePresentRectanglesKHR(
4752     VkPhysicalDevice                            physicalDevice,
4753     VkSurfaceKHR                                surface,
4754     uint32_t*                                   pRectCount,
4755     VkRect2D*                                   pRects) {
4756     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
4757     bool skip = false;
4758     for (auto intercept : layer_data->object_dispatch) {
4759         auto lock = intercept->write_lock();
4760         skip |= intercept->PreCallValidateGetPhysicalDevicePresentRectanglesKHR(physicalDevice, surface, pRectCount, pRects);
4761         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
4762     }
4763     for (auto intercept : layer_data->object_dispatch) {
4764         auto lock = intercept->write_lock();
4765         intercept->PreCallRecordGetPhysicalDevicePresentRectanglesKHR(physicalDevice, surface, pRectCount, pRects);
4766     }
4767     VkResult result = DispatchGetPhysicalDevicePresentRectanglesKHR(physicalDevice, surface, pRectCount, pRects);
4768     for (auto intercept : layer_data->object_dispatch) {
4769         auto lock = intercept->write_lock();
4770         intercept->PostCallRecordGetPhysicalDevicePresentRectanglesKHR(physicalDevice, surface, pRectCount, pRects, result);
4771     }
4772     return result;
4773 }
4774 
AcquireNextImage2KHR(VkDevice device,const VkAcquireNextImageInfoKHR * pAcquireInfo,uint32_t * pImageIndex)4775 VKAPI_ATTR VkResult VKAPI_CALL AcquireNextImage2KHR(
4776     VkDevice                                    device,
4777     const VkAcquireNextImageInfoKHR*            pAcquireInfo,
4778     uint32_t*                                   pImageIndex) {
4779     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
4780     bool skip = false;
4781     for (auto intercept : layer_data->object_dispatch) {
4782         auto lock = intercept->write_lock();
4783         skip |= intercept->PreCallValidateAcquireNextImage2KHR(device, pAcquireInfo, pImageIndex);
4784         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
4785     }
4786     for (auto intercept : layer_data->object_dispatch) {
4787         auto lock = intercept->write_lock();
4788         intercept->PreCallRecordAcquireNextImage2KHR(device, pAcquireInfo, pImageIndex);
4789     }
4790     VkResult result = DispatchAcquireNextImage2KHR(device, pAcquireInfo, pImageIndex);
4791     for (auto intercept : layer_data->object_dispatch) {
4792         auto lock = intercept->write_lock();
4793         intercept->PostCallRecordAcquireNextImage2KHR(device, pAcquireInfo, pImageIndex, result);
4794     }
4795     return result;
4796 }
4797 
4798 
GetPhysicalDeviceDisplayPropertiesKHR(VkPhysicalDevice physicalDevice,uint32_t * pPropertyCount,VkDisplayPropertiesKHR * pProperties)4799 VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceDisplayPropertiesKHR(
4800     VkPhysicalDevice                            physicalDevice,
4801     uint32_t*                                   pPropertyCount,
4802     VkDisplayPropertiesKHR*                     pProperties) {
4803     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
4804     bool skip = false;
4805     for (auto intercept : layer_data->object_dispatch) {
4806         auto lock = intercept->write_lock();
4807         skip |= intercept->PreCallValidateGetPhysicalDeviceDisplayPropertiesKHR(physicalDevice, pPropertyCount, pProperties);
4808         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
4809     }
4810     for (auto intercept : layer_data->object_dispatch) {
4811         auto lock = intercept->write_lock();
4812         intercept->PreCallRecordGetPhysicalDeviceDisplayPropertiesKHR(physicalDevice, pPropertyCount, pProperties);
4813     }
4814     VkResult result = DispatchGetPhysicalDeviceDisplayPropertiesKHR(physicalDevice, pPropertyCount, pProperties);
4815     for (auto intercept : layer_data->object_dispatch) {
4816         auto lock = intercept->write_lock();
4817         intercept->PostCallRecordGetPhysicalDeviceDisplayPropertiesKHR(physicalDevice, pPropertyCount, pProperties, result);
4818     }
4819     return result;
4820 }
4821 
GetPhysicalDeviceDisplayPlanePropertiesKHR(VkPhysicalDevice physicalDevice,uint32_t * pPropertyCount,VkDisplayPlanePropertiesKHR * pProperties)4822 VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceDisplayPlanePropertiesKHR(
4823     VkPhysicalDevice                            physicalDevice,
4824     uint32_t*                                   pPropertyCount,
4825     VkDisplayPlanePropertiesKHR*                pProperties) {
4826     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
4827     bool skip = false;
4828     for (auto intercept : layer_data->object_dispatch) {
4829         auto lock = intercept->write_lock();
4830         skip |= intercept->PreCallValidateGetPhysicalDeviceDisplayPlanePropertiesKHR(physicalDevice, pPropertyCount, pProperties);
4831         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
4832     }
4833     for (auto intercept : layer_data->object_dispatch) {
4834         auto lock = intercept->write_lock();
4835         intercept->PreCallRecordGetPhysicalDeviceDisplayPlanePropertiesKHR(physicalDevice, pPropertyCount, pProperties);
4836     }
4837     VkResult result = DispatchGetPhysicalDeviceDisplayPlanePropertiesKHR(physicalDevice, pPropertyCount, pProperties);
4838     for (auto intercept : layer_data->object_dispatch) {
4839         auto lock = intercept->write_lock();
4840         intercept->PostCallRecordGetPhysicalDeviceDisplayPlanePropertiesKHR(physicalDevice, pPropertyCount, pProperties, result);
4841     }
4842     return result;
4843 }
4844 
GetDisplayPlaneSupportedDisplaysKHR(VkPhysicalDevice physicalDevice,uint32_t planeIndex,uint32_t * pDisplayCount,VkDisplayKHR * pDisplays)4845 VKAPI_ATTR VkResult VKAPI_CALL GetDisplayPlaneSupportedDisplaysKHR(
4846     VkPhysicalDevice                            physicalDevice,
4847     uint32_t                                    planeIndex,
4848     uint32_t*                                   pDisplayCount,
4849     VkDisplayKHR*                               pDisplays) {
4850     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
4851     bool skip = false;
4852     for (auto intercept : layer_data->object_dispatch) {
4853         auto lock = intercept->write_lock();
4854         skip |= intercept->PreCallValidateGetDisplayPlaneSupportedDisplaysKHR(physicalDevice, planeIndex, pDisplayCount, pDisplays);
4855         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
4856     }
4857     for (auto intercept : layer_data->object_dispatch) {
4858         auto lock = intercept->write_lock();
4859         intercept->PreCallRecordGetDisplayPlaneSupportedDisplaysKHR(physicalDevice, planeIndex, pDisplayCount, pDisplays);
4860     }
4861     VkResult result = DispatchGetDisplayPlaneSupportedDisplaysKHR(physicalDevice, planeIndex, pDisplayCount, pDisplays);
4862     for (auto intercept : layer_data->object_dispatch) {
4863         auto lock = intercept->write_lock();
4864         intercept->PostCallRecordGetDisplayPlaneSupportedDisplaysKHR(physicalDevice, planeIndex, pDisplayCount, pDisplays, result);
4865     }
4866     return result;
4867 }
4868 
GetDisplayModePropertiesKHR(VkPhysicalDevice physicalDevice,VkDisplayKHR display,uint32_t * pPropertyCount,VkDisplayModePropertiesKHR * pProperties)4869 VKAPI_ATTR VkResult VKAPI_CALL GetDisplayModePropertiesKHR(
4870     VkPhysicalDevice                            physicalDevice,
4871     VkDisplayKHR                                display,
4872     uint32_t*                                   pPropertyCount,
4873     VkDisplayModePropertiesKHR*                 pProperties) {
4874     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
4875     bool skip = false;
4876     for (auto intercept : layer_data->object_dispatch) {
4877         auto lock = intercept->write_lock();
4878         skip |= intercept->PreCallValidateGetDisplayModePropertiesKHR(physicalDevice, display, pPropertyCount, pProperties);
4879         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
4880     }
4881     for (auto intercept : layer_data->object_dispatch) {
4882         auto lock = intercept->write_lock();
4883         intercept->PreCallRecordGetDisplayModePropertiesKHR(physicalDevice, display, pPropertyCount, pProperties);
4884     }
4885     VkResult result = DispatchGetDisplayModePropertiesKHR(physicalDevice, display, pPropertyCount, pProperties);
4886     for (auto intercept : layer_data->object_dispatch) {
4887         auto lock = intercept->write_lock();
4888         intercept->PostCallRecordGetDisplayModePropertiesKHR(physicalDevice, display, pPropertyCount, pProperties, result);
4889     }
4890     return result;
4891 }
4892 
CreateDisplayModeKHR(VkPhysicalDevice physicalDevice,VkDisplayKHR display,const VkDisplayModeCreateInfoKHR * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkDisplayModeKHR * pMode)4893 VKAPI_ATTR VkResult VKAPI_CALL CreateDisplayModeKHR(
4894     VkPhysicalDevice                            physicalDevice,
4895     VkDisplayKHR                                display,
4896     const VkDisplayModeCreateInfoKHR*           pCreateInfo,
4897     const VkAllocationCallbacks*                pAllocator,
4898     VkDisplayModeKHR*                           pMode) {
4899     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
4900     bool skip = false;
4901     for (auto intercept : layer_data->object_dispatch) {
4902         auto lock = intercept->write_lock();
4903         skip |= intercept->PreCallValidateCreateDisplayModeKHR(physicalDevice, display, pCreateInfo, pAllocator, pMode);
4904         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
4905     }
4906     for (auto intercept : layer_data->object_dispatch) {
4907         auto lock = intercept->write_lock();
4908         intercept->PreCallRecordCreateDisplayModeKHR(physicalDevice, display, pCreateInfo, pAllocator, pMode);
4909     }
4910     VkResult result = DispatchCreateDisplayModeKHR(physicalDevice, display, pCreateInfo, pAllocator, pMode);
4911     for (auto intercept : layer_data->object_dispatch) {
4912         auto lock = intercept->write_lock();
4913         intercept->PostCallRecordCreateDisplayModeKHR(physicalDevice, display, pCreateInfo, pAllocator, pMode, result);
4914     }
4915     return result;
4916 }
4917 
GetDisplayPlaneCapabilitiesKHR(VkPhysicalDevice physicalDevice,VkDisplayModeKHR mode,uint32_t planeIndex,VkDisplayPlaneCapabilitiesKHR * pCapabilities)4918 VKAPI_ATTR VkResult VKAPI_CALL GetDisplayPlaneCapabilitiesKHR(
4919     VkPhysicalDevice                            physicalDevice,
4920     VkDisplayModeKHR                            mode,
4921     uint32_t                                    planeIndex,
4922     VkDisplayPlaneCapabilitiesKHR*              pCapabilities) {
4923     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
4924     bool skip = false;
4925     for (auto intercept : layer_data->object_dispatch) {
4926         auto lock = intercept->write_lock();
4927         skip |= intercept->PreCallValidateGetDisplayPlaneCapabilitiesKHR(physicalDevice, mode, planeIndex, pCapabilities);
4928         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
4929     }
4930     for (auto intercept : layer_data->object_dispatch) {
4931         auto lock = intercept->write_lock();
4932         intercept->PreCallRecordGetDisplayPlaneCapabilitiesKHR(physicalDevice, mode, planeIndex, pCapabilities);
4933     }
4934     VkResult result = DispatchGetDisplayPlaneCapabilitiesKHR(physicalDevice, mode, planeIndex, pCapabilities);
4935     for (auto intercept : layer_data->object_dispatch) {
4936         auto lock = intercept->write_lock();
4937         intercept->PostCallRecordGetDisplayPlaneCapabilitiesKHR(physicalDevice, mode, planeIndex, pCapabilities, result);
4938     }
4939     return result;
4940 }
4941 
CreateDisplayPlaneSurfaceKHR(VkInstance instance,const VkDisplaySurfaceCreateInfoKHR * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkSurfaceKHR * pSurface)4942 VKAPI_ATTR VkResult VKAPI_CALL CreateDisplayPlaneSurfaceKHR(
4943     VkInstance                                  instance,
4944     const VkDisplaySurfaceCreateInfoKHR*        pCreateInfo,
4945     const VkAllocationCallbacks*                pAllocator,
4946     VkSurfaceKHR*                               pSurface) {
4947     auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map);
4948     bool skip = false;
4949     for (auto intercept : layer_data->object_dispatch) {
4950         auto lock = intercept->write_lock();
4951         skip |= intercept->PreCallValidateCreateDisplayPlaneSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
4952         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
4953     }
4954     for (auto intercept : layer_data->object_dispatch) {
4955         auto lock = intercept->write_lock();
4956         intercept->PreCallRecordCreateDisplayPlaneSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
4957     }
4958     VkResult result = DispatchCreateDisplayPlaneSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
4959     for (auto intercept : layer_data->object_dispatch) {
4960         auto lock = intercept->write_lock();
4961         intercept->PostCallRecordCreateDisplayPlaneSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface, result);
4962     }
4963     return result;
4964 }
4965 
4966 
CreateSharedSwapchainsKHR(VkDevice device,uint32_t swapchainCount,const VkSwapchainCreateInfoKHR * pCreateInfos,const VkAllocationCallbacks * pAllocator,VkSwapchainKHR * pSwapchains)4967 VKAPI_ATTR VkResult VKAPI_CALL CreateSharedSwapchainsKHR(
4968     VkDevice                                    device,
4969     uint32_t                                    swapchainCount,
4970     const VkSwapchainCreateInfoKHR*             pCreateInfos,
4971     const VkAllocationCallbacks*                pAllocator,
4972     VkSwapchainKHR*                             pSwapchains) {
4973     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
4974     bool skip = false;
4975     for (auto intercept : layer_data->object_dispatch) {
4976         auto lock = intercept->write_lock();
4977         skip |= intercept->PreCallValidateCreateSharedSwapchainsKHR(device, swapchainCount, pCreateInfos, pAllocator, pSwapchains);
4978         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
4979     }
4980     for (auto intercept : layer_data->object_dispatch) {
4981         auto lock = intercept->write_lock();
4982         intercept->PreCallRecordCreateSharedSwapchainsKHR(device, swapchainCount, pCreateInfos, pAllocator, pSwapchains);
4983     }
4984     VkResult result = DispatchCreateSharedSwapchainsKHR(device, swapchainCount, pCreateInfos, pAllocator, pSwapchains);
4985     for (auto intercept : layer_data->object_dispatch) {
4986         auto lock = intercept->write_lock();
4987         intercept->PostCallRecordCreateSharedSwapchainsKHR(device, swapchainCount, pCreateInfos, pAllocator, pSwapchains, result);
4988     }
4989     return result;
4990 }
4991 
4992 #ifdef VK_USE_PLATFORM_XLIB_KHR
4993 
CreateXlibSurfaceKHR(VkInstance instance,const VkXlibSurfaceCreateInfoKHR * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkSurfaceKHR * pSurface)4994 VKAPI_ATTR VkResult VKAPI_CALL CreateXlibSurfaceKHR(
4995     VkInstance                                  instance,
4996     const VkXlibSurfaceCreateInfoKHR*           pCreateInfo,
4997     const VkAllocationCallbacks*                pAllocator,
4998     VkSurfaceKHR*                               pSurface) {
4999     auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map);
5000     bool skip = false;
5001     for (auto intercept : layer_data->object_dispatch) {
5002         auto lock = intercept->write_lock();
5003         skip |= intercept->PreCallValidateCreateXlibSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
5004         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
5005     }
5006     for (auto intercept : layer_data->object_dispatch) {
5007         auto lock = intercept->write_lock();
5008         intercept->PreCallRecordCreateXlibSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
5009     }
5010     VkResult result = DispatchCreateXlibSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
5011     for (auto intercept : layer_data->object_dispatch) {
5012         auto lock = intercept->write_lock();
5013         intercept->PostCallRecordCreateXlibSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface, result);
5014     }
5015     return result;
5016 }
5017 
GetPhysicalDeviceXlibPresentationSupportKHR(VkPhysicalDevice physicalDevice,uint32_t queueFamilyIndex,Display * dpy,VisualID visualID)5018 VKAPI_ATTR VkBool32 VKAPI_CALL GetPhysicalDeviceXlibPresentationSupportKHR(
5019     VkPhysicalDevice                            physicalDevice,
5020     uint32_t                                    queueFamilyIndex,
5021     Display*                                    dpy,
5022     VisualID                                    visualID) {
5023     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
5024     bool skip = false;
5025     for (auto intercept : layer_data->object_dispatch) {
5026         auto lock = intercept->write_lock();
5027         skip |= intercept->PreCallValidateGetPhysicalDeviceXlibPresentationSupportKHR(physicalDevice, queueFamilyIndex, dpy, visualID);
5028         if (skip) return VK_FALSE;
5029     }
5030     for (auto intercept : layer_data->object_dispatch) {
5031         auto lock = intercept->write_lock();
5032         intercept->PreCallRecordGetPhysicalDeviceXlibPresentationSupportKHR(physicalDevice, queueFamilyIndex, dpy, visualID);
5033     }
5034     VkBool32 result = DispatchGetPhysicalDeviceXlibPresentationSupportKHR(physicalDevice, queueFamilyIndex, dpy, visualID);
5035     for (auto intercept : layer_data->object_dispatch) {
5036         auto lock = intercept->write_lock();
5037         intercept->PostCallRecordGetPhysicalDeviceXlibPresentationSupportKHR(physicalDevice, queueFamilyIndex, dpy, visualID);
5038     }
5039     return result;
5040 }
5041 #endif // VK_USE_PLATFORM_XLIB_KHR
5042 
5043 #ifdef VK_USE_PLATFORM_XCB_KHR
5044 
CreateXcbSurfaceKHR(VkInstance instance,const VkXcbSurfaceCreateInfoKHR * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkSurfaceKHR * pSurface)5045 VKAPI_ATTR VkResult VKAPI_CALL CreateXcbSurfaceKHR(
5046     VkInstance                                  instance,
5047     const VkXcbSurfaceCreateInfoKHR*            pCreateInfo,
5048     const VkAllocationCallbacks*                pAllocator,
5049     VkSurfaceKHR*                               pSurface) {
5050     auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map);
5051     bool skip = false;
5052     for (auto intercept : layer_data->object_dispatch) {
5053         auto lock = intercept->write_lock();
5054         skip |= intercept->PreCallValidateCreateXcbSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
5055         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
5056     }
5057     for (auto intercept : layer_data->object_dispatch) {
5058         auto lock = intercept->write_lock();
5059         intercept->PreCallRecordCreateXcbSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
5060     }
5061     VkResult result = DispatchCreateXcbSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
5062     for (auto intercept : layer_data->object_dispatch) {
5063         auto lock = intercept->write_lock();
5064         intercept->PostCallRecordCreateXcbSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface, result);
5065     }
5066     return result;
5067 }
5068 
GetPhysicalDeviceXcbPresentationSupportKHR(VkPhysicalDevice physicalDevice,uint32_t queueFamilyIndex,xcb_connection_t * connection,xcb_visualid_t visual_id)5069 VKAPI_ATTR VkBool32 VKAPI_CALL GetPhysicalDeviceXcbPresentationSupportKHR(
5070     VkPhysicalDevice                            physicalDevice,
5071     uint32_t                                    queueFamilyIndex,
5072     xcb_connection_t*                           connection,
5073     xcb_visualid_t                              visual_id) {
5074     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
5075     bool skip = false;
5076     for (auto intercept : layer_data->object_dispatch) {
5077         auto lock = intercept->write_lock();
5078         skip |= intercept->PreCallValidateGetPhysicalDeviceXcbPresentationSupportKHR(physicalDevice, queueFamilyIndex, connection, visual_id);
5079         if (skip) return VK_FALSE;
5080     }
5081     for (auto intercept : layer_data->object_dispatch) {
5082         auto lock = intercept->write_lock();
5083         intercept->PreCallRecordGetPhysicalDeviceXcbPresentationSupportKHR(physicalDevice, queueFamilyIndex, connection, visual_id);
5084     }
5085     VkBool32 result = DispatchGetPhysicalDeviceXcbPresentationSupportKHR(physicalDevice, queueFamilyIndex, connection, visual_id);
5086     for (auto intercept : layer_data->object_dispatch) {
5087         auto lock = intercept->write_lock();
5088         intercept->PostCallRecordGetPhysicalDeviceXcbPresentationSupportKHR(physicalDevice, queueFamilyIndex, connection, visual_id);
5089     }
5090     return result;
5091 }
5092 #endif // VK_USE_PLATFORM_XCB_KHR
5093 
5094 #ifdef VK_USE_PLATFORM_WAYLAND_KHR
5095 
CreateWaylandSurfaceKHR(VkInstance instance,const VkWaylandSurfaceCreateInfoKHR * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkSurfaceKHR * pSurface)5096 VKAPI_ATTR VkResult VKAPI_CALL CreateWaylandSurfaceKHR(
5097     VkInstance                                  instance,
5098     const VkWaylandSurfaceCreateInfoKHR*        pCreateInfo,
5099     const VkAllocationCallbacks*                pAllocator,
5100     VkSurfaceKHR*                               pSurface) {
5101     auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map);
5102     bool skip = false;
5103     for (auto intercept : layer_data->object_dispatch) {
5104         auto lock = intercept->write_lock();
5105         skip |= intercept->PreCallValidateCreateWaylandSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
5106         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
5107     }
5108     for (auto intercept : layer_data->object_dispatch) {
5109         auto lock = intercept->write_lock();
5110         intercept->PreCallRecordCreateWaylandSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
5111     }
5112     VkResult result = DispatchCreateWaylandSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
5113     for (auto intercept : layer_data->object_dispatch) {
5114         auto lock = intercept->write_lock();
5115         intercept->PostCallRecordCreateWaylandSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface, result);
5116     }
5117     return result;
5118 }
5119 
GetPhysicalDeviceWaylandPresentationSupportKHR(VkPhysicalDevice physicalDevice,uint32_t queueFamilyIndex,struct wl_display * display)5120 VKAPI_ATTR VkBool32 VKAPI_CALL GetPhysicalDeviceWaylandPresentationSupportKHR(
5121     VkPhysicalDevice                            physicalDevice,
5122     uint32_t                                    queueFamilyIndex,
5123     struct wl_display*                          display) {
5124     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
5125     bool skip = false;
5126     for (auto intercept : layer_data->object_dispatch) {
5127         auto lock = intercept->write_lock();
5128         skip |= intercept->PreCallValidateGetPhysicalDeviceWaylandPresentationSupportKHR(physicalDevice, queueFamilyIndex, display);
5129         if (skip) return VK_FALSE;
5130     }
5131     for (auto intercept : layer_data->object_dispatch) {
5132         auto lock = intercept->write_lock();
5133         intercept->PreCallRecordGetPhysicalDeviceWaylandPresentationSupportKHR(physicalDevice, queueFamilyIndex, display);
5134     }
5135     VkBool32 result = DispatchGetPhysicalDeviceWaylandPresentationSupportKHR(physicalDevice, queueFamilyIndex, display);
5136     for (auto intercept : layer_data->object_dispatch) {
5137         auto lock = intercept->write_lock();
5138         intercept->PostCallRecordGetPhysicalDeviceWaylandPresentationSupportKHR(physicalDevice, queueFamilyIndex, display);
5139     }
5140     return result;
5141 }
5142 #endif // VK_USE_PLATFORM_WAYLAND_KHR
5143 
5144 #ifdef VK_USE_PLATFORM_ANDROID_KHR
5145 
CreateAndroidSurfaceKHR(VkInstance instance,const VkAndroidSurfaceCreateInfoKHR * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkSurfaceKHR * pSurface)5146 VKAPI_ATTR VkResult VKAPI_CALL CreateAndroidSurfaceKHR(
5147     VkInstance                                  instance,
5148     const VkAndroidSurfaceCreateInfoKHR*        pCreateInfo,
5149     const VkAllocationCallbacks*                pAllocator,
5150     VkSurfaceKHR*                               pSurface) {
5151     auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map);
5152     bool skip = false;
5153     for (auto intercept : layer_data->object_dispatch) {
5154         auto lock = intercept->write_lock();
5155         skip |= intercept->PreCallValidateCreateAndroidSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
5156         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
5157     }
5158     for (auto intercept : layer_data->object_dispatch) {
5159         auto lock = intercept->write_lock();
5160         intercept->PreCallRecordCreateAndroidSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
5161     }
5162     VkResult result = DispatchCreateAndroidSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
5163     for (auto intercept : layer_data->object_dispatch) {
5164         auto lock = intercept->write_lock();
5165         intercept->PostCallRecordCreateAndroidSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface, result);
5166     }
5167     return result;
5168 }
5169 #endif // VK_USE_PLATFORM_ANDROID_KHR
5170 
5171 #ifdef VK_USE_PLATFORM_WIN32_KHR
5172 
CreateWin32SurfaceKHR(VkInstance instance,const VkWin32SurfaceCreateInfoKHR * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkSurfaceKHR * pSurface)5173 VKAPI_ATTR VkResult VKAPI_CALL CreateWin32SurfaceKHR(
5174     VkInstance                                  instance,
5175     const VkWin32SurfaceCreateInfoKHR*          pCreateInfo,
5176     const VkAllocationCallbacks*                pAllocator,
5177     VkSurfaceKHR*                               pSurface) {
5178     auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map);
5179     bool skip = false;
5180     for (auto intercept : layer_data->object_dispatch) {
5181         auto lock = intercept->write_lock();
5182         skip |= intercept->PreCallValidateCreateWin32SurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
5183         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
5184     }
5185     for (auto intercept : layer_data->object_dispatch) {
5186         auto lock = intercept->write_lock();
5187         intercept->PreCallRecordCreateWin32SurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
5188     }
5189     VkResult result = DispatchCreateWin32SurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
5190     for (auto intercept : layer_data->object_dispatch) {
5191         auto lock = intercept->write_lock();
5192         intercept->PostCallRecordCreateWin32SurfaceKHR(instance, pCreateInfo, pAllocator, pSurface, result);
5193     }
5194     return result;
5195 }
5196 
GetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice physicalDevice,uint32_t queueFamilyIndex)5197 VKAPI_ATTR VkBool32 VKAPI_CALL GetPhysicalDeviceWin32PresentationSupportKHR(
5198     VkPhysicalDevice                            physicalDevice,
5199     uint32_t                                    queueFamilyIndex) {
5200     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
5201     bool skip = false;
5202     for (auto intercept : layer_data->object_dispatch) {
5203         auto lock = intercept->write_lock();
5204         skip |= intercept->PreCallValidateGetPhysicalDeviceWin32PresentationSupportKHR(physicalDevice, queueFamilyIndex);
5205         if (skip) return VK_FALSE;
5206     }
5207     for (auto intercept : layer_data->object_dispatch) {
5208         auto lock = intercept->write_lock();
5209         intercept->PreCallRecordGetPhysicalDeviceWin32PresentationSupportKHR(physicalDevice, queueFamilyIndex);
5210     }
5211     VkBool32 result = DispatchGetPhysicalDeviceWin32PresentationSupportKHR(physicalDevice, queueFamilyIndex);
5212     for (auto intercept : layer_data->object_dispatch) {
5213         auto lock = intercept->write_lock();
5214         intercept->PostCallRecordGetPhysicalDeviceWin32PresentationSupportKHR(physicalDevice, queueFamilyIndex);
5215     }
5216     return result;
5217 }
5218 #endif // VK_USE_PLATFORM_WIN32_KHR
5219 
5220 
5221 
5222 
GetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physicalDevice,VkPhysicalDeviceFeatures2 * pFeatures)5223 VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFeatures2KHR(
5224     VkPhysicalDevice                            physicalDevice,
5225     VkPhysicalDeviceFeatures2*                  pFeatures) {
5226     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
5227     bool skip = false;
5228     for (auto intercept : layer_data->object_dispatch) {
5229         auto lock = intercept->write_lock();
5230         skip |= intercept->PreCallValidateGetPhysicalDeviceFeatures2KHR(physicalDevice, pFeatures);
5231         if (skip) return;
5232     }
5233     for (auto intercept : layer_data->object_dispatch) {
5234         auto lock = intercept->write_lock();
5235         intercept->PreCallRecordGetPhysicalDeviceFeatures2KHR(physicalDevice, pFeatures);
5236     }
5237     DispatchGetPhysicalDeviceFeatures2KHR(physicalDevice, pFeatures);
5238     for (auto intercept : layer_data->object_dispatch) {
5239         auto lock = intercept->write_lock();
5240         intercept->PostCallRecordGetPhysicalDeviceFeatures2KHR(physicalDevice, pFeatures);
5241     }
5242 }
5243 
GetPhysicalDeviceProperties2KHR(VkPhysicalDevice physicalDevice,VkPhysicalDeviceProperties2 * pProperties)5244 VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceProperties2KHR(
5245     VkPhysicalDevice                            physicalDevice,
5246     VkPhysicalDeviceProperties2*                pProperties) {
5247     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
5248     bool skip = false;
5249     for (auto intercept : layer_data->object_dispatch) {
5250         auto lock = intercept->write_lock();
5251         skip |= intercept->PreCallValidateGetPhysicalDeviceProperties2KHR(physicalDevice, pProperties);
5252         if (skip) return;
5253     }
5254     for (auto intercept : layer_data->object_dispatch) {
5255         auto lock = intercept->write_lock();
5256         intercept->PreCallRecordGetPhysicalDeviceProperties2KHR(physicalDevice, pProperties);
5257     }
5258     DispatchGetPhysicalDeviceProperties2KHR(physicalDevice, pProperties);
5259     for (auto intercept : layer_data->object_dispatch) {
5260         auto lock = intercept->write_lock();
5261         intercept->PostCallRecordGetPhysicalDeviceProperties2KHR(physicalDevice, pProperties);
5262     }
5263 }
5264 
GetPhysicalDeviceFormatProperties2KHR(VkPhysicalDevice physicalDevice,VkFormat format,VkFormatProperties2 * pFormatProperties)5265 VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFormatProperties2KHR(
5266     VkPhysicalDevice                            physicalDevice,
5267     VkFormat                                    format,
5268     VkFormatProperties2*                        pFormatProperties) {
5269     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
5270     bool skip = false;
5271     for (auto intercept : layer_data->object_dispatch) {
5272         auto lock = intercept->write_lock();
5273         skip |= intercept->PreCallValidateGetPhysicalDeviceFormatProperties2KHR(physicalDevice, format, pFormatProperties);
5274         if (skip) return;
5275     }
5276     for (auto intercept : layer_data->object_dispatch) {
5277         auto lock = intercept->write_lock();
5278         intercept->PreCallRecordGetPhysicalDeviceFormatProperties2KHR(physicalDevice, format, pFormatProperties);
5279     }
5280     DispatchGetPhysicalDeviceFormatProperties2KHR(physicalDevice, format, pFormatProperties);
5281     for (auto intercept : layer_data->object_dispatch) {
5282         auto lock = intercept->write_lock();
5283         intercept->PostCallRecordGetPhysicalDeviceFormatProperties2KHR(physicalDevice, format, pFormatProperties);
5284     }
5285 }
5286 
GetPhysicalDeviceImageFormatProperties2KHR(VkPhysicalDevice physicalDevice,const VkPhysicalDeviceImageFormatInfo2 * pImageFormatInfo,VkImageFormatProperties2 * pImageFormatProperties)5287 VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceImageFormatProperties2KHR(
5288     VkPhysicalDevice                            physicalDevice,
5289     const VkPhysicalDeviceImageFormatInfo2*     pImageFormatInfo,
5290     VkImageFormatProperties2*                   pImageFormatProperties) {
5291     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
5292     bool skip = false;
5293     for (auto intercept : layer_data->object_dispatch) {
5294         auto lock = intercept->write_lock();
5295         skip |= intercept->PreCallValidateGetPhysicalDeviceImageFormatProperties2KHR(physicalDevice, pImageFormatInfo, pImageFormatProperties);
5296         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
5297     }
5298     for (auto intercept : layer_data->object_dispatch) {
5299         auto lock = intercept->write_lock();
5300         intercept->PreCallRecordGetPhysicalDeviceImageFormatProperties2KHR(physicalDevice, pImageFormatInfo, pImageFormatProperties);
5301     }
5302     VkResult result = DispatchGetPhysicalDeviceImageFormatProperties2KHR(physicalDevice, pImageFormatInfo, pImageFormatProperties);
5303     for (auto intercept : layer_data->object_dispatch) {
5304         auto lock = intercept->write_lock();
5305         intercept->PostCallRecordGetPhysicalDeviceImageFormatProperties2KHR(physicalDevice, pImageFormatInfo, pImageFormatProperties, result);
5306     }
5307     return result;
5308 }
5309 
GetPhysicalDeviceQueueFamilyProperties2KHR(VkPhysicalDevice physicalDevice,uint32_t * pQueueFamilyPropertyCount,VkQueueFamilyProperties2 * pQueueFamilyProperties)5310 VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceQueueFamilyProperties2KHR(
5311     VkPhysicalDevice                            physicalDevice,
5312     uint32_t*                                   pQueueFamilyPropertyCount,
5313     VkQueueFamilyProperties2*                   pQueueFamilyProperties) {
5314     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
5315     bool skip = false;
5316     for (auto intercept : layer_data->object_dispatch) {
5317         auto lock = intercept->write_lock();
5318         skip |= intercept->PreCallValidateGetPhysicalDeviceQueueFamilyProperties2KHR(physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties);
5319         if (skip) return;
5320     }
5321     for (auto intercept : layer_data->object_dispatch) {
5322         auto lock = intercept->write_lock();
5323         intercept->PreCallRecordGetPhysicalDeviceQueueFamilyProperties2KHR(physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties);
5324     }
5325     DispatchGetPhysicalDeviceQueueFamilyProperties2KHR(physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties);
5326     for (auto intercept : layer_data->object_dispatch) {
5327         auto lock = intercept->write_lock();
5328         intercept->PostCallRecordGetPhysicalDeviceQueueFamilyProperties2KHR(physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties);
5329     }
5330 }
5331 
GetPhysicalDeviceMemoryProperties2KHR(VkPhysicalDevice physicalDevice,VkPhysicalDeviceMemoryProperties2 * pMemoryProperties)5332 VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceMemoryProperties2KHR(
5333     VkPhysicalDevice                            physicalDevice,
5334     VkPhysicalDeviceMemoryProperties2*          pMemoryProperties) {
5335     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
5336     bool skip = false;
5337     for (auto intercept : layer_data->object_dispatch) {
5338         auto lock = intercept->write_lock();
5339         skip |= intercept->PreCallValidateGetPhysicalDeviceMemoryProperties2KHR(physicalDevice, pMemoryProperties);
5340         if (skip) return;
5341     }
5342     for (auto intercept : layer_data->object_dispatch) {
5343         auto lock = intercept->write_lock();
5344         intercept->PreCallRecordGetPhysicalDeviceMemoryProperties2KHR(physicalDevice, pMemoryProperties);
5345     }
5346     DispatchGetPhysicalDeviceMemoryProperties2KHR(physicalDevice, pMemoryProperties);
5347     for (auto intercept : layer_data->object_dispatch) {
5348         auto lock = intercept->write_lock();
5349         intercept->PostCallRecordGetPhysicalDeviceMemoryProperties2KHR(physicalDevice, pMemoryProperties);
5350     }
5351 }
5352 
GetPhysicalDeviceSparseImageFormatProperties2KHR(VkPhysicalDevice physicalDevice,const VkPhysicalDeviceSparseImageFormatInfo2 * pFormatInfo,uint32_t * pPropertyCount,VkSparseImageFormatProperties2 * pProperties)5353 VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceSparseImageFormatProperties2KHR(
5354     VkPhysicalDevice                            physicalDevice,
5355     const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo,
5356     uint32_t*                                   pPropertyCount,
5357     VkSparseImageFormatProperties2*             pProperties) {
5358     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
5359     bool skip = false;
5360     for (auto intercept : layer_data->object_dispatch) {
5361         auto lock = intercept->write_lock();
5362         skip |= intercept->PreCallValidateGetPhysicalDeviceSparseImageFormatProperties2KHR(physicalDevice, pFormatInfo, pPropertyCount, pProperties);
5363         if (skip) return;
5364     }
5365     for (auto intercept : layer_data->object_dispatch) {
5366         auto lock = intercept->write_lock();
5367         intercept->PreCallRecordGetPhysicalDeviceSparseImageFormatProperties2KHR(physicalDevice, pFormatInfo, pPropertyCount, pProperties);
5368     }
5369     DispatchGetPhysicalDeviceSparseImageFormatProperties2KHR(physicalDevice, pFormatInfo, pPropertyCount, pProperties);
5370     for (auto intercept : layer_data->object_dispatch) {
5371         auto lock = intercept->write_lock();
5372         intercept->PostCallRecordGetPhysicalDeviceSparseImageFormatProperties2KHR(physicalDevice, pFormatInfo, pPropertyCount, pProperties);
5373     }
5374 }
5375 
5376 
GetDeviceGroupPeerMemoryFeaturesKHR(VkDevice device,uint32_t heapIndex,uint32_t localDeviceIndex,uint32_t remoteDeviceIndex,VkPeerMemoryFeatureFlags * pPeerMemoryFeatures)5377 VKAPI_ATTR void VKAPI_CALL GetDeviceGroupPeerMemoryFeaturesKHR(
5378     VkDevice                                    device,
5379     uint32_t                                    heapIndex,
5380     uint32_t                                    localDeviceIndex,
5381     uint32_t                                    remoteDeviceIndex,
5382     VkPeerMemoryFeatureFlags*                   pPeerMemoryFeatures) {
5383     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
5384     bool skip = false;
5385     for (auto intercept : layer_data->object_dispatch) {
5386         auto lock = intercept->write_lock();
5387         skip |= intercept->PreCallValidateGetDeviceGroupPeerMemoryFeaturesKHR(device, heapIndex, localDeviceIndex, remoteDeviceIndex, pPeerMemoryFeatures);
5388         if (skip) return;
5389     }
5390     for (auto intercept : layer_data->object_dispatch) {
5391         auto lock = intercept->write_lock();
5392         intercept->PreCallRecordGetDeviceGroupPeerMemoryFeaturesKHR(device, heapIndex, localDeviceIndex, remoteDeviceIndex, pPeerMemoryFeatures);
5393     }
5394     DispatchGetDeviceGroupPeerMemoryFeaturesKHR(device, heapIndex, localDeviceIndex, remoteDeviceIndex, pPeerMemoryFeatures);
5395     for (auto intercept : layer_data->object_dispatch) {
5396         auto lock = intercept->write_lock();
5397         intercept->PostCallRecordGetDeviceGroupPeerMemoryFeaturesKHR(device, heapIndex, localDeviceIndex, remoteDeviceIndex, pPeerMemoryFeatures);
5398     }
5399 }
5400 
CmdSetDeviceMaskKHR(VkCommandBuffer commandBuffer,uint32_t deviceMask)5401 VKAPI_ATTR void VKAPI_CALL CmdSetDeviceMaskKHR(
5402     VkCommandBuffer                             commandBuffer,
5403     uint32_t                                    deviceMask) {
5404     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
5405     bool skip = false;
5406     for (auto intercept : layer_data->object_dispatch) {
5407         auto lock = intercept->write_lock();
5408         skip |= intercept->PreCallValidateCmdSetDeviceMaskKHR(commandBuffer, deviceMask);
5409         if (skip) return;
5410     }
5411     for (auto intercept : layer_data->object_dispatch) {
5412         auto lock = intercept->write_lock();
5413         intercept->PreCallRecordCmdSetDeviceMaskKHR(commandBuffer, deviceMask);
5414     }
5415     DispatchCmdSetDeviceMaskKHR(commandBuffer, deviceMask);
5416     for (auto intercept : layer_data->object_dispatch) {
5417         auto lock = intercept->write_lock();
5418         intercept->PostCallRecordCmdSetDeviceMaskKHR(commandBuffer, deviceMask);
5419     }
5420 }
5421 
CmdDispatchBaseKHR(VkCommandBuffer commandBuffer,uint32_t baseGroupX,uint32_t baseGroupY,uint32_t baseGroupZ,uint32_t groupCountX,uint32_t groupCountY,uint32_t groupCountZ)5422 VKAPI_ATTR void VKAPI_CALL CmdDispatchBaseKHR(
5423     VkCommandBuffer                             commandBuffer,
5424     uint32_t                                    baseGroupX,
5425     uint32_t                                    baseGroupY,
5426     uint32_t                                    baseGroupZ,
5427     uint32_t                                    groupCountX,
5428     uint32_t                                    groupCountY,
5429     uint32_t                                    groupCountZ) {
5430     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
5431     bool skip = false;
5432     for (auto intercept : layer_data->object_dispatch) {
5433         auto lock = intercept->write_lock();
5434         skip |= intercept->PreCallValidateCmdDispatchBaseKHR(commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ);
5435         if (skip) return;
5436     }
5437     for (auto intercept : layer_data->object_dispatch) {
5438         auto lock = intercept->write_lock();
5439         intercept->PreCallRecordCmdDispatchBaseKHR(commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ);
5440     }
5441     DispatchCmdDispatchBaseKHR(commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ);
5442     for (auto intercept : layer_data->object_dispatch) {
5443         auto lock = intercept->write_lock();
5444         intercept->PostCallRecordCmdDispatchBaseKHR(commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ);
5445     }
5446 }
5447 
5448 
5449 
TrimCommandPoolKHR(VkDevice device,VkCommandPool commandPool,VkCommandPoolTrimFlags flags)5450 VKAPI_ATTR void VKAPI_CALL TrimCommandPoolKHR(
5451     VkDevice                                    device,
5452     VkCommandPool                               commandPool,
5453     VkCommandPoolTrimFlags                      flags) {
5454     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
5455     bool skip = false;
5456     for (auto intercept : layer_data->object_dispatch) {
5457         auto lock = intercept->write_lock();
5458         skip |= intercept->PreCallValidateTrimCommandPoolKHR(device, commandPool, flags);
5459         if (skip) return;
5460     }
5461     for (auto intercept : layer_data->object_dispatch) {
5462         auto lock = intercept->write_lock();
5463         intercept->PreCallRecordTrimCommandPoolKHR(device, commandPool, flags);
5464     }
5465     DispatchTrimCommandPoolKHR(device, commandPool, flags);
5466     for (auto intercept : layer_data->object_dispatch) {
5467         auto lock = intercept->write_lock();
5468         intercept->PostCallRecordTrimCommandPoolKHR(device, commandPool, flags);
5469     }
5470 }
5471 
5472 
EnumeratePhysicalDeviceGroupsKHR(VkInstance instance,uint32_t * pPhysicalDeviceGroupCount,VkPhysicalDeviceGroupProperties * pPhysicalDeviceGroupProperties)5473 VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDeviceGroupsKHR(
5474     VkInstance                                  instance,
5475     uint32_t*                                   pPhysicalDeviceGroupCount,
5476     VkPhysicalDeviceGroupProperties*            pPhysicalDeviceGroupProperties) {
5477     auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map);
5478     bool skip = false;
5479     for (auto intercept : layer_data->object_dispatch) {
5480         auto lock = intercept->write_lock();
5481         skip |= intercept->PreCallValidateEnumeratePhysicalDeviceGroupsKHR(instance, pPhysicalDeviceGroupCount, pPhysicalDeviceGroupProperties);
5482         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
5483     }
5484     for (auto intercept : layer_data->object_dispatch) {
5485         auto lock = intercept->write_lock();
5486         intercept->PreCallRecordEnumeratePhysicalDeviceGroupsKHR(instance, pPhysicalDeviceGroupCount, pPhysicalDeviceGroupProperties);
5487     }
5488     VkResult result = DispatchEnumeratePhysicalDeviceGroupsKHR(instance, pPhysicalDeviceGroupCount, pPhysicalDeviceGroupProperties);
5489     for (auto intercept : layer_data->object_dispatch) {
5490         auto lock = intercept->write_lock();
5491         intercept->PostCallRecordEnumeratePhysicalDeviceGroupsKHR(instance, pPhysicalDeviceGroupCount, pPhysicalDeviceGroupProperties, result);
5492     }
5493     return result;
5494 }
5495 
5496 
GetPhysicalDeviceExternalBufferPropertiesKHR(VkPhysicalDevice physicalDevice,const VkPhysicalDeviceExternalBufferInfo * pExternalBufferInfo,VkExternalBufferProperties * pExternalBufferProperties)5497 VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalBufferPropertiesKHR(
5498     VkPhysicalDevice                            physicalDevice,
5499     const VkPhysicalDeviceExternalBufferInfo*   pExternalBufferInfo,
5500     VkExternalBufferProperties*                 pExternalBufferProperties) {
5501     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
5502     bool skip = false;
5503     for (auto intercept : layer_data->object_dispatch) {
5504         auto lock = intercept->write_lock();
5505         skip |= intercept->PreCallValidateGetPhysicalDeviceExternalBufferPropertiesKHR(physicalDevice, pExternalBufferInfo, pExternalBufferProperties);
5506         if (skip) return;
5507     }
5508     for (auto intercept : layer_data->object_dispatch) {
5509         auto lock = intercept->write_lock();
5510         intercept->PreCallRecordGetPhysicalDeviceExternalBufferPropertiesKHR(physicalDevice, pExternalBufferInfo, pExternalBufferProperties);
5511     }
5512     DispatchGetPhysicalDeviceExternalBufferPropertiesKHR(physicalDevice, pExternalBufferInfo, pExternalBufferProperties);
5513     for (auto intercept : layer_data->object_dispatch) {
5514         auto lock = intercept->write_lock();
5515         intercept->PostCallRecordGetPhysicalDeviceExternalBufferPropertiesKHR(physicalDevice, pExternalBufferInfo, pExternalBufferProperties);
5516     }
5517 }
5518 
5519 
5520 #ifdef VK_USE_PLATFORM_WIN32_KHR
5521 
GetMemoryWin32HandleKHR(VkDevice device,const VkMemoryGetWin32HandleInfoKHR * pGetWin32HandleInfo,HANDLE * pHandle)5522 VKAPI_ATTR VkResult VKAPI_CALL GetMemoryWin32HandleKHR(
5523     VkDevice                                    device,
5524     const VkMemoryGetWin32HandleInfoKHR*        pGetWin32HandleInfo,
5525     HANDLE*                                     pHandle) {
5526     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
5527     bool skip = false;
5528     for (auto intercept : layer_data->object_dispatch) {
5529         auto lock = intercept->write_lock();
5530         skip |= intercept->PreCallValidateGetMemoryWin32HandleKHR(device, pGetWin32HandleInfo, pHandle);
5531         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
5532     }
5533     for (auto intercept : layer_data->object_dispatch) {
5534         auto lock = intercept->write_lock();
5535         intercept->PreCallRecordGetMemoryWin32HandleKHR(device, pGetWin32HandleInfo, pHandle);
5536     }
5537     VkResult result = DispatchGetMemoryWin32HandleKHR(device, pGetWin32HandleInfo, pHandle);
5538     for (auto intercept : layer_data->object_dispatch) {
5539         auto lock = intercept->write_lock();
5540         intercept->PostCallRecordGetMemoryWin32HandleKHR(device, pGetWin32HandleInfo, pHandle, result);
5541     }
5542     return result;
5543 }
5544 
GetMemoryWin32HandlePropertiesKHR(VkDevice device,VkExternalMemoryHandleTypeFlagBits handleType,HANDLE handle,VkMemoryWin32HandlePropertiesKHR * pMemoryWin32HandleProperties)5545 VKAPI_ATTR VkResult VKAPI_CALL GetMemoryWin32HandlePropertiesKHR(
5546     VkDevice                                    device,
5547     VkExternalMemoryHandleTypeFlagBits          handleType,
5548     HANDLE                                      handle,
5549     VkMemoryWin32HandlePropertiesKHR*           pMemoryWin32HandleProperties) {
5550     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
5551     bool skip = false;
5552     for (auto intercept : layer_data->object_dispatch) {
5553         auto lock = intercept->write_lock();
5554         skip |= intercept->PreCallValidateGetMemoryWin32HandlePropertiesKHR(device, handleType, handle, pMemoryWin32HandleProperties);
5555         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
5556     }
5557     for (auto intercept : layer_data->object_dispatch) {
5558         auto lock = intercept->write_lock();
5559         intercept->PreCallRecordGetMemoryWin32HandlePropertiesKHR(device, handleType, handle, pMemoryWin32HandleProperties);
5560     }
5561     VkResult result = DispatchGetMemoryWin32HandlePropertiesKHR(device, handleType, handle, pMemoryWin32HandleProperties);
5562     for (auto intercept : layer_data->object_dispatch) {
5563         auto lock = intercept->write_lock();
5564         intercept->PostCallRecordGetMemoryWin32HandlePropertiesKHR(device, handleType, handle, pMemoryWin32HandleProperties, result);
5565     }
5566     return result;
5567 }
5568 #endif // VK_USE_PLATFORM_WIN32_KHR
5569 
5570 
GetMemoryFdKHR(VkDevice device,const VkMemoryGetFdInfoKHR * pGetFdInfo,int * pFd)5571 VKAPI_ATTR VkResult VKAPI_CALL GetMemoryFdKHR(
5572     VkDevice                                    device,
5573     const VkMemoryGetFdInfoKHR*                 pGetFdInfo,
5574     int*                                        pFd) {
5575     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
5576     bool skip = false;
5577     for (auto intercept : layer_data->object_dispatch) {
5578         auto lock = intercept->write_lock();
5579         skip |= intercept->PreCallValidateGetMemoryFdKHR(device, pGetFdInfo, pFd);
5580         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
5581     }
5582     for (auto intercept : layer_data->object_dispatch) {
5583         auto lock = intercept->write_lock();
5584         intercept->PreCallRecordGetMemoryFdKHR(device, pGetFdInfo, pFd);
5585     }
5586     VkResult result = DispatchGetMemoryFdKHR(device, pGetFdInfo, pFd);
5587     for (auto intercept : layer_data->object_dispatch) {
5588         auto lock = intercept->write_lock();
5589         intercept->PostCallRecordGetMemoryFdKHR(device, pGetFdInfo, pFd, result);
5590     }
5591     return result;
5592 }
5593 
GetMemoryFdPropertiesKHR(VkDevice device,VkExternalMemoryHandleTypeFlagBits handleType,int fd,VkMemoryFdPropertiesKHR * pMemoryFdProperties)5594 VKAPI_ATTR VkResult VKAPI_CALL GetMemoryFdPropertiesKHR(
5595     VkDevice                                    device,
5596     VkExternalMemoryHandleTypeFlagBits          handleType,
5597     int                                         fd,
5598     VkMemoryFdPropertiesKHR*                    pMemoryFdProperties) {
5599     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
5600     bool skip = false;
5601     for (auto intercept : layer_data->object_dispatch) {
5602         auto lock = intercept->write_lock();
5603         skip |= intercept->PreCallValidateGetMemoryFdPropertiesKHR(device, handleType, fd, pMemoryFdProperties);
5604         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
5605     }
5606     for (auto intercept : layer_data->object_dispatch) {
5607         auto lock = intercept->write_lock();
5608         intercept->PreCallRecordGetMemoryFdPropertiesKHR(device, handleType, fd, pMemoryFdProperties);
5609     }
5610     VkResult result = DispatchGetMemoryFdPropertiesKHR(device, handleType, fd, pMemoryFdProperties);
5611     for (auto intercept : layer_data->object_dispatch) {
5612         auto lock = intercept->write_lock();
5613         intercept->PostCallRecordGetMemoryFdPropertiesKHR(device, handleType, fd, pMemoryFdProperties, result);
5614     }
5615     return result;
5616 }
5617 
5618 #ifdef VK_USE_PLATFORM_WIN32_KHR
5619 #endif // VK_USE_PLATFORM_WIN32_KHR
5620 
5621 
GetPhysicalDeviceExternalSemaphorePropertiesKHR(VkPhysicalDevice physicalDevice,const VkPhysicalDeviceExternalSemaphoreInfo * pExternalSemaphoreInfo,VkExternalSemaphoreProperties * pExternalSemaphoreProperties)5622 VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalSemaphorePropertiesKHR(
5623     VkPhysicalDevice                            physicalDevice,
5624     const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo,
5625     VkExternalSemaphoreProperties*              pExternalSemaphoreProperties) {
5626     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
5627     bool skip = false;
5628     for (auto intercept : layer_data->object_dispatch) {
5629         auto lock = intercept->write_lock();
5630         skip |= intercept->PreCallValidateGetPhysicalDeviceExternalSemaphorePropertiesKHR(physicalDevice, pExternalSemaphoreInfo, pExternalSemaphoreProperties);
5631         if (skip) return;
5632     }
5633     for (auto intercept : layer_data->object_dispatch) {
5634         auto lock = intercept->write_lock();
5635         intercept->PreCallRecordGetPhysicalDeviceExternalSemaphorePropertiesKHR(physicalDevice, pExternalSemaphoreInfo, pExternalSemaphoreProperties);
5636     }
5637     DispatchGetPhysicalDeviceExternalSemaphorePropertiesKHR(physicalDevice, pExternalSemaphoreInfo, pExternalSemaphoreProperties);
5638     for (auto intercept : layer_data->object_dispatch) {
5639         auto lock = intercept->write_lock();
5640         intercept->PostCallRecordGetPhysicalDeviceExternalSemaphorePropertiesKHR(physicalDevice, pExternalSemaphoreInfo, pExternalSemaphoreProperties);
5641     }
5642 }
5643 
5644 
5645 #ifdef VK_USE_PLATFORM_WIN32_KHR
5646 
ImportSemaphoreWin32HandleKHR(VkDevice device,const VkImportSemaphoreWin32HandleInfoKHR * pImportSemaphoreWin32HandleInfo)5647 VKAPI_ATTR VkResult VKAPI_CALL ImportSemaphoreWin32HandleKHR(
5648     VkDevice                                    device,
5649     const VkImportSemaphoreWin32HandleInfoKHR*  pImportSemaphoreWin32HandleInfo) {
5650     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
5651     bool skip = false;
5652     for (auto intercept : layer_data->object_dispatch) {
5653         auto lock = intercept->write_lock();
5654         skip |= intercept->PreCallValidateImportSemaphoreWin32HandleKHR(device, pImportSemaphoreWin32HandleInfo);
5655         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
5656     }
5657     for (auto intercept : layer_data->object_dispatch) {
5658         auto lock = intercept->write_lock();
5659         intercept->PreCallRecordImportSemaphoreWin32HandleKHR(device, pImportSemaphoreWin32HandleInfo);
5660     }
5661     VkResult result = DispatchImportSemaphoreWin32HandleKHR(device, pImportSemaphoreWin32HandleInfo);
5662     for (auto intercept : layer_data->object_dispatch) {
5663         auto lock = intercept->write_lock();
5664         intercept->PostCallRecordImportSemaphoreWin32HandleKHR(device, pImportSemaphoreWin32HandleInfo, result);
5665     }
5666     return result;
5667 }
5668 
GetSemaphoreWin32HandleKHR(VkDevice device,const VkSemaphoreGetWin32HandleInfoKHR * pGetWin32HandleInfo,HANDLE * pHandle)5669 VKAPI_ATTR VkResult VKAPI_CALL GetSemaphoreWin32HandleKHR(
5670     VkDevice                                    device,
5671     const VkSemaphoreGetWin32HandleInfoKHR*     pGetWin32HandleInfo,
5672     HANDLE*                                     pHandle) {
5673     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
5674     bool skip = false;
5675     for (auto intercept : layer_data->object_dispatch) {
5676         auto lock = intercept->write_lock();
5677         skip |= intercept->PreCallValidateGetSemaphoreWin32HandleKHR(device, pGetWin32HandleInfo, pHandle);
5678         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
5679     }
5680     for (auto intercept : layer_data->object_dispatch) {
5681         auto lock = intercept->write_lock();
5682         intercept->PreCallRecordGetSemaphoreWin32HandleKHR(device, pGetWin32HandleInfo, pHandle);
5683     }
5684     VkResult result = DispatchGetSemaphoreWin32HandleKHR(device, pGetWin32HandleInfo, pHandle);
5685     for (auto intercept : layer_data->object_dispatch) {
5686         auto lock = intercept->write_lock();
5687         intercept->PostCallRecordGetSemaphoreWin32HandleKHR(device, pGetWin32HandleInfo, pHandle, result);
5688     }
5689     return result;
5690 }
5691 #endif // VK_USE_PLATFORM_WIN32_KHR
5692 
5693 
ImportSemaphoreFdKHR(VkDevice device,const VkImportSemaphoreFdInfoKHR * pImportSemaphoreFdInfo)5694 VKAPI_ATTR VkResult VKAPI_CALL ImportSemaphoreFdKHR(
5695     VkDevice                                    device,
5696     const VkImportSemaphoreFdInfoKHR*           pImportSemaphoreFdInfo) {
5697     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
5698     bool skip = false;
5699     for (auto intercept : layer_data->object_dispatch) {
5700         auto lock = intercept->write_lock();
5701         skip |= intercept->PreCallValidateImportSemaphoreFdKHR(device, pImportSemaphoreFdInfo);
5702         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
5703     }
5704     for (auto intercept : layer_data->object_dispatch) {
5705         auto lock = intercept->write_lock();
5706         intercept->PreCallRecordImportSemaphoreFdKHR(device, pImportSemaphoreFdInfo);
5707     }
5708     VkResult result = DispatchImportSemaphoreFdKHR(device, pImportSemaphoreFdInfo);
5709     for (auto intercept : layer_data->object_dispatch) {
5710         auto lock = intercept->write_lock();
5711         intercept->PostCallRecordImportSemaphoreFdKHR(device, pImportSemaphoreFdInfo, result);
5712     }
5713     return result;
5714 }
5715 
GetSemaphoreFdKHR(VkDevice device,const VkSemaphoreGetFdInfoKHR * pGetFdInfo,int * pFd)5716 VKAPI_ATTR VkResult VKAPI_CALL GetSemaphoreFdKHR(
5717     VkDevice                                    device,
5718     const VkSemaphoreGetFdInfoKHR*              pGetFdInfo,
5719     int*                                        pFd) {
5720     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
5721     bool skip = false;
5722     for (auto intercept : layer_data->object_dispatch) {
5723         auto lock = intercept->write_lock();
5724         skip |= intercept->PreCallValidateGetSemaphoreFdKHR(device, pGetFdInfo, pFd);
5725         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
5726     }
5727     for (auto intercept : layer_data->object_dispatch) {
5728         auto lock = intercept->write_lock();
5729         intercept->PreCallRecordGetSemaphoreFdKHR(device, pGetFdInfo, pFd);
5730     }
5731     VkResult result = DispatchGetSemaphoreFdKHR(device, pGetFdInfo, pFd);
5732     for (auto intercept : layer_data->object_dispatch) {
5733         auto lock = intercept->write_lock();
5734         intercept->PostCallRecordGetSemaphoreFdKHR(device, pGetFdInfo, pFd, result);
5735     }
5736     return result;
5737 }
5738 
5739 
CmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer,VkPipelineBindPoint pipelineBindPoint,VkPipelineLayout layout,uint32_t set,uint32_t descriptorWriteCount,const VkWriteDescriptorSet * pDescriptorWrites)5740 VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSetKHR(
5741     VkCommandBuffer                             commandBuffer,
5742     VkPipelineBindPoint                         pipelineBindPoint,
5743     VkPipelineLayout                            layout,
5744     uint32_t                                    set,
5745     uint32_t                                    descriptorWriteCount,
5746     const VkWriteDescriptorSet*                 pDescriptorWrites) {
5747     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
5748     bool skip = false;
5749     for (auto intercept : layer_data->object_dispatch) {
5750         auto lock = intercept->write_lock();
5751         skip |= intercept->PreCallValidateCmdPushDescriptorSetKHR(commandBuffer, pipelineBindPoint, layout, set, descriptorWriteCount, pDescriptorWrites);
5752         if (skip) return;
5753     }
5754     for (auto intercept : layer_data->object_dispatch) {
5755         auto lock = intercept->write_lock();
5756         intercept->PreCallRecordCmdPushDescriptorSetKHR(commandBuffer, pipelineBindPoint, layout, set, descriptorWriteCount, pDescriptorWrites);
5757     }
5758     DispatchCmdPushDescriptorSetKHR(commandBuffer, pipelineBindPoint, layout, set, descriptorWriteCount, pDescriptorWrites);
5759     for (auto intercept : layer_data->object_dispatch) {
5760         auto lock = intercept->write_lock();
5761         intercept->PostCallRecordCmdPushDescriptorSetKHR(commandBuffer, pipelineBindPoint, layout, set, descriptorWriteCount, pDescriptorWrites);
5762     }
5763 }
5764 
CmdPushDescriptorSetWithTemplateKHR(VkCommandBuffer commandBuffer,VkDescriptorUpdateTemplate descriptorUpdateTemplate,VkPipelineLayout layout,uint32_t set,const void * pData)5765 VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSetWithTemplateKHR(
5766     VkCommandBuffer                             commandBuffer,
5767     VkDescriptorUpdateTemplate                  descriptorUpdateTemplate,
5768     VkPipelineLayout                            layout,
5769     uint32_t                                    set,
5770     const void*                                 pData) {
5771     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
5772     bool skip = false;
5773     for (auto intercept : layer_data->object_dispatch) {
5774         auto lock = intercept->write_lock();
5775         skip |= intercept->PreCallValidateCmdPushDescriptorSetWithTemplateKHR(commandBuffer, descriptorUpdateTemplate, layout, set, pData);
5776         if (skip) return;
5777     }
5778     for (auto intercept : layer_data->object_dispatch) {
5779         auto lock = intercept->write_lock();
5780         intercept->PreCallRecordCmdPushDescriptorSetWithTemplateKHR(commandBuffer, descriptorUpdateTemplate, layout, set, pData);
5781     }
5782     DispatchCmdPushDescriptorSetWithTemplateKHR(commandBuffer, descriptorUpdateTemplate, layout, set, pData);
5783     for (auto intercept : layer_data->object_dispatch) {
5784         auto lock = intercept->write_lock();
5785         intercept->PostCallRecordCmdPushDescriptorSetWithTemplateKHR(commandBuffer, descriptorUpdateTemplate, layout, set, pData);
5786     }
5787 }
5788 
5789 
5790 
5791 
5792 
CreateDescriptorUpdateTemplateKHR(VkDevice device,const VkDescriptorUpdateTemplateCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkDescriptorUpdateTemplate * pDescriptorUpdateTemplate)5793 VKAPI_ATTR VkResult VKAPI_CALL CreateDescriptorUpdateTemplateKHR(
5794     VkDevice                                    device,
5795     const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
5796     const VkAllocationCallbacks*                pAllocator,
5797     VkDescriptorUpdateTemplate*                 pDescriptorUpdateTemplate) {
5798     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
5799     bool skip = false;
5800     for (auto intercept : layer_data->object_dispatch) {
5801         auto lock = intercept->write_lock();
5802         skip |= intercept->PreCallValidateCreateDescriptorUpdateTemplateKHR(device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate);
5803         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
5804     }
5805     for (auto intercept : layer_data->object_dispatch) {
5806         auto lock = intercept->write_lock();
5807         intercept->PreCallRecordCreateDescriptorUpdateTemplateKHR(device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate);
5808     }
5809     VkResult result = DispatchCreateDescriptorUpdateTemplateKHR(device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate);
5810     for (auto intercept : layer_data->object_dispatch) {
5811         auto lock = intercept->write_lock();
5812         intercept->PostCallRecordCreateDescriptorUpdateTemplateKHR(device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate, result);
5813     }
5814     return result;
5815 }
5816 
DestroyDescriptorUpdateTemplateKHR(VkDevice device,VkDescriptorUpdateTemplate descriptorUpdateTemplate,const VkAllocationCallbacks * pAllocator)5817 VKAPI_ATTR void VKAPI_CALL DestroyDescriptorUpdateTemplateKHR(
5818     VkDevice                                    device,
5819     VkDescriptorUpdateTemplate                  descriptorUpdateTemplate,
5820     const VkAllocationCallbacks*                pAllocator) {
5821     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
5822     bool skip = false;
5823     for (auto intercept : layer_data->object_dispatch) {
5824         auto lock = intercept->write_lock();
5825         skip |= intercept->PreCallValidateDestroyDescriptorUpdateTemplateKHR(device, descriptorUpdateTemplate, pAllocator);
5826         if (skip) return;
5827     }
5828     for (auto intercept : layer_data->object_dispatch) {
5829         auto lock = intercept->write_lock();
5830         intercept->PreCallRecordDestroyDescriptorUpdateTemplateKHR(device, descriptorUpdateTemplate, pAllocator);
5831     }
5832     DispatchDestroyDescriptorUpdateTemplateKHR(device, descriptorUpdateTemplate, pAllocator);
5833     for (auto intercept : layer_data->object_dispatch) {
5834         auto lock = intercept->write_lock();
5835         intercept->PostCallRecordDestroyDescriptorUpdateTemplateKHR(device, descriptorUpdateTemplate, pAllocator);
5836     }
5837 }
5838 
UpdateDescriptorSetWithTemplateKHR(VkDevice device,VkDescriptorSet descriptorSet,VkDescriptorUpdateTemplate descriptorUpdateTemplate,const void * pData)5839 VKAPI_ATTR void VKAPI_CALL UpdateDescriptorSetWithTemplateKHR(
5840     VkDevice                                    device,
5841     VkDescriptorSet                             descriptorSet,
5842     VkDescriptorUpdateTemplate                  descriptorUpdateTemplate,
5843     const void*                                 pData) {
5844     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
5845     bool skip = false;
5846     for (auto intercept : layer_data->object_dispatch) {
5847         auto lock = intercept->write_lock();
5848         skip |= intercept->PreCallValidateUpdateDescriptorSetWithTemplateKHR(device, descriptorSet, descriptorUpdateTemplate, pData);
5849         if (skip) return;
5850     }
5851     for (auto intercept : layer_data->object_dispatch) {
5852         auto lock = intercept->write_lock();
5853         intercept->PreCallRecordUpdateDescriptorSetWithTemplateKHR(device, descriptorSet, descriptorUpdateTemplate, pData);
5854     }
5855     DispatchUpdateDescriptorSetWithTemplateKHR(device, descriptorSet, descriptorUpdateTemplate, pData);
5856     for (auto intercept : layer_data->object_dispatch) {
5857         auto lock = intercept->write_lock();
5858         intercept->PostCallRecordUpdateDescriptorSetWithTemplateKHR(device, descriptorSet, descriptorUpdateTemplate, pData);
5859     }
5860 }
5861 
5862 
5863 
CreateRenderPass2KHR(VkDevice device,const VkRenderPassCreateInfo2KHR * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkRenderPass * pRenderPass)5864 VKAPI_ATTR VkResult VKAPI_CALL CreateRenderPass2KHR(
5865     VkDevice                                    device,
5866     const VkRenderPassCreateInfo2KHR*           pCreateInfo,
5867     const VkAllocationCallbacks*                pAllocator,
5868     VkRenderPass*                               pRenderPass) {
5869     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
5870     bool skip = false;
5871     for (auto intercept : layer_data->object_dispatch) {
5872         auto lock = intercept->write_lock();
5873         skip |= intercept->PreCallValidateCreateRenderPass2KHR(device, pCreateInfo, pAllocator, pRenderPass);
5874         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
5875     }
5876     for (auto intercept : layer_data->object_dispatch) {
5877         auto lock = intercept->write_lock();
5878         intercept->PreCallRecordCreateRenderPass2KHR(device, pCreateInfo, pAllocator, pRenderPass);
5879     }
5880     VkResult result = DispatchCreateRenderPass2KHR(device, pCreateInfo, pAllocator, pRenderPass);
5881     for (auto intercept : layer_data->object_dispatch) {
5882         auto lock = intercept->write_lock();
5883         intercept->PostCallRecordCreateRenderPass2KHR(device, pCreateInfo, pAllocator, pRenderPass, result);
5884     }
5885     return result;
5886 }
5887 
CmdBeginRenderPass2KHR(VkCommandBuffer commandBuffer,const VkRenderPassBeginInfo * pRenderPassBegin,const VkSubpassBeginInfoKHR * pSubpassBeginInfo)5888 VKAPI_ATTR void VKAPI_CALL CmdBeginRenderPass2KHR(
5889     VkCommandBuffer                             commandBuffer,
5890     const VkRenderPassBeginInfo*                pRenderPassBegin,
5891     const VkSubpassBeginInfoKHR*                pSubpassBeginInfo) {
5892     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
5893     bool skip = false;
5894     for (auto intercept : layer_data->object_dispatch) {
5895         auto lock = intercept->write_lock();
5896         skip |= intercept->PreCallValidateCmdBeginRenderPass2KHR(commandBuffer, pRenderPassBegin, pSubpassBeginInfo);
5897         if (skip) return;
5898     }
5899     for (auto intercept : layer_data->object_dispatch) {
5900         auto lock = intercept->write_lock();
5901         intercept->PreCallRecordCmdBeginRenderPass2KHR(commandBuffer, pRenderPassBegin, pSubpassBeginInfo);
5902     }
5903     DispatchCmdBeginRenderPass2KHR(commandBuffer, pRenderPassBegin, pSubpassBeginInfo);
5904     for (auto intercept : layer_data->object_dispatch) {
5905         auto lock = intercept->write_lock();
5906         intercept->PostCallRecordCmdBeginRenderPass2KHR(commandBuffer, pRenderPassBegin, pSubpassBeginInfo);
5907     }
5908 }
5909 
CmdNextSubpass2KHR(VkCommandBuffer commandBuffer,const VkSubpassBeginInfoKHR * pSubpassBeginInfo,const VkSubpassEndInfoKHR * pSubpassEndInfo)5910 VKAPI_ATTR void VKAPI_CALL CmdNextSubpass2KHR(
5911     VkCommandBuffer                             commandBuffer,
5912     const VkSubpassBeginInfoKHR*                pSubpassBeginInfo,
5913     const VkSubpassEndInfoKHR*                  pSubpassEndInfo) {
5914     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
5915     bool skip = false;
5916     for (auto intercept : layer_data->object_dispatch) {
5917         auto lock = intercept->write_lock();
5918         skip |= intercept->PreCallValidateCmdNextSubpass2KHR(commandBuffer, pSubpassBeginInfo, pSubpassEndInfo);
5919         if (skip) return;
5920     }
5921     for (auto intercept : layer_data->object_dispatch) {
5922         auto lock = intercept->write_lock();
5923         intercept->PreCallRecordCmdNextSubpass2KHR(commandBuffer, pSubpassBeginInfo, pSubpassEndInfo);
5924     }
5925     DispatchCmdNextSubpass2KHR(commandBuffer, pSubpassBeginInfo, pSubpassEndInfo);
5926     for (auto intercept : layer_data->object_dispatch) {
5927         auto lock = intercept->write_lock();
5928         intercept->PostCallRecordCmdNextSubpass2KHR(commandBuffer, pSubpassBeginInfo, pSubpassEndInfo);
5929     }
5930 }
5931 
CmdEndRenderPass2KHR(VkCommandBuffer commandBuffer,const VkSubpassEndInfoKHR * pSubpassEndInfo)5932 VKAPI_ATTR void VKAPI_CALL CmdEndRenderPass2KHR(
5933     VkCommandBuffer                             commandBuffer,
5934     const VkSubpassEndInfoKHR*                  pSubpassEndInfo) {
5935     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
5936     bool skip = false;
5937     for (auto intercept : layer_data->object_dispatch) {
5938         auto lock = intercept->write_lock();
5939         skip |= intercept->PreCallValidateCmdEndRenderPass2KHR(commandBuffer, pSubpassEndInfo);
5940         if (skip) return;
5941     }
5942     for (auto intercept : layer_data->object_dispatch) {
5943         auto lock = intercept->write_lock();
5944         intercept->PreCallRecordCmdEndRenderPass2KHR(commandBuffer, pSubpassEndInfo);
5945     }
5946     DispatchCmdEndRenderPass2KHR(commandBuffer, pSubpassEndInfo);
5947     for (auto intercept : layer_data->object_dispatch) {
5948         auto lock = intercept->write_lock();
5949         intercept->PostCallRecordCmdEndRenderPass2KHR(commandBuffer, pSubpassEndInfo);
5950     }
5951 }
5952 
5953 
GetSwapchainStatusKHR(VkDevice device,VkSwapchainKHR swapchain)5954 VKAPI_ATTR VkResult VKAPI_CALL GetSwapchainStatusKHR(
5955     VkDevice                                    device,
5956     VkSwapchainKHR                              swapchain) {
5957     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
5958     bool skip = false;
5959     for (auto intercept : layer_data->object_dispatch) {
5960         auto lock = intercept->write_lock();
5961         skip |= intercept->PreCallValidateGetSwapchainStatusKHR(device, swapchain);
5962         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
5963     }
5964     for (auto intercept : layer_data->object_dispatch) {
5965         auto lock = intercept->write_lock();
5966         intercept->PreCallRecordGetSwapchainStatusKHR(device, swapchain);
5967     }
5968     VkResult result = DispatchGetSwapchainStatusKHR(device, swapchain);
5969     for (auto intercept : layer_data->object_dispatch) {
5970         auto lock = intercept->write_lock();
5971         intercept->PostCallRecordGetSwapchainStatusKHR(device, swapchain, result);
5972     }
5973     return result;
5974 }
5975 
5976 
GetPhysicalDeviceExternalFencePropertiesKHR(VkPhysicalDevice physicalDevice,const VkPhysicalDeviceExternalFenceInfo * pExternalFenceInfo,VkExternalFenceProperties * pExternalFenceProperties)5977 VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalFencePropertiesKHR(
5978     VkPhysicalDevice                            physicalDevice,
5979     const VkPhysicalDeviceExternalFenceInfo*    pExternalFenceInfo,
5980     VkExternalFenceProperties*                  pExternalFenceProperties) {
5981     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
5982     bool skip = false;
5983     for (auto intercept : layer_data->object_dispatch) {
5984         auto lock = intercept->write_lock();
5985         skip |= intercept->PreCallValidateGetPhysicalDeviceExternalFencePropertiesKHR(physicalDevice, pExternalFenceInfo, pExternalFenceProperties);
5986         if (skip) return;
5987     }
5988     for (auto intercept : layer_data->object_dispatch) {
5989         auto lock = intercept->write_lock();
5990         intercept->PreCallRecordGetPhysicalDeviceExternalFencePropertiesKHR(physicalDevice, pExternalFenceInfo, pExternalFenceProperties);
5991     }
5992     DispatchGetPhysicalDeviceExternalFencePropertiesKHR(physicalDevice, pExternalFenceInfo, pExternalFenceProperties);
5993     for (auto intercept : layer_data->object_dispatch) {
5994         auto lock = intercept->write_lock();
5995         intercept->PostCallRecordGetPhysicalDeviceExternalFencePropertiesKHR(physicalDevice, pExternalFenceInfo, pExternalFenceProperties);
5996     }
5997 }
5998 
5999 
6000 #ifdef VK_USE_PLATFORM_WIN32_KHR
6001 
ImportFenceWin32HandleKHR(VkDevice device,const VkImportFenceWin32HandleInfoKHR * pImportFenceWin32HandleInfo)6002 VKAPI_ATTR VkResult VKAPI_CALL ImportFenceWin32HandleKHR(
6003     VkDevice                                    device,
6004     const VkImportFenceWin32HandleInfoKHR*      pImportFenceWin32HandleInfo) {
6005     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
6006     bool skip = false;
6007     for (auto intercept : layer_data->object_dispatch) {
6008         auto lock = intercept->write_lock();
6009         skip |= intercept->PreCallValidateImportFenceWin32HandleKHR(device, pImportFenceWin32HandleInfo);
6010         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
6011     }
6012     for (auto intercept : layer_data->object_dispatch) {
6013         auto lock = intercept->write_lock();
6014         intercept->PreCallRecordImportFenceWin32HandleKHR(device, pImportFenceWin32HandleInfo);
6015     }
6016     VkResult result = DispatchImportFenceWin32HandleKHR(device, pImportFenceWin32HandleInfo);
6017     for (auto intercept : layer_data->object_dispatch) {
6018         auto lock = intercept->write_lock();
6019         intercept->PostCallRecordImportFenceWin32HandleKHR(device, pImportFenceWin32HandleInfo, result);
6020     }
6021     return result;
6022 }
6023 
GetFenceWin32HandleKHR(VkDevice device,const VkFenceGetWin32HandleInfoKHR * pGetWin32HandleInfo,HANDLE * pHandle)6024 VKAPI_ATTR VkResult VKAPI_CALL GetFenceWin32HandleKHR(
6025     VkDevice                                    device,
6026     const VkFenceGetWin32HandleInfoKHR*         pGetWin32HandleInfo,
6027     HANDLE*                                     pHandle) {
6028     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
6029     bool skip = false;
6030     for (auto intercept : layer_data->object_dispatch) {
6031         auto lock = intercept->write_lock();
6032         skip |= intercept->PreCallValidateGetFenceWin32HandleKHR(device, pGetWin32HandleInfo, pHandle);
6033         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
6034     }
6035     for (auto intercept : layer_data->object_dispatch) {
6036         auto lock = intercept->write_lock();
6037         intercept->PreCallRecordGetFenceWin32HandleKHR(device, pGetWin32HandleInfo, pHandle);
6038     }
6039     VkResult result = DispatchGetFenceWin32HandleKHR(device, pGetWin32HandleInfo, pHandle);
6040     for (auto intercept : layer_data->object_dispatch) {
6041         auto lock = intercept->write_lock();
6042         intercept->PostCallRecordGetFenceWin32HandleKHR(device, pGetWin32HandleInfo, pHandle, result);
6043     }
6044     return result;
6045 }
6046 #endif // VK_USE_PLATFORM_WIN32_KHR
6047 
6048 
ImportFenceFdKHR(VkDevice device,const VkImportFenceFdInfoKHR * pImportFenceFdInfo)6049 VKAPI_ATTR VkResult VKAPI_CALL ImportFenceFdKHR(
6050     VkDevice                                    device,
6051     const VkImportFenceFdInfoKHR*               pImportFenceFdInfo) {
6052     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
6053     bool skip = false;
6054     for (auto intercept : layer_data->object_dispatch) {
6055         auto lock = intercept->write_lock();
6056         skip |= intercept->PreCallValidateImportFenceFdKHR(device, pImportFenceFdInfo);
6057         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
6058     }
6059     for (auto intercept : layer_data->object_dispatch) {
6060         auto lock = intercept->write_lock();
6061         intercept->PreCallRecordImportFenceFdKHR(device, pImportFenceFdInfo);
6062     }
6063     VkResult result = DispatchImportFenceFdKHR(device, pImportFenceFdInfo);
6064     for (auto intercept : layer_data->object_dispatch) {
6065         auto lock = intercept->write_lock();
6066         intercept->PostCallRecordImportFenceFdKHR(device, pImportFenceFdInfo, result);
6067     }
6068     return result;
6069 }
6070 
GetFenceFdKHR(VkDevice device,const VkFenceGetFdInfoKHR * pGetFdInfo,int * pFd)6071 VKAPI_ATTR VkResult VKAPI_CALL GetFenceFdKHR(
6072     VkDevice                                    device,
6073     const VkFenceGetFdInfoKHR*                  pGetFdInfo,
6074     int*                                        pFd) {
6075     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
6076     bool skip = false;
6077     for (auto intercept : layer_data->object_dispatch) {
6078         auto lock = intercept->write_lock();
6079         skip |= intercept->PreCallValidateGetFenceFdKHR(device, pGetFdInfo, pFd);
6080         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
6081     }
6082     for (auto intercept : layer_data->object_dispatch) {
6083         auto lock = intercept->write_lock();
6084         intercept->PreCallRecordGetFenceFdKHR(device, pGetFdInfo, pFd);
6085     }
6086     VkResult result = DispatchGetFenceFdKHR(device, pGetFdInfo, pFd);
6087     for (auto intercept : layer_data->object_dispatch) {
6088         auto lock = intercept->write_lock();
6089         intercept->PostCallRecordGetFenceFdKHR(device, pGetFdInfo, pFd, result);
6090     }
6091     return result;
6092 }
6093 
6094 
6095 
GetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physicalDevice,const VkPhysicalDeviceSurfaceInfo2KHR * pSurfaceInfo,VkSurfaceCapabilities2KHR * pSurfaceCapabilities)6096 VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceCapabilities2KHR(
6097     VkPhysicalDevice                            physicalDevice,
6098     const VkPhysicalDeviceSurfaceInfo2KHR*      pSurfaceInfo,
6099     VkSurfaceCapabilities2KHR*                  pSurfaceCapabilities) {
6100     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
6101     bool skip = false;
6102     for (auto intercept : layer_data->object_dispatch) {
6103         auto lock = intercept->write_lock();
6104         skip |= intercept->PreCallValidateGetPhysicalDeviceSurfaceCapabilities2KHR(physicalDevice, pSurfaceInfo, pSurfaceCapabilities);
6105         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
6106     }
6107     for (auto intercept : layer_data->object_dispatch) {
6108         auto lock = intercept->write_lock();
6109         intercept->PreCallRecordGetPhysicalDeviceSurfaceCapabilities2KHR(physicalDevice, pSurfaceInfo, pSurfaceCapabilities);
6110     }
6111     VkResult result = DispatchGetPhysicalDeviceSurfaceCapabilities2KHR(physicalDevice, pSurfaceInfo, pSurfaceCapabilities);
6112     for (auto intercept : layer_data->object_dispatch) {
6113         auto lock = intercept->write_lock();
6114         intercept->PostCallRecordGetPhysicalDeviceSurfaceCapabilities2KHR(physicalDevice, pSurfaceInfo, pSurfaceCapabilities, result);
6115     }
6116     return result;
6117 }
6118 
GetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice,const VkPhysicalDeviceSurfaceInfo2KHR * pSurfaceInfo,uint32_t * pSurfaceFormatCount,VkSurfaceFormat2KHR * pSurfaceFormats)6119 VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceFormats2KHR(
6120     VkPhysicalDevice                            physicalDevice,
6121     const VkPhysicalDeviceSurfaceInfo2KHR*      pSurfaceInfo,
6122     uint32_t*                                   pSurfaceFormatCount,
6123     VkSurfaceFormat2KHR*                        pSurfaceFormats) {
6124     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
6125     bool skip = false;
6126     for (auto intercept : layer_data->object_dispatch) {
6127         auto lock = intercept->write_lock();
6128         skip |= intercept->PreCallValidateGetPhysicalDeviceSurfaceFormats2KHR(physicalDevice, pSurfaceInfo, pSurfaceFormatCount, pSurfaceFormats);
6129         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
6130     }
6131     for (auto intercept : layer_data->object_dispatch) {
6132         auto lock = intercept->write_lock();
6133         intercept->PreCallRecordGetPhysicalDeviceSurfaceFormats2KHR(physicalDevice, pSurfaceInfo, pSurfaceFormatCount, pSurfaceFormats);
6134     }
6135     VkResult result = DispatchGetPhysicalDeviceSurfaceFormats2KHR(physicalDevice, pSurfaceInfo, pSurfaceFormatCount, pSurfaceFormats);
6136     for (auto intercept : layer_data->object_dispatch) {
6137         auto lock = intercept->write_lock();
6138         intercept->PostCallRecordGetPhysicalDeviceSurfaceFormats2KHR(physicalDevice, pSurfaceInfo, pSurfaceFormatCount, pSurfaceFormats, result);
6139     }
6140     return result;
6141 }
6142 
6143 
6144 
GetPhysicalDeviceDisplayProperties2KHR(VkPhysicalDevice physicalDevice,uint32_t * pPropertyCount,VkDisplayProperties2KHR * pProperties)6145 VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceDisplayProperties2KHR(
6146     VkPhysicalDevice                            physicalDevice,
6147     uint32_t*                                   pPropertyCount,
6148     VkDisplayProperties2KHR*                    pProperties) {
6149     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
6150     bool skip = false;
6151     for (auto intercept : layer_data->object_dispatch) {
6152         auto lock = intercept->write_lock();
6153         skip |= intercept->PreCallValidateGetPhysicalDeviceDisplayProperties2KHR(physicalDevice, pPropertyCount, pProperties);
6154         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
6155     }
6156     for (auto intercept : layer_data->object_dispatch) {
6157         auto lock = intercept->write_lock();
6158         intercept->PreCallRecordGetPhysicalDeviceDisplayProperties2KHR(physicalDevice, pPropertyCount, pProperties);
6159     }
6160     VkResult result = DispatchGetPhysicalDeviceDisplayProperties2KHR(physicalDevice, pPropertyCount, pProperties);
6161     for (auto intercept : layer_data->object_dispatch) {
6162         auto lock = intercept->write_lock();
6163         intercept->PostCallRecordGetPhysicalDeviceDisplayProperties2KHR(physicalDevice, pPropertyCount, pProperties, result);
6164     }
6165     return result;
6166 }
6167 
GetPhysicalDeviceDisplayPlaneProperties2KHR(VkPhysicalDevice physicalDevice,uint32_t * pPropertyCount,VkDisplayPlaneProperties2KHR * pProperties)6168 VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceDisplayPlaneProperties2KHR(
6169     VkPhysicalDevice                            physicalDevice,
6170     uint32_t*                                   pPropertyCount,
6171     VkDisplayPlaneProperties2KHR*               pProperties) {
6172     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
6173     bool skip = false;
6174     for (auto intercept : layer_data->object_dispatch) {
6175         auto lock = intercept->write_lock();
6176         skip |= intercept->PreCallValidateGetPhysicalDeviceDisplayPlaneProperties2KHR(physicalDevice, pPropertyCount, pProperties);
6177         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
6178     }
6179     for (auto intercept : layer_data->object_dispatch) {
6180         auto lock = intercept->write_lock();
6181         intercept->PreCallRecordGetPhysicalDeviceDisplayPlaneProperties2KHR(physicalDevice, pPropertyCount, pProperties);
6182     }
6183     VkResult result = DispatchGetPhysicalDeviceDisplayPlaneProperties2KHR(physicalDevice, pPropertyCount, pProperties);
6184     for (auto intercept : layer_data->object_dispatch) {
6185         auto lock = intercept->write_lock();
6186         intercept->PostCallRecordGetPhysicalDeviceDisplayPlaneProperties2KHR(physicalDevice, pPropertyCount, pProperties, result);
6187     }
6188     return result;
6189 }
6190 
GetDisplayModeProperties2KHR(VkPhysicalDevice physicalDevice,VkDisplayKHR display,uint32_t * pPropertyCount,VkDisplayModeProperties2KHR * pProperties)6191 VKAPI_ATTR VkResult VKAPI_CALL GetDisplayModeProperties2KHR(
6192     VkPhysicalDevice                            physicalDevice,
6193     VkDisplayKHR                                display,
6194     uint32_t*                                   pPropertyCount,
6195     VkDisplayModeProperties2KHR*                pProperties) {
6196     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
6197     bool skip = false;
6198     for (auto intercept : layer_data->object_dispatch) {
6199         auto lock = intercept->write_lock();
6200         skip |= intercept->PreCallValidateGetDisplayModeProperties2KHR(physicalDevice, display, pPropertyCount, pProperties);
6201         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
6202     }
6203     for (auto intercept : layer_data->object_dispatch) {
6204         auto lock = intercept->write_lock();
6205         intercept->PreCallRecordGetDisplayModeProperties2KHR(physicalDevice, display, pPropertyCount, pProperties);
6206     }
6207     VkResult result = DispatchGetDisplayModeProperties2KHR(physicalDevice, display, pPropertyCount, pProperties);
6208     for (auto intercept : layer_data->object_dispatch) {
6209         auto lock = intercept->write_lock();
6210         intercept->PostCallRecordGetDisplayModeProperties2KHR(physicalDevice, display, pPropertyCount, pProperties, result);
6211     }
6212     return result;
6213 }
6214 
GetDisplayPlaneCapabilities2KHR(VkPhysicalDevice physicalDevice,const VkDisplayPlaneInfo2KHR * pDisplayPlaneInfo,VkDisplayPlaneCapabilities2KHR * pCapabilities)6215 VKAPI_ATTR VkResult VKAPI_CALL GetDisplayPlaneCapabilities2KHR(
6216     VkPhysicalDevice                            physicalDevice,
6217     const VkDisplayPlaneInfo2KHR*               pDisplayPlaneInfo,
6218     VkDisplayPlaneCapabilities2KHR*             pCapabilities) {
6219     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
6220     bool skip = false;
6221     for (auto intercept : layer_data->object_dispatch) {
6222         auto lock = intercept->write_lock();
6223         skip |= intercept->PreCallValidateGetDisplayPlaneCapabilities2KHR(physicalDevice, pDisplayPlaneInfo, pCapabilities);
6224         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
6225     }
6226     for (auto intercept : layer_data->object_dispatch) {
6227         auto lock = intercept->write_lock();
6228         intercept->PreCallRecordGetDisplayPlaneCapabilities2KHR(physicalDevice, pDisplayPlaneInfo, pCapabilities);
6229     }
6230     VkResult result = DispatchGetDisplayPlaneCapabilities2KHR(physicalDevice, pDisplayPlaneInfo, pCapabilities);
6231     for (auto intercept : layer_data->object_dispatch) {
6232         auto lock = intercept->write_lock();
6233         intercept->PostCallRecordGetDisplayPlaneCapabilities2KHR(physicalDevice, pDisplayPlaneInfo, pCapabilities, result);
6234     }
6235     return result;
6236 }
6237 
6238 
6239 
6240 
6241 
GetImageMemoryRequirements2KHR(VkDevice device,const VkImageMemoryRequirementsInfo2 * pInfo,VkMemoryRequirements2 * pMemoryRequirements)6242 VKAPI_ATTR void VKAPI_CALL GetImageMemoryRequirements2KHR(
6243     VkDevice                                    device,
6244     const VkImageMemoryRequirementsInfo2*       pInfo,
6245     VkMemoryRequirements2*                      pMemoryRequirements) {
6246     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
6247     bool skip = false;
6248     for (auto intercept : layer_data->object_dispatch) {
6249         auto lock = intercept->write_lock();
6250         skip |= intercept->PreCallValidateGetImageMemoryRequirements2KHR(device, pInfo, pMemoryRequirements);
6251         if (skip) return;
6252     }
6253     for (auto intercept : layer_data->object_dispatch) {
6254         auto lock = intercept->write_lock();
6255         intercept->PreCallRecordGetImageMemoryRequirements2KHR(device, pInfo, pMemoryRequirements);
6256     }
6257     DispatchGetImageMemoryRequirements2KHR(device, pInfo, pMemoryRequirements);
6258     for (auto intercept : layer_data->object_dispatch) {
6259         auto lock = intercept->write_lock();
6260         intercept->PostCallRecordGetImageMemoryRequirements2KHR(device, pInfo, pMemoryRequirements);
6261     }
6262 }
6263 
GetBufferMemoryRequirements2KHR(VkDevice device,const VkBufferMemoryRequirementsInfo2 * pInfo,VkMemoryRequirements2 * pMemoryRequirements)6264 VKAPI_ATTR void VKAPI_CALL GetBufferMemoryRequirements2KHR(
6265     VkDevice                                    device,
6266     const VkBufferMemoryRequirementsInfo2*      pInfo,
6267     VkMemoryRequirements2*                      pMemoryRequirements) {
6268     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
6269     bool skip = false;
6270     for (auto intercept : layer_data->object_dispatch) {
6271         auto lock = intercept->write_lock();
6272         skip |= intercept->PreCallValidateGetBufferMemoryRequirements2KHR(device, pInfo, pMemoryRequirements);
6273         if (skip) return;
6274     }
6275     for (auto intercept : layer_data->object_dispatch) {
6276         auto lock = intercept->write_lock();
6277         intercept->PreCallRecordGetBufferMemoryRequirements2KHR(device, pInfo, pMemoryRequirements);
6278     }
6279     DispatchGetBufferMemoryRequirements2KHR(device, pInfo, pMemoryRequirements);
6280     for (auto intercept : layer_data->object_dispatch) {
6281         auto lock = intercept->write_lock();
6282         intercept->PostCallRecordGetBufferMemoryRequirements2KHR(device, pInfo, pMemoryRequirements);
6283     }
6284 }
6285 
GetImageSparseMemoryRequirements2KHR(VkDevice device,const VkImageSparseMemoryRequirementsInfo2 * pInfo,uint32_t * pSparseMemoryRequirementCount,VkSparseImageMemoryRequirements2 * pSparseMemoryRequirements)6286 VKAPI_ATTR void VKAPI_CALL GetImageSparseMemoryRequirements2KHR(
6287     VkDevice                                    device,
6288     const VkImageSparseMemoryRequirementsInfo2* pInfo,
6289     uint32_t*                                   pSparseMemoryRequirementCount,
6290     VkSparseImageMemoryRequirements2*           pSparseMemoryRequirements) {
6291     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
6292     bool skip = false;
6293     for (auto intercept : layer_data->object_dispatch) {
6294         auto lock = intercept->write_lock();
6295         skip |= intercept->PreCallValidateGetImageSparseMemoryRequirements2KHR(device, pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements);
6296         if (skip) return;
6297     }
6298     for (auto intercept : layer_data->object_dispatch) {
6299         auto lock = intercept->write_lock();
6300         intercept->PreCallRecordGetImageSparseMemoryRequirements2KHR(device, pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements);
6301     }
6302     DispatchGetImageSparseMemoryRequirements2KHR(device, pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements);
6303     for (auto intercept : layer_data->object_dispatch) {
6304         auto lock = intercept->write_lock();
6305         intercept->PostCallRecordGetImageSparseMemoryRequirements2KHR(device, pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements);
6306     }
6307 }
6308 
6309 
6310 
CreateSamplerYcbcrConversionKHR(VkDevice device,const VkSamplerYcbcrConversionCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkSamplerYcbcrConversion * pYcbcrConversion)6311 VKAPI_ATTR VkResult VKAPI_CALL CreateSamplerYcbcrConversionKHR(
6312     VkDevice                                    device,
6313     const VkSamplerYcbcrConversionCreateInfo*   pCreateInfo,
6314     const VkAllocationCallbacks*                pAllocator,
6315     VkSamplerYcbcrConversion*                   pYcbcrConversion) {
6316     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
6317     bool skip = false;
6318     for (auto intercept : layer_data->object_dispatch) {
6319         auto lock = intercept->write_lock();
6320         skip |= intercept->PreCallValidateCreateSamplerYcbcrConversionKHR(device, pCreateInfo, pAllocator, pYcbcrConversion);
6321         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
6322     }
6323     for (auto intercept : layer_data->object_dispatch) {
6324         auto lock = intercept->write_lock();
6325         intercept->PreCallRecordCreateSamplerYcbcrConversionKHR(device, pCreateInfo, pAllocator, pYcbcrConversion);
6326     }
6327     VkResult result = DispatchCreateSamplerYcbcrConversionKHR(device, pCreateInfo, pAllocator, pYcbcrConversion);
6328     for (auto intercept : layer_data->object_dispatch) {
6329         auto lock = intercept->write_lock();
6330         intercept->PostCallRecordCreateSamplerYcbcrConversionKHR(device, pCreateInfo, pAllocator, pYcbcrConversion, result);
6331     }
6332     return result;
6333 }
6334 
DestroySamplerYcbcrConversionKHR(VkDevice device,VkSamplerYcbcrConversion ycbcrConversion,const VkAllocationCallbacks * pAllocator)6335 VKAPI_ATTR void VKAPI_CALL DestroySamplerYcbcrConversionKHR(
6336     VkDevice                                    device,
6337     VkSamplerYcbcrConversion                    ycbcrConversion,
6338     const VkAllocationCallbacks*                pAllocator) {
6339     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
6340     bool skip = false;
6341     for (auto intercept : layer_data->object_dispatch) {
6342         auto lock = intercept->write_lock();
6343         skip |= intercept->PreCallValidateDestroySamplerYcbcrConversionKHR(device, ycbcrConversion, pAllocator);
6344         if (skip) return;
6345     }
6346     for (auto intercept : layer_data->object_dispatch) {
6347         auto lock = intercept->write_lock();
6348         intercept->PreCallRecordDestroySamplerYcbcrConversionKHR(device, ycbcrConversion, pAllocator);
6349     }
6350     DispatchDestroySamplerYcbcrConversionKHR(device, ycbcrConversion, pAllocator);
6351     for (auto intercept : layer_data->object_dispatch) {
6352         auto lock = intercept->write_lock();
6353         intercept->PostCallRecordDestroySamplerYcbcrConversionKHR(device, ycbcrConversion, pAllocator);
6354     }
6355 }
6356 
6357 
BindBufferMemory2KHR(VkDevice device,uint32_t bindInfoCount,const VkBindBufferMemoryInfo * pBindInfos)6358 VKAPI_ATTR VkResult VKAPI_CALL BindBufferMemory2KHR(
6359     VkDevice                                    device,
6360     uint32_t                                    bindInfoCount,
6361     const VkBindBufferMemoryInfo*               pBindInfos) {
6362     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
6363     bool skip = false;
6364     for (auto intercept : layer_data->object_dispatch) {
6365         auto lock = intercept->write_lock();
6366         skip |= intercept->PreCallValidateBindBufferMemory2KHR(device, bindInfoCount, pBindInfos);
6367         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
6368     }
6369     for (auto intercept : layer_data->object_dispatch) {
6370         auto lock = intercept->write_lock();
6371         intercept->PreCallRecordBindBufferMemory2KHR(device, bindInfoCount, pBindInfos);
6372     }
6373     VkResult result = DispatchBindBufferMemory2KHR(device, bindInfoCount, pBindInfos);
6374     for (auto intercept : layer_data->object_dispatch) {
6375         auto lock = intercept->write_lock();
6376         intercept->PostCallRecordBindBufferMemory2KHR(device, bindInfoCount, pBindInfos, result);
6377     }
6378     return result;
6379 }
6380 
BindImageMemory2KHR(VkDevice device,uint32_t bindInfoCount,const VkBindImageMemoryInfo * pBindInfos)6381 VKAPI_ATTR VkResult VKAPI_CALL BindImageMemory2KHR(
6382     VkDevice                                    device,
6383     uint32_t                                    bindInfoCount,
6384     const VkBindImageMemoryInfo*                pBindInfos) {
6385     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
6386     bool skip = false;
6387     for (auto intercept : layer_data->object_dispatch) {
6388         auto lock = intercept->write_lock();
6389         skip |= intercept->PreCallValidateBindImageMemory2KHR(device, bindInfoCount, pBindInfos);
6390         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
6391     }
6392     for (auto intercept : layer_data->object_dispatch) {
6393         auto lock = intercept->write_lock();
6394         intercept->PreCallRecordBindImageMemory2KHR(device, bindInfoCount, pBindInfos);
6395     }
6396     VkResult result = DispatchBindImageMemory2KHR(device, bindInfoCount, pBindInfos);
6397     for (auto intercept : layer_data->object_dispatch) {
6398         auto lock = intercept->write_lock();
6399         intercept->PostCallRecordBindImageMemory2KHR(device, bindInfoCount, pBindInfos, result);
6400     }
6401     return result;
6402 }
6403 
6404 
GetDescriptorSetLayoutSupportKHR(VkDevice device,const VkDescriptorSetLayoutCreateInfo * pCreateInfo,VkDescriptorSetLayoutSupport * pSupport)6405 VKAPI_ATTR void VKAPI_CALL GetDescriptorSetLayoutSupportKHR(
6406     VkDevice                                    device,
6407     const VkDescriptorSetLayoutCreateInfo*      pCreateInfo,
6408     VkDescriptorSetLayoutSupport*               pSupport) {
6409     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
6410     bool skip = false;
6411     for (auto intercept : layer_data->object_dispatch) {
6412         auto lock = intercept->write_lock();
6413         skip |= intercept->PreCallValidateGetDescriptorSetLayoutSupportKHR(device, pCreateInfo, pSupport);
6414         if (skip) return;
6415     }
6416     for (auto intercept : layer_data->object_dispatch) {
6417         auto lock = intercept->write_lock();
6418         intercept->PreCallRecordGetDescriptorSetLayoutSupportKHR(device, pCreateInfo, pSupport);
6419     }
6420     DispatchGetDescriptorSetLayoutSupportKHR(device, pCreateInfo, pSupport);
6421     for (auto intercept : layer_data->object_dispatch) {
6422         auto lock = intercept->write_lock();
6423         intercept->PostCallRecordGetDescriptorSetLayoutSupportKHR(device, pCreateInfo, pSupport);
6424     }
6425 }
6426 
6427 
CmdDrawIndirectCountKHR(VkCommandBuffer commandBuffer,VkBuffer buffer,VkDeviceSize offset,VkBuffer countBuffer,VkDeviceSize countBufferOffset,uint32_t maxDrawCount,uint32_t stride)6428 VKAPI_ATTR void VKAPI_CALL CmdDrawIndirectCountKHR(
6429     VkCommandBuffer                             commandBuffer,
6430     VkBuffer                                    buffer,
6431     VkDeviceSize                                offset,
6432     VkBuffer                                    countBuffer,
6433     VkDeviceSize                                countBufferOffset,
6434     uint32_t                                    maxDrawCount,
6435     uint32_t                                    stride) {
6436     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
6437     bool skip = false;
6438     for (auto intercept : layer_data->object_dispatch) {
6439         auto lock = intercept->write_lock();
6440         skip |= intercept->PreCallValidateCmdDrawIndirectCountKHR(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride);
6441         if (skip) return;
6442     }
6443     for (auto intercept : layer_data->object_dispatch) {
6444         auto lock = intercept->write_lock();
6445         intercept->PreCallRecordCmdDrawIndirectCountKHR(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride);
6446     }
6447     DispatchCmdDrawIndirectCountKHR(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride);
6448     for (auto intercept : layer_data->object_dispatch) {
6449         auto lock = intercept->write_lock();
6450         intercept->PostCallRecordCmdDrawIndirectCountKHR(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride);
6451     }
6452 }
6453 
CmdDrawIndexedIndirectCountKHR(VkCommandBuffer commandBuffer,VkBuffer buffer,VkDeviceSize offset,VkBuffer countBuffer,VkDeviceSize countBufferOffset,uint32_t maxDrawCount,uint32_t stride)6454 VKAPI_ATTR void VKAPI_CALL CmdDrawIndexedIndirectCountKHR(
6455     VkCommandBuffer                             commandBuffer,
6456     VkBuffer                                    buffer,
6457     VkDeviceSize                                offset,
6458     VkBuffer                                    countBuffer,
6459     VkDeviceSize                                countBufferOffset,
6460     uint32_t                                    maxDrawCount,
6461     uint32_t                                    stride) {
6462     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
6463     bool skip = false;
6464     for (auto intercept : layer_data->object_dispatch) {
6465         auto lock = intercept->write_lock();
6466         skip |= intercept->PreCallValidateCmdDrawIndexedIndirectCountKHR(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride);
6467         if (skip) return;
6468     }
6469     for (auto intercept : layer_data->object_dispatch) {
6470         auto lock = intercept->write_lock();
6471         intercept->PreCallRecordCmdDrawIndexedIndirectCountKHR(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride);
6472     }
6473     DispatchCmdDrawIndexedIndirectCountKHR(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride);
6474     for (auto intercept : layer_data->object_dispatch) {
6475         auto lock = intercept->write_lock();
6476         intercept->PostCallRecordCmdDrawIndexedIndirectCountKHR(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride);
6477     }
6478 }
6479 
6480 
6481 
6482 
6483 
6484 
6485 
6486 
6487 
6488 
6489 
GetPipelineExecutablePropertiesKHR(VkDevice device,const VkPipelineInfoKHR * pPipelineInfo,uint32_t * pExecutableCount,VkPipelineExecutablePropertiesKHR * pProperties)6490 VKAPI_ATTR VkResult VKAPI_CALL GetPipelineExecutablePropertiesKHR(
6491     VkDevice                                    device,
6492     const VkPipelineInfoKHR*                    pPipelineInfo,
6493     uint32_t*                                   pExecutableCount,
6494     VkPipelineExecutablePropertiesKHR*          pProperties) {
6495     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
6496     bool skip = false;
6497     for (auto intercept : layer_data->object_dispatch) {
6498         auto lock = intercept->write_lock();
6499         skip |= intercept->PreCallValidateGetPipelineExecutablePropertiesKHR(device, pPipelineInfo, pExecutableCount, pProperties);
6500         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
6501     }
6502     for (auto intercept : layer_data->object_dispatch) {
6503         auto lock = intercept->write_lock();
6504         intercept->PreCallRecordGetPipelineExecutablePropertiesKHR(device, pPipelineInfo, pExecutableCount, pProperties);
6505     }
6506     VkResult result = DispatchGetPipelineExecutablePropertiesKHR(device, pPipelineInfo, pExecutableCount, pProperties);
6507     for (auto intercept : layer_data->object_dispatch) {
6508         auto lock = intercept->write_lock();
6509         intercept->PostCallRecordGetPipelineExecutablePropertiesKHR(device, pPipelineInfo, pExecutableCount, pProperties, result);
6510     }
6511     return result;
6512 }
6513 
GetPipelineExecutableStatisticsKHR(VkDevice device,const VkPipelineExecutableInfoKHR * pExecutableInfo,uint32_t * pStatisticCount,VkPipelineExecutableStatisticKHR * pStatistics)6514 VKAPI_ATTR VkResult VKAPI_CALL GetPipelineExecutableStatisticsKHR(
6515     VkDevice                                    device,
6516     const VkPipelineExecutableInfoKHR*          pExecutableInfo,
6517     uint32_t*                                   pStatisticCount,
6518     VkPipelineExecutableStatisticKHR*           pStatistics) {
6519     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
6520     bool skip = false;
6521     for (auto intercept : layer_data->object_dispatch) {
6522         auto lock = intercept->write_lock();
6523         skip |= intercept->PreCallValidateGetPipelineExecutableStatisticsKHR(device, pExecutableInfo, pStatisticCount, pStatistics);
6524         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
6525     }
6526     for (auto intercept : layer_data->object_dispatch) {
6527         auto lock = intercept->write_lock();
6528         intercept->PreCallRecordGetPipelineExecutableStatisticsKHR(device, pExecutableInfo, pStatisticCount, pStatistics);
6529     }
6530     VkResult result = DispatchGetPipelineExecutableStatisticsKHR(device, pExecutableInfo, pStatisticCount, pStatistics);
6531     for (auto intercept : layer_data->object_dispatch) {
6532         auto lock = intercept->write_lock();
6533         intercept->PostCallRecordGetPipelineExecutableStatisticsKHR(device, pExecutableInfo, pStatisticCount, pStatistics, result);
6534     }
6535     return result;
6536 }
6537 
GetPipelineExecutableInternalRepresentationsKHR(VkDevice device,const VkPipelineExecutableInfoKHR * pExecutableInfo,uint32_t * pInternalRepresentationCount,VkPipelineExecutableInternalRepresentationKHR * pInternalRepresentations)6538 VKAPI_ATTR VkResult VKAPI_CALL GetPipelineExecutableInternalRepresentationsKHR(
6539     VkDevice                                    device,
6540     const VkPipelineExecutableInfoKHR*          pExecutableInfo,
6541     uint32_t*                                   pInternalRepresentationCount,
6542     VkPipelineExecutableInternalRepresentationKHR* pInternalRepresentations) {
6543     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
6544     bool skip = false;
6545     for (auto intercept : layer_data->object_dispatch) {
6546         auto lock = intercept->write_lock();
6547         skip |= intercept->PreCallValidateGetPipelineExecutableInternalRepresentationsKHR(device, pExecutableInfo, pInternalRepresentationCount, pInternalRepresentations);
6548         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
6549     }
6550     for (auto intercept : layer_data->object_dispatch) {
6551         auto lock = intercept->write_lock();
6552         intercept->PreCallRecordGetPipelineExecutableInternalRepresentationsKHR(device, pExecutableInfo, pInternalRepresentationCount, pInternalRepresentations);
6553     }
6554     VkResult result = DispatchGetPipelineExecutableInternalRepresentationsKHR(device, pExecutableInfo, pInternalRepresentationCount, pInternalRepresentations);
6555     for (auto intercept : layer_data->object_dispatch) {
6556         auto lock = intercept->write_lock();
6557         intercept->PostCallRecordGetPipelineExecutableInternalRepresentationsKHR(device, pExecutableInfo, pInternalRepresentationCount, pInternalRepresentations, result);
6558     }
6559     return result;
6560 }
6561 
6562 
CreateDebugReportCallbackEXT(VkInstance instance,const VkDebugReportCallbackCreateInfoEXT * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkDebugReportCallbackEXT * pCallback)6563 VKAPI_ATTR VkResult VKAPI_CALL CreateDebugReportCallbackEXT(
6564     VkInstance                                  instance,
6565     const VkDebugReportCallbackCreateInfoEXT*   pCreateInfo,
6566     const VkAllocationCallbacks*                pAllocator,
6567     VkDebugReportCallbackEXT*                   pCallback) {
6568     auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map);
6569     bool skip = false;
6570     for (auto intercept : layer_data->object_dispatch) {
6571         auto lock = intercept->write_lock();
6572         skip |= intercept->PreCallValidateCreateDebugReportCallbackEXT(instance, pCreateInfo, pAllocator, pCallback);
6573         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
6574     }
6575     for (auto intercept : layer_data->object_dispatch) {
6576         auto lock = intercept->write_lock();
6577         intercept->PreCallRecordCreateDebugReportCallbackEXT(instance, pCreateInfo, pAllocator, pCallback);
6578     }
6579     VkResult result = DispatchCreateDebugReportCallbackEXT(instance, pCreateInfo, pAllocator, pCallback);
6580     layer_create_report_callback(layer_data->report_data, false, pCreateInfo, pAllocator, pCallback);
6581     for (auto intercept : layer_data->object_dispatch) {
6582         auto lock = intercept->write_lock();
6583         intercept->PostCallRecordCreateDebugReportCallbackEXT(instance, pCreateInfo, pAllocator, pCallback, result);
6584     }
6585     return result;
6586 }
6587 
DestroyDebugReportCallbackEXT(VkInstance instance,VkDebugReportCallbackEXT callback,const VkAllocationCallbacks * pAllocator)6588 VKAPI_ATTR void VKAPI_CALL DestroyDebugReportCallbackEXT(
6589     VkInstance                                  instance,
6590     VkDebugReportCallbackEXT                    callback,
6591     const VkAllocationCallbacks*                pAllocator) {
6592     auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map);
6593     bool skip = false;
6594     for (auto intercept : layer_data->object_dispatch) {
6595         auto lock = intercept->write_lock();
6596         skip |= intercept->PreCallValidateDestroyDebugReportCallbackEXT(instance, callback, pAllocator);
6597         if (skip) return;
6598     }
6599     for (auto intercept : layer_data->object_dispatch) {
6600         auto lock = intercept->write_lock();
6601         intercept->PreCallRecordDestroyDebugReportCallbackEXT(instance, callback, pAllocator);
6602     }
6603     DispatchDestroyDebugReportCallbackEXT(instance, callback, pAllocator);
6604     layer_destroy_report_callback(layer_data->report_data, callback, pAllocator);
6605     for (auto intercept : layer_data->object_dispatch) {
6606         auto lock = intercept->write_lock();
6607         intercept->PostCallRecordDestroyDebugReportCallbackEXT(instance, callback, pAllocator);
6608     }
6609 }
6610 
DebugReportMessageEXT(VkInstance instance,VkDebugReportFlagsEXT flags,VkDebugReportObjectTypeEXT objectType,uint64_t object,size_t location,int32_t messageCode,const char * pLayerPrefix,const char * pMessage)6611 VKAPI_ATTR void VKAPI_CALL DebugReportMessageEXT(
6612     VkInstance                                  instance,
6613     VkDebugReportFlagsEXT                       flags,
6614     VkDebugReportObjectTypeEXT                  objectType,
6615     uint64_t                                    object,
6616     size_t                                      location,
6617     int32_t                                     messageCode,
6618     const char*                                 pLayerPrefix,
6619     const char*                                 pMessage) {
6620     auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map);
6621     bool skip = false;
6622     for (auto intercept : layer_data->object_dispatch) {
6623         auto lock = intercept->write_lock();
6624         skip |= intercept->PreCallValidateDebugReportMessageEXT(instance, flags, objectType, object, location, messageCode, pLayerPrefix, pMessage);
6625         if (skip) return;
6626     }
6627     for (auto intercept : layer_data->object_dispatch) {
6628         auto lock = intercept->write_lock();
6629         intercept->PreCallRecordDebugReportMessageEXT(instance, flags, objectType, object, location, messageCode, pLayerPrefix, pMessage);
6630     }
6631     DispatchDebugReportMessageEXT(instance, flags, objectType, object, location, messageCode, pLayerPrefix, pMessage);
6632     for (auto intercept : layer_data->object_dispatch) {
6633         auto lock = intercept->write_lock();
6634         intercept->PostCallRecordDebugReportMessageEXT(instance, flags, objectType, object, location, messageCode, pLayerPrefix, pMessage);
6635     }
6636 }
6637 
6638 
6639 
6640 
6641 
6642 
6643 
6644 
DebugMarkerSetObjectTagEXT(VkDevice device,const VkDebugMarkerObjectTagInfoEXT * pTagInfo)6645 VKAPI_ATTR VkResult VKAPI_CALL DebugMarkerSetObjectTagEXT(
6646     VkDevice                                    device,
6647     const VkDebugMarkerObjectTagInfoEXT*        pTagInfo) {
6648     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
6649     bool skip = false;
6650     for (auto intercept : layer_data->object_dispatch) {
6651         auto lock = intercept->write_lock();
6652         skip |= intercept->PreCallValidateDebugMarkerSetObjectTagEXT(device, pTagInfo);
6653         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
6654     }
6655     for (auto intercept : layer_data->object_dispatch) {
6656         auto lock = intercept->write_lock();
6657         intercept->PreCallRecordDebugMarkerSetObjectTagEXT(device, pTagInfo);
6658     }
6659     VkResult result = DispatchDebugMarkerSetObjectTagEXT(device, pTagInfo);
6660     for (auto intercept : layer_data->object_dispatch) {
6661         auto lock = intercept->write_lock();
6662         intercept->PostCallRecordDebugMarkerSetObjectTagEXT(device, pTagInfo, result);
6663     }
6664     return result;
6665 }
6666 
DebugMarkerSetObjectNameEXT(VkDevice device,const VkDebugMarkerObjectNameInfoEXT * pNameInfo)6667 VKAPI_ATTR VkResult VKAPI_CALL DebugMarkerSetObjectNameEXT(
6668     VkDevice                                    device,
6669     const VkDebugMarkerObjectNameInfoEXT*       pNameInfo) {
6670     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
6671     bool skip = false;
6672     for (auto intercept : layer_data->object_dispatch) {
6673         auto lock = intercept->write_lock();
6674         skip |= intercept->PreCallValidateDebugMarkerSetObjectNameEXT(device, pNameInfo);
6675         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
6676     }
6677     for (auto intercept : layer_data->object_dispatch) {
6678         auto lock = intercept->write_lock();
6679         intercept->PreCallRecordDebugMarkerSetObjectNameEXT(device, pNameInfo);
6680     }
6681     layer_data->report_data->DebugReportSetMarkerObjectName(pNameInfo);
6682     VkResult result = DispatchDebugMarkerSetObjectNameEXT(device, pNameInfo);
6683     for (auto intercept : layer_data->object_dispatch) {
6684         auto lock = intercept->write_lock();
6685         intercept->PostCallRecordDebugMarkerSetObjectNameEXT(device, pNameInfo, result);
6686     }
6687     return result;
6688 }
6689 
CmdDebugMarkerBeginEXT(VkCommandBuffer commandBuffer,const VkDebugMarkerMarkerInfoEXT * pMarkerInfo)6690 VKAPI_ATTR void VKAPI_CALL CmdDebugMarkerBeginEXT(
6691     VkCommandBuffer                             commandBuffer,
6692     const VkDebugMarkerMarkerInfoEXT*           pMarkerInfo) {
6693     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
6694     bool skip = false;
6695     for (auto intercept : layer_data->object_dispatch) {
6696         auto lock = intercept->write_lock();
6697         skip |= intercept->PreCallValidateCmdDebugMarkerBeginEXT(commandBuffer, pMarkerInfo);
6698         if (skip) return;
6699     }
6700     for (auto intercept : layer_data->object_dispatch) {
6701         auto lock = intercept->write_lock();
6702         intercept->PreCallRecordCmdDebugMarkerBeginEXT(commandBuffer, pMarkerInfo);
6703     }
6704     DispatchCmdDebugMarkerBeginEXT(commandBuffer, pMarkerInfo);
6705     for (auto intercept : layer_data->object_dispatch) {
6706         auto lock = intercept->write_lock();
6707         intercept->PostCallRecordCmdDebugMarkerBeginEXT(commandBuffer, pMarkerInfo);
6708     }
6709 }
6710 
CmdDebugMarkerEndEXT(VkCommandBuffer commandBuffer)6711 VKAPI_ATTR void VKAPI_CALL CmdDebugMarkerEndEXT(
6712     VkCommandBuffer                             commandBuffer) {
6713     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
6714     bool skip = false;
6715     for (auto intercept : layer_data->object_dispatch) {
6716         auto lock = intercept->write_lock();
6717         skip |= intercept->PreCallValidateCmdDebugMarkerEndEXT(commandBuffer);
6718         if (skip) return;
6719     }
6720     for (auto intercept : layer_data->object_dispatch) {
6721         auto lock = intercept->write_lock();
6722         intercept->PreCallRecordCmdDebugMarkerEndEXT(commandBuffer);
6723     }
6724     DispatchCmdDebugMarkerEndEXT(commandBuffer);
6725     for (auto intercept : layer_data->object_dispatch) {
6726         auto lock = intercept->write_lock();
6727         intercept->PostCallRecordCmdDebugMarkerEndEXT(commandBuffer);
6728     }
6729 }
6730 
CmdDebugMarkerInsertEXT(VkCommandBuffer commandBuffer,const VkDebugMarkerMarkerInfoEXT * pMarkerInfo)6731 VKAPI_ATTR void VKAPI_CALL CmdDebugMarkerInsertEXT(
6732     VkCommandBuffer                             commandBuffer,
6733     const VkDebugMarkerMarkerInfoEXT*           pMarkerInfo) {
6734     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
6735     bool skip = false;
6736     for (auto intercept : layer_data->object_dispatch) {
6737         auto lock = intercept->write_lock();
6738         skip |= intercept->PreCallValidateCmdDebugMarkerInsertEXT(commandBuffer, pMarkerInfo);
6739         if (skip) return;
6740     }
6741     for (auto intercept : layer_data->object_dispatch) {
6742         auto lock = intercept->write_lock();
6743         intercept->PreCallRecordCmdDebugMarkerInsertEXT(commandBuffer, pMarkerInfo);
6744     }
6745     DispatchCmdDebugMarkerInsertEXT(commandBuffer, pMarkerInfo);
6746     for (auto intercept : layer_data->object_dispatch) {
6747         auto lock = intercept->write_lock();
6748         intercept->PostCallRecordCmdDebugMarkerInsertEXT(commandBuffer, pMarkerInfo);
6749     }
6750 }
6751 
6752 
6753 
6754 
CmdBindTransformFeedbackBuffersEXT(VkCommandBuffer commandBuffer,uint32_t firstBinding,uint32_t bindingCount,const VkBuffer * pBuffers,const VkDeviceSize * pOffsets,const VkDeviceSize * pSizes)6755 VKAPI_ATTR void VKAPI_CALL CmdBindTransformFeedbackBuffersEXT(
6756     VkCommandBuffer                             commandBuffer,
6757     uint32_t                                    firstBinding,
6758     uint32_t                                    bindingCount,
6759     const VkBuffer*                             pBuffers,
6760     const VkDeviceSize*                         pOffsets,
6761     const VkDeviceSize*                         pSizes) {
6762     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
6763     bool skip = false;
6764     for (auto intercept : layer_data->object_dispatch) {
6765         auto lock = intercept->write_lock();
6766         skip |= intercept->PreCallValidateCmdBindTransformFeedbackBuffersEXT(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets, pSizes);
6767         if (skip) return;
6768     }
6769     for (auto intercept : layer_data->object_dispatch) {
6770         auto lock = intercept->write_lock();
6771         intercept->PreCallRecordCmdBindTransformFeedbackBuffersEXT(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets, pSizes);
6772     }
6773     DispatchCmdBindTransformFeedbackBuffersEXT(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets, pSizes);
6774     for (auto intercept : layer_data->object_dispatch) {
6775         auto lock = intercept->write_lock();
6776         intercept->PostCallRecordCmdBindTransformFeedbackBuffersEXT(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets, pSizes);
6777     }
6778 }
6779 
CmdBeginTransformFeedbackEXT(VkCommandBuffer commandBuffer,uint32_t firstCounterBuffer,uint32_t counterBufferCount,const VkBuffer * pCounterBuffers,const VkDeviceSize * pCounterBufferOffsets)6780 VKAPI_ATTR void VKAPI_CALL CmdBeginTransformFeedbackEXT(
6781     VkCommandBuffer                             commandBuffer,
6782     uint32_t                                    firstCounterBuffer,
6783     uint32_t                                    counterBufferCount,
6784     const VkBuffer*                             pCounterBuffers,
6785     const VkDeviceSize*                         pCounterBufferOffsets) {
6786     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
6787     bool skip = false;
6788     for (auto intercept : layer_data->object_dispatch) {
6789         auto lock = intercept->write_lock();
6790         skip |= intercept->PreCallValidateCmdBeginTransformFeedbackEXT(commandBuffer, firstCounterBuffer, counterBufferCount, pCounterBuffers, pCounterBufferOffsets);
6791         if (skip) return;
6792     }
6793     for (auto intercept : layer_data->object_dispatch) {
6794         auto lock = intercept->write_lock();
6795         intercept->PreCallRecordCmdBeginTransformFeedbackEXT(commandBuffer, firstCounterBuffer, counterBufferCount, pCounterBuffers, pCounterBufferOffsets);
6796     }
6797     DispatchCmdBeginTransformFeedbackEXT(commandBuffer, firstCounterBuffer, counterBufferCount, pCounterBuffers, pCounterBufferOffsets);
6798     for (auto intercept : layer_data->object_dispatch) {
6799         auto lock = intercept->write_lock();
6800         intercept->PostCallRecordCmdBeginTransformFeedbackEXT(commandBuffer, firstCounterBuffer, counterBufferCount, pCounterBuffers, pCounterBufferOffsets);
6801     }
6802 }
6803 
CmdEndTransformFeedbackEXT(VkCommandBuffer commandBuffer,uint32_t firstCounterBuffer,uint32_t counterBufferCount,const VkBuffer * pCounterBuffers,const VkDeviceSize * pCounterBufferOffsets)6804 VKAPI_ATTR void VKAPI_CALL CmdEndTransformFeedbackEXT(
6805     VkCommandBuffer                             commandBuffer,
6806     uint32_t                                    firstCounterBuffer,
6807     uint32_t                                    counterBufferCount,
6808     const VkBuffer*                             pCounterBuffers,
6809     const VkDeviceSize*                         pCounterBufferOffsets) {
6810     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
6811     bool skip = false;
6812     for (auto intercept : layer_data->object_dispatch) {
6813         auto lock = intercept->write_lock();
6814         skip |= intercept->PreCallValidateCmdEndTransformFeedbackEXT(commandBuffer, firstCounterBuffer, counterBufferCount, pCounterBuffers, pCounterBufferOffsets);
6815         if (skip) return;
6816     }
6817     for (auto intercept : layer_data->object_dispatch) {
6818         auto lock = intercept->write_lock();
6819         intercept->PreCallRecordCmdEndTransformFeedbackEXT(commandBuffer, firstCounterBuffer, counterBufferCount, pCounterBuffers, pCounterBufferOffsets);
6820     }
6821     DispatchCmdEndTransformFeedbackEXT(commandBuffer, firstCounterBuffer, counterBufferCount, pCounterBuffers, pCounterBufferOffsets);
6822     for (auto intercept : layer_data->object_dispatch) {
6823         auto lock = intercept->write_lock();
6824         intercept->PostCallRecordCmdEndTransformFeedbackEXT(commandBuffer, firstCounterBuffer, counterBufferCount, pCounterBuffers, pCounterBufferOffsets);
6825     }
6826 }
6827 
CmdBeginQueryIndexedEXT(VkCommandBuffer commandBuffer,VkQueryPool queryPool,uint32_t query,VkQueryControlFlags flags,uint32_t index)6828 VKAPI_ATTR void VKAPI_CALL CmdBeginQueryIndexedEXT(
6829     VkCommandBuffer                             commandBuffer,
6830     VkQueryPool                                 queryPool,
6831     uint32_t                                    query,
6832     VkQueryControlFlags                         flags,
6833     uint32_t                                    index) {
6834     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
6835     bool skip = false;
6836     for (auto intercept : layer_data->object_dispatch) {
6837         auto lock = intercept->write_lock();
6838         skip |= intercept->PreCallValidateCmdBeginQueryIndexedEXT(commandBuffer, queryPool, query, flags, index);
6839         if (skip) return;
6840     }
6841     for (auto intercept : layer_data->object_dispatch) {
6842         auto lock = intercept->write_lock();
6843         intercept->PreCallRecordCmdBeginQueryIndexedEXT(commandBuffer, queryPool, query, flags, index);
6844     }
6845     DispatchCmdBeginQueryIndexedEXT(commandBuffer, queryPool, query, flags, index);
6846     for (auto intercept : layer_data->object_dispatch) {
6847         auto lock = intercept->write_lock();
6848         intercept->PostCallRecordCmdBeginQueryIndexedEXT(commandBuffer, queryPool, query, flags, index);
6849     }
6850 }
6851 
CmdEndQueryIndexedEXT(VkCommandBuffer commandBuffer,VkQueryPool queryPool,uint32_t query,uint32_t index)6852 VKAPI_ATTR void VKAPI_CALL CmdEndQueryIndexedEXT(
6853     VkCommandBuffer                             commandBuffer,
6854     VkQueryPool                                 queryPool,
6855     uint32_t                                    query,
6856     uint32_t                                    index) {
6857     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
6858     bool skip = false;
6859     for (auto intercept : layer_data->object_dispatch) {
6860         auto lock = intercept->write_lock();
6861         skip |= intercept->PreCallValidateCmdEndQueryIndexedEXT(commandBuffer, queryPool, query, index);
6862         if (skip) return;
6863     }
6864     for (auto intercept : layer_data->object_dispatch) {
6865         auto lock = intercept->write_lock();
6866         intercept->PreCallRecordCmdEndQueryIndexedEXT(commandBuffer, queryPool, query, index);
6867     }
6868     DispatchCmdEndQueryIndexedEXT(commandBuffer, queryPool, query, index);
6869     for (auto intercept : layer_data->object_dispatch) {
6870         auto lock = intercept->write_lock();
6871         intercept->PostCallRecordCmdEndQueryIndexedEXT(commandBuffer, queryPool, query, index);
6872     }
6873 }
6874 
CmdDrawIndirectByteCountEXT(VkCommandBuffer commandBuffer,uint32_t instanceCount,uint32_t firstInstance,VkBuffer counterBuffer,VkDeviceSize counterBufferOffset,uint32_t counterOffset,uint32_t vertexStride)6875 VKAPI_ATTR void VKAPI_CALL CmdDrawIndirectByteCountEXT(
6876     VkCommandBuffer                             commandBuffer,
6877     uint32_t                                    instanceCount,
6878     uint32_t                                    firstInstance,
6879     VkBuffer                                    counterBuffer,
6880     VkDeviceSize                                counterBufferOffset,
6881     uint32_t                                    counterOffset,
6882     uint32_t                                    vertexStride) {
6883     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
6884     bool skip = false;
6885     for (auto intercept : layer_data->object_dispatch) {
6886         auto lock = intercept->write_lock();
6887         skip |= intercept->PreCallValidateCmdDrawIndirectByteCountEXT(commandBuffer, instanceCount, firstInstance, counterBuffer, counterBufferOffset, counterOffset, vertexStride);
6888         if (skip) return;
6889     }
6890     for (auto intercept : layer_data->object_dispatch) {
6891         auto lock = intercept->write_lock();
6892         intercept->PreCallRecordCmdDrawIndirectByteCountEXT(commandBuffer, instanceCount, firstInstance, counterBuffer, counterBufferOffset, counterOffset, vertexStride);
6893     }
6894     DispatchCmdDrawIndirectByteCountEXT(commandBuffer, instanceCount, firstInstance, counterBuffer, counterBufferOffset, counterOffset, vertexStride);
6895     for (auto intercept : layer_data->object_dispatch) {
6896         auto lock = intercept->write_lock();
6897         intercept->PostCallRecordCmdDrawIndirectByteCountEXT(commandBuffer, instanceCount, firstInstance, counterBuffer, counterBufferOffset, counterOffset, vertexStride);
6898     }
6899 }
6900 
6901 
GetImageViewHandleNVX(VkDevice device,const VkImageViewHandleInfoNVX * pInfo)6902 VKAPI_ATTR uint32_t VKAPI_CALL GetImageViewHandleNVX(
6903     VkDevice                                    device,
6904     const VkImageViewHandleInfoNVX*             pInfo) {
6905     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
6906     bool skip = false;
6907     for (auto intercept : layer_data->object_dispatch) {
6908         auto lock = intercept->write_lock();
6909         skip |= intercept->PreCallValidateGetImageViewHandleNVX(device, pInfo);
6910         if (skip) return 0;
6911     }
6912     for (auto intercept : layer_data->object_dispatch) {
6913         auto lock = intercept->write_lock();
6914         intercept->PreCallRecordGetImageViewHandleNVX(device, pInfo);
6915     }
6916     uint32_t result = DispatchGetImageViewHandleNVX(device, pInfo);
6917     for (auto intercept : layer_data->object_dispatch) {
6918         auto lock = intercept->write_lock();
6919         intercept->PostCallRecordGetImageViewHandleNVX(device, pInfo);
6920     }
6921     return result;
6922 }
6923 
6924 
CmdDrawIndirectCountAMD(VkCommandBuffer commandBuffer,VkBuffer buffer,VkDeviceSize offset,VkBuffer countBuffer,VkDeviceSize countBufferOffset,uint32_t maxDrawCount,uint32_t stride)6925 VKAPI_ATTR void VKAPI_CALL CmdDrawIndirectCountAMD(
6926     VkCommandBuffer                             commandBuffer,
6927     VkBuffer                                    buffer,
6928     VkDeviceSize                                offset,
6929     VkBuffer                                    countBuffer,
6930     VkDeviceSize                                countBufferOffset,
6931     uint32_t                                    maxDrawCount,
6932     uint32_t                                    stride) {
6933     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
6934     bool skip = false;
6935     for (auto intercept : layer_data->object_dispatch) {
6936         auto lock = intercept->write_lock();
6937         skip |= intercept->PreCallValidateCmdDrawIndirectCountAMD(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride);
6938         if (skip) return;
6939     }
6940     for (auto intercept : layer_data->object_dispatch) {
6941         auto lock = intercept->write_lock();
6942         intercept->PreCallRecordCmdDrawIndirectCountAMD(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride);
6943     }
6944     DispatchCmdDrawIndirectCountAMD(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride);
6945     for (auto intercept : layer_data->object_dispatch) {
6946         auto lock = intercept->write_lock();
6947         intercept->PostCallRecordCmdDrawIndirectCountAMD(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride);
6948     }
6949 }
6950 
CmdDrawIndexedIndirectCountAMD(VkCommandBuffer commandBuffer,VkBuffer buffer,VkDeviceSize offset,VkBuffer countBuffer,VkDeviceSize countBufferOffset,uint32_t maxDrawCount,uint32_t stride)6951 VKAPI_ATTR void VKAPI_CALL CmdDrawIndexedIndirectCountAMD(
6952     VkCommandBuffer                             commandBuffer,
6953     VkBuffer                                    buffer,
6954     VkDeviceSize                                offset,
6955     VkBuffer                                    countBuffer,
6956     VkDeviceSize                                countBufferOffset,
6957     uint32_t                                    maxDrawCount,
6958     uint32_t                                    stride) {
6959     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
6960     bool skip = false;
6961     for (auto intercept : layer_data->object_dispatch) {
6962         auto lock = intercept->write_lock();
6963         skip |= intercept->PreCallValidateCmdDrawIndexedIndirectCountAMD(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride);
6964         if (skip) return;
6965     }
6966     for (auto intercept : layer_data->object_dispatch) {
6967         auto lock = intercept->write_lock();
6968         intercept->PreCallRecordCmdDrawIndexedIndirectCountAMD(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride);
6969     }
6970     DispatchCmdDrawIndexedIndirectCountAMD(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride);
6971     for (auto intercept : layer_data->object_dispatch) {
6972         auto lock = intercept->write_lock();
6973         intercept->PostCallRecordCmdDrawIndexedIndirectCountAMD(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride);
6974     }
6975 }
6976 
6977 
6978 
6979 
6980 
6981 
GetShaderInfoAMD(VkDevice device,VkPipeline pipeline,VkShaderStageFlagBits shaderStage,VkShaderInfoTypeAMD infoType,size_t * pInfoSize,void * pInfo)6982 VKAPI_ATTR VkResult VKAPI_CALL GetShaderInfoAMD(
6983     VkDevice                                    device,
6984     VkPipeline                                  pipeline,
6985     VkShaderStageFlagBits                       shaderStage,
6986     VkShaderInfoTypeAMD                         infoType,
6987     size_t*                                     pInfoSize,
6988     void*                                       pInfo) {
6989     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
6990     bool skip = false;
6991     for (auto intercept : layer_data->object_dispatch) {
6992         auto lock = intercept->write_lock();
6993         skip |= intercept->PreCallValidateGetShaderInfoAMD(device, pipeline, shaderStage, infoType, pInfoSize, pInfo);
6994         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
6995     }
6996     for (auto intercept : layer_data->object_dispatch) {
6997         auto lock = intercept->write_lock();
6998         intercept->PreCallRecordGetShaderInfoAMD(device, pipeline, shaderStage, infoType, pInfoSize, pInfo);
6999     }
7000     VkResult result = DispatchGetShaderInfoAMD(device, pipeline, shaderStage, infoType, pInfoSize, pInfo);
7001     for (auto intercept : layer_data->object_dispatch) {
7002         auto lock = intercept->write_lock();
7003         intercept->PostCallRecordGetShaderInfoAMD(device, pipeline, shaderStage, infoType, pInfoSize, pInfo, result);
7004     }
7005     return result;
7006 }
7007 
7008 
7009 #ifdef VK_USE_PLATFORM_GGP
7010 
CreateStreamDescriptorSurfaceGGP(VkInstance instance,const VkStreamDescriptorSurfaceCreateInfoGGP * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkSurfaceKHR * pSurface)7011 VKAPI_ATTR VkResult VKAPI_CALL CreateStreamDescriptorSurfaceGGP(
7012     VkInstance                                  instance,
7013     const VkStreamDescriptorSurfaceCreateInfoGGP* pCreateInfo,
7014     const VkAllocationCallbacks*                pAllocator,
7015     VkSurfaceKHR*                               pSurface) {
7016     auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map);
7017     bool skip = false;
7018     for (auto intercept : layer_data->object_dispatch) {
7019         auto lock = intercept->write_lock();
7020         skip |= intercept->PreCallValidateCreateStreamDescriptorSurfaceGGP(instance, pCreateInfo, pAllocator, pSurface);
7021         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
7022     }
7023     for (auto intercept : layer_data->object_dispatch) {
7024         auto lock = intercept->write_lock();
7025         intercept->PreCallRecordCreateStreamDescriptorSurfaceGGP(instance, pCreateInfo, pAllocator, pSurface);
7026     }
7027     VkResult result = DispatchCreateStreamDescriptorSurfaceGGP(instance, pCreateInfo, pAllocator, pSurface);
7028     for (auto intercept : layer_data->object_dispatch) {
7029         auto lock = intercept->write_lock();
7030         intercept->PostCallRecordCreateStreamDescriptorSurfaceGGP(instance, pCreateInfo, pAllocator, pSurface, result);
7031     }
7032     return result;
7033 }
7034 #endif // VK_USE_PLATFORM_GGP
7035 
7036 
7037 
7038 
GetPhysicalDeviceExternalImageFormatPropertiesNV(VkPhysicalDevice physicalDevice,VkFormat format,VkImageType type,VkImageTiling tiling,VkImageUsageFlags usage,VkImageCreateFlags flags,VkExternalMemoryHandleTypeFlagsNV externalHandleType,VkExternalImageFormatPropertiesNV * pExternalImageFormatProperties)7039 VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceExternalImageFormatPropertiesNV(
7040     VkPhysicalDevice                            physicalDevice,
7041     VkFormat                                    format,
7042     VkImageType                                 type,
7043     VkImageTiling                               tiling,
7044     VkImageUsageFlags                           usage,
7045     VkImageCreateFlags                          flags,
7046     VkExternalMemoryHandleTypeFlagsNV           externalHandleType,
7047     VkExternalImageFormatPropertiesNV*          pExternalImageFormatProperties) {
7048     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
7049     bool skip = false;
7050     for (auto intercept : layer_data->object_dispatch) {
7051         auto lock = intercept->write_lock();
7052         skip |= intercept->PreCallValidateGetPhysicalDeviceExternalImageFormatPropertiesNV(physicalDevice, format, type, tiling, usage, flags, externalHandleType, pExternalImageFormatProperties);
7053         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
7054     }
7055     for (auto intercept : layer_data->object_dispatch) {
7056         auto lock = intercept->write_lock();
7057         intercept->PreCallRecordGetPhysicalDeviceExternalImageFormatPropertiesNV(physicalDevice, format, type, tiling, usage, flags, externalHandleType, pExternalImageFormatProperties);
7058     }
7059     VkResult result = DispatchGetPhysicalDeviceExternalImageFormatPropertiesNV(physicalDevice, format, type, tiling, usage, flags, externalHandleType, pExternalImageFormatProperties);
7060     for (auto intercept : layer_data->object_dispatch) {
7061         auto lock = intercept->write_lock();
7062         intercept->PostCallRecordGetPhysicalDeviceExternalImageFormatPropertiesNV(physicalDevice, format, type, tiling, usage, flags, externalHandleType, pExternalImageFormatProperties, result);
7063     }
7064     return result;
7065 }
7066 
7067 
7068 #ifdef VK_USE_PLATFORM_WIN32_KHR
7069 
GetMemoryWin32HandleNV(VkDevice device,VkDeviceMemory memory,VkExternalMemoryHandleTypeFlagsNV handleType,HANDLE * pHandle)7070 VKAPI_ATTR VkResult VKAPI_CALL GetMemoryWin32HandleNV(
7071     VkDevice                                    device,
7072     VkDeviceMemory                              memory,
7073     VkExternalMemoryHandleTypeFlagsNV           handleType,
7074     HANDLE*                                     pHandle) {
7075     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
7076     bool skip = false;
7077     for (auto intercept : layer_data->object_dispatch) {
7078         auto lock = intercept->write_lock();
7079         skip |= intercept->PreCallValidateGetMemoryWin32HandleNV(device, memory, handleType, pHandle);
7080         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
7081     }
7082     for (auto intercept : layer_data->object_dispatch) {
7083         auto lock = intercept->write_lock();
7084         intercept->PreCallRecordGetMemoryWin32HandleNV(device, memory, handleType, pHandle);
7085     }
7086     VkResult result = DispatchGetMemoryWin32HandleNV(device, memory, handleType, pHandle);
7087     for (auto intercept : layer_data->object_dispatch) {
7088         auto lock = intercept->write_lock();
7089         intercept->PostCallRecordGetMemoryWin32HandleNV(device, memory, handleType, pHandle, result);
7090     }
7091     return result;
7092 }
7093 #endif // VK_USE_PLATFORM_WIN32_KHR
7094 
7095 #ifdef VK_USE_PLATFORM_WIN32_KHR
7096 #endif // VK_USE_PLATFORM_WIN32_KHR
7097 
7098 
7099 #ifdef VK_USE_PLATFORM_VI_NN
7100 
CreateViSurfaceNN(VkInstance instance,const VkViSurfaceCreateInfoNN * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkSurfaceKHR * pSurface)7101 VKAPI_ATTR VkResult VKAPI_CALL CreateViSurfaceNN(
7102     VkInstance                                  instance,
7103     const VkViSurfaceCreateInfoNN*              pCreateInfo,
7104     const VkAllocationCallbacks*                pAllocator,
7105     VkSurfaceKHR*                               pSurface) {
7106     auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map);
7107     bool skip = false;
7108     for (auto intercept : layer_data->object_dispatch) {
7109         auto lock = intercept->write_lock();
7110         skip |= intercept->PreCallValidateCreateViSurfaceNN(instance, pCreateInfo, pAllocator, pSurface);
7111         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
7112     }
7113     for (auto intercept : layer_data->object_dispatch) {
7114         auto lock = intercept->write_lock();
7115         intercept->PreCallRecordCreateViSurfaceNN(instance, pCreateInfo, pAllocator, pSurface);
7116     }
7117     VkResult result = DispatchCreateViSurfaceNN(instance, pCreateInfo, pAllocator, pSurface);
7118     for (auto intercept : layer_data->object_dispatch) {
7119         auto lock = intercept->write_lock();
7120         intercept->PostCallRecordCreateViSurfaceNN(instance, pCreateInfo, pAllocator, pSurface, result);
7121     }
7122     return result;
7123 }
7124 #endif // VK_USE_PLATFORM_VI_NN
7125 
7126 
7127 
7128 
7129 
7130 
CmdBeginConditionalRenderingEXT(VkCommandBuffer commandBuffer,const VkConditionalRenderingBeginInfoEXT * pConditionalRenderingBegin)7131 VKAPI_ATTR void VKAPI_CALL CmdBeginConditionalRenderingEXT(
7132     VkCommandBuffer                             commandBuffer,
7133     const VkConditionalRenderingBeginInfoEXT*   pConditionalRenderingBegin) {
7134     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
7135     bool skip = false;
7136     for (auto intercept : layer_data->object_dispatch) {
7137         auto lock = intercept->write_lock();
7138         skip |= intercept->PreCallValidateCmdBeginConditionalRenderingEXT(commandBuffer, pConditionalRenderingBegin);
7139         if (skip) return;
7140     }
7141     for (auto intercept : layer_data->object_dispatch) {
7142         auto lock = intercept->write_lock();
7143         intercept->PreCallRecordCmdBeginConditionalRenderingEXT(commandBuffer, pConditionalRenderingBegin);
7144     }
7145     DispatchCmdBeginConditionalRenderingEXT(commandBuffer, pConditionalRenderingBegin);
7146     for (auto intercept : layer_data->object_dispatch) {
7147         auto lock = intercept->write_lock();
7148         intercept->PostCallRecordCmdBeginConditionalRenderingEXT(commandBuffer, pConditionalRenderingBegin);
7149     }
7150 }
7151 
CmdEndConditionalRenderingEXT(VkCommandBuffer commandBuffer)7152 VKAPI_ATTR void VKAPI_CALL CmdEndConditionalRenderingEXT(
7153     VkCommandBuffer                             commandBuffer) {
7154     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
7155     bool skip = false;
7156     for (auto intercept : layer_data->object_dispatch) {
7157         auto lock = intercept->write_lock();
7158         skip |= intercept->PreCallValidateCmdEndConditionalRenderingEXT(commandBuffer);
7159         if (skip) return;
7160     }
7161     for (auto intercept : layer_data->object_dispatch) {
7162         auto lock = intercept->write_lock();
7163         intercept->PreCallRecordCmdEndConditionalRenderingEXT(commandBuffer);
7164     }
7165     DispatchCmdEndConditionalRenderingEXT(commandBuffer);
7166     for (auto intercept : layer_data->object_dispatch) {
7167         auto lock = intercept->write_lock();
7168         intercept->PostCallRecordCmdEndConditionalRenderingEXT(commandBuffer);
7169     }
7170 }
7171 
7172 
CmdProcessCommandsNVX(VkCommandBuffer commandBuffer,const VkCmdProcessCommandsInfoNVX * pProcessCommandsInfo)7173 VKAPI_ATTR void VKAPI_CALL CmdProcessCommandsNVX(
7174     VkCommandBuffer                             commandBuffer,
7175     const VkCmdProcessCommandsInfoNVX*          pProcessCommandsInfo) {
7176     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
7177     bool skip = false;
7178     for (auto intercept : layer_data->object_dispatch) {
7179         auto lock = intercept->write_lock();
7180         skip |= intercept->PreCallValidateCmdProcessCommandsNVX(commandBuffer, pProcessCommandsInfo);
7181         if (skip) return;
7182     }
7183     for (auto intercept : layer_data->object_dispatch) {
7184         auto lock = intercept->write_lock();
7185         intercept->PreCallRecordCmdProcessCommandsNVX(commandBuffer, pProcessCommandsInfo);
7186     }
7187     DispatchCmdProcessCommandsNVX(commandBuffer, pProcessCommandsInfo);
7188     for (auto intercept : layer_data->object_dispatch) {
7189         auto lock = intercept->write_lock();
7190         intercept->PostCallRecordCmdProcessCommandsNVX(commandBuffer, pProcessCommandsInfo);
7191     }
7192 }
7193 
CmdReserveSpaceForCommandsNVX(VkCommandBuffer commandBuffer,const VkCmdReserveSpaceForCommandsInfoNVX * pReserveSpaceInfo)7194 VKAPI_ATTR void VKAPI_CALL CmdReserveSpaceForCommandsNVX(
7195     VkCommandBuffer                             commandBuffer,
7196     const VkCmdReserveSpaceForCommandsInfoNVX*  pReserveSpaceInfo) {
7197     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
7198     bool skip = false;
7199     for (auto intercept : layer_data->object_dispatch) {
7200         auto lock = intercept->write_lock();
7201         skip |= intercept->PreCallValidateCmdReserveSpaceForCommandsNVX(commandBuffer, pReserveSpaceInfo);
7202         if (skip) return;
7203     }
7204     for (auto intercept : layer_data->object_dispatch) {
7205         auto lock = intercept->write_lock();
7206         intercept->PreCallRecordCmdReserveSpaceForCommandsNVX(commandBuffer, pReserveSpaceInfo);
7207     }
7208     DispatchCmdReserveSpaceForCommandsNVX(commandBuffer, pReserveSpaceInfo);
7209     for (auto intercept : layer_data->object_dispatch) {
7210         auto lock = intercept->write_lock();
7211         intercept->PostCallRecordCmdReserveSpaceForCommandsNVX(commandBuffer, pReserveSpaceInfo);
7212     }
7213 }
7214 
CreateIndirectCommandsLayoutNVX(VkDevice device,const VkIndirectCommandsLayoutCreateInfoNVX * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkIndirectCommandsLayoutNVX * pIndirectCommandsLayout)7215 VKAPI_ATTR VkResult VKAPI_CALL CreateIndirectCommandsLayoutNVX(
7216     VkDevice                                    device,
7217     const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo,
7218     const VkAllocationCallbacks*                pAllocator,
7219     VkIndirectCommandsLayoutNVX*                pIndirectCommandsLayout) {
7220     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
7221     bool skip = false;
7222     for (auto intercept : layer_data->object_dispatch) {
7223         auto lock = intercept->write_lock();
7224         skip |= intercept->PreCallValidateCreateIndirectCommandsLayoutNVX(device, pCreateInfo, pAllocator, pIndirectCommandsLayout);
7225         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
7226     }
7227     for (auto intercept : layer_data->object_dispatch) {
7228         auto lock = intercept->write_lock();
7229         intercept->PreCallRecordCreateIndirectCommandsLayoutNVX(device, pCreateInfo, pAllocator, pIndirectCommandsLayout);
7230     }
7231     VkResult result = DispatchCreateIndirectCommandsLayoutNVX(device, pCreateInfo, pAllocator, pIndirectCommandsLayout);
7232     for (auto intercept : layer_data->object_dispatch) {
7233         auto lock = intercept->write_lock();
7234         intercept->PostCallRecordCreateIndirectCommandsLayoutNVX(device, pCreateInfo, pAllocator, pIndirectCommandsLayout, result);
7235     }
7236     return result;
7237 }
7238 
DestroyIndirectCommandsLayoutNVX(VkDevice device,VkIndirectCommandsLayoutNVX indirectCommandsLayout,const VkAllocationCallbacks * pAllocator)7239 VKAPI_ATTR void VKAPI_CALL DestroyIndirectCommandsLayoutNVX(
7240     VkDevice                                    device,
7241     VkIndirectCommandsLayoutNVX                 indirectCommandsLayout,
7242     const VkAllocationCallbacks*                pAllocator) {
7243     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
7244     bool skip = false;
7245     for (auto intercept : layer_data->object_dispatch) {
7246         auto lock = intercept->write_lock();
7247         skip |= intercept->PreCallValidateDestroyIndirectCommandsLayoutNVX(device, indirectCommandsLayout, pAllocator);
7248         if (skip) return;
7249     }
7250     for (auto intercept : layer_data->object_dispatch) {
7251         auto lock = intercept->write_lock();
7252         intercept->PreCallRecordDestroyIndirectCommandsLayoutNVX(device, indirectCommandsLayout, pAllocator);
7253     }
7254     DispatchDestroyIndirectCommandsLayoutNVX(device, indirectCommandsLayout, pAllocator);
7255     for (auto intercept : layer_data->object_dispatch) {
7256         auto lock = intercept->write_lock();
7257         intercept->PostCallRecordDestroyIndirectCommandsLayoutNVX(device, indirectCommandsLayout, pAllocator);
7258     }
7259 }
7260 
CreateObjectTableNVX(VkDevice device,const VkObjectTableCreateInfoNVX * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkObjectTableNVX * pObjectTable)7261 VKAPI_ATTR VkResult VKAPI_CALL CreateObjectTableNVX(
7262     VkDevice                                    device,
7263     const VkObjectTableCreateInfoNVX*           pCreateInfo,
7264     const VkAllocationCallbacks*                pAllocator,
7265     VkObjectTableNVX*                           pObjectTable) {
7266     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
7267     bool skip = false;
7268     for (auto intercept : layer_data->object_dispatch) {
7269         auto lock = intercept->write_lock();
7270         skip |= intercept->PreCallValidateCreateObjectTableNVX(device, pCreateInfo, pAllocator, pObjectTable);
7271         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
7272     }
7273     for (auto intercept : layer_data->object_dispatch) {
7274         auto lock = intercept->write_lock();
7275         intercept->PreCallRecordCreateObjectTableNVX(device, pCreateInfo, pAllocator, pObjectTable);
7276     }
7277     VkResult result = DispatchCreateObjectTableNVX(device, pCreateInfo, pAllocator, pObjectTable);
7278     for (auto intercept : layer_data->object_dispatch) {
7279         auto lock = intercept->write_lock();
7280         intercept->PostCallRecordCreateObjectTableNVX(device, pCreateInfo, pAllocator, pObjectTable, result);
7281     }
7282     return result;
7283 }
7284 
DestroyObjectTableNVX(VkDevice device,VkObjectTableNVX objectTable,const VkAllocationCallbacks * pAllocator)7285 VKAPI_ATTR void VKAPI_CALL DestroyObjectTableNVX(
7286     VkDevice                                    device,
7287     VkObjectTableNVX                            objectTable,
7288     const VkAllocationCallbacks*                pAllocator) {
7289     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
7290     bool skip = false;
7291     for (auto intercept : layer_data->object_dispatch) {
7292         auto lock = intercept->write_lock();
7293         skip |= intercept->PreCallValidateDestroyObjectTableNVX(device, objectTable, pAllocator);
7294         if (skip) return;
7295     }
7296     for (auto intercept : layer_data->object_dispatch) {
7297         auto lock = intercept->write_lock();
7298         intercept->PreCallRecordDestroyObjectTableNVX(device, objectTable, pAllocator);
7299     }
7300     DispatchDestroyObjectTableNVX(device, objectTable, pAllocator);
7301     for (auto intercept : layer_data->object_dispatch) {
7302         auto lock = intercept->write_lock();
7303         intercept->PostCallRecordDestroyObjectTableNVX(device, objectTable, pAllocator);
7304     }
7305 }
7306 
RegisterObjectsNVX(VkDevice device,VkObjectTableNVX objectTable,uint32_t objectCount,const VkObjectTableEntryNVX * const * ppObjectTableEntries,const uint32_t * pObjectIndices)7307 VKAPI_ATTR VkResult VKAPI_CALL RegisterObjectsNVX(
7308     VkDevice                                    device,
7309     VkObjectTableNVX                            objectTable,
7310     uint32_t                                    objectCount,
7311     const VkObjectTableEntryNVX* const*         ppObjectTableEntries,
7312     const uint32_t*                             pObjectIndices) {
7313     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
7314     bool skip = false;
7315     for (auto intercept : layer_data->object_dispatch) {
7316         auto lock = intercept->write_lock();
7317         skip |= intercept->PreCallValidateRegisterObjectsNVX(device, objectTable, objectCount, ppObjectTableEntries, pObjectIndices);
7318         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
7319     }
7320     for (auto intercept : layer_data->object_dispatch) {
7321         auto lock = intercept->write_lock();
7322         intercept->PreCallRecordRegisterObjectsNVX(device, objectTable, objectCount, ppObjectTableEntries, pObjectIndices);
7323     }
7324     VkResult result = DispatchRegisterObjectsNVX(device, objectTable, objectCount, ppObjectTableEntries, pObjectIndices);
7325     for (auto intercept : layer_data->object_dispatch) {
7326         auto lock = intercept->write_lock();
7327         intercept->PostCallRecordRegisterObjectsNVX(device, objectTable, objectCount, ppObjectTableEntries, pObjectIndices, result);
7328     }
7329     return result;
7330 }
7331 
UnregisterObjectsNVX(VkDevice device,VkObjectTableNVX objectTable,uint32_t objectCount,const VkObjectEntryTypeNVX * pObjectEntryTypes,const uint32_t * pObjectIndices)7332 VKAPI_ATTR VkResult VKAPI_CALL UnregisterObjectsNVX(
7333     VkDevice                                    device,
7334     VkObjectTableNVX                            objectTable,
7335     uint32_t                                    objectCount,
7336     const VkObjectEntryTypeNVX*                 pObjectEntryTypes,
7337     const uint32_t*                             pObjectIndices) {
7338     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
7339     bool skip = false;
7340     for (auto intercept : layer_data->object_dispatch) {
7341         auto lock = intercept->write_lock();
7342         skip |= intercept->PreCallValidateUnregisterObjectsNVX(device, objectTable, objectCount, pObjectEntryTypes, pObjectIndices);
7343         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
7344     }
7345     for (auto intercept : layer_data->object_dispatch) {
7346         auto lock = intercept->write_lock();
7347         intercept->PreCallRecordUnregisterObjectsNVX(device, objectTable, objectCount, pObjectEntryTypes, pObjectIndices);
7348     }
7349     VkResult result = DispatchUnregisterObjectsNVX(device, objectTable, objectCount, pObjectEntryTypes, pObjectIndices);
7350     for (auto intercept : layer_data->object_dispatch) {
7351         auto lock = intercept->write_lock();
7352         intercept->PostCallRecordUnregisterObjectsNVX(device, objectTable, objectCount, pObjectEntryTypes, pObjectIndices, result);
7353     }
7354     return result;
7355 }
7356 
GetPhysicalDeviceGeneratedCommandsPropertiesNVX(VkPhysicalDevice physicalDevice,VkDeviceGeneratedCommandsFeaturesNVX * pFeatures,VkDeviceGeneratedCommandsLimitsNVX * pLimits)7357 VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceGeneratedCommandsPropertiesNVX(
7358     VkPhysicalDevice                            physicalDevice,
7359     VkDeviceGeneratedCommandsFeaturesNVX*       pFeatures,
7360     VkDeviceGeneratedCommandsLimitsNVX*         pLimits) {
7361     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
7362     bool skip = false;
7363     for (auto intercept : layer_data->object_dispatch) {
7364         auto lock = intercept->write_lock();
7365         skip |= intercept->PreCallValidateGetPhysicalDeviceGeneratedCommandsPropertiesNVX(physicalDevice, pFeatures, pLimits);
7366         if (skip) return;
7367     }
7368     for (auto intercept : layer_data->object_dispatch) {
7369         auto lock = intercept->write_lock();
7370         intercept->PreCallRecordGetPhysicalDeviceGeneratedCommandsPropertiesNVX(physicalDevice, pFeatures, pLimits);
7371     }
7372     DispatchGetPhysicalDeviceGeneratedCommandsPropertiesNVX(physicalDevice, pFeatures, pLimits);
7373     for (auto intercept : layer_data->object_dispatch) {
7374         auto lock = intercept->write_lock();
7375         intercept->PostCallRecordGetPhysicalDeviceGeneratedCommandsPropertiesNVX(physicalDevice, pFeatures, pLimits);
7376     }
7377 }
7378 
7379 
CmdSetViewportWScalingNV(VkCommandBuffer commandBuffer,uint32_t firstViewport,uint32_t viewportCount,const VkViewportWScalingNV * pViewportWScalings)7380 VKAPI_ATTR void VKAPI_CALL CmdSetViewportWScalingNV(
7381     VkCommandBuffer                             commandBuffer,
7382     uint32_t                                    firstViewport,
7383     uint32_t                                    viewportCount,
7384     const VkViewportWScalingNV*                 pViewportWScalings) {
7385     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
7386     bool skip = false;
7387     for (auto intercept : layer_data->object_dispatch) {
7388         auto lock = intercept->write_lock();
7389         skip |= intercept->PreCallValidateCmdSetViewportWScalingNV(commandBuffer, firstViewport, viewportCount, pViewportWScalings);
7390         if (skip) return;
7391     }
7392     for (auto intercept : layer_data->object_dispatch) {
7393         auto lock = intercept->write_lock();
7394         intercept->PreCallRecordCmdSetViewportWScalingNV(commandBuffer, firstViewport, viewportCount, pViewportWScalings);
7395     }
7396     DispatchCmdSetViewportWScalingNV(commandBuffer, firstViewport, viewportCount, pViewportWScalings);
7397     for (auto intercept : layer_data->object_dispatch) {
7398         auto lock = intercept->write_lock();
7399         intercept->PostCallRecordCmdSetViewportWScalingNV(commandBuffer, firstViewport, viewportCount, pViewportWScalings);
7400     }
7401 }
7402 
7403 
ReleaseDisplayEXT(VkPhysicalDevice physicalDevice,VkDisplayKHR display)7404 VKAPI_ATTR VkResult VKAPI_CALL ReleaseDisplayEXT(
7405     VkPhysicalDevice                            physicalDevice,
7406     VkDisplayKHR                                display) {
7407     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
7408     bool skip = false;
7409     for (auto intercept : layer_data->object_dispatch) {
7410         auto lock = intercept->write_lock();
7411         skip |= intercept->PreCallValidateReleaseDisplayEXT(physicalDevice, display);
7412         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
7413     }
7414     for (auto intercept : layer_data->object_dispatch) {
7415         auto lock = intercept->write_lock();
7416         intercept->PreCallRecordReleaseDisplayEXT(physicalDevice, display);
7417     }
7418     VkResult result = DispatchReleaseDisplayEXT(physicalDevice, display);
7419     for (auto intercept : layer_data->object_dispatch) {
7420         auto lock = intercept->write_lock();
7421         intercept->PostCallRecordReleaseDisplayEXT(physicalDevice, display, result);
7422     }
7423     return result;
7424 }
7425 
7426 #ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT
7427 
AcquireXlibDisplayEXT(VkPhysicalDevice physicalDevice,Display * dpy,VkDisplayKHR display)7428 VKAPI_ATTR VkResult VKAPI_CALL AcquireXlibDisplayEXT(
7429     VkPhysicalDevice                            physicalDevice,
7430     Display*                                    dpy,
7431     VkDisplayKHR                                display) {
7432     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
7433     bool skip = false;
7434     for (auto intercept : layer_data->object_dispatch) {
7435         auto lock = intercept->write_lock();
7436         skip |= intercept->PreCallValidateAcquireXlibDisplayEXT(physicalDevice, dpy, display);
7437         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
7438     }
7439     for (auto intercept : layer_data->object_dispatch) {
7440         auto lock = intercept->write_lock();
7441         intercept->PreCallRecordAcquireXlibDisplayEXT(physicalDevice, dpy, display);
7442     }
7443     VkResult result = DispatchAcquireXlibDisplayEXT(physicalDevice, dpy, display);
7444     for (auto intercept : layer_data->object_dispatch) {
7445         auto lock = intercept->write_lock();
7446         intercept->PostCallRecordAcquireXlibDisplayEXT(physicalDevice, dpy, display, result);
7447     }
7448     return result;
7449 }
7450 
GetRandROutputDisplayEXT(VkPhysicalDevice physicalDevice,Display * dpy,RROutput rrOutput,VkDisplayKHR * pDisplay)7451 VKAPI_ATTR VkResult VKAPI_CALL GetRandROutputDisplayEXT(
7452     VkPhysicalDevice                            physicalDevice,
7453     Display*                                    dpy,
7454     RROutput                                    rrOutput,
7455     VkDisplayKHR*                               pDisplay) {
7456     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
7457     bool skip = false;
7458     for (auto intercept : layer_data->object_dispatch) {
7459         auto lock = intercept->write_lock();
7460         skip |= intercept->PreCallValidateGetRandROutputDisplayEXT(physicalDevice, dpy, rrOutput, pDisplay);
7461         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
7462     }
7463     for (auto intercept : layer_data->object_dispatch) {
7464         auto lock = intercept->write_lock();
7465         intercept->PreCallRecordGetRandROutputDisplayEXT(physicalDevice, dpy, rrOutput, pDisplay);
7466     }
7467     VkResult result = DispatchGetRandROutputDisplayEXT(physicalDevice, dpy, rrOutput, pDisplay);
7468     for (auto intercept : layer_data->object_dispatch) {
7469         auto lock = intercept->write_lock();
7470         intercept->PostCallRecordGetRandROutputDisplayEXT(physicalDevice, dpy, rrOutput, pDisplay, result);
7471     }
7472     return result;
7473 }
7474 #endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT
7475 
7476 
GetPhysicalDeviceSurfaceCapabilities2EXT(VkPhysicalDevice physicalDevice,VkSurfaceKHR surface,VkSurfaceCapabilities2EXT * pSurfaceCapabilities)7477 VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceCapabilities2EXT(
7478     VkPhysicalDevice                            physicalDevice,
7479     VkSurfaceKHR                                surface,
7480     VkSurfaceCapabilities2EXT*                  pSurfaceCapabilities) {
7481     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
7482     bool skip = false;
7483     for (auto intercept : layer_data->object_dispatch) {
7484         auto lock = intercept->write_lock();
7485         skip |= intercept->PreCallValidateGetPhysicalDeviceSurfaceCapabilities2EXT(physicalDevice, surface, pSurfaceCapabilities);
7486         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
7487     }
7488     for (auto intercept : layer_data->object_dispatch) {
7489         auto lock = intercept->write_lock();
7490         intercept->PreCallRecordGetPhysicalDeviceSurfaceCapabilities2EXT(physicalDevice, surface, pSurfaceCapabilities);
7491     }
7492     VkResult result = DispatchGetPhysicalDeviceSurfaceCapabilities2EXT(physicalDevice, surface, pSurfaceCapabilities);
7493     for (auto intercept : layer_data->object_dispatch) {
7494         auto lock = intercept->write_lock();
7495         intercept->PostCallRecordGetPhysicalDeviceSurfaceCapabilities2EXT(physicalDevice, surface, pSurfaceCapabilities, result);
7496     }
7497     return result;
7498 }
7499 
7500 
DisplayPowerControlEXT(VkDevice device,VkDisplayKHR display,const VkDisplayPowerInfoEXT * pDisplayPowerInfo)7501 VKAPI_ATTR VkResult VKAPI_CALL DisplayPowerControlEXT(
7502     VkDevice                                    device,
7503     VkDisplayKHR                                display,
7504     const VkDisplayPowerInfoEXT*                pDisplayPowerInfo) {
7505     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
7506     bool skip = false;
7507     for (auto intercept : layer_data->object_dispatch) {
7508         auto lock = intercept->write_lock();
7509         skip |= intercept->PreCallValidateDisplayPowerControlEXT(device, display, pDisplayPowerInfo);
7510         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
7511     }
7512     for (auto intercept : layer_data->object_dispatch) {
7513         auto lock = intercept->write_lock();
7514         intercept->PreCallRecordDisplayPowerControlEXT(device, display, pDisplayPowerInfo);
7515     }
7516     VkResult result = DispatchDisplayPowerControlEXT(device, display, pDisplayPowerInfo);
7517     for (auto intercept : layer_data->object_dispatch) {
7518         auto lock = intercept->write_lock();
7519         intercept->PostCallRecordDisplayPowerControlEXT(device, display, pDisplayPowerInfo, result);
7520     }
7521     return result;
7522 }
7523 
RegisterDeviceEventEXT(VkDevice device,const VkDeviceEventInfoEXT * pDeviceEventInfo,const VkAllocationCallbacks * pAllocator,VkFence * pFence)7524 VKAPI_ATTR VkResult VKAPI_CALL RegisterDeviceEventEXT(
7525     VkDevice                                    device,
7526     const VkDeviceEventInfoEXT*                 pDeviceEventInfo,
7527     const VkAllocationCallbacks*                pAllocator,
7528     VkFence*                                    pFence) {
7529     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
7530     bool skip = false;
7531     for (auto intercept : layer_data->object_dispatch) {
7532         auto lock = intercept->write_lock();
7533         skip |= intercept->PreCallValidateRegisterDeviceEventEXT(device, pDeviceEventInfo, pAllocator, pFence);
7534         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
7535     }
7536     for (auto intercept : layer_data->object_dispatch) {
7537         auto lock = intercept->write_lock();
7538         intercept->PreCallRecordRegisterDeviceEventEXT(device, pDeviceEventInfo, pAllocator, pFence);
7539     }
7540     VkResult result = DispatchRegisterDeviceEventEXT(device, pDeviceEventInfo, pAllocator, pFence);
7541     for (auto intercept : layer_data->object_dispatch) {
7542         auto lock = intercept->write_lock();
7543         intercept->PostCallRecordRegisterDeviceEventEXT(device, pDeviceEventInfo, pAllocator, pFence, result);
7544     }
7545     return result;
7546 }
7547 
RegisterDisplayEventEXT(VkDevice device,VkDisplayKHR display,const VkDisplayEventInfoEXT * pDisplayEventInfo,const VkAllocationCallbacks * pAllocator,VkFence * pFence)7548 VKAPI_ATTR VkResult VKAPI_CALL RegisterDisplayEventEXT(
7549     VkDevice                                    device,
7550     VkDisplayKHR                                display,
7551     const VkDisplayEventInfoEXT*                pDisplayEventInfo,
7552     const VkAllocationCallbacks*                pAllocator,
7553     VkFence*                                    pFence) {
7554     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
7555     bool skip = false;
7556     for (auto intercept : layer_data->object_dispatch) {
7557         auto lock = intercept->write_lock();
7558         skip |= intercept->PreCallValidateRegisterDisplayEventEXT(device, display, pDisplayEventInfo, pAllocator, pFence);
7559         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
7560     }
7561     for (auto intercept : layer_data->object_dispatch) {
7562         auto lock = intercept->write_lock();
7563         intercept->PreCallRecordRegisterDisplayEventEXT(device, display, pDisplayEventInfo, pAllocator, pFence);
7564     }
7565     VkResult result = DispatchRegisterDisplayEventEXT(device, display, pDisplayEventInfo, pAllocator, pFence);
7566     for (auto intercept : layer_data->object_dispatch) {
7567         auto lock = intercept->write_lock();
7568         intercept->PostCallRecordRegisterDisplayEventEXT(device, display, pDisplayEventInfo, pAllocator, pFence, result);
7569     }
7570     return result;
7571 }
7572 
GetSwapchainCounterEXT(VkDevice device,VkSwapchainKHR swapchain,VkSurfaceCounterFlagBitsEXT counter,uint64_t * pCounterValue)7573 VKAPI_ATTR VkResult VKAPI_CALL GetSwapchainCounterEXT(
7574     VkDevice                                    device,
7575     VkSwapchainKHR                              swapchain,
7576     VkSurfaceCounterFlagBitsEXT                 counter,
7577     uint64_t*                                   pCounterValue) {
7578     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
7579     bool skip = false;
7580     for (auto intercept : layer_data->object_dispatch) {
7581         auto lock = intercept->write_lock();
7582         skip |= intercept->PreCallValidateGetSwapchainCounterEXT(device, swapchain, counter, pCounterValue);
7583         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
7584     }
7585     for (auto intercept : layer_data->object_dispatch) {
7586         auto lock = intercept->write_lock();
7587         intercept->PreCallRecordGetSwapchainCounterEXT(device, swapchain, counter, pCounterValue);
7588     }
7589     VkResult result = DispatchGetSwapchainCounterEXT(device, swapchain, counter, pCounterValue);
7590     for (auto intercept : layer_data->object_dispatch) {
7591         auto lock = intercept->write_lock();
7592         intercept->PostCallRecordGetSwapchainCounterEXT(device, swapchain, counter, pCounterValue, result);
7593     }
7594     return result;
7595 }
7596 
7597 
GetRefreshCycleDurationGOOGLE(VkDevice device,VkSwapchainKHR swapchain,VkRefreshCycleDurationGOOGLE * pDisplayTimingProperties)7598 VKAPI_ATTR VkResult VKAPI_CALL GetRefreshCycleDurationGOOGLE(
7599     VkDevice                                    device,
7600     VkSwapchainKHR                              swapchain,
7601     VkRefreshCycleDurationGOOGLE*               pDisplayTimingProperties) {
7602     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
7603     bool skip = false;
7604     for (auto intercept : layer_data->object_dispatch) {
7605         auto lock = intercept->write_lock();
7606         skip |= intercept->PreCallValidateGetRefreshCycleDurationGOOGLE(device, swapchain, pDisplayTimingProperties);
7607         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
7608     }
7609     for (auto intercept : layer_data->object_dispatch) {
7610         auto lock = intercept->write_lock();
7611         intercept->PreCallRecordGetRefreshCycleDurationGOOGLE(device, swapchain, pDisplayTimingProperties);
7612     }
7613     VkResult result = DispatchGetRefreshCycleDurationGOOGLE(device, swapchain, pDisplayTimingProperties);
7614     for (auto intercept : layer_data->object_dispatch) {
7615         auto lock = intercept->write_lock();
7616         intercept->PostCallRecordGetRefreshCycleDurationGOOGLE(device, swapchain, pDisplayTimingProperties, result);
7617     }
7618     return result;
7619 }
7620 
GetPastPresentationTimingGOOGLE(VkDevice device,VkSwapchainKHR swapchain,uint32_t * pPresentationTimingCount,VkPastPresentationTimingGOOGLE * pPresentationTimings)7621 VKAPI_ATTR VkResult VKAPI_CALL GetPastPresentationTimingGOOGLE(
7622     VkDevice                                    device,
7623     VkSwapchainKHR                              swapchain,
7624     uint32_t*                                   pPresentationTimingCount,
7625     VkPastPresentationTimingGOOGLE*             pPresentationTimings) {
7626     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
7627     bool skip = false;
7628     for (auto intercept : layer_data->object_dispatch) {
7629         auto lock = intercept->write_lock();
7630         skip |= intercept->PreCallValidateGetPastPresentationTimingGOOGLE(device, swapchain, pPresentationTimingCount, pPresentationTimings);
7631         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
7632     }
7633     for (auto intercept : layer_data->object_dispatch) {
7634         auto lock = intercept->write_lock();
7635         intercept->PreCallRecordGetPastPresentationTimingGOOGLE(device, swapchain, pPresentationTimingCount, pPresentationTimings);
7636     }
7637     VkResult result = DispatchGetPastPresentationTimingGOOGLE(device, swapchain, pPresentationTimingCount, pPresentationTimings);
7638     for (auto intercept : layer_data->object_dispatch) {
7639         auto lock = intercept->write_lock();
7640         intercept->PostCallRecordGetPastPresentationTimingGOOGLE(device, swapchain, pPresentationTimingCount, pPresentationTimings, result);
7641     }
7642     return result;
7643 }
7644 
7645 
7646 
7647 
7648 
7649 
7650 
CmdSetDiscardRectangleEXT(VkCommandBuffer commandBuffer,uint32_t firstDiscardRectangle,uint32_t discardRectangleCount,const VkRect2D * pDiscardRectangles)7651 VKAPI_ATTR void VKAPI_CALL CmdSetDiscardRectangleEXT(
7652     VkCommandBuffer                             commandBuffer,
7653     uint32_t                                    firstDiscardRectangle,
7654     uint32_t                                    discardRectangleCount,
7655     const VkRect2D*                             pDiscardRectangles) {
7656     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
7657     bool skip = false;
7658     for (auto intercept : layer_data->object_dispatch) {
7659         auto lock = intercept->write_lock();
7660         skip |= intercept->PreCallValidateCmdSetDiscardRectangleEXT(commandBuffer, firstDiscardRectangle, discardRectangleCount, pDiscardRectangles);
7661         if (skip) return;
7662     }
7663     for (auto intercept : layer_data->object_dispatch) {
7664         auto lock = intercept->write_lock();
7665         intercept->PreCallRecordCmdSetDiscardRectangleEXT(commandBuffer, firstDiscardRectangle, discardRectangleCount, pDiscardRectangles);
7666     }
7667     DispatchCmdSetDiscardRectangleEXT(commandBuffer, firstDiscardRectangle, discardRectangleCount, pDiscardRectangles);
7668     for (auto intercept : layer_data->object_dispatch) {
7669         auto lock = intercept->write_lock();
7670         intercept->PostCallRecordCmdSetDiscardRectangleEXT(commandBuffer, firstDiscardRectangle, discardRectangleCount, pDiscardRectangles);
7671     }
7672 }
7673 
7674 
7675 
7676 
7677 
SetHdrMetadataEXT(VkDevice device,uint32_t swapchainCount,const VkSwapchainKHR * pSwapchains,const VkHdrMetadataEXT * pMetadata)7678 VKAPI_ATTR void VKAPI_CALL SetHdrMetadataEXT(
7679     VkDevice                                    device,
7680     uint32_t                                    swapchainCount,
7681     const VkSwapchainKHR*                       pSwapchains,
7682     const VkHdrMetadataEXT*                     pMetadata) {
7683     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
7684     bool skip = false;
7685     for (auto intercept : layer_data->object_dispatch) {
7686         auto lock = intercept->write_lock();
7687         skip |= intercept->PreCallValidateSetHdrMetadataEXT(device, swapchainCount, pSwapchains, pMetadata);
7688         if (skip) return;
7689     }
7690     for (auto intercept : layer_data->object_dispatch) {
7691         auto lock = intercept->write_lock();
7692         intercept->PreCallRecordSetHdrMetadataEXT(device, swapchainCount, pSwapchains, pMetadata);
7693     }
7694     DispatchSetHdrMetadataEXT(device, swapchainCount, pSwapchains, pMetadata);
7695     for (auto intercept : layer_data->object_dispatch) {
7696         auto lock = intercept->write_lock();
7697         intercept->PostCallRecordSetHdrMetadataEXT(device, swapchainCount, pSwapchains, pMetadata);
7698     }
7699 }
7700 
7701 #ifdef VK_USE_PLATFORM_IOS_MVK
7702 
CreateIOSSurfaceMVK(VkInstance instance,const VkIOSSurfaceCreateInfoMVK * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkSurfaceKHR * pSurface)7703 VKAPI_ATTR VkResult VKAPI_CALL CreateIOSSurfaceMVK(
7704     VkInstance                                  instance,
7705     const VkIOSSurfaceCreateInfoMVK*            pCreateInfo,
7706     const VkAllocationCallbacks*                pAllocator,
7707     VkSurfaceKHR*                               pSurface) {
7708     auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map);
7709     bool skip = false;
7710     for (auto intercept : layer_data->object_dispatch) {
7711         auto lock = intercept->write_lock();
7712         skip |= intercept->PreCallValidateCreateIOSSurfaceMVK(instance, pCreateInfo, pAllocator, pSurface);
7713         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
7714     }
7715     for (auto intercept : layer_data->object_dispatch) {
7716         auto lock = intercept->write_lock();
7717         intercept->PreCallRecordCreateIOSSurfaceMVK(instance, pCreateInfo, pAllocator, pSurface);
7718     }
7719     VkResult result = DispatchCreateIOSSurfaceMVK(instance, pCreateInfo, pAllocator, pSurface);
7720     for (auto intercept : layer_data->object_dispatch) {
7721         auto lock = intercept->write_lock();
7722         intercept->PostCallRecordCreateIOSSurfaceMVK(instance, pCreateInfo, pAllocator, pSurface, result);
7723     }
7724     return result;
7725 }
7726 #endif // VK_USE_PLATFORM_IOS_MVK
7727 
7728 #ifdef VK_USE_PLATFORM_MACOS_MVK
7729 
CreateMacOSSurfaceMVK(VkInstance instance,const VkMacOSSurfaceCreateInfoMVK * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkSurfaceKHR * pSurface)7730 VKAPI_ATTR VkResult VKAPI_CALL CreateMacOSSurfaceMVK(
7731     VkInstance                                  instance,
7732     const VkMacOSSurfaceCreateInfoMVK*          pCreateInfo,
7733     const VkAllocationCallbacks*                pAllocator,
7734     VkSurfaceKHR*                               pSurface) {
7735     auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map);
7736     bool skip = false;
7737     for (auto intercept : layer_data->object_dispatch) {
7738         auto lock = intercept->write_lock();
7739         skip |= intercept->PreCallValidateCreateMacOSSurfaceMVK(instance, pCreateInfo, pAllocator, pSurface);
7740         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
7741     }
7742     for (auto intercept : layer_data->object_dispatch) {
7743         auto lock = intercept->write_lock();
7744         intercept->PreCallRecordCreateMacOSSurfaceMVK(instance, pCreateInfo, pAllocator, pSurface);
7745     }
7746     VkResult result = DispatchCreateMacOSSurfaceMVK(instance, pCreateInfo, pAllocator, pSurface);
7747     for (auto intercept : layer_data->object_dispatch) {
7748         auto lock = intercept->write_lock();
7749         intercept->PostCallRecordCreateMacOSSurfaceMVK(instance, pCreateInfo, pAllocator, pSurface, result);
7750     }
7751     return result;
7752 }
7753 #endif // VK_USE_PLATFORM_MACOS_MVK
7754 
7755 
7756 
7757 
SetDebugUtilsObjectNameEXT(VkDevice device,const VkDebugUtilsObjectNameInfoEXT * pNameInfo)7758 VKAPI_ATTR VkResult VKAPI_CALL SetDebugUtilsObjectNameEXT(
7759     VkDevice                                    device,
7760     const VkDebugUtilsObjectNameInfoEXT*        pNameInfo) {
7761     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
7762     bool skip = false;
7763     for (auto intercept : layer_data->object_dispatch) {
7764         auto lock = intercept->write_lock();
7765         skip |= intercept->PreCallValidateSetDebugUtilsObjectNameEXT(device, pNameInfo);
7766         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
7767     }
7768     for (auto intercept : layer_data->object_dispatch) {
7769         auto lock = intercept->write_lock();
7770         intercept->PreCallRecordSetDebugUtilsObjectNameEXT(device, pNameInfo);
7771     }
7772     layer_data->report_data->DebugReportSetUtilsObjectName(pNameInfo);
7773     VkResult result = DispatchSetDebugUtilsObjectNameEXT(device, pNameInfo);
7774     for (auto intercept : layer_data->object_dispatch) {
7775         auto lock = intercept->write_lock();
7776         intercept->PostCallRecordSetDebugUtilsObjectNameEXT(device, pNameInfo, result);
7777     }
7778     return result;
7779 }
7780 
SetDebugUtilsObjectTagEXT(VkDevice device,const VkDebugUtilsObjectTagInfoEXT * pTagInfo)7781 VKAPI_ATTR VkResult VKAPI_CALL SetDebugUtilsObjectTagEXT(
7782     VkDevice                                    device,
7783     const VkDebugUtilsObjectTagInfoEXT*         pTagInfo) {
7784     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
7785     bool skip = false;
7786     for (auto intercept : layer_data->object_dispatch) {
7787         auto lock = intercept->write_lock();
7788         skip |= intercept->PreCallValidateSetDebugUtilsObjectTagEXT(device, pTagInfo);
7789         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
7790     }
7791     for (auto intercept : layer_data->object_dispatch) {
7792         auto lock = intercept->write_lock();
7793         intercept->PreCallRecordSetDebugUtilsObjectTagEXT(device, pTagInfo);
7794     }
7795     VkResult result = DispatchSetDebugUtilsObjectTagEXT(device, pTagInfo);
7796     for (auto intercept : layer_data->object_dispatch) {
7797         auto lock = intercept->write_lock();
7798         intercept->PostCallRecordSetDebugUtilsObjectTagEXT(device, pTagInfo, result);
7799     }
7800     return result;
7801 }
7802 
QueueBeginDebugUtilsLabelEXT(VkQueue queue,const VkDebugUtilsLabelEXT * pLabelInfo)7803 VKAPI_ATTR void VKAPI_CALL QueueBeginDebugUtilsLabelEXT(
7804     VkQueue                                     queue,
7805     const VkDebugUtilsLabelEXT*                 pLabelInfo) {
7806     auto layer_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map);
7807     bool skip = false;
7808     for (auto intercept : layer_data->object_dispatch) {
7809         auto lock = intercept->write_lock();
7810         skip |= intercept->PreCallValidateQueueBeginDebugUtilsLabelEXT(queue, pLabelInfo);
7811         if (skip) return;
7812     }
7813     for (auto intercept : layer_data->object_dispatch) {
7814         auto lock = intercept->write_lock();
7815         intercept->PreCallRecordQueueBeginDebugUtilsLabelEXT(queue, pLabelInfo);
7816     }
7817     BeginQueueDebugUtilsLabel(layer_data->report_data, queue, pLabelInfo);
7818     DispatchQueueBeginDebugUtilsLabelEXT(queue, pLabelInfo);
7819     for (auto intercept : layer_data->object_dispatch) {
7820         auto lock = intercept->write_lock();
7821         intercept->PostCallRecordQueueBeginDebugUtilsLabelEXT(queue, pLabelInfo);
7822     }
7823 }
7824 
QueueEndDebugUtilsLabelEXT(VkQueue queue)7825 VKAPI_ATTR void VKAPI_CALL QueueEndDebugUtilsLabelEXT(
7826     VkQueue                                     queue) {
7827     auto layer_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map);
7828     bool skip = false;
7829     for (auto intercept : layer_data->object_dispatch) {
7830         auto lock = intercept->write_lock();
7831         skip |= intercept->PreCallValidateQueueEndDebugUtilsLabelEXT(queue);
7832         if (skip) return;
7833     }
7834     for (auto intercept : layer_data->object_dispatch) {
7835         auto lock = intercept->write_lock();
7836         intercept->PreCallRecordQueueEndDebugUtilsLabelEXT(queue);
7837     }
7838     DispatchQueueEndDebugUtilsLabelEXT(queue);
7839     EndQueueDebugUtilsLabel(layer_data->report_data, queue);
7840     for (auto intercept : layer_data->object_dispatch) {
7841         auto lock = intercept->write_lock();
7842         intercept->PostCallRecordQueueEndDebugUtilsLabelEXT(queue);
7843     }
7844 }
7845 
QueueInsertDebugUtilsLabelEXT(VkQueue queue,const VkDebugUtilsLabelEXT * pLabelInfo)7846 VKAPI_ATTR void VKAPI_CALL QueueInsertDebugUtilsLabelEXT(
7847     VkQueue                                     queue,
7848     const VkDebugUtilsLabelEXT*                 pLabelInfo) {
7849     auto layer_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map);
7850     bool skip = false;
7851     for (auto intercept : layer_data->object_dispatch) {
7852         auto lock = intercept->write_lock();
7853         skip |= intercept->PreCallValidateQueueInsertDebugUtilsLabelEXT(queue, pLabelInfo);
7854         if (skip) return;
7855     }
7856     for (auto intercept : layer_data->object_dispatch) {
7857         auto lock = intercept->write_lock();
7858         intercept->PreCallRecordQueueInsertDebugUtilsLabelEXT(queue, pLabelInfo);
7859     }
7860     InsertQueueDebugUtilsLabel(layer_data->report_data, queue, pLabelInfo);
7861     DispatchQueueInsertDebugUtilsLabelEXT(queue, pLabelInfo);
7862     for (auto intercept : layer_data->object_dispatch) {
7863         auto lock = intercept->write_lock();
7864         intercept->PostCallRecordQueueInsertDebugUtilsLabelEXT(queue, pLabelInfo);
7865     }
7866 }
7867 
CmdBeginDebugUtilsLabelEXT(VkCommandBuffer commandBuffer,const VkDebugUtilsLabelEXT * pLabelInfo)7868 VKAPI_ATTR void VKAPI_CALL CmdBeginDebugUtilsLabelEXT(
7869     VkCommandBuffer                             commandBuffer,
7870     const VkDebugUtilsLabelEXT*                 pLabelInfo) {
7871     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
7872     bool skip = false;
7873     for (auto intercept : layer_data->object_dispatch) {
7874         auto lock = intercept->write_lock();
7875         skip |= intercept->PreCallValidateCmdBeginDebugUtilsLabelEXT(commandBuffer, pLabelInfo);
7876         if (skip) return;
7877     }
7878     for (auto intercept : layer_data->object_dispatch) {
7879         auto lock = intercept->write_lock();
7880         intercept->PreCallRecordCmdBeginDebugUtilsLabelEXT(commandBuffer, pLabelInfo);
7881     }
7882     DispatchCmdBeginDebugUtilsLabelEXT(commandBuffer, pLabelInfo);
7883     for (auto intercept : layer_data->object_dispatch) {
7884         auto lock = intercept->write_lock();
7885         intercept->PostCallRecordCmdBeginDebugUtilsLabelEXT(commandBuffer, pLabelInfo);
7886     }
7887 }
7888 
CmdEndDebugUtilsLabelEXT(VkCommandBuffer commandBuffer)7889 VKAPI_ATTR void VKAPI_CALL CmdEndDebugUtilsLabelEXT(
7890     VkCommandBuffer                             commandBuffer) {
7891     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
7892     bool skip = false;
7893     for (auto intercept : layer_data->object_dispatch) {
7894         auto lock = intercept->write_lock();
7895         skip |= intercept->PreCallValidateCmdEndDebugUtilsLabelEXT(commandBuffer);
7896         if (skip) return;
7897     }
7898     for (auto intercept : layer_data->object_dispatch) {
7899         auto lock = intercept->write_lock();
7900         intercept->PreCallRecordCmdEndDebugUtilsLabelEXT(commandBuffer);
7901     }
7902     DispatchCmdEndDebugUtilsLabelEXT(commandBuffer);
7903     for (auto intercept : layer_data->object_dispatch) {
7904         auto lock = intercept->write_lock();
7905         intercept->PostCallRecordCmdEndDebugUtilsLabelEXT(commandBuffer);
7906     }
7907 }
7908 
CmdInsertDebugUtilsLabelEXT(VkCommandBuffer commandBuffer,const VkDebugUtilsLabelEXT * pLabelInfo)7909 VKAPI_ATTR void VKAPI_CALL CmdInsertDebugUtilsLabelEXT(
7910     VkCommandBuffer                             commandBuffer,
7911     const VkDebugUtilsLabelEXT*                 pLabelInfo) {
7912     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
7913     bool skip = false;
7914     for (auto intercept : layer_data->object_dispatch) {
7915         auto lock = intercept->write_lock();
7916         skip |= intercept->PreCallValidateCmdInsertDebugUtilsLabelEXT(commandBuffer, pLabelInfo);
7917         if (skip) return;
7918     }
7919     for (auto intercept : layer_data->object_dispatch) {
7920         auto lock = intercept->write_lock();
7921         intercept->PreCallRecordCmdInsertDebugUtilsLabelEXT(commandBuffer, pLabelInfo);
7922     }
7923     DispatchCmdInsertDebugUtilsLabelEXT(commandBuffer, pLabelInfo);
7924     for (auto intercept : layer_data->object_dispatch) {
7925         auto lock = intercept->write_lock();
7926         intercept->PostCallRecordCmdInsertDebugUtilsLabelEXT(commandBuffer, pLabelInfo);
7927     }
7928 }
7929 
CreateDebugUtilsMessengerEXT(VkInstance instance,const VkDebugUtilsMessengerCreateInfoEXT * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkDebugUtilsMessengerEXT * pMessenger)7930 VKAPI_ATTR VkResult VKAPI_CALL CreateDebugUtilsMessengerEXT(
7931     VkInstance                                  instance,
7932     const VkDebugUtilsMessengerCreateInfoEXT*   pCreateInfo,
7933     const VkAllocationCallbacks*                pAllocator,
7934     VkDebugUtilsMessengerEXT*                   pMessenger) {
7935     auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map);
7936     bool skip = false;
7937     for (auto intercept : layer_data->object_dispatch) {
7938         auto lock = intercept->write_lock();
7939         skip |= intercept->PreCallValidateCreateDebugUtilsMessengerEXT(instance, pCreateInfo, pAllocator, pMessenger);
7940         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
7941     }
7942     for (auto intercept : layer_data->object_dispatch) {
7943         auto lock = intercept->write_lock();
7944         intercept->PreCallRecordCreateDebugUtilsMessengerEXT(instance, pCreateInfo, pAllocator, pMessenger);
7945     }
7946     VkResult result = DispatchCreateDebugUtilsMessengerEXT(instance, pCreateInfo, pAllocator, pMessenger);
7947     layer_create_messenger_callback(layer_data->report_data, false, pCreateInfo, pAllocator, pMessenger);
7948     for (auto intercept : layer_data->object_dispatch) {
7949         auto lock = intercept->write_lock();
7950         intercept->PostCallRecordCreateDebugUtilsMessengerEXT(instance, pCreateInfo, pAllocator, pMessenger, result);
7951     }
7952     return result;
7953 }
7954 
DestroyDebugUtilsMessengerEXT(VkInstance instance,VkDebugUtilsMessengerEXT messenger,const VkAllocationCallbacks * pAllocator)7955 VKAPI_ATTR void VKAPI_CALL DestroyDebugUtilsMessengerEXT(
7956     VkInstance                                  instance,
7957     VkDebugUtilsMessengerEXT                    messenger,
7958     const VkAllocationCallbacks*                pAllocator) {
7959     auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map);
7960     bool skip = false;
7961     for (auto intercept : layer_data->object_dispatch) {
7962         auto lock = intercept->write_lock();
7963         skip |= intercept->PreCallValidateDestroyDebugUtilsMessengerEXT(instance, messenger, pAllocator);
7964         if (skip) return;
7965     }
7966     for (auto intercept : layer_data->object_dispatch) {
7967         auto lock = intercept->write_lock();
7968         intercept->PreCallRecordDestroyDebugUtilsMessengerEXT(instance, messenger, pAllocator);
7969     }
7970     DispatchDestroyDebugUtilsMessengerEXT(instance, messenger, pAllocator);
7971     layer_destroy_messenger_callback(layer_data->report_data, messenger, pAllocator);
7972     for (auto intercept : layer_data->object_dispatch) {
7973         auto lock = intercept->write_lock();
7974         intercept->PostCallRecordDestroyDebugUtilsMessengerEXT(instance, messenger, pAllocator);
7975     }
7976 }
7977 
SubmitDebugUtilsMessageEXT(VkInstance instance,VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,VkDebugUtilsMessageTypeFlagsEXT messageTypes,const VkDebugUtilsMessengerCallbackDataEXT * pCallbackData)7978 VKAPI_ATTR void VKAPI_CALL SubmitDebugUtilsMessageEXT(
7979     VkInstance                                  instance,
7980     VkDebugUtilsMessageSeverityFlagBitsEXT      messageSeverity,
7981     VkDebugUtilsMessageTypeFlagsEXT             messageTypes,
7982     const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData) {
7983     auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map);
7984     bool skip = false;
7985     for (auto intercept : layer_data->object_dispatch) {
7986         auto lock = intercept->write_lock();
7987         skip |= intercept->PreCallValidateSubmitDebugUtilsMessageEXT(instance, messageSeverity, messageTypes, pCallbackData);
7988         if (skip) return;
7989     }
7990     for (auto intercept : layer_data->object_dispatch) {
7991         auto lock = intercept->write_lock();
7992         intercept->PreCallRecordSubmitDebugUtilsMessageEXT(instance, messageSeverity, messageTypes, pCallbackData);
7993     }
7994     DispatchSubmitDebugUtilsMessageEXT(instance, messageSeverity, messageTypes, pCallbackData);
7995     for (auto intercept : layer_data->object_dispatch) {
7996         auto lock = intercept->write_lock();
7997         intercept->PostCallRecordSubmitDebugUtilsMessageEXT(instance, messageSeverity, messageTypes, pCallbackData);
7998     }
7999 }
8000 
8001 #ifdef VK_USE_PLATFORM_ANDROID_KHR
8002 
GetAndroidHardwareBufferPropertiesANDROID(VkDevice device,const struct AHardwareBuffer * buffer,VkAndroidHardwareBufferPropertiesANDROID * pProperties)8003 VKAPI_ATTR VkResult VKAPI_CALL GetAndroidHardwareBufferPropertiesANDROID(
8004     VkDevice                                    device,
8005     const struct AHardwareBuffer*               buffer,
8006     VkAndroidHardwareBufferPropertiesANDROID*   pProperties) {
8007     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
8008     bool skip = false;
8009     for (auto intercept : layer_data->object_dispatch) {
8010         auto lock = intercept->write_lock();
8011         skip |= intercept->PreCallValidateGetAndroidHardwareBufferPropertiesANDROID(device, buffer, pProperties);
8012         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
8013     }
8014     for (auto intercept : layer_data->object_dispatch) {
8015         auto lock = intercept->write_lock();
8016         intercept->PreCallRecordGetAndroidHardwareBufferPropertiesANDROID(device, buffer, pProperties);
8017     }
8018     VkResult result = DispatchGetAndroidHardwareBufferPropertiesANDROID(device, buffer, pProperties);
8019     for (auto intercept : layer_data->object_dispatch) {
8020         auto lock = intercept->write_lock();
8021         intercept->PostCallRecordGetAndroidHardwareBufferPropertiesANDROID(device, buffer, pProperties, result);
8022     }
8023     return result;
8024 }
8025 
GetMemoryAndroidHardwareBufferANDROID(VkDevice device,const VkMemoryGetAndroidHardwareBufferInfoANDROID * pInfo,struct AHardwareBuffer ** pBuffer)8026 VKAPI_ATTR VkResult VKAPI_CALL GetMemoryAndroidHardwareBufferANDROID(
8027     VkDevice                                    device,
8028     const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo,
8029     struct AHardwareBuffer**                    pBuffer) {
8030     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
8031     bool skip = false;
8032     for (auto intercept : layer_data->object_dispatch) {
8033         auto lock = intercept->write_lock();
8034         skip |= intercept->PreCallValidateGetMemoryAndroidHardwareBufferANDROID(device, pInfo, pBuffer);
8035         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
8036     }
8037     for (auto intercept : layer_data->object_dispatch) {
8038         auto lock = intercept->write_lock();
8039         intercept->PreCallRecordGetMemoryAndroidHardwareBufferANDROID(device, pInfo, pBuffer);
8040     }
8041     VkResult result = DispatchGetMemoryAndroidHardwareBufferANDROID(device, pInfo, pBuffer);
8042     for (auto intercept : layer_data->object_dispatch) {
8043         auto lock = intercept->write_lock();
8044         intercept->PostCallRecordGetMemoryAndroidHardwareBufferANDROID(device, pInfo, pBuffer, result);
8045     }
8046     return result;
8047 }
8048 #endif // VK_USE_PLATFORM_ANDROID_KHR
8049 
8050 
8051 
8052 
8053 
8054 
8055 
8056 
CmdSetSampleLocationsEXT(VkCommandBuffer commandBuffer,const VkSampleLocationsInfoEXT * pSampleLocationsInfo)8057 VKAPI_ATTR void VKAPI_CALL CmdSetSampleLocationsEXT(
8058     VkCommandBuffer                             commandBuffer,
8059     const VkSampleLocationsInfoEXT*             pSampleLocationsInfo) {
8060     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
8061     bool skip = false;
8062     for (auto intercept : layer_data->object_dispatch) {
8063         auto lock = intercept->write_lock();
8064         skip |= intercept->PreCallValidateCmdSetSampleLocationsEXT(commandBuffer, pSampleLocationsInfo);
8065         if (skip) return;
8066     }
8067     for (auto intercept : layer_data->object_dispatch) {
8068         auto lock = intercept->write_lock();
8069         intercept->PreCallRecordCmdSetSampleLocationsEXT(commandBuffer, pSampleLocationsInfo);
8070     }
8071     DispatchCmdSetSampleLocationsEXT(commandBuffer, pSampleLocationsInfo);
8072     for (auto intercept : layer_data->object_dispatch) {
8073         auto lock = intercept->write_lock();
8074         intercept->PostCallRecordCmdSetSampleLocationsEXT(commandBuffer, pSampleLocationsInfo);
8075     }
8076 }
8077 
GetPhysicalDeviceMultisamplePropertiesEXT(VkPhysicalDevice physicalDevice,VkSampleCountFlagBits samples,VkMultisamplePropertiesEXT * pMultisampleProperties)8078 VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceMultisamplePropertiesEXT(
8079     VkPhysicalDevice                            physicalDevice,
8080     VkSampleCountFlagBits                       samples,
8081     VkMultisamplePropertiesEXT*                 pMultisampleProperties) {
8082     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
8083     bool skip = false;
8084     for (auto intercept : layer_data->object_dispatch) {
8085         auto lock = intercept->write_lock();
8086         skip |= intercept->PreCallValidateGetPhysicalDeviceMultisamplePropertiesEXT(physicalDevice, samples, pMultisampleProperties);
8087         if (skip) return;
8088     }
8089     for (auto intercept : layer_data->object_dispatch) {
8090         auto lock = intercept->write_lock();
8091         intercept->PreCallRecordGetPhysicalDeviceMultisamplePropertiesEXT(physicalDevice, samples, pMultisampleProperties);
8092     }
8093     DispatchGetPhysicalDeviceMultisamplePropertiesEXT(physicalDevice, samples, pMultisampleProperties);
8094     for (auto intercept : layer_data->object_dispatch) {
8095         auto lock = intercept->write_lock();
8096         intercept->PostCallRecordGetPhysicalDeviceMultisamplePropertiesEXT(physicalDevice, samples, pMultisampleProperties);
8097     }
8098 }
8099 
8100 
8101 
8102 
8103 
8104 
8105 
8106 
GetImageDrmFormatModifierPropertiesEXT(VkDevice device,VkImage image,VkImageDrmFormatModifierPropertiesEXT * pProperties)8107 VKAPI_ATTR VkResult VKAPI_CALL GetImageDrmFormatModifierPropertiesEXT(
8108     VkDevice                                    device,
8109     VkImage                                     image,
8110     VkImageDrmFormatModifierPropertiesEXT*      pProperties) {
8111     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
8112     bool skip = false;
8113     for (auto intercept : layer_data->object_dispatch) {
8114         auto lock = intercept->write_lock();
8115         skip |= intercept->PreCallValidateGetImageDrmFormatModifierPropertiesEXT(device, image, pProperties);
8116         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
8117     }
8118     for (auto intercept : layer_data->object_dispatch) {
8119         auto lock = intercept->write_lock();
8120         intercept->PreCallRecordGetImageDrmFormatModifierPropertiesEXT(device, image, pProperties);
8121     }
8122     VkResult result = DispatchGetImageDrmFormatModifierPropertiesEXT(device, image, pProperties);
8123     for (auto intercept : layer_data->object_dispatch) {
8124         auto lock = intercept->write_lock();
8125         intercept->PostCallRecordGetImageDrmFormatModifierPropertiesEXT(device, image, pProperties, result);
8126     }
8127     return result;
8128 }
8129 
8130 
8131 
8132 
8133 
CmdBindShadingRateImageNV(VkCommandBuffer commandBuffer,VkImageView imageView,VkImageLayout imageLayout)8134 VKAPI_ATTR void VKAPI_CALL CmdBindShadingRateImageNV(
8135     VkCommandBuffer                             commandBuffer,
8136     VkImageView                                 imageView,
8137     VkImageLayout                               imageLayout) {
8138     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
8139     bool skip = false;
8140     for (auto intercept : layer_data->object_dispatch) {
8141         auto lock = intercept->write_lock();
8142         skip |= intercept->PreCallValidateCmdBindShadingRateImageNV(commandBuffer, imageView, imageLayout);
8143         if (skip) return;
8144     }
8145     for (auto intercept : layer_data->object_dispatch) {
8146         auto lock = intercept->write_lock();
8147         intercept->PreCallRecordCmdBindShadingRateImageNV(commandBuffer, imageView, imageLayout);
8148     }
8149     DispatchCmdBindShadingRateImageNV(commandBuffer, imageView, imageLayout);
8150     for (auto intercept : layer_data->object_dispatch) {
8151         auto lock = intercept->write_lock();
8152         intercept->PostCallRecordCmdBindShadingRateImageNV(commandBuffer, imageView, imageLayout);
8153     }
8154 }
8155 
CmdSetViewportShadingRatePaletteNV(VkCommandBuffer commandBuffer,uint32_t firstViewport,uint32_t viewportCount,const VkShadingRatePaletteNV * pShadingRatePalettes)8156 VKAPI_ATTR void VKAPI_CALL CmdSetViewportShadingRatePaletteNV(
8157     VkCommandBuffer                             commandBuffer,
8158     uint32_t                                    firstViewport,
8159     uint32_t                                    viewportCount,
8160     const VkShadingRatePaletteNV*               pShadingRatePalettes) {
8161     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
8162     bool skip = false;
8163     for (auto intercept : layer_data->object_dispatch) {
8164         auto lock = intercept->write_lock();
8165         skip |= intercept->PreCallValidateCmdSetViewportShadingRatePaletteNV(commandBuffer, firstViewport, viewportCount, pShadingRatePalettes);
8166         if (skip) return;
8167     }
8168     for (auto intercept : layer_data->object_dispatch) {
8169         auto lock = intercept->write_lock();
8170         intercept->PreCallRecordCmdSetViewportShadingRatePaletteNV(commandBuffer, firstViewport, viewportCount, pShadingRatePalettes);
8171     }
8172     DispatchCmdSetViewportShadingRatePaletteNV(commandBuffer, firstViewport, viewportCount, pShadingRatePalettes);
8173     for (auto intercept : layer_data->object_dispatch) {
8174         auto lock = intercept->write_lock();
8175         intercept->PostCallRecordCmdSetViewportShadingRatePaletteNV(commandBuffer, firstViewport, viewportCount, pShadingRatePalettes);
8176     }
8177 }
8178 
CmdSetCoarseSampleOrderNV(VkCommandBuffer commandBuffer,VkCoarseSampleOrderTypeNV sampleOrderType,uint32_t customSampleOrderCount,const VkCoarseSampleOrderCustomNV * pCustomSampleOrders)8179 VKAPI_ATTR void VKAPI_CALL CmdSetCoarseSampleOrderNV(
8180     VkCommandBuffer                             commandBuffer,
8181     VkCoarseSampleOrderTypeNV                   sampleOrderType,
8182     uint32_t                                    customSampleOrderCount,
8183     const VkCoarseSampleOrderCustomNV*          pCustomSampleOrders) {
8184     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
8185     bool skip = false;
8186     for (auto intercept : layer_data->object_dispatch) {
8187         auto lock = intercept->write_lock();
8188         skip |= intercept->PreCallValidateCmdSetCoarseSampleOrderNV(commandBuffer, sampleOrderType, customSampleOrderCount, pCustomSampleOrders);
8189         if (skip) return;
8190     }
8191     for (auto intercept : layer_data->object_dispatch) {
8192         auto lock = intercept->write_lock();
8193         intercept->PreCallRecordCmdSetCoarseSampleOrderNV(commandBuffer, sampleOrderType, customSampleOrderCount, pCustomSampleOrders);
8194     }
8195     DispatchCmdSetCoarseSampleOrderNV(commandBuffer, sampleOrderType, customSampleOrderCount, pCustomSampleOrders);
8196     for (auto intercept : layer_data->object_dispatch) {
8197         auto lock = intercept->write_lock();
8198         intercept->PostCallRecordCmdSetCoarseSampleOrderNV(commandBuffer, sampleOrderType, customSampleOrderCount, pCustomSampleOrders);
8199     }
8200 }
8201 
8202 
CreateAccelerationStructureNV(VkDevice device,const VkAccelerationStructureCreateInfoNV * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkAccelerationStructureNV * pAccelerationStructure)8203 VKAPI_ATTR VkResult VKAPI_CALL CreateAccelerationStructureNV(
8204     VkDevice                                    device,
8205     const VkAccelerationStructureCreateInfoNV*  pCreateInfo,
8206     const VkAllocationCallbacks*                pAllocator,
8207     VkAccelerationStructureNV*                  pAccelerationStructure) {
8208     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
8209     bool skip = false;
8210     for (auto intercept : layer_data->object_dispatch) {
8211         auto lock = intercept->write_lock();
8212         skip |= intercept->PreCallValidateCreateAccelerationStructureNV(device, pCreateInfo, pAllocator, pAccelerationStructure);
8213         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
8214     }
8215     for (auto intercept : layer_data->object_dispatch) {
8216         auto lock = intercept->write_lock();
8217         intercept->PreCallRecordCreateAccelerationStructureNV(device, pCreateInfo, pAllocator, pAccelerationStructure);
8218     }
8219     VkResult result = DispatchCreateAccelerationStructureNV(device, pCreateInfo, pAllocator, pAccelerationStructure);
8220     for (auto intercept : layer_data->object_dispatch) {
8221         auto lock = intercept->write_lock();
8222         intercept->PostCallRecordCreateAccelerationStructureNV(device, pCreateInfo, pAllocator, pAccelerationStructure, result);
8223     }
8224     return result;
8225 }
8226 
DestroyAccelerationStructureNV(VkDevice device,VkAccelerationStructureNV accelerationStructure,const VkAllocationCallbacks * pAllocator)8227 VKAPI_ATTR void VKAPI_CALL DestroyAccelerationStructureNV(
8228     VkDevice                                    device,
8229     VkAccelerationStructureNV                   accelerationStructure,
8230     const VkAllocationCallbacks*                pAllocator) {
8231     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
8232     bool skip = false;
8233     for (auto intercept : layer_data->object_dispatch) {
8234         auto lock = intercept->write_lock();
8235         skip |= intercept->PreCallValidateDestroyAccelerationStructureNV(device, accelerationStructure, pAllocator);
8236         if (skip) return;
8237     }
8238     for (auto intercept : layer_data->object_dispatch) {
8239         auto lock = intercept->write_lock();
8240         intercept->PreCallRecordDestroyAccelerationStructureNV(device, accelerationStructure, pAllocator);
8241     }
8242     DispatchDestroyAccelerationStructureNV(device, accelerationStructure, pAllocator);
8243     for (auto intercept : layer_data->object_dispatch) {
8244         auto lock = intercept->write_lock();
8245         intercept->PostCallRecordDestroyAccelerationStructureNV(device, accelerationStructure, pAllocator);
8246     }
8247 }
8248 
GetAccelerationStructureMemoryRequirementsNV(VkDevice device,const VkAccelerationStructureMemoryRequirementsInfoNV * pInfo,VkMemoryRequirements2KHR * pMemoryRequirements)8249 VKAPI_ATTR void VKAPI_CALL GetAccelerationStructureMemoryRequirementsNV(
8250     VkDevice                                    device,
8251     const VkAccelerationStructureMemoryRequirementsInfoNV* pInfo,
8252     VkMemoryRequirements2KHR*                   pMemoryRequirements) {
8253     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
8254     bool skip = false;
8255     for (auto intercept : layer_data->object_dispatch) {
8256         auto lock = intercept->write_lock();
8257         skip |= intercept->PreCallValidateGetAccelerationStructureMemoryRequirementsNV(device, pInfo, pMemoryRequirements);
8258         if (skip) return;
8259     }
8260     for (auto intercept : layer_data->object_dispatch) {
8261         auto lock = intercept->write_lock();
8262         intercept->PreCallRecordGetAccelerationStructureMemoryRequirementsNV(device, pInfo, pMemoryRequirements);
8263     }
8264     DispatchGetAccelerationStructureMemoryRequirementsNV(device, pInfo, pMemoryRequirements);
8265     for (auto intercept : layer_data->object_dispatch) {
8266         auto lock = intercept->write_lock();
8267         intercept->PostCallRecordGetAccelerationStructureMemoryRequirementsNV(device, pInfo, pMemoryRequirements);
8268     }
8269 }
8270 
BindAccelerationStructureMemoryNV(VkDevice device,uint32_t bindInfoCount,const VkBindAccelerationStructureMemoryInfoNV * pBindInfos)8271 VKAPI_ATTR VkResult VKAPI_CALL BindAccelerationStructureMemoryNV(
8272     VkDevice                                    device,
8273     uint32_t                                    bindInfoCount,
8274     const VkBindAccelerationStructureMemoryInfoNV* pBindInfos) {
8275     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
8276     bool skip = false;
8277     for (auto intercept : layer_data->object_dispatch) {
8278         auto lock = intercept->write_lock();
8279         skip |= intercept->PreCallValidateBindAccelerationStructureMemoryNV(device, bindInfoCount, pBindInfos);
8280         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
8281     }
8282     for (auto intercept : layer_data->object_dispatch) {
8283         auto lock = intercept->write_lock();
8284         intercept->PreCallRecordBindAccelerationStructureMemoryNV(device, bindInfoCount, pBindInfos);
8285     }
8286     VkResult result = DispatchBindAccelerationStructureMemoryNV(device, bindInfoCount, pBindInfos);
8287     for (auto intercept : layer_data->object_dispatch) {
8288         auto lock = intercept->write_lock();
8289         intercept->PostCallRecordBindAccelerationStructureMemoryNV(device, bindInfoCount, pBindInfos, result);
8290     }
8291     return result;
8292 }
8293 
CmdBuildAccelerationStructureNV(VkCommandBuffer commandBuffer,const VkAccelerationStructureInfoNV * pInfo,VkBuffer instanceData,VkDeviceSize instanceOffset,VkBool32 update,VkAccelerationStructureNV dst,VkAccelerationStructureNV src,VkBuffer scratch,VkDeviceSize scratchOffset)8294 VKAPI_ATTR void VKAPI_CALL CmdBuildAccelerationStructureNV(
8295     VkCommandBuffer                             commandBuffer,
8296     const VkAccelerationStructureInfoNV*        pInfo,
8297     VkBuffer                                    instanceData,
8298     VkDeviceSize                                instanceOffset,
8299     VkBool32                                    update,
8300     VkAccelerationStructureNV                   dst,
8301     VkAccelerationStructureNV                   src,
8302     VkBuffer                                    scratch,
8303     VkDeviceSize                                scratchOffset) {
8304     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
8305     bool skip = false;
8306     for (auto intercept : layer_data->object_dispatch) {
8307         auto lock = intercept->write_lock();
8308         skip |= intercept->PreCallValidateCmdBuildAccelerationStructureNV(commandBuffer, pInfo, instanceData, instanceOffset, update, dst, src, scratch, scratchOffset);
8309         if (skip) return;
8310     }
8311     for (auto intercept : layer_data->object_dispatch) {
8312         auto lock = intercept->write_lock();
8313         intercept->PreCallRecordCmdBuildAccelerationStructureNV(commandBuffer, pInfo, instanceData, instanceOffset, update, dst, src, scratch, scratchOffset);
8314     }
8315     DispatchCmdBuildAccelerationStructureNV(commandBuffer, pInfo, instanceData, instanceOffset, update, dst, src, scratch, scratchOffset);
8316     for (auto intercept : layer_data->object_dispatch) {
8317         auto lock = intercept->write_lock();
8318         intercept->PostCallRecordCmdBuildAccelerationStructureNV(commandBuffer, pInfo, instanceData, instanceOffset, update, dst, src, scratch, scratchOffset);
8319     }
8320 }
8321 
CmdCopyAccelerationStructureNV(VkCommandBuffer commandBuffer,VkAccelerationStructureNV dst,VkAccelerationStructureNV src,VkCopyAccelerationStructureModeNV mode)8322 VKAPI_ATTR void VKAPI_CALL CmdCopyAccelerationStructureNV(
8323     VkCommandBuffer                             commandBuffer,
8324     VkAccelerationStructureNV                   dst,
8325     VkAccelerationStructureNV                   src,
8326     VkCopyAccelerationStructureModeNV           mode) {
8327     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
8328     bool skip = false;
8329     for (auto intercept : layer_data->object_dispatch) {
8330         auto lock = intercept->write_lock();
8331         skip |= intercept->PreCallValidateCmdCopyAccelerationStructureNV(commandBuffer, dst, src, mode);
8332         if (skip) return;
8333     }
8334     for (auto intercept : layer_data->object_dispatch) {
8335         auto lock = intercept->write_lock();
8336         intercept->PreCallRecordCmdCopyAccelerationStructureNV(commandBuffer, dst, src, mode);
8337     }
8338     DispatchCmdCopyAccelerationStructureNV(commandBuffer, dst, src, mode);
8339     for (auto intercept : layer_data->object_dispatch) {
8340         auto lock = intercept->write_lock();
8341         intercept->PostCallRecordCmdCopyAccelerationStructureNV(commandBuffer, dst, src, mode);
8342     }
8343 }
8344 
CmdTraceRaysNV(VkCommandBuffer commandBuffer,VkBuffer raygenShaderBindingTableBuffer,VkDeviceSize raygenShaderBindingOffset,VkBuffer missShaderBindingTableBuffer,VkDeviceSize missShaderBindingOffset,VkDeviceSize missShaderBindingStride,VkBuffer hitShaderBindingTableBuffer,VkDeviceSize hitShaderBindingOffset,VkDeviceSize hitShaderBindingStride,VkBuffer callableShaderBindingTableBuffer,VkDeviceSize callableShaderBindingOffset,VkDeviceSize callableShaderBindingStride,uint32_t width,uint32_t height,uint32_t depth)8345 VKAPI_ATTR void VKAPI_CALL CmdTraceRaysNV(
8346     VkCommandBuffer                             commandBuffer,
8347     VkBuffer                                    raygenShaderBindingTableBuffer,
8348     VkDeviceSize                                raygenShaderBindingOffset,
8349     VkBuffer                                    missShaderBindingTableBuffer,
8350     VkDeviceSize                                missShaderBindingOffset,
8351     VkDeviceSize                                missShaderBindingStride,
8352     VkBuffer                                    hitShaderBindingTableBuffer,
8353     VkDeviceSize                                hitShaderBindingOffset,
8354     VkDeviceSize                                hitShaderBindingStride,
8355     VkBuffer                                    callableShaderBindingTableBuffer,
8356     VkDeviceSize                                callableShaderBindingOffset,
8357     VkDeviceSize                                callableShaderBindingStride,
8358     uint32_t                                    width,
8359     uint32_t                                    height,
8360     uint32_t                                    depth) {
8361     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
8362     bool skip = false;
8363     for (auto intercept : layer_data->object_dispatch) {
8364         auto lock = intercept->write_lock();
8365         skip |= intercept->PreCallValidateCmdTraceRaysNV(commandBuffer, raygenShaderBindingTableBuffer, raygenShaderBindingOffset, missShaderBindingTableBuffer, missShaderBindingOffset, missShaderBindingStride, hitShaderBindingTableBuffer, hitShaderBindingOffset, hitShaderBindingStride, callableShaderBindingTableBuffer, callableShaderBindingOffset, callableShaderBindingStride, width, height, depth);
8366         if (skip) return;
8367     }
8368     for (auto intercept : layer_data->object_dispatch) {
8369         auto lock = intercept->write_lock();
8370         intercept->PreCallRecordCmdTraceRaysNV(commandBuffer, raygenShaderBindingTableBuffer, raygenShaderBindingOffset, missShaderBindingTableBuffer, missShaderBindingOffset, missShaderBindingStride, hitShaderBindingTableBuffer, hitShaderBindingOffset, hitShaderBindingStride, callableShaderBindingTableBuffer, callableShaderBindingOffset, callableShaderBindingStride, width, height, depth);
8371     }
8372     DispatchCmdTraceRaysNV(commandBuffer, raygenShaderBindingTableBuffer, raygenShaderBindingOffset, missShaderBindingTableBuffer, missShaderBindingOffset, missShaderBindingStride, hitShaderBindingTableBuffer, hitShaderBindingOffset, hitShaderBindingStride, callableShaderBindingTableBuffer, callableShaderBindingOffset, callableShaderBindingStride, width, height, depth);
8373     for (auto intercept : layer_data->object_dispatch) {
8374         auto lock = intercept->write_lock();
8375         intercept->PostCallRecordCmdTraceRaysNV(commandBuffer, raygenShaderBindingTableBuffer, raygenShaderBindingOffset, missShaderBindingTableBuffer, missShaderBindingOffset, missShaderBindingStride, hitShaderBindingTableBuffer, hitShaderBindingOffset, hitShaderBindingStride, callableShaderBindingTableBuffer, callableShaderBindingOffset, callableShaderBindingStride, width, height, depth);
8376     }
8377 }
8378 
GetRayTracingShaderGroupHandlesNV(VkDevice device,VkPipeline pipeline,uint32_t firstGroup,uint32_t groupCount,size_t dataSize,void * pData)8379 VKAPI_ATTR VkResult VKAPI_CALL GetRayTracingShaderGroupHandlesNV(
8380     VkDevice                                    device,
8381     VkPipeline                                  pipeline,
8382     uint32_t                                    firstGroup,
8383     uint32_t                                    groupCount,
8384     size_t                                      dataSize,
8385     void*                                       pData) {
8386     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
8387     bool skip = false;
8388     for (auto intercept : layer_data->object_dispatch) {
8389         auto lock = intercept->write_lock();
8390         skip |= intercept->PreCallValidateGetRayTracingShaderGroupHandlesNV(device, pipeline, firstGroup, groupCount, dataSize, pData);
8391         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
8392     }
8393     for (auto intercept : layer_data->object_dispatch) {
8394         auto lock = intercept->write_lock();
8395         intercept->PreCallRecordGetRayTracingShaderGroupHandlesNV(device, pipeline, firstGroup, groupCount, dataSize, pData);
8396     }
8397     VkResult result = DispatchGetRayTracingShaderGroupHandlesNV(device, pipeline, firstGroup, groupCount, dataSize, pData);
8398     for (auto intercept : layer_data->object_dispatch) {
8399         auto lock = intercept->write_lock();
8400         intercept->PostCallRecordGetRayTracingShaderGroupHandlesNV(device, pipeline, firstGroup, groupCount, dataSize, pData, result);
8401     }
8402     return result;
8403 }
8404 
GetAccelerationStructureHandleNV(VkDevice device,VkAccelerationStructureNV accelerationStructure,size_t dataSize,void * pData)8405 VKAPI_ATTR VkResult VKAPI_CALL GetAccelerationStructureHandleNV(
8406     VkDevice                                    device,
8407     VkAccelerationStructureNV                   accelerationStructure,
8408     size_t                                      dataSize,
8409     void*                                       pData) {
8410     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
8411     bool skip = false;
8412     for (auto intercept : layer_data->object_dispatch) {
8413         auto lock = intercept->write_lock();
8414         skip |= intercept->PreCallValidateGetAccelerationStructureHandleNV(device, accelerationStructure, dataSize, pData);
8415         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
8416     }
8417     for (auto intercept : layer_data->object_dispatch) {
8418         auto lock = intercept->write_lock();
8419         intercept->PreCallRecordGetAccelerationStructureHandleNV(device, accelerationStructure, dataSize, pData);
8420     }
8421     VkResult result = DispatchGetAccelerationStructureHandleNV(device, accelerationStructure, dataSize, pData);
8422     for (auto intercept : layer_data->object_dispatch) {
8423         auto lock = intercept->write_lock();
8424         intercept->PostCallRecordGetAccelerationStructureHandleNV(device, accelerationStructure, dataSize, pData, result);
8425     }
8426     return result;
8427 }
8428 
CmdWriteAccelerationStructuresPropertiesNV(VkCommandBuffer commandBuffer,uint32_t accelerationStructureCount,const VkAccelerationStructureNV * pAccelerationStructures,VkQueryType queryType,VkQueryPool queryPool,uint32_t firstQuery)8429 VKAPI_ATTR void VKAPI_CALL CmdWriteAccelerationStructuresPropertiesNV(
8430     VkCommandBuffer                             commandBuffer,
8431     uint32_t                                    accelerationStructureCount,
8432     const VkAccelerationStructureNV*            pAccelerationStructures,
8433     VkQueryType                                 queryType,
8434     VkQueryPool                                 queryPool,
8435     uint32_t                                    firstQuery) {
8436     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
8437     bool skip = false;
8438     for (auto intercept : layer_data->object_dispatch) {
8439         auto lock = intercept->write_lock();
8440         skip |= intercept->PreCallValidateCmdWriteAccelerationStructuresPropertiesNV(commandBuffer, accelerationStructureCount, pAccelerationStructures, queryType, queryPool, firstQuery);
8441         if (skip) return;
8442     }
8443     for (auto intercept : layer_data->object_dispatch) {
8444         auto lock = intercept->write_lock();
8445         intercept->PreCallRecordCmdWriteAccelerationStructuresPropertiesNV(commandBuffer, accelerationStructureCount, pAccelerationStructures, queryType, queryPool, firstQuery);
8446     }
8447     DispatchCmdWriteAccelerationStructuresPropertiesNV(commandBuffer, accelerationStructureCount, pAccelerationStructures, queryType, queryPool, firstQuery);
8448     for (auto intercept : layer_data->object_dispatch) {
8449         auto lock = intercept->write_lock();
8450         intercept->PostCallRecordCmdWriteAccelerationStructuresPropertiesNV(commandBuffer, accelerationStructureCount, pAccelerationStructures, queryType, queryPool, firstQuery);
8451     }
8452 }
8453 
CompileDeferredNV(VkDevice device,VkPipeline pipeline,uint32_t shader)8454 VKAPI_ATTR VkResult VKAPI_CALL CompileDeferredNV(
8455     VkDevice                                    device,
8456     VkPipeline                                  pipeline,
8457     uint32_t                                    shader) {
8458     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
8459     bool skip = false;
8460     for (auto intercept : layer_data->object_dispatch) {
8461         auto lock = intercept->write_lock();
8462         skip |= intercept->PreCallValidateCompileDeferredNV(device, pipeline, shader);
8463         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
8464     }
8465     for (auto intercept : layer_data->object_dispatch) {
8466         auto lock = intercept->write_lock();
8467         intercept->PreCallRecordCompileDeferredNV(device, pipeline, shader);
8468     }
8469     VkResult result = DispatchCompileDeferredNV(device, pipeline, shader);
8470     for (auto intercept : layer_data->object_dispatch) {
8471         auto lock = intercept->write_lock();
8472         intercept->PostCallRecordCompileDeferredNV(device, pipeline, shader, result);
8473     }
8474     return result;
8475 }
8476 
8477 
8478 
8479 
8480 
GetMemoryHostPointerPropertiesEXT(VkDevice device,VkExternalMemoryHandleTypeFlagBits handleType,const void * pHostPointer,VkMemoryHostPointerPropertiesEXT * pMemoryHostPointerProperties)8481 VKAPI_ATTR VkResult VKAPI_CALL GetMemoryHostPointerPropertiesEXT(
8482     VkDevice                                    device,
8483     VkExternalMemoryHandleTypeFlagBits          handleType,
8484     const void*                                 pHostPointer,
8485     VkMemoryHostPointerPropertiesEXT*           pMemoryHostPointerProperties) {
8486     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
8487     bool skip = false;
8488     for (auto intercept : layer_data->object_dispatch) {
8489         auto lock = intercept->write_lock();
8490         skip |= intercept->PreCallValidateGetMemoryHostPointerPropertiesEXT(device, handleType, pHostPointer, pMemoryHostPointerProperties);
8491         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
8492     }
8493     for (auto intercept : layer_data->object_dispatch) {
8494         auto lock = intercept->write_lock();
8495         intercept->PreCallRecordGetMemoryHostPointerPropertiesEXT(device, handleType, pHostPointer, pMemoryHostPointerProperties);
8496     }
8497     VkResult result = DispatchGetMemoryHostPointerPropertiesEXT(device, handleType, pHostPointer, pMemoryHostPointerProperties);
8498     for (auto intercept : layer_data->object_dispatch) {
8499         auto lock = intercept->write_lock();
8500         intercept->PostCallRecordGetMemoryHostPointerPropertiesEXT(device, handleType, pHostPointer, pMemoryHostPointerProperties, result);
8501     }
8502     return result;
8503 }
8504 
8505 
CmdWriteBufferMarkerAMD(VkCommandBuffer commandBuffer,VkPipelineStageFlagBits pipelineStage,VkBuffer dstBuffer,VkDeviceSize dstOffset,uint32_t marker)8506 VKAPI_ATTR void VKAPI_CALL CmdWriteBufferMarkerAMD(
8507     VkCommandBuffer                             commandBuffer,
8508     VkPipelineStageFlagBits                     pipelineStage,
8509     VkBuffer                                    dstBuffer,
8510     VkDeviceSize                                dstOffset,
8511     uint32_t                                    marker) {
8512     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
8513     bool skip = false;
8514     for (auto intercept : layer_data->object_dispatch) {
8515         auto lock = intercept->write_lock();
8516         skip |= intercept->PreCallValidateCmdWriteBufferMarkerAMD(commandBuffer, pipelineStage, dstBuffer, dstOffset, marker);
8517         if (skip) return;
8518     }
8519     for (auto intercept : layer_data->object_dispatch) {
8520         auto lock = intercept->write_lock();
8521         intercept->PreCallRecordCmdWriteBufferMarkerAMD(commandBuffer, pipelineStage, dstBuffer, dstOffset, marker);
8522     }
8523     DispatchCmdWriteBufferMarkerAMD(commandBuffer, pipelineStage, dstBuffer, dstOffset, marker);
8524     for (auto intercept : layer_data->object_dispatch) {
8525         auto lock = intercept->write_lock();
8526         intercept->PostCallRecordCmdWriteBufferMarkerAMD(commandBuffer, pipelineStage, dstBuffer, dstOffset, marker);
8527     }
8528 }
8529 
8530 
8531 
GetPhysicalDeviceCalibrateableTimeDomainsEXT(VkPhysicalDevice physicalDevice,uint32_t * pTimeDomainCount,VkTimeDomainEXT * pTimeDomains)8532 VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceCalibrateableTimeDomainsEXT(
8533     VkPhysicalDevice                            physicalDevice,
8534     uint32_t*                                   pTimeDomainCount,
8535     VkTimeDomainEXT*                            pTimeDomains) {
8536     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
8537     bool skip = false;
8538     for (auto intercept : layer_data->object_dispatch) {
8539         auto lock = intercept->write_lock();
8540         skip |= intercept->PreCallValidateGetPhysicalDeviceCalibrateableTimeDomainsEXT(physicalDevice, pTimeDomainCount, pTimeDomains);
8541         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
8542     }
8543     for (auto intercept : layer_data->object_dispatch) {
8544         auto lock = intercept->write_lock();
8545         intercept->PreCallRecordGetPhysicalDeviceCalibrateableTimeDomainsEXT(physicalDevice, pTimeDomainCount, pTimeDomains);
8546     }
8547     VkResult result = DispatchGetPhysicalDeviceCalibrateableTimeDomainsEXT(physicalDevice, pTimeDomainCount, pTimeDomains);
8548     for (auto intercept : layer_data->object_dispatch) {
8549         auto lock = intercept->write_lock();
8550         intercept->PostCallRecordGetPhysicalDeviceCalibrateableTimeDomainsEXT(physicalDevice, pTimeDomainCount, pTimeDomains, result);
8551     }
8552     return result;
8553 }
8554 
GetCalibratedTimestampsEXT(VkDevice device,uint32_t timestampCount,const VkCalibratedTimestampInfoEXT * pTimestampInfos,uint64_t * pTimestamps,uint64_t * pMaxDeviation)8555 VKAPI_ATTR VkResult VKAPI_CALL GetCalibratedTimestampsEXT(
8556     VkDevice                                    device,
8557     uint32_t                                    timestampCount,
8558     const VkCalibratedTimestampInfoEXT*         pTimestampInfos,
8559     uint64_t*                                   pTimestamps,
8560     uint64_t*                                   pMaxDeviation) {
8561     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
8562     bool skip = false;
8563     for (auto intercept : layer_data->object_dispatch) {
8564         auto lock = intercept->write_lock();
8565         skip |= intercept->PreCallValidateGetCalibratedTimestampsEXT(device, timestampCount, pTimestampInfos, pTimestamps, pMaxDeviation);
8566         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
8567     }
8568     for (auto intercept : layer_data->object_dispatch) {
8569         auto lock = intercept->write_lock();
8570         intercept->PreCallRecordGetCalibratedTimestampsEXT(device, timestampCount, pTimestampInfos, pTimestamps, pMaxDeviation);
8571     }
8572     VkResult result = DispatchGetCalibratedTimestampsEXT(device, timestampCount, pTimestampInfos, pTimestamps, pMaxDeviation);
8573     for (auto intercept : layer_data->object_dispatch) {
8574         auto lock = intercept->write_lock();
8575         intercept->PostCallRecordGetCalibratedTimestampsEXT(device, timestampCount, pTimestampInfos, pTimestamps, pMaxDeviation, result);
8576     }
8577     return result;
8578 }
8579 
8580 
8581 
8582 
8583 #ifdef VK_USE_PLATFORM_GGP
8584 #endif // VK_USE_PLATFORM_GGP
8585 
8586 
8587 
8588 
8589 
CmdDrawMeshTasksNV(VkCommandBuffer commandBuffer,uint32_t taskCount,uint32_t firstTask)8590 VKAPI_ATTR void VKAPI_CALL CmdDrawMeshTasksNV(
8591     VkCommandBuffer                             commandBuffer,
8592     uint32_t                                    taskCount,
8593     uint32_t                                    firstTask) {
8594     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
8595     bool skip = false;
8596     for (auto intercept : layer_data->object_dispatch) {
8597         auto lock = intercept->write_lock();
8598         skip |= intercept->PreCallValidateCmdDrawMeshTasksNV(commandBuffer, taskCount, firstTask);
8599         if (skip) return;
8600     }
8601     for (auto intercept : layer_data->object_dispatch) {
8602         auto lock = intercept->write_lock();
8603         intercept->PreCallRecordCmdDrawMeshTasksNV(commandBuffer, taskCount, firstTask);
8604     }
8605     DispatchCmdDrawMeshTasksNV(commandBuffer, taskCount, firstTask);
8606     for (auto intercept : layer_data->object_dispatch) {
8607         auto lock = intercept->write_lock();
8608         intercept->PostCallRecordCmdDrawMeshTasksNV(commandBuffer, taskCount, firstTask);
8609     }
8610 }
8611 
CmdDrawMeshTasksIndirectNV(VkCommandBuffer commandBuffer,VkBuffer buffer,VkDeviceSize offset,uint32_t drawCount,uint32_t stride)8612 VKAPI_ATTR void VKAPI_CALL CmdDrawMeshTasksIndirectNV(
8613     VkCommandBuffer                             commandBuffer,
8614     VkBuffer                                    buffer,
8615     VkDeviceSize                                offset,
8616     uint32_t                                    drawCount,
8617     uint32_t                                    stride) {
8618     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
8619     bool skip = false;
8620     for (auto intercept : layer_data->object_dispatch) {
8621         auto lock = intercept->write_lock();
8622         skip |= intercept->PreCallValidateCmdDrawMeshTasksIndirectNV(commandBuffer, buffer, offset, drawCount, stride);
8623         if (skip) return;
8624     }
8625     for (auto intercept : layer_data->object_dispatch) {
8626         auto lock = intercept->write_lock();
8627         intercept->PreCallRecordCmdDrawMeshTasksIndirectNV(commandBuffer, buffer, offset, drawCount, stride);
8628     }
8629     DispatchCmdDrawMeshTasksIndirectNV(commandBuffer, buffer, offset, drawCount, stride);
8630     for (auto intercept : layer_data->object_dispatch) {
8631         auto lock = intercept->write_lock();
8632         intercept->PostCallRecordCmdDrawMeshTasksIndirectNV(commandBuffer, buffer, offset, drawCount, stride);
8633     }
8634 }
8635 
CmdDrawMeshTasksIndirectCountNV(VkCommandBuffer commandBuffer,VkBuffer buffer,VkDeviceSize offset,VkBuffer countBuffer,VkDeviceSize countBufferOffset,uint32_t maxDrawCount,uint32_t stride)8636 VKAPI_ATTR void VKAPI_CALL CmdDrawMeshTasksIndirectCountNV(
8637     VkCommandBuffer                             commandBuffer,
8638     VkBuffer                                    buffer,
8639     VkDeviceSize                                offset,
8640     VkBuffer                                    countBuffer,
8641     VkDeviceSize                                countBufferOffset,
8642     uint32_t                                    maxDrawCount,
8643     uint32_t                                    stride) {
8644     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
8645     bool skip = false;
8646     for (auto intercept : layer_data->object_dispatch) {
8647         auto lock = intercept->write_lock();
8648         skip |= intercept->PreCallValidateCmdDrawMeshTasksIndirectCountNV(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride);
8649         if (skip) return;
8650     }
8651     for (auto intercept : layer_data->object_dispatch) {
8652         auto lock = intercept->write_lock();
8653         intercept->PreCallRecordCmdDrawMeshTasksIndirectCountNV(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride);
8654     }
8655     DispatchCmdDrawMeshTasksIndirectCountNV(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride);
8656     for (auto intercept : layer_data->object_dispatch) {
8657         auto lock = intercept->write_lock();
8658         intercept->PostCallRecordCmdDrawMeshTasksIndirectCountNV(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride);
8659     }
8660 }
8661 
8662 
8663 
8664 
CmdSetExclusiveScissorNV(VkCommandBuffer commandBuffer,uint32_t firstExclusiveScissor,uint32_t exclusiveScissorCount,const VkRect2D * pExclusiveScissors)8665 VKAPI_ATTR void VKAPI_CALL CmdSetExclusiveScissorNV(
8666     VkCommandBuffer                             commandBuffer,
8667     uint32_t                                    firstExclusiveScissor,
8668     uint32_t                                    exclusiveScissorCount,
8669     const VkRect2D*                             pExclusiveScissors) {
8670     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
8671     bool skip = false;
8672     for (auto intercept : layer_data->object_dispatch) {
8673         auto lock = intercept->write_lock();
8674         skip |= intercept->PreCallValidateCmdSetExclusiveScissorNV(commandBuffer, firstExclusiveScissor, exclusiveScissorCount, pExclusiveScissors);
8675         if (skip) return;
8676     }
8677     for (auto intercept : layer_data->object_dispatch) {
8678         auto lock = intercept->write_lock();
8679         intercept->PreCallRecordCmdSetExclusiveScissorNV(commandBuffer, firstExclusiveScissor, exclusiveScissorCount, pExclusiveScissors);
8680     }
8681     DispatchCmdSetExclusiveScissorNV(commandBuffer, firstExclusiveScissor, exclusiveScissorCount, pExclusiveScissors);
8682     for (auto intercept : layer_data->object_dispatch) {
8683         auto lock = intercept->write_lock();
8684         intercept->PostCallRecordCmdSetExclusiveScissorNV(commandBuffer, firstExclusiveScissor, exclusiveScissorCount, pExclusiveScissors);
8685     }
8686 }
8687 
8688 
CmdSetCheckpointNV(VkCommandBuffer commandBuffer,const void * pCheckpointMarker)8689 VKAPI_ATTR void VKAPI_CALL CmdSetCheckpointNV(
8690     VkCommandBuffer                             commandBuffer,
8691     const void*                                 pCheckpointMarker) {
8692     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
8693     bool skip = false;
8694     for (auto intercept : layer_data->object_dispatch) {
8695         auto lock = intercept->write_lock();
8696         skip |= intercept->PreCallValidateCmdSetCheckpointNV(commandBuffer, pCheckpointMarker);
8697         if (skip) return;
8698     }
8699     for (auto intercept : layer_data->object_dispatch) {
8700         auto lock = intercept->write_lock();
8701         intercept->PreCallRecordCmdSetCheckpointNV(commandBuffer, pCheckpointMarker);
8702     }
8703     DispatchCmdSetCheckpointNV(commandBuffer, pCheckpointMarker);
8704     for (auto intercept : layer_data->object_dispatch) {
8705         auto lock = intercept->write_lock();
8706         intercept->PostCallRecordCmdSetCheckpointNV(commandBuffer, pCheckpointMarker);
8707     }
8708 }
8709 
GetQueueCheckpointDataNV(VkQueue queue,uint32_t * pCheckpointDataCount,VkCheckpointDataNV * pCheckpointData)8710 VKAPI_ATTR void VKAPI_CALL GetQueueCheckpointDataNV(
8711     VkQueue                                     queue,
8712     uint32_t*                                   pCheckpointDataCount,
8713     VkCheckpointDataNV*                         pCheckpointData) {
8714     auto layer_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map);
8715     bool skip = false;
8716     for (auto intercept : layer_data->object_dispatch) {
8717         auto lock = intercept->write_lock();
8718         skip |= intercept->PreCallValidateGetQueueCheckpointDataNV(queue, pCheckpointDataCount, pCheckpointData);
8719         if (skip) return;
8720     }
8721     for (auto intercept : layer_data->object_dispatch) {
8722         auto lock = intercept->write_lock();
8723         intercept->PreCallRecordGetQueueCheckpointDataNV(queue, pCheckpointDataCount, pCheckpointData);
8724     }
8725     DispatchGetQueueCheckpointDataNV(queue, pCheckpointDataCount, pCheckpointData);
8726     for (auto intercept : layer_data->object_dispatch) {
8727         auto lock = intercept->write_lock();
8728         intercept->PostCallRecordGetQueueCheckpointDataNV(queue, pCheckpointDataCount, pCheckpointData);
8729     }
8730 }
8731 
8732 
8733 
InitializePerformanceApiINTEL(VkDevice device,const VkInitializePerformanceApiInfoINTEL * pInitializeInfo)8734 VKAPI_ATTR VkResult VKAPI_CALL InitializePerformanceApiINTEL(
8735     VkDevice                                    device,
8736     const VkInitializePerformanceApiInfoINTEL*  pInitializeInfo) {
8737     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
8738     bool skip = false;
8739     for (auto intercept : layer_data->object_dispatch) {
8740         auto lock = intercept->write_lock();
8741         skip |= intercept->PreCallValidateInitializePerformanceApiINTEL(device, pInitializeInfo);
8742         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
8743     }
8744     for (auto intercept : layer_data->object_dispatch) {
8745         auto lock = intercept->write_lock();
8746         intercept->PreCallRecordInitializePerformanceApiINTEL(device, pInitializeInfo);
8747     }
8748     VkResult result = DispatchInitializePerformanceApiINTEL(device, pInitializeInfo);
8749     for (auto intercept : layer_data->object_dispatch) {
8750         auto lock = intercept->write_lock();
8751         intercept->PostCallRecordInitializePerformanceApiINTEL(device, pInitializeInfo, result);
8752     }
8753     return result;
8754 }
8755 
UninitializePerformanceApiINTEL(VkDevice device)8756 VKAPI_ATTR void VKAPI_CALL UninitializePerformanceApiINTEL(
8757     VkDevice                                    device) {
8758     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
8759     bool skip = false;
8760     for (auto intercept : layer_data->object_dispatch) {
8761         auto lock = intercept->write_lock();
8762         skip |= intercept->PreCallValidateUninitializePerformanceApiINTEL(device);
8763         if (skip) return;
8764     }
8765     for (auto intercept : layer_data->object_dispatch) {
8766         auto lock = intercept->write_lock();
8767         intercept->PreCallRecordUninitializePerformanceApiINTEL(device);
8768     }
8769     DispatchUninitializePerformanceApiINTEL(device);
8770     for (auto intercept : layer_data->object_dispatch) {
8771         auto lock = intercept->write_lock();
8772         intercept->PostCallRecordUninitializePerformanceApiINTEL(device);
8773     }
8774 }
8775 
CmdSetPerformanceMarkerINTEL(VkCommandBuffer commandBuffer,const VkPerformanceMarkerInfoINTEL * pMarkerInfo)8776 VKAPI_ATTR VkResult VKAPI_CALL CmdSetPerformanceMarkerINTEL(
8777     VkCommandBuffer                             commandBuffer,
8778     const VkPerformanceMarkerInfoINTEL*         pMarkerInfo) {
8779     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
8780     bool skip = false;
8781     for (auto intercept : layer_data->object_dispatch) {
8782         auto lock = intercept->write_lock();
8783         skip |= intercept->PreCallValidateCmdSetPerformanceMarkerINTEL(commandBuffer, pMarkerInfo);
8784         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
8785     }
8786     for (auto intercept : layer_data->object_dispatch) {
8787         auto lock = intercept->write_lock();
8788         intercept->PreCallRecordCmdSetPerformanceMarkerINTEL(commandBuffer, pMarkerInfo);
8789     }
8790     VkResult result = DispatchCmdSetPerformanceMarkerINTEL(commandBuffer, pMarkerInfo);
8791     for (auto intercept : layer_data->object_dispatch) {
8792         auto lock = intercept->write_lock();
8793         intercept->PostCallRecordCmdSetPerformanceMarkerINTEL(commandBuffer, pMarkerInfo, result);
8794     }
8795     return result;
8796 }
8797 
CmdSetPerformanceStreamMarkerINTEL(VkCommandBuffer commandBuffer,const VkPerformanceStreamMarkerInfoINTEL * pMarkerInfo)8798 VKAPI_ATTR VkResult VKAPI_CALL CmdSetPerformanceStreamMarkerINTEL(
8799     VkCommandBuffer                             commandBuffer,
8800     const VkPerformanceStreamMarkerInfoINTEL*   pMarkerInfo) {
8801     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
8802     bool skip = false;
8803     for (auto intercept : layer_data->object_dispatch) {
8804         auto lock = intercept->write_lock();
8805         skip |= intercept->PreCallValidateCmdSetPerformanceStreamMarkerINTEL(commandBuffer, pMarkerInfo);
8806         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
8807     }
8808     for (auto intercept : layer_data->object_dispatch) {
8809         auto lock = intercept->write_lock();
8810         intercept->PreCallRecordCmdSetPerformanceStreamMarkerINTEL(commandBuffer, pMarkerInfo);
8811     }
8812     VkResult result = DispatchCmdSetPerformanceStreamMarkerINTEL(commandBuffer, pMarkerInfo);
8813     for (auto intercept : layer_data->object_dispatch) {
8814         auto lock = intercept->write_lock();
8815         intercept->PostCallRecordCmdSetPerformanceStreamMarkerINTEL(commandBuffer, pMarkerInfo, result);
8816     }
8817     return result;
8818 }
8819 
CmdSetPerformanceOverrideINTEL(VkCommandBuffer commandBuffer,const VkPerformanceOverrideInfoINTEL * pOverrideInfo)8820 VKAPI_ATTR VkResult VKAPI_CALL CmdSetPerformanceOverrideINTEL(
8821     VkCommandBuffer                             commandBuffer,
8822     const VkPerformanceOverrideInfoINTEL*       pOverrideInfo) {
8823     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
8824     bool skip = false;
8825     for (auto intercept : layer_data->object_dispatch) {
8826         auto lock = intercept->write_lock();
8827         skip |= intercept->PreCallValidateCmdSetPerformanceOverrideINTEL(commandBuffer, pOverrideInfo);
8828         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
8829     }
8830     for (auto intercept : layer_data->object_dispatch) {
8831         auto lock = intercept->write_lock();
8832         intercept->PreCallRecordCmdSetPerformanceOverrideINTEL(commandBuffer, pOverrideInfo);
8833     }
8834     VkResult result = DispatchCmdSetPerformanceOverrideINTEL(commandBuffer, pOverrideInfo);
8835     for (auto intercept : layer_data->object_dispatch) {
8836         auto lock = intercept->write_lock();
8837         intercept->PostCallRecordCmdSetPerformanceOverrideINTEL(commandBuffer, pOverrideInfo, result);
8838     }
8839     return result;
8840 }
8841 
AcquirePerformanceConfigurationINTEL(VkDevice device,const VkPerformanceConfigurationAcquireInfoINTEL * pAcquireInfo,VkPerformanceConfigurationINTEL * pConfiguration)8842 VKAPI_ATTR VkResult VKAPI_CALL AcquirePerformanceConfigurationINTEL(
8843     VkDevice                                    device,
8844     const VkPerformanceConfigurationAcquireInfoINTEL* pAcquireInfo,
8845     VkPerformanceConfigurationINTEL*            pConfiguration) {
8846     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
8847     bool skip = false;
8848     for (auto intercept : layer_data->object_dispatch) {
8849         auto lock = intercept->write_lock();
8850         skip |= intercept->PreCallValidateAcquirePerformanceConfigurationINTEL(device, pAcquireInfo, pConfiguration);
8851         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
8852     }
8853     for (auto intercept : layer_data->object_dispatch) {
8854         auto lock = intercept->write_lock();
8855         intercept->PreCallRecordAcquirePerformanceConfigurationINTEL(device, pAcquireInfo, pConfiguration);
8856     }
8857     VkResult result = DispatchAcquirePerformanceConfigurationINTEL(device, pAcquireInfo, pConfiguration);
8858     for (auto intercept : layer_data->object_dispatch) {
8859         auto lock = intercept->write_lock();
8860         intercept->PostCallRecordAcquirePerformanceConfigurationINTEL(device, pAcquireInfo, pConfiguration, result);
8861     }
8862     return result;
8863 }
8864 
ReleasePerformanceConfigurationINTEL(VkDevice device,VkPerformanceConfigurationINTEL configuration)8865 VKAPI_ATTR VkResult VKAPI_CALL ReleasePerformanceConfigurationINTEL(
8866     VkDevice                                    device,
8867     VkPerformanceConfigurationINTEL             configuration) {
8868     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
8869     bool skip = false;
8870     for (auto intercept : layer_data->object_dispatch) {
8871         auto lock = intercept->write_lock();
8872         skip |= intercept->PreCallValidateReleasePerformanceConfigurationINTEL(device, configuration);
8873         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
8874     }
8875     for (auto intercept : layer_data->object_dispatch) {
8876         auto lock = intercept->write_lock();
8877         intercept->PreCallRecordReleasePerformanceConfigurationINTEL(device, configuration);
8878     }
8879     VkResult result = DispatchReleasePerformanceConfigurationINTEL(device, configuration);
8880     for (auto intercept : layer_data->object_dispatch) {
8881         auto lock = intercept->write_lock();
8882         intercept->PostCallRecordReleasePerformanceConfigurationINTEL(device, configuration, result);
8883     }
8884     return result;
8885 }
8886 
QueueSetPerformanceConfigurationINTEL(VkQueue queue,VkPerformanceConfigurationINTEL configuration)8887 VKAPI_ATTR VkResult VKAPI_CALL QueueSetPerformanceConfigurationINTEL(
8888     VkQueue                                     queue,
8889     VkPerformanceConfigurationINTEL             configuration) {
8890     auto layer_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map);
8891     bool skip = false;
8892     for (auto intercept : layer_data->object_dispatch) {
8893         auto lock = intercept->write_lock();
8894         skip |= intercept->PreCallValidateQueueSetPerformanceConfigurationINTEL(queue, configuration);
8895         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
8896     }
8897     for (auto intercept : layer_data->object_dispatch) {
8898         auto lock = intercept->write_lock();
8899         intercept->PreCallRecordQueueSetPerformanceConfigurationINTEL(queue, configuration);
8900     }
8901     VkResult result = DispatchQueueSetPerformanceConfigurationINTEL(queue, configuration);
8902     for (auto intercept : layer_data->object_dispatch) {
8903         auto lock = intercept->write_lock();
8904         intercept->PostCallRecordQueueSetPerformanceConfigurationINTEL(queue, configuration, result);
8905     }
8906     return result;
8907 }
8908 
GetPerformanceParameterINTEL(VkDevice device,VkPerformanceParameterTypeINTEL parameter,VkPerformanceValueINTEL * pValue)8909 VKAPI_ATTR VkResult VKAPI_CALL GetPerformanceParameterINTEL(
8910     VkDevice                                    device,
8911     VkPerformanceParameterTypeINTEL             parameter,
8912     VkPerformanceValueINTEL*                    pValue) {
8913     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
8914     bool skip = false;
8915     for (auto intercept : layer_data->object_dispatch) {
8916         auto lock = intercept->write_lock();
8917         skip |= intercept->PreCallValidateGetPerformanceParameterINTEL(device, parameter, pValue);
8918         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
8919     }
8920     for (auto intercept : layer_data->object_dispatch) {
8921         auto lock = intercept->write_lock();
8922         intercept->PreCallRecordGetPerformanceParameterINTEL(device, parameter, pValue);
8923     }
8924     VkResult result = DispatchGetPerformanceParameterINTEL(device, parameter, pValue);
8925     for (auto intercept : layer_data->object_dispatch) {
8926         auto lock = intercept->write_lock();
8927         intercept->PostCallRecordGetPerformanceParameterINTEL(device, parameter, pValue, result);
8928     }
8929     return result;
8930 }
8931 
8932 
8933 
SetLocalDimmingAMD(VkDevice device,VkSwapchainKHR swapChain,VkBool32 localDimmingEnable)8934 VKAPI_ATTR void VKAPI_CALL SetLocalDimmingAMD(
8935     VkDevice                                    device,
8936     VkSwapchainKHR                              swapChain,
8937     VkBool32                                    localDimmingEnable) {
8938     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
8939     bool skip = false;
8940     for (auto intercept : layer_data->object_dispatch) {
8941         auto lock = intercept->write_lock();
8942         skip |= intercept->PreCallValidateSetLocalDimmingAMD(device, swapChain, localDimmingEnable);
8943         if (skip) return;
8944     }
8945     for (auto intercept : layer_data->object_dispatch) {
8946         auto lock = intercept->write_lock();
8947         intercept->PreCallRecordSetLocalDimmingAMD(device, swapChain, localDimmingEnable);
8948     }
8949     DispatchSetLocalDimmingAMD(device, swapChain, localDimmingEnable);
8950     for (auto intercept : layer_data->object_dispatch) {
8951         auto lock = intercept->write_lock();
8952         intercept->PostCallRecordSetLocalDimmingAMD(device, swapChain, localDimmingEnable);
8953     }
8954 }
8955 
8956 #ifdef VK_USE_PLATFORM_FUCHSIA
8957 
CreateImagePipeSurfaceFUCHSIA(VkInstance instance,const VkImagePipeSurfaceCreateInfoFUCHSIA * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkSurfaceKHR * pSurface)8958 VKAPI_ATTR VkResult VKAPI_CALL CreateImagePipeSurfaceFUCHSIA(
8959     VkInstance                                  instance,
8960     const VkImagePipeSurfaceCreateInfoFUCHSIA*  pCreateInfo,
8961     const VkAllocationCallbacks*                pAllocator,
8962     VkSurfaceKHR*                               pSurface) {
8963     auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map);
8964     bool skip = false;
8965     for (auto intercept : layer_data->object_dispatch) {
8966         auto lock = intercept->write_lock();
8967         skip |= intercept->PreCallValidateCreateImagePipeSurfaceFUCHSIA(instance, pCreateInfo, pAllocator, pSurface);
8968         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
8969     }
8970     for (auto intercept : layer_data->object_dispatch) {
8971         auto lock = intercept->write_lock();
8972         intercept->PreCallRecordCreateImagePipeSurfaceFUCHSIA(instance, pCreateInfo, pAllocator, pSurface);
8973     }
8974     VkResult result = DispatchCreateImagePipeSurfaceFUCHSIA(instance, pCreateInfo, pAllocator, pSurface);
8975     for (auto intercept : layer_data->object_dispatch) {
8976         auto lock = intercept->write_lock();
8977         intercept->PostCallRecordCreateImagePipeSurfaceFUCHSIA(instance, pCreateInfo, pAllocator, pSurface, result);
8978     }
8979     return result;
8980 }
8981 #endif // VK_USE_PLATFORM_FUCHSIA
8982 
8983 #ifdef VK_USE_PLATFORM_METAL_EXT
8984 
CreateMetalSurfaceEXT(VkInstance instance,const VkMetalSurfaceCreateInfoEXT * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkSurfaceKHR * pSurface)8985 VKAPI_ATTR VkResult VKAPI_CALL CreateMetalSurfaceEXT(
8986     VkInstance                                  instance,
8987     const VkMetalSurfaceCreateInfoEXT*          pCreateInfo,
8988     const VkAllocationCallbacks*                pAllocator,
8989     VkSurfaceKHR*                               pSurface) {
8990     auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map);
8991     bool skip = false;
8992     for (auto intercept : layer_data->object_dispatch) {
8993         auto lock = intercept->write_lock();
8994         skip |= intercept->PreCallValidateCreateMetalSurfaceEXT(instance, pCreateInfo, pAllocator, pSurface);
8995         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
8996     }
8997     for (auto intercept : layer_data->object_dispatch) {
8998         auto lock = intercept->write_lock();
8999         intercept->PreCallRecordCreateMetalSurfaceEXT(instance, pCreateInfo, pAllocator, pSurface);
9000     }
9001     VkResult result = DispatchCreateMetalSurfaceEXT(instance, pCreateInfo, pAllocator, pSurface);
9002     for (auto intercept : layer_data->object_dispatch) {
9003         auto lock = intercept->write_lock();
9004         intercept->PostCallRecordCreateMetalSurfaceEXT(instance, pCreateInfo, pAllocator, pSurface, result);
9005     }
9006     return result;
9007 }
9008 #endif // VK_USE_PLATFORM_METAL_EXT
9009 
9010 
9011 
9012 
9013 
9014 
9015 
9016 
9017 
9018 
9019 
9020 
GetBufferDeviceAddressEXT(VkDevice device,const VkBufferDeviceAddressInfoEXT * pInfo)9021 VKAPI_ATTR VkDeviceAddress VKAPI_CALL GetBufferDeviceAddressEXT(
9022     VkDevice                                    device,
9023     const VkBufferDeviceAddressInfoEXT*         pInfo) {
9024     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
9025     bool skip = false;
9026     for (auto intercept : layer_data->object_dispatch) {
9027         auto lock = intercept->write_lock();
9028         skip |= intercept->PreCallValidateGetBufferDeviceAddressEXT(device, pInfo);
9029         if (skip) return 0;
9030     }
9031     for (auto intercept : layer_data->object_dispatch) {
9032         auto lock = intercept->write_lock();
9033         intercept->PreCallRecordGetBufferDeviceAddressEXT(device, pInfo);
9034     }
9035     VkDeviceAddress result = DispatchGetBufferDeviceAddressEXT(device, pInfo);
9036     for (auto intercept : layer_data->object_dispatch) {
9037         auto lock = intercept->write_lock();
9038         intercept->PostCallRecordGetBufferDeviceAddressEXT(device, pInfo);
9039     }
9040     return result;
9041 }
9042 
9043 
9044 
9045 
GetPhysicalDeviceCooperativeMatrixPropertiesNV(VkPhysicalDevice physicalDevice,uint32_t * pPropertyCount,VkCooperativeMatrixPropertiesNV * pProperties)9046 VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceCooperativeMatrixPropertiesNV(
9047     VkPhysicalDevice                            physicalDevice,
9048     uint32_t*                                   pPropertyCount,
9049     VkCooperativeMatrixPropertiesNV*            pProperties) {
9050     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
9051     bool skip = false;
9052     for (auto intercept : layer_data->object_dispatch) {
9053         auto lock = intercept->write_lock();
9054         skip |= intercept->PreCallValidateGetPhysicalDeviceCooperativeMatrixPropertiesNV(physicalDevice, pPropertyCount, pProperties);
9055         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
9056     }
9057     for (auto intercept : layer_data->object_dispatch) {
9058         auto lock = intercept->write_lock();
9059         intercept->PreCallRecordGetPhysicalDeviceCooperativeMatrixPropertiesNV(physicalDevice, pPropertyCount, pProperties);
9060     }
9061     VkResult result = DispatchGetPhysicalDeviceCooperativeMatrixPropertiesNV(physicalDevice, pPropertyCount, pProperties);
9062     for (auto intercept : layer_data->object_dispatch) {
9063         auto lock = intercept->write_lock();
9064         intercept->PostCallRecordGetPhysicalDeviceCooperativeMatrixPropertiesNV(physicalDevice, pPropertyCount, pProperties, result);
9065     }
9066     return result;
9067 }
9068 
9069 
GetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV(VkPhysicalDevice physicalDevice,uint32_t * pCombinationCount,VkFramebufferMixedSamplesCombinationNV * pCombinations)9070 VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV(
9071     VkPhysicalDevice                            physicalDevice,
9072     uint32_t*                                   pCombinationCount,
9073     VkFramebufferMixedSamplesCombinationNV*     pCombinations) {
9074     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
9075     bool skip = false;
9076     for (auto intercept : layer_data->object_dispatch) {
9077         auto lock = intercept->write_lock();
9078         skip |= intercept->PreCallValidateGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV(physicalDevice, pCombinationCount, pCombinations);
9079         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
9080     }
9081     for (auto intercept : layer_data->object_dispatch) {
9082         auto lock = intercept->write_lock();
9083         intercept->PreCallRecordGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV(physicalDevice, pCombinationCount, pCombinations);
9084     }
9085     VkResult result = DispatchGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV(physicalDevice, pCombinationCount, pCombinations);
9086     for (auto intercept : layer_data->object_dispatch) {
9087         auto lock = intercept->write_lock();
9088         intercept->PostCallRecordGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV(physicalDevice, pCombinationCount, pCombinations, result);
9089     }
9090     return result;
9091 }
9092 
9093 
9094 
9095 #ifdef VK_USE_PLATFORM_WIN32_KHR
9096 
GetPhysicalDeviceSurfacePresentModes2EXT(VkPhysicalDevice physicalDevice,const VkPhysicalDeviceSurfaceInfo2KHR * pSurfaceInfo,uint32_t * pPresentModeCount,VkPresentModeKHR * pPresentModes)9097 VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfacePresentModes2EXT(
9098     VkPhysicalDevice                            physicalDevice,
9099     const VkPhysicalDeviceSurfaceInfo2KHR*      pSurfaceInfo,
9100     uint32_t*                                   pPresentModeCount,
9101     VkPresentModeKHR*                           pPresentModes) {
9102     auto layer_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
9103     bool skip = false;
9104     for (auto intercept : layer_data->object_dispatch) {
9105         auto lock = intercept->write_lock();
9106         skip |= intercept->PreCallValidateGetPhysicalDeviceSurfacePresentModes2EXT(physicalDevice, pSurfaceInfo, pPresentModeCount, pPresentModes);
9107         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
9108     }
9109     for (auto intercept : layer_data->object_dispatch) {
9110         auto lock = intercept->write_lock();
9111         intercept->PreCallRecordGetPhysicalDeviceSurfacePresentModes2EXT(physicalDevice, pSurfaceInfo, pPresentModeCount, pPresentModes);
9112     }
9113     VkResult result = DispatchGetPhysicalDeviceSurfacePresentModes2EXT(physicalDevice, pSurfaceInfo, pPresentModeCount, pPresentModes);
9114     for (auto intercept : layer_data->object_dispatch) {
9115         auto lock = intercept->write_lock();
9116         intercept->PostCallRecordGetPhysicalDeviceSurfacePresentModes2EXT(physicalDevice, pSurfaceInfo, pPresentModeCount, pPresentModes, result);
9117     }
9118     return result;
9119 }
9120 
AcquireFullScreenExclusiveModeEXT(VkDevice device,VkSwapchainKHR swapchain)9121 VKAPI_ATTR VkResult VKAPI_CALL AcquireFullScreenExclusiveModeEXT(
9122     VkDevice                                    device,
9123     VkSwapchainKHR                              swapchain) {
9124     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
9125     bool skip = false;
9126     for (auto intercept : layer_data->object_dispatch) {
9127         auto lock = intercept->write_lock();
9128         skip |= intercept->PreCallValidateAcquireFullScreenExclusiveModeEXT(device, swapchain);
9129         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
9130     }
9131     for (auto intercept : layer_data->object_dispatch) {
9132         auto lock = intercept->write_lock();
9133         intercept->PreCallRecordAcquireFullScreenExclusiveModeEXT(device, swapchain);
9134     }
9135     VkResult result = DispatchAcquireFullScreenExclusiveModeEXT(device, swapchain);
9136     for (auto intercept : layer_data->object_dispatch) {
9137         auto lock = intercept->write_lock();
9138         intercept->PostCallRecordAcquireFullScreenExclusiveModeEXT(device, swapchain, result);
9139     }
9140     return result;
9141 }
9142 
ReleaseFullScreenExclusiveModeEXT(VkDevice device,VkSwapchainKHR swapchain)9143 VKAPI_ATTR VkResult VKAPI_CALL ReleaseFullScreenExclusiveModeEXT(
9144     VkDevice                                    device,
9145     VkSwapchainKHR                              swapchain) {
9146     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
9147     bool skip = false;
9148     for (auto intercept : layer_data->object_dispatch) {
9149         auto lock = intercept->write_lock();
9150         skip |= intercept->PreCallValidateReleaseFullScreenExclusiveModeEXT(device, swapchain);
9151         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
9152     }
9153     for (auto intercept : layer_data->object_dispatch) {
9154         auto lock = intercept->write_lock();
9155         intercept->PreCallRecordReleaseFullScreenExclusiveModeEXT(device, swapchain);
9156     }
9157     VkResult result = DispatchReleaseFullScreenExclusiveModeEXT(device, swapchain);
9158     for (auto intercept : layer_data->object_dispatch) {
9159         auto lock = intercept->write_lock();
9160         intercept->PostCallRecordReleaseFullScreenExclusiveModeEXT(device, swapchain, result);
9161     }
9162     return result;
9163 }
9164 
GetDeviceGroupSurfacePresentModes2EXT(VkDevice device,const VkPhysicalDeviceSurfaceInfo2KHR * pSurfaceInfo,VkDeviceGroupPresentModeFlagsKHR * pModes)9165 VKAPI_ATTR VkResult VKAPI_CALL GetDeviceGroupSurfacePresentModes2EXT(
9166     VkDevice                                    device,
9167     const VkPhysicalDeviceSurfaceInfo2KHR*      pSurfaceInfo,
9168     VkDeviceGroupPresentModeFlagsKHR*           pModes) {
9169     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
9170     bool skip = false;
9171     for (auto intercept : layer_data->object_dispatch) {
9172         auto lock = intercept->write_lock();
9173         skip |= intercept->PreCallValidateGetDeviceGroupSurfacePresentModes2EXT(device, pSurfaceInfo, pModes);
9174         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
9175     }
9176     for (auto intercept : layer_data->object_dispatch) {
9177         auto lock = intercept->write_lock();
9178         intercept->PreCallRecordGetDeviceGroupSurfacePresentModes2EXT(device, pSurfaceInfo, pModes);
9179     }
9180     VkResult result = DispatchGetDeviceGroupSurfacePresentModes2EXT(device, pSurfaceInfo, pModes);
9181     for (auto intercept : layer_data->object_dispatch) {
9182         auto lock = intercept->write_lock();
9183         intercept->PostCallRecordGetDeviceGroupSurfacePresentModes2EXT(device, pSurfaceInfo, pModes, result);
9184     }
9185     return result;
9186 }
9187 #endif // VK_USE_PLATFORM_WIN32_KHR
9188 
9189 
CreateHeadlessSurfaceEXT(VkInstance instance,const VkHeadlessSurfaceCreateInfoEXT * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkSurfaceKHR * pSurface)9190 VKAPI_ATTR VkResult VKAPI_CALL CreateHeadlessSurfaceEXT(
9191     VkInstance                                  instance,
9192     const VkHeadlessSurfaceCreateInfoEXT*       pCreateInfo,
9193     const VkAllocationCallbacks*                pAllocator,
9194     VkSurfaceKHR*                               pSurface) {
9195     auto layer_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map);
9196     bool skip = false;
9197     for (auto intercept : layer_data->object_dispatch) {
9198         auto lock = intercept->write_lock();
9199         skip |= intercept->PreCallValidateCreateHeadlessSurfaceEXT(instance, pCreateInfo, pAllocator, pSurface);
9200         if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
9201     }
9202     for (auto intercept : layer_data->object_dispatch) {
9203         auto lock = intercept->write_lock();
9204         intercept->PreCallRecordCreateHeadlessSurfaceEXT(instance, pCreateInfo, pAllocator, pSurface);
9205     }
9206     VkResult result = DispatchCreateHeadlessSurfaceEXT(instance, pCreateInfo, pAllocator, pSurface);
9207     for (auto intercept : layer_data->object_dispatch) {
9208         auto lock = intercept->write_lock();
9209         intercept->PostCallRecordCreateHeadlessSurfaceEXT(instance, pCreateInfo, pAllocator, pSurface, result);
9210     }
9211     return result;
9212 }
9213 
9214 
CmdSetLineStippleEXT(VkCommandBuffer commandBuffer,uint32_t lineStippleFactor,uint16_t lineStipplePattern)9215 VKAPI_ATTR void VKAPI_CALL CmdSetLineStippleEXT(
9216     VkCommandBuffer                             commandBuffer,
9217     uint32_t                                    lineStippleFactor,
9218     uint16_t                                    lineStipplePattern) {
9219     auto layer_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
9220     bool skip = false;
9221     for (auto intercept : layer_data->object_dispatch) {
9222         auto lock = intercept->write_lock();
9223         skip |= intercept->PreCallValidateCmdSetLineStippleEXT(commandBuffer, lineStippleFactor, lineStipplePattern);
9224         if (skip) return;
9225     }
9226     for (auto intercept : layer_data->object_dispatch) {
9227         auto lock = intercept->write_lock();
9228         intercept->PreCallRecordCmdSetLineStippleEXT(commandBuffer, lineStippleFactor, lineStipplePattern);
9229     }
9230     DispatchCmdSetLineStippleEXT(commandBuffer, lineStippleFactor, lineStipplePattern);
9231     for (auto intercept : layer_data->object_dispatch) {
9232         auto lock = intercept->write_lock();
9233         intercept->PostCallRecordCmdSetLineStippleEXT(commandBuffer, lineStippleFactor, lineStipplePattern);
9234     }
9235 }
9236 
9237 
ResetQueryPoolEXT(VkDevice device,VkQueryPool queryPool,uint32_t firstQuery,uint32_t queryCount)9238 VKAPI_ATTR void VKAPI_CALL ResetQueryPoolEXT(
9239     VkDevice                                    device,
9240     VkQueryPool                                 queryPool,
9241     uint32_t                                    firstQuery,
9242     uint32_t                                    queryCount) {
9243     auto layer_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
9244     bool skip = false;
9245     for (auto intercept : layer_data->object_dispatch) {
9246         auto lock = intercept->write_lock();
9247         skip |= intercept->PreCallValidateResetQueryPoolEXT(device, queryPool, firstQuery, queryCount);
9248         if (skip) return;
9249     }
9250     for (auto intercept : layer_data->object_dispatch) {
9251         auto lock = intercept->write_lock();
9252         intercept->PreCallRecordResetQueryPoolEXT(device, queryPool, firstQuery, queryCount);
9253     }
9254     DispatchResetQueryPoolEXT(device, queryPool, firstQuery, queryCount);
9255     for (auto intercept : layer_data->object_dispatch) {
9256         auto lock = intercept->write_lock();
9257         intercept->PostCallRecordResetQueryPoolEXT(device, queryPool, firstQuery, queryCount);
9258     }
9259 }
9260 
9261 
9262 
9263 
9264 // Map of intercepted ApiName to its associated function data
9265 const std::unordered_map<std::string, function_data> name_to_funcptr_map = {
9266     {"vkCreateInstance", {true, (void*)CreateInstance}},
9267     {"vkDestroyInstance", {true, (void*)DestroyInstance}},
9268     {"vkEnumeratePhysicalDevices", {true, (void*)EnumeratePhysicalDevices}},
9269     {"vkGetPhysicalDeviceFeatures", {true, (void*)GetPhysicalDeviceFeatures}},
9270     {"vkGetPhysicalDeviceFormatProperties", {true, (void*)GetPhysicalDeviceFormatProperties}},
9271     {"vkGetPhysicalDeviceImageFormatProperties", {true, (void*)GetPhysicalDeviceImageFormatProperties}},
9272     {"vkGetPhysicalDeviceProperties", {true, (void*)GetPhysicalDeviceProperties}},
9273     {"vkGetPhysicalDeviceQueueFamilyProperties", {true, (void*)GetPhysicalDeviceQueueFamilyProperties}},
9274     {"vkGetPhysicalDeviceMemoryProperties", {true, (void*)GetPhysicalDeviceMemoryProperties}},
9275     {"vkGetInstanceProcAddr", {true, (void*)GetInstanceProcAddr}},
9276     {"vkGetDeviceProcAddr", {false, (void*)GetDeviceProcAddr}},
9277     {"vkCreateDevice", {true, (void*)CreateDevice}},
9278     {"vkDestroyDevice", {false, (void*)DestroyDevice}},
9279     {"vkEnumerateInstanceExtensionProperties", {false, (void*)EnumerateInstanceExtensionProperties}},
9280     {"vkEnumerateDeviceExtensionProperties", {true, (void*)EnumerateDeviceExtensionProperties}},
9281     {"vkEnumerateInstanceLayerProperties", {false, (void*)EnumerateInstanceLayerProperties}},
9282     {"vkEnumerateDeviceLayerProperties", {true, (void*)EnumerateDeviceLayerProperties}},
9283     {"vkGetDeviceQueue", {false, (void*)GetDeviceQueue}},
9284     {"vkQueueSubmit", {false, (void*)QueueSubmit}},
9285     {"vkQueueWaitIdle", {false, (void*)QueueWaitIdle}},
9286     {"vkDeviceWaitIdle", {false, (void*)DeviceWaitIdle}},
9287     {"vkAllocateMemory", {false, (void*)AllocateMemory}},
9288     {"vkFreeMemory", {false, (void*)FreeMemory}},
9289     {"vkMapMemory", {false, (void*)MapMemory}},
9290     {"vkUnmapMemory", {false, (void*)UnmapMemory}},
9291     {"vkFlushMappedMemoryRanges", {false, (void*)FlushMappedMemoryRanges}},
9292     {"vkInvalidateMappedMemoryRanges", {false, (void*)InvalidateMappedMemoryRanges}},
9293     {"vkGetDeviceMemoryCommitment", {false, (void*)GetDeviceMemoryCommitment}},
9294     {"vkBindBufferMemory", {false, (void*)BindBufferMemory}},
9295     {"vkBindImageMemory", {false, (void*)BindImageMemory}},
9296     {"vkGetBufferMemoryRequirements", {false, (void*)GetBufferMemoryRequirements}},
9297     {"vkGetImageMemoryRequirements", {false, (void*)GetImageMemoryRequirements}},
9298     {"vkGetImageSparseMemoryRequirements", {false, (void*)GetImageSparseMemoryRequirements}},
9299     {"vkGetPhysicalDeviceSparseImageFormatProperties", {true, (void*)GetPhysicalDeviceSparseImageFormatProperties}},
9300     {"vkQueueBindSparse", {false, (void*)QueueBindSparse}},
9301     {"vkCreateFence", {false, (void*)CreateFence}},
9302     {"vkDestroyFence", {false, (void*)DestroyFence}},
9303     {"vkResetFences", {false, (void*)ResetFences}},
9304     {"vkGetFenceStatus", {false, (void*)GetFenceStatus}},
9305     {"vkWaitForFences", {false, (void*)WaitForFences}},
9306     {"vkCreateSemaphore", {false, (void*)CreateSemaphore}},
9307     {"vkDestroySemaphore", {false, (void*)DestroySemaphore}},
9308     {"vkCreateEvent", {false, (void*)CreateEvent}},
9309     {"vkDestroyEvent", {false, (void*)DestroyEvent}},
9310     {"vkGetEventStatus", {false, (void*)GetEventStatus}},
9311     {"vkSetEvent", {false, (void*)SetEvent}},
9312     {"vkResetEvent", {false, (void*)ResetEvent}},
9313     {"vkCreateQueryPool", {false, (void*)CreateQueryPool}},
9314     {"vkDestroyQueryPool", {false, (void*)DestroyQueryPool}},
9315     {"vkGetQueryPoolResults", {false, (void*)GetQueryPoolResults}},
9316     {"vkCreateBuffer", {false, (void*)CreateBuffer}},
9317     {"vkDestroyBuffer", {false, (void*)DestroyBuffer}},
9318     {"vkCreateBufferView", {false, (void*)CreateBufferView}},
9319     {"vkDestroyBufferView", {false, (void*)DestroyBufferView}},
9320     {"vkCreateImage", {false, (void*)CreateImage}},
9321     {"vkDestroyImage", {false, (void*)DestroyImage}},
9322     {"vkGetImageSubresourceLayout", {false, (void*)GetImageSubresourceLayout}},
9323     {"vkCreateImageView", {false, (void*)CreateImageView}},
9324     {"vkDestroyImageView", {false, (void*)DestroyImageView}},
9325     {"vkCreateShaderModule", {false, (void*)CreateShaderModule}},
9326     {"vkDestroyShaderModule", {false, (void*)DestroyShaderModule}},
9327     {"vkCreatePipelineCache", {false, (void*)CreatePipelineCache}},
9328     {"vkDestroyPipelineCache", {false, (void*)DestroyPipelineCache}},
9329     {"vkGetPipelineCacheData", {false, (void*)GetPipelineCacheData}},
9330     {"vkMergePipelineCaches", {false, (void*)MergePipelineCaches}},
9331     {"vkCreateGraphicsPipelines", {false, (void*)CreateGraphicsPipelines}},
9332     {"vkCreateComputePipelines", {false, (void*)CreateComputePipelines}},
9333     {"vkDestroyPipeline", {false, (void*)DestroyPipeline}},
9334     {"vkCreatePipelineLayout", {false, (void*)CreatePipelineLayout}},
9335     {"vkDestroyPipelineLayout", {false, (void*)DestroyPipelineLayout}},
9336     {"vkCreateSampler", {false, (void*)CreateSampler}},
9337     {"vkDestroySampler", {false, (void*)DestroySampler}},
9338     {"vkCreateDescriptorSetLayout", {false, (void*)CreateDescriptorSetLayout}},
9339     {"vkDestroyDescriptorSetLayout", {false, (void*)DestroyDescriptorSetLayout}},
9340     {"vkCreateDescriptorPool", {false, (void*)CreateDescriptorPool}},
9341     {"vkDestroyDescriptorPool", {false, (void*)DestroyDescriptorPool}},
9342     {"vkResetDescriptorPool", {false, (void*)ResetDescriptorPool}},
9343     {"vkAllocateDescriptorSets", {false, (void*)AllocateDescriptorSets}},
9344     {"vkFreeDescriptorSets", {false, (void*)FreeDescriptorSets}},
9345     {"vkUpdateDescriptorSets", {false, (void*)UpdateDescriptorSets}},
9346     {"vkCreateFramebuffer", {false, (void*)CreateFramebuffer}},
9347     {"vkDestroyFramebuffer", {false, (void*)DestroyFramebuffer}},
9348     {"vkCreateRenderPass", {false, (void*)CreateRenderPass}},
9349     {"vkDestroyRenderPass", {false, (void*)DestroyRenderPass}},
9350     {"vkGetRenderAreaGranularity", {false, (void*)GetRenderAreaGranularity}},
9351     {"vkCreateCommandPool", {false, (void*)CreateCommandPool}},
9352     {"vkDestroyCommandPool", {false, (void*)DestroyCommandPool}},
9353     {"vkResetCommandPool", {false, (void*)ResetCommandPool}},
9354     {"vkAllocateCommandBuffers", {false, (void*)AllocateCommandBuffers}},
9355     {"vkFreeCommandBuffers", {false, (void*)FreeCommandBuffers}},
9356     {"vkBeginCommandBuffer", {false, (void*)BeginCommandBuffer}},
9357     {"vkEndCommandBuffer", {false, (void*)EndCommandBuffer}},
9358     {"vkResetCommandBuffer", {false, (void*)ResetCommandBuffer}},
9359     {"vkCmdBindPipeline", {false, (void*)CmdBindPipeline}},
9360     {"vkCmdSetViewport", {false, (void*)CmdSetViewport}},
9361     {"vkCmdSetScissor", {false, (void*)CmdSetScissor}},
9362     {"vkCmdSetLineWidth", {false, (void*)CmdSetLineWidth}},
9363     {"vkCmdSetDepthBias", {false, (void*)CmdSetDepthBias}},
9364     {"vkCmdSetBlendConstants", {false, (void*)CmdSetBlendConstants}},
9365     {"vkCmdSetDepthBounds", {false, (void*)CmdSetDepthBounds}},
9366     {"vkCmdSetStencilCompareMask", {false, (void*)CmdSetStencilCompareMask}},
9367     {"vkCmdSetStencilWriteMask", {false, (void*)CmdSetStencilWriteMask}},
9368     {"vkCmdSetStencilReference", {false, (void*)CmdSetStencilReference}},
9369     {"vkCmdBindDescriptorSets", {false, (void*)CmdBindDescriptorSets}},
9370     {"vkCmdBindIndexBuffer", {false, (void*)CmdBindIndexBuffer}},
9371     {"vkCmdBindVertexBuffers", {false, (void*)CmdBindVertexBuffers}},
9372     {"vkCmdDraw", {false, (void*)CmdDraw}},
9373     {"vkCmdDrawIndexed", {false, (void*)CmdDrawIndexed}},
9374     {"vkCmdDrawIndirect", {false, (void*)CmdDrawIndirect}},
9375     {"vkCmdDrawIndexedIndirect", {false, (void*)CmdDrawIndexedIndirect}},
9376     {"vkCmdDispatch", {false, (void*)CmdDispatch}},
9377     {"vkCmdDispatchIndirect", {false, (void*)CmdDispatchIndirect}},
9378     {"vkCmdCopyBuffer", {false, (void*)CmdCopyBuffer}},
9379     {"vkCmdCopyImage", {false, (void*)CmdCopyImage}},
9380     {"vkCmdBlitImage", {false, (void*)CmdBlitImage}},
9381     {"vkCmdCopyBufferToImage", {false, (void*)CmdCopyBufferToImage}},
9382     {"vkCmdCopyImageToBuffer", {false, (void*)CmdCopyImageToBuffer}},
9383     {"vkCmdUpdateBuffer", {false, (void*)CmdUpdateBuffer}},
9384     {"vkCmdFillBuffer", {false, (void*)CmdFillBuffer}},
9385     {"vkCmdClearColorImage", {false, (void*)CmdClearColorImage}},
9386     {"vkCmdClearDepthStencilImage", {false, (void*)CmdClearDepthStencilImage}},
9387     {"vkCmdClearAttachments", {false, (void*)CmdClearAttachments}},
9388     {"vkCmdResolveImage", {false, (void*)CmdResolveImage}},
9389     {"vkCmdSetEvent", {false, (void*)CmdSetEvent}},
9390     {"vkCmdResetEvent", {false, (void*)CmdResetEvent}},
9391     {"vkCmdWaitEvents", {false, (void*)CmdWaitEvents}},
9392     {"vkCmdPipelineBarrier", {false, (void*)CmdPipelineBarrier}},
9393     {"vkCmdBeginQuery", {false, (void*)CmdBeginQuery}},
9394     {"vkCmdEndQuery", {false, (void*)CmdEndQuery}},
9395     {"vkCmdResetQueryPool", {false, (void*)CmdResetQueryPool}},
9396     {"vkCmdWriteTimestamp", {false, (void*)CmdWriteTimestamp}},
9397     {"vkCmdCopyQueryPoolResults", {false, (void*)CmdCopyQueryPoolResults}},
9398     {"vkCmdPushConstants", {false, (void*)CmdPushConstants}},
9399     {"vkCmdBeginRenderPass", {false, (void*)CmdBeginRenderPass}},
9400     {"vkCmdNextSubpass", {false, (void*)CmdNextSubpass}},
9401     {"vkCmdEndRenderPass", {false, (void*)CmdEndRenderPass}},
9402     {"vkCmdExecuteCommands", {false, (void*)CmdExecuteCommands}},
9403     {"vkBindBufferMemory2", {false, (void*)BindBufferMemory2}},
9404     {"vkBindImageMemory2", {false, (void*)BindImageMemory2}},
9405     {"vkGetDeviceGroupPeerMemoryFeatures", {false, (void*)GetDeviceGroupPeerMemoryFeatures}},
9406     {"vkCmdSetDeviceMask", {false, (void*)CmdSetDeviceMask}},
9407     {"vkCmdDispatchBase", {false, (void*)CmdDispatchBase}},
9408     {"vkEnumeratePhysicalDeviceGroups", {true, (void*)EnumeratePhysicalDeviceGroups}},
9409     {"vkGetImageMemoryRequirements2", {false, (void*)GetImageMemoryRequirements2}},
9410     {"vkGetBufferMemoryRequirements2", {false, (void*)GetBufferMemoryRequirements2}},
9411     {"vkGetImageSparseMemoryRequirements2", {false, (void*)GetImageSparseMemoryRequirements2}},
9412     {"vkGetPhysicalDeviceFeatures2", {true, (void*)GetPhysicalDeviceFeatures2}},
9413     {"vkGetPhysicalDeviceProperties2", {true, (void*)GetPhysicalDeviceProperties2}},
9414     {"vkGetPhysicalDeviceFormatProperties2", {true, (void*)GetPhysicalDeviceFormatProperties2}},
9415     {"vkGetPhysicalDeviceImageFormatProperties2", {true, (void*)GetPhysicalDeviceImageFormatProperties2}},
9416     {"vkGetPhysicalDeviceQueueFamilyProperties2", {true, (void*)GetPhysicalDeviceQueueFamilyProperties2}},
9417     {"vkGetPhysicalDeviceMemoryProperties2", {true, (void*)GetPhysicalDeviceMemoryProperties2}},
9418     {"vkGetPhysicalDeviceSparseImageFormatProperties2", {true, (void*)GetPhysicalDeviceSparseImageFormatProperties2}},
9419     {"vkTrimCommandPool", {false, (void*)TrimCommandPool}},
9420     {"vkGetDeviceQueue2", {false, (void*)GetDeviceQueue2}},
9421     {"vkCreateSamplerYcbcrConversion", {false, (void*)CreateSamplerYcbcrConversion}},
9422     {"vkDestroySamplerYcbcrConversion", {false, (void*)DestroySamplerYcbcrConversion}},
9423     {"vkCreateDescriptorUpdateTemplate", {false, (void*)CreateDescriptorUpdateTemplate}},
9424     {"vkDestroyDescriptorUpdateTemplate", {false, (void*)DestroyDescriptorUpdateTemplate}},
9425     {"vkUpdateDescriptorSetWithTemplate", {false, (void*)UpdateDescriptorSetWithTemplate}},
9426     {"vkGetPhysicalDeviceExternalBufferProperties", {true, (void*)GetPhysicalDeviceExternalBufferProperties}},
9427     {"vkGetPhysicalDeviceExternalFenceProperties", {true, (void*)GetPhysicalDeviceExternalFenceProperties}},
9428     {"vkGetPhysicalDeviceExternalSemaphoreProperties", {true, (void*)GetPhysicalDeviceExternalSemaphoreProperties}},
9429     {"vkGetDescriptorSetLayoutSupport", {false, (void*)GetDescriptorSetLayoutSupport}},
9430     {"vkDestroySurfaceKHR", {true, (void*)DestroySurfaceKHR}},
9431     {"vkGetPhysicalDeviceSurfaceSupportKHR", {true, (void*)GetPhysicalDeviceSurfaceSupportKHR}},
9432     {"vkGetPhysicalDeviceSurfaceCapabilitiesKHR", {true, (void*)GetPhysicalDeviceSurfaceCapabilitiesKHR}},
9433     {"vkGetPhysicalDeviceSurfaceFormatsKHR", {true, (void*)GetPhysicalDeviceSurfaceFormatsKHR}},
9434     {"vkGetPhysicalDeviceSurfacePresentModesKHR", {true, (void*)GetPhysicalDeviceSurfacePresentModesKHR}},
9435     {"vkCreateSwapchainKHR", {false, (void*)CreateSwapchainKHR}},
9436     {"vkDestroySwapchainKHR", {false, (void*)DestroySwapchainKHR}},
9437     {"vkGetSwapchainImagesKHR", {false, (void*)GetSwapchainImagesKHR}},
9438     {"vkAcquireNextImageKHR", {false, (void*)AcquireNextImageKHR}},
9439     {"vkQueuePresentKHR", {false, (void*)QueuePresentKHR}},
9440     {"vkGetDeviceGroupPresentCapabilitiesKHR", {false, (void*)GetDeviceGroupPresentCapabilitiesKHR}},
9441     {"vkGetDeviceGroupSurfacePresentModesKHR", {false, (void*)GetDeviceGroupSurfacePresentModesKHR}},
9442     {"vkGetPhysicalDevicePresentRectanglesKHR", {true, (void*)GetPhysicalDevicePresentRectanglesKHR}},
9443     {"vkAcquireNextImage2KHR", {false, (void*)AcquireNextImage2KHR}},
9444     {"vkGetPhysicalDeviceDisplayPropertiesKHR", {true, (void*)GetPhysicalDeviceDisplayPropertiesKHR}},
9445     {"vkGetPhysicalDeviceDisplayPlanePropertiesKHR", {true, (void*)GetPhysicalDeviceDisplayPlanePropertiesKHR}},
9446     {"vkGetDisplayPlaneSupportedDisplaysKHR", {true, (void*)GetDisplayPlaneSupportedDisplaysKHR}},
9447     {"vkGetDisplayModePropertiesKHR", {true, (void*)GetDisplayModePropertiesKHR}},
9448     {"vkCreateDisplayModeKHR", {true, (void*)CreateDisplayModeKHR}},
9449     {"vkGetDisplayPlaneCapabilitiesKHR", {true, (void*)GetDisplayPlaneCapabilitiesKHR}},
9450     {"vkCreateDisplayPlaneSurfaceKHR", {true, (void*)CreateDisplayPlaneSurfaceKHR}},
9451     {"vkCreateSharedSwapchainsKHR", {false, (void*)CreateSharedSwapchainsKHR}},
9452 #ifdef VK_USE_PLATFORM_XLIB_KHR
9453     {"vkCreateXlibSurfaceKHR", {true, (void*)CreateXlibSurfaceKHR}},
9454 #endif
9455 #ifdef VK_USE_PLATFORM_XLIB_KHR
9456     {"vkGetPhysicalDeviceXlibPresentationSupportKHR", {true, (void*)GetPhysicalDeviceXlibPresentationSupportKHR}},
9457 #endif
9458 #ifdef VK_USE_PLATFORM_XCB_KHR
9459     {"vkCreateXcbSurfaceKHR", {true, (void*)CreateXcbSurfaceKHR}},
9460 #endif
9461 #ifdef VK_USE_PLATFORM_XCB_KHR
9462     {"vkGetPhysicalDeviceXcbPresentationSupportKHR", {true, (void*)GetPhysicalDeviceXcbPresentationSupportKHR}},
9463 #endif
9464 #ifdef VK_USE_PLATFORM_WAYLAND_KHR
9465     {"vkCreateWaylandSurfaceKHR", {true, (void*)CreateWaylandSurfaceKHR}},
9466 #endif
9467 #ifdef VK_USE_PLATFORM_WAYLAND_KHR
9468     {"vkGetPhysicalDeviceWaylandPresentationSupportKHR", {true, (void*)GetPhysicalDeviceWaylandPresentationSupportKHR}},
9469 #endif
9470 #ifdef VK_USE_PLATFORM_ANDROID_KHR
9471     {"vkCreateAndroidSurfaceKHR", {true, (void*)CreateAndroidSurfaceKHR}},
9472 #endif
9473 #ifdef VK_USE_PLATFORM_WIN32_KHR
9474     {"vkCreateWin32SurfaceKHR", {true, (void*)CreateWin32SurfaceKHR}},
9475 #endif
9476 #ifdef VK_USE_PLATFORM_WIN32_KHR
9477     {"vkGetPhysicalDeviceWin32PresentationSupportKHR", {true, (void*)GetPhysicalDeviceWin32PresentationSupportKHR}},
9478 #endif
9479     {"vkGetPhysicalDeviceFeatures2KHR", {true, (void*)GetPhysicalDeviceFeatures2KHR}},
9480     {"vkGetPhysicalDeviceProperties2KHR", {true, (void*)GetPhysicalDeviceProperties2KHR}},
9481     {"vkGetPhysicalDeviceFormatProperties2KHR", {true, (void*)GetPhysicalDeviceFormatProperties2KHR}},
9482     {"vkGetPhysicalDeviceImageFormatProperties2KHR", {true, (void*)GetPhysicalDeviceImageFormatProperties2KHR}},
9483     {"vkGetPhysicalDeviceQueueFamilyProperties2KHR", {true, (void*)GetPhysicalDeviceQueueFamilyProperties2KHR}},
9484     {"vkGetPhysicalDeviceMemoryProperties2KHR", {true, (void*)GetPhysicalDeviceMemoryProperties2KHR}},
9485     {"vkGetPhysicalDeviceSparseImageFormatProperties2KHR", {true, (void*)GetPhysicalDeviceSparseImageFormatProperties2KHR}},
9486     {"vkGetDeviceGroupPeerMemoryFeaturesKHR", {false, (void*)GetDeviceGroupPeerMemoryFeaturesKHR}},
9487     {"vkCmdSetDeviceMaskKHR", {false, (void*)CmdSetDeviceMaskKHR}},
9488     {"vkCmdDispatchBaseKHR", {false, (void*)CmdDispatchBaseKHR}},
9489     {"vkTrimCommandPoolKHR", {false, (void*)TrimCommandPoolKHR}},
9490     {"vkEnumeratePhysicalDeviceGroupsKHR", {true, (void*)EnumeratePhysicalDeviceGroupsKHR}},
9491     {"vkGetPhysicalDeviceExternalBufferPropertiesKHR", {true, (void*)GetPhysicalDeviceExternalBufferPropertiesKHR}},
9492 #ifdef VK_USE_PLATFORM_WIN32_KHR
9493     {"vkGetMemoryWin32HandleKHR", {false, (void*)GetMemoryWin32HandleKHR}},
9494 #endif
9495 #ifdef VK_USE_PLATFORM_WIN32_KHR
9496     {"vkGetMemoryWin32HandlePropertiesKHR", {false, (void*)GetMemoryWin32HandlePropertiesKHR}},
9497 #endif
9498     {"vkGetMemoryFdKHR", {false, (void*)GetMemoryFdKHR}},
9499     {"vkGetMemoryFdPropertiesKHR", {false, (void*)GetMemoryFdPropertiesKHR}},
9500     {"vkGetPhysicalDeviceExternalSemaphorePropertiesKHR", {true, (void*)GetPhysicalDeviceExternalSemaphorePropertiesKHR}},
9501 #ifdef VK_USE_PLATFORM_WIN32_KHR
9502     {"vkImportSemaphoreWin32HandleKHR", {false, (void*)ImportSemaphoreWin32HandleKHR}},
9503 #endif
9504 #ifdef VK_USE_PLATFORM_WIN32_KHR
9505     {"vkGetSemaphoreWin32HandleKHR", {false, (void*)GetSemaphoreWin32HandleKHR}},
9506 #endif
9507     {"vkImportSemaphoreFdKHR", {false, (void*)ImportSemaphoreFdKHR}},
9508     {"vkGetSemaphoreFdKHR", {false, (void*)GetSemaphoreFdKHR}},
9509     {"vkCmdPushDescriptorSetKHR", {false, (void*)CmdPushDescriptorSetKHR}},
9510     {"vkCmdPushDescriptorSetWithTemplateKHR", {false, (void*)CmdPushDescriptorSetWithTemplateKHR}},
9511     {"vkCreateDescriptorUpdateTemplateKHR", {false, (void*)CreateDescriptorUpdateTemplateKHR}},
9512     {"vkDestroyDescriptorUpdateTemplateKHR", {false, (void*)DestroyDescriptorUpdateTemplateKHR}},
9513     {"vkUpdateDescriptorSetWithTemplateKHR", {false, (void*)UpdateDescriptorSetWithTemplateKHR}},
9514     {"vkCreateRenderPass2KHR", {false, (void*)CreateRenderPass2KHR}},
9515     {"vkCmdBeginRenderPass2KHR", {false, (void*)CmdBeginRenderPass2KHR}},
9516     {"vkCmdNextSubpass2KHR", {false, (void*)CmdNextSubpass2KHR}},
9517     {"vkCmdEndRenderPass2KHR", {false, (void*)CmdEndRenderPass2KHR}},
9518     {"vkGetSwapchainStatusKHR", {false, (void*)GetSwapchainStatusKHR}},
9519     {"vkGetPhysicalDeviceExternalFencePropertiesKHR", {true, (void*)GetPhysicalDeviceExternalFencePropertiesKHR}},
9520 #ifdef VK_USE_PLATFORM_WIN32_KHR
9521     {"vkImportFenceWin32HandleKHR", {false, (void*)ImportFenceWin32HandleKHR}},
9522 #endif
9523 #ifdef VK_USE_PLATFORM_WIN32_KHR
9524     {"vkGetFenceWin32HandleKHR", {false, (void*)GetFenceWin32HandleKHR}},
9525 #endif
9526     {"vkImportFenceFdKHR", {false, (void*)ImportFenceFdKHR}},
9527     {"vkGetFenceFdKHR", {false, (void*)GetFenceFdKHR}},
9528     {"vkGetPhysicalDeviceSurfaceCapabilities2KHR", {true, (void*)GetPhysicalDeviceSurfaceCapabilities2KHR}},
9529     {"vkGetPhysicalDeviceSurfaceFormats2KHR", {true, (void*)GetPhysicalDeviceSurfaceFormats2KHR}},
9530     {"vkGetPhysicalDeviceDisplayProperties2KHR", {true, (void*)GetPhysicalDeviceDisplayProperties2KHR}},
9531     {"vkGetPhysicalDeviceDisplayPlaneProperties2KHR", {true, (void*)GetPhysicalDeviceDisplayPlaneProperties2KHR}},
9532     {"vkGetDisplayModeProperties2KHR", {true, (void*)GetDisplayModeProperties2KHR}},
9533     {"vkGetDisplayPlaneCapabilities2KHR", {true, (void*)GetDisplayPlaneCapabilities2KHR}},
9534     {"vkGetImageMemoryRequirements2KHR", {false, (void*)GetImageMemoryRequirements2KHR}},
9535     {"vkGetBufferMemoryRequirements2KHR", {false, (void*)GetBufferMemoryRequirements2KHR}},
9536     {"vkGetImageSparseMemoryRequirements2KHR", {false, (void*)GetImageSparseMemoryRequirements2KHR}},
9537     {"vkCreateSamplerYcbcrConversionKHR", {false, (void*)CreateSamplerYcbcrConversionKHR}},
9538     {"vkDestroySamplerYcbcrConversionKHR", {false, (void*)DestroySamplerYcbcrConversionKHR}},
9539     {"vkBindBufferMemory2KHR", {false, (void*)BindBufferMemory2KHR}},
9540     {"vkBindImageMemory2KHR", {false, (void*)BindImageMemory2KHR}},
9541     {"vkGetDescriptorSetLayoutSupportKHR", {false, (void*)GetDescriptorSetLayoutSupportKHR}},
9542     {"vkCmdDrawIndirectCountKHR", {false, (void*)CmdDrawIndirectCountKHR}},
9543     {"vkCmdDrawIndexedIndirectCountKHR", {false, (void*)CmdDrawIndexedIndirectCountKHR}},
9544     {"vkGetPipelineExecutablePropertiesKHR", {false, (void*)GetPipelineExecutablePropertiesKHR}},
9545     {"vkGetPipelineExecutableStatisticsKHR", {false, (void*)GetPipelineExecutableStatisticsKHR}},
9546     {"vkGetPipelineExecutableInternalRepresentationsKHR", {false, (void*)GetPipelineExecutableInternalRepresentationsKHR}},
9547     {"vkCreateDebugReportCallbackEXT", {true, (void*)CreateDebugReportCallbackEXT}},
9548     {"vkDestroyDebugReportCallbackEXT", {true, (void*)DestroyDebugReportCallbackEXT}},
9549     {"vkDebugReportMessageEXT", {true, (void*)DebugReportMessageEXT}},
9550     {"vkDebugMarkerSetObjectTagEXT", {false, (void*)DebugMarkerSetObjectTagEXT}},
9551     {"vkDebugMarkerSetObjectNameEXT", {false, (void*)DebugMarkerSetObjectNameEXT}},
9552     {"vkCmdDebugMarkerBeginEXT", {false, (void*)CmdDebugMarkerBeginEXT}},
9553     {"vkCmdDebugMarkerEndEXT", {false, (void*)CmdDebugMarkerEndEXT}},
9554     {"vkCmdDebugMarkerInsertEXT", {false, (void*)CmdDebugMarkerInsertEXT}},
9555     {"vkCmdBindTransformFeedbackBuffersEXT", {false, (void*)CmdBindTransformFeedbackBuffersEXT}},
9556     {"vkCmdBeginTransformFeedbackEXT", {false, (void*)CmdBeginTransformFeedbackEXT}},
9557     {"vkCmdEndTransformFeedbackEXT", {false, (void*)CmdEndTransformFeedbackEXT}},
9558     {"vkCmdBeginQueryIndexedEXT", {false, (void*)CmdBeginQueryIndexedEXT}},
9559     {"vkCmdEndQueryIndexedEXT", {false, (void*)CmdEndQueryIndexedEXT}},
9560     {"vkCmdDrawIndirectByteCountEXT", {false, (void*)CmdDrawIndirectByteCountEXT}},
9561     {"vkGetImageViewHandleNVX", {false, (void*)GetImageViewHandleNVX}},
9562     {"vkCmdDrawIndirectCountAMD", {false, (void*)CmdDrawIndirectCountAMD}},
9563     {"vkCmdDrawIndexedIndirectCountAMD", {false, (void*)CmdDrawIndexedIndirectCountAMD}},
9564     {"vkGetShaderInfoAMD", {false, (void*)GetShaderInfoAMD}},
9565 #ifdef VK_USE_PLATFORM_GGP
9566     {"vkCreateStreamDescriptorSurfaceGGP", {true, (void*)CreateStreamDescriptorSurfaceGGP}},
9567 #endif
9568     {"vkGetPhysicalDeviceExternalImageFormatPropertiesNV", {true, (void*)GetPhysicalDeviceExternalImageFormatPropertiesNV}},
9569 #ifdef VK_USE_PLATFORM_WIN32_KHR
9570     {"vkGetMemoryWin32HandleNV", {false, (void*)GetMemoryWin32HandleNV}},
9571 #endif
9572 #ifdef VK_USE_PLATFORM_VI_NN
9573     {"vkCreateViSurfaceNN", {true, (void*)CreateViSurfaceNN}},
9574 #endif
9575     {"vkCmdBeginConditionalRenderingEXT", {false, (void*)CmdBeginConditionalRenderingEXT}},
9576     {"vkCmdEndConditionalRenderingEXT", {false, (void*)CmdEndConditionalRenderingEXT}},
9577     {"vkCmdProcessCommandsNVX", {false, (void*)CmdProcessCommandsNVX}},
9578     {"vkCmdReserveSpaceForCommandsNVX", {false, (void*)CmdReserveSpaceForCommandsNVX}},
9579     {"vkCreateIndirectCommandsLayoutNVX", {false, (void*)CreateIndirectCommandsLayoutNVX}},
9580     {"vkDestroyIndirectCommandsLayoutNVX", {false, (void*)DestroyIndirectCommandsLayoutNVX}},
9581     {"vkCreateObjectTableNVX", {false, (void*)CreateObjectTableNVX}},
9582     {"vkDestroyObjectTableNVX", {false, (void*)DestroyObjectTableNVX}},
9583     {"vkRegisterObjectsNVX", {false, (void*)RegisterObjectsNVX}},
9584     {"vkUnregisterObjectsNVX", {false, (void*)UnregisterObjectsNVX}},
9585     {"vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX", {true, (void*)GetPhysicalDeviceGeneratedCommandsPropertiesNVX}},
9586     {"vkCmdSetViewportWScalingNV", {false, (void*)CmdSetViewportWScalingNV}},
9587     {"vkReleaseDisplayEXT", {true, (void*)ReleaseDisplayEXT}},
9588 #ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT
9589     {"vkAcquireXlibDisplayEXT", {true, (void*)AcquireXlibDisplayEXT}},
9590 #endif
9591 #ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT
9592     {"vkGetRandROutputDisplayEXT", {true, (void*)GetRandROutputDisplayEXT}},
9593 #endif
9594     {"vkGetPhysicalDeviceSurfaceCapabilities2EXT", {true, (void*)GetPhysicalDeviceSurfaceCapabilities2EXT}},
9595     {"vkDisplayPowerControlEXT", {false, (void*)DisplayPowerControlEXT}},
9596     {"vkRegisterDeviceEventEXT", {false, (void*)RegisterDeviceEventEXT}},
9597     {"vkRegisterDisplayEventEXT", {false, (void*)RegisterDisplayEventEXT}},
9598     {"vkGetSwapchainCounterEXT", {false, (void*)GetSwapchainCounterEXT}},
9599     {"vkGetRefreshCycleDurationGOOGLE", {false, (void*)GetRefreshCycleDurationGOOGLE}},
9600     {"vkGetPastPresentationTimingGOOGLE", {false, (void*)GetPastPresentationTimingGOOGLE}},
9601     {"vkCmdSetDiscardRectangleEXT", {false, (void*)CmdSetDiscardRectangleEXT}},
9602     {"vkSetHdrMetadataEXT", {false, (void*)SetHdrMetadataEXT}},
9603 #ifdef VK_USE_PLATFORM_IOS_MVK
9604     {"vkCreateIOSSurfaceMVK", {true, (void*)CreateIOSSurfaceMVK}},
9605 #endif
9606 #ifdef VK_USE_PLATFORM_MACOS_MVK
9607     {"vkCreateMacOSSurfaceMVK", {true, (void*)CreateMacOSSurfaceMVK}},
9608 #endif
9609     {"vkSetDebugUtilsObjectNameEXT", {false, (void*)SetDebugUtilsObjectNameEXT}},
9610     {"vkSetDebugUtilsObjectTagEXT", {false, (void*)SetDebugUtilsObjectTagEXT}},
9611     {"vkQueueBeginDebugUtilsLabelEXT", {false, (void*)QueueBeginDebugUtilsLabelEXT}},
9612     {"vkQueueEndDebugUtilsLabelEXT", {false, (void*)QueueEndDebugUtilsLabelEXT}},
9613     {"vkQueueInsertDebugUtilsLabelEXT", {false, (void*)QueueInsertDebugUtilsLabelEXT}},
9614     {"vkCmdBeginDebugUtilsLabelEXT", {false, (void*)CmdBeginDebugUtilsLabelEXT}},
9615     {"vkCmdEndDebugUtilsLabelEXT", {false, (void*)CmdEndDebugUtilsLabelEXT}},
9616     {"vkCmdInsertDebugUtilsLabelEXT", {false, (void*)CmdInsertDebugUtilsLabelEXT}},
9617     {"vkCreateDebugUtilsMessengerEXT", {true, (void*)CreateDebugUtilsMessengerEXT}},
9618     {"vkDestroyDebugUtilsMessengerEXT", {true, (void*)DestroyDebugUtilsMessengerEXT}},
9619     {"vkSubmitDebugUtilsMessageEXT", {true, (void*)SubmitDebugUtilsMessageEXT}},
9620 #ifdef VK_USE_PLATFORM_ANDROID_KHR
9621     {"vkGetAndroidHardwareBufferPropertiesANDROID", {false, (void*)GetAndroidHardwareBufferPropertiesANDROID}},
9622 #endif
9623 #ifdef VK_USE_PLATFORM_ANDROID_KHR
9624     {"vkGetMemoryAndroidHardwareBufferANDROID", {false, (void*)GetMemoryAndroidHardwareBufferANDROID}},
9625 #endif
9626     {"vkCmdSetSampleLocationsEXT", {false, (void*)CmdSetSampleLocationsEXT}},
9627     {"vkGetPhysicalDeviceMultisamplePropertiesEXT", {true, (void*)GetPhysicalDeviceMultisamplePropertiesEXT}},
9628     {"vkGetImageDrmFormatModifierPropertiesEXT", {false, (void*)GetImageDrmFormatModifierPropertiesEXT}},
9629 #ifdef BUILD_CORE_VALIDATION
9630     {"vkCreateValidationCacheEXT", {false, (void*)CreateValidationCacheEXT}},
9631 #endif
9632 #ifdef BUILD_CORE_VALIDATION
9633     {"vkDestroyValidationCacheEXT", {false, (void*)DestroyValidationCacheEXT}},
9634 #endif
9635 #ifdef BUILD_CORE_VALIDATION
9636     {"vkMergeValidationCachesEXT", {false, (void*)MergeValidationCachesEXT}},
9637 #endif
9638 #ifdef BUILD_CORE_VALIDATION
9639     {"vkGetValidationCacheDataEXT", {false, (void*)GetValidationCacheDataEXT}},
9640 #endif
9641     {"vkCmdBindShadingRateImageNV", {false, (void*)CmdBindShadingRateImageNV}},
9642     {"vkCmdSetViewportShadingRatePaletteNV", {false, (void*)CmdSetViewportShadingRatePaletteNV}},
9643     {"vkCmdSetCoarseSampleOrderNV", {false, (void*)CmdSetCoarseSampleOrderNV}},
9644     {"vkCreateAccelerationStructureNV", {false, (void*)CreateAccelerationStructureNV}},
9645     {"vkDestroyAccelerationStructureNV", {false, (void*)DestroyAccelerationStructureNV}},
9646     {"vkGetAccelerationStructureMemoryRequirementsNV", {false, (void*)GetAccelerationStructureMemoryRequirementsNV}},
9647     {"vkBindAccelerationStructureMemoryNV", {false, (void*)BindAccelerationStructureMemoryNV}},
9648     {"vkCmdBuildAccelerationStructureNV", {false, (void*)CmdBuildAccelerationStructureNV}},
9649     {"vkCmdCopyAccelerationStructureNV", {false, (void*)CmdCopyAccelerationStructureNV}},
9650     {"vkCmdTraceRaysNV", {false, (void*)CmdTraceRaysNV}},
9651     {"vkCreateRayTracingPipelinesNV", {false, (void*)CreateRayTracingPipelinesNV}},
9652     {"vkGetRayTracingShaderGroupHandlesNV", {false, (void*)GetRayTracingShaderGroupHandlesNV}},
9653     {"vkGetAccelerationStructureHandleNV", {false, (void*)GetAccelerationStructureHandleNV}},
9654     {"vkCmdWriteAccelerationStructuresPropertiesNV", {false, (void*)CmdWriteAccelerationStructuresPropertiesNV}},
9655     {"vkCompileDeferredNV", {false, (void*)CompileDeferredNV}},
9656     {"vkGetMemoryHostPointerPropertiesEXT", {false, (void*)GetMemoryHostPointerPropertiesEXT}},
9657     {"vkCmdWriteBufferMarkerAMD", {false, (void*)CmdWriteBufferMarkerAMD}},
9658     {"vkGetPhysicalDeviceCalibrateableTimeDomainsEXT", {true, (void*)GetPhysicalDeviceCalibrateableTimeDomainsEXT}},
9659     {"vkGetCalibratedTimestampsEXT", {false, (void*)GetCalibratedTimestampsEXT}},
9660     {"vkCmdDrawMeshTasksNV", {false, (void*)CmdDrawMeshTasksNV}},
9661     {"vkCmdDrawMeshTasksIndirectNV", {false, (void*)CmdDrawMeshTasksIndirectNV}},
9662     {"vkCmdDrawMeshTasksIndirectCountNV", {false, (void*)CmdDrawMeshTasksIndirectCountNV}},
9663     {"vkCmdSetExclusiveScissorNV", {false, (void*)CmdSetExclusiveScissorNV}},
9664     {"vkCmdSetCheckpointNV", {false, (void*)CmdSetCheckpointNV}},
9665     {"vkGetQueueCheckpointDataNV", {false, (void*)GetQueueCheckpointDataNV}},
9666     {"vkInitializePerformanceApiINTEL", {false, (void*)InitializePerformanceApiINTEL}},
9667     {"vkUninitializePerformanceApiINTEL", {false, (void*)UninitializePerformanceApiINTEL}},
9668     {"vkCmdSetPerformanceMarkerINTEL", {false, (void*)CmdSetPerformanceMarkerINTEL}},
9669     {"vkCmdSetPerformanceStreamMarkerINTEL", {false, (void*)CmdSetPerformanceStreamMarkerINTEL}},
9670     {"vkCmdSetPerformanceOverrideINTEL", {false, (void*)CmdSetPerformanceOverrideINTEL}},
9671     {"vkAcquirePerformanceConfigurationINTEL", {false, (void*)AcquirePerformanceConfigurationINTEL}},
9672     {"vkReleasePerformanceConfigurationINTEL", {false, (void*)ReleasePerformanceConfigurationINTEL}},
9673     {"vkQueueSetPerformanceConfigurationINTEL", {false, (void*)QueueSetPerformanceConfigurationINTEL}},
9674     {"vkGetPerformanceParameterINTEL", {false, (void*)GetPerformanceParameterINTEL}},
9675     {"vkSetLocalDimmingAMD", {false, (void*)SetLocalDimmingAMD}},
9676 #ifdef VK_USE_PLATFORM_FUCHSIA
9677     {"vkCreateImagePipeSurfaceFUCHSIA", {true, (void*)CreateImagePipeSurfaceFUCHSIA}},
9678 #endif
9679 #ifdef VK_USE_PLATFORM_METAL_EXT
9680     {"vkCreateMetalSurfaceEXT", {true, (void*)CreateMetalSurfaceEXT}},
9681 #endif
9682     {"vkGetBufferDeviceAddressEXT", {false, (void*)GetBufferDeviceAddressEXT}},
9683     {"vkGetPhysicalDeviceCooperativeMatrixPropertiesNV", {true, (void*)GetPhysicalDeviceCooperativeMatrixPropertiesNV}},
9684     {"vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV", {true, (void*)GetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV}},
9685 #ifdef VK_USE_PLATFORM_WIN32_KHR
9686     {"vkGetPhysicalDeviceSurfacePresentModes2EXT", {true, (void*)GetPhysicalDeviceSurfacePresentModes2EXT}},
9687 #endif
9688 #ifdef VK_USE_PLATFORM_WIN32_KHR
9689     {"vkAcquireFullScreenExclusiveModeEXT", {false, (void*)AcquireFullScreenExclusiveModeEXT}},
9690 #endif
9691 #ifdef VK_USE_PLATFORM_WIN32_KHR
9692     {"vkReleaseFullScreenExclusiveModeEXT", {false, (void*)ReleaseFullScreenExclusiveModeEXT}},
9693 #endif
9694 #ifdef VK_USE_PLATFORM_WIN32_KHR
9695     {"vkGetDeviceGroupSurfacePresentModes2EXT", {false, (void*)GetDeviceGroupSurfacePresentModes2EXT}},
9696 #endif
9697     {"vkCreateHeadlessSurfaceEXT", {true, (void*)CreateHeadlessSurfaceEXT}},
9698     {"vkCmdSetLineStippleEXT", {false, (void*)CmdSetLineStippleEXT}},
9699     {"vkResetQueryPoolEXT", {false, (void*)ResetQueryPoolEXT}},
9700 };
9701 
9702 
9703 } // namespace vulkan_layer_chassis
9704 
9705 // loader-layer interface v0, just wrappers since there is only a layer
9706 
vkEnumerateInstanceExtensionProperties(const char * pLayerName,uint32_t * pCount,VkExtensionProperties * pProperties)9707 VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceExtensionProperties(const char *pLayerName, uint32_t *pCount,
9708                                                                                       VkExtensionProperties *pProperties) {
9709     return vulkan_layer_chassis::EnumerateInstanceExtensionProperties(pLayerName, pCount, pProperties);
9710 }
9711 
vkEnumerateInstanceLayerProperties(uint32_t * pCount,VkLayerProperties * pProperties)9712 VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceLayerProperties(uint32_t *pCount,
9713                                                                                   VkLayerProperties *pProperties) {
9714     return vulkan_layer_chassis::EnumerateInstanceLayerProperties(pCount, pProperties);
9715 }
9716 
vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice,uint32_t * pCount,VkLayerProperties * pProperties)9717 VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t *pCount,
9718                                                                                 VkLayerProperties *pProperties) {
9719     // the layer command handles VK_NULL_HANDLE just fine internally
9720     assert(physicalDevice == VK_NULL_HANDLE);
9721     return vulkan_layer_chassis::EnumerateDeviceLayerProperties(VK_NULL_HANDLE, pCount, pProperties);
9722 }
9723 
vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice,const char * pLayerName,uint32_t * pCount,VkExtensionProperties * pProperties)9724 VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice,
9725                                                                                     const char *pLayerName, uint32_t *pCount,
9726                                                                                     VkExtensionProperties *pProperties) {
9727     // the layer command handles VK_NULL_HANDLE just fine internally
9728     assert(physicalDevice == VK_NULL_HANDLE);
9729     return vulkan_layer_chassis::EnumerateDeviceExtensionProperties(VK_NULL_HANDLE, pLayerName, pCount, pProperties);
9730 }
9731 
vkGetDeviceProcAddr(VkDevice dev,const char * funcName)9732 VK_LAYER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetDeviceProcAddr(VkDevice dev, const char *funcName) {
9733     return vulkan_layer_chassis::GetDeviceProcAddr(dev, funcName);
9734 }
9735 
vkGetInstanceProcAddr(VkInstance instance,const char * funcName)9736 VK_LAYER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(VkInstance instance, const char *funcName) {
9737     return vulkan_layer_chassis::GetInstanceProcAddr(instance, funcName);
9738 }
9739 
vkNegotiateLoaderLayerInterfaceVersion(VkNegotiateLayerInterface * pVersionStruct)9740 VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkNegotiateLoaderLayerInterfaceVersion(VkNegotiateLayerInterface *pVersionStruct) {
9741     assert(pVersionStruct != NULL);
9742     assert(pVersionStruct->sType == LAYER_NEGOTIATE_INTERFACE_STRUCT);
9743 
9744     // Fill in the function pointers if our version is at least capable of having the structure contain them.
9745     if (pVersionStruct->loaderLayerInterfaceVersion >= 2) {
9746         pVersionStruct->pfnGetInstanceProcAddr = vkGetInstanceProcAddr;
9747         pVersionStruct->pfnGetDeviceProcAddr = vkGetDeviceProcAddr;
9748         pVersionStruct->pfnGetPhysicalDeviceProcAddr = nullptr;
9749     }
9750 
9751     return VK_SUCCESS;
9752 }
9753