loader: Fix gcc 8.1 cast warning
[platform/upstream/Vulkan-LoaderAndValidationLayers.git] / loader / loader.h
1 /*
2  *
3  * Copyright (c) 2014-2017 The Khronos Group Inc.
4  * Copyright (c) 2014-2017 Valve Corporation
5  * Copyright (c) 2014-2017 LunarG, Inc.
6  * Copyright (C) 2015 Google Inc.
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *     http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  * Author: Jon Ashburn <jon@lunarg.com>
21  * Author: Courtney Goeltzenleuchter <courtney@LunarG.com>
22  * Author: Chia-I Wu <olvaffe@gmail.com>
23  * Author: Chia-I Wu <olv@lunarg.com>
24  * Author: Mark Lobodzinski <mark@LunarG.com>
25  *
26  */
27
28 #ifndef LOADER_H
29 #define LOADER_H
30
31 #include <vulkan/vulkan.h>
32 #include "vk_loader_platform.h"
33 #include "vk_loader_layer.h"
34 #include <vulkan/vk_layer.h>
35 #include <vulkan/vk_icd.h>
36 #include <assert.h>
37 #include "vk_loader_extensions.h"
38
39 #if defined(__GNUC__) && __GNUC__ >= 4
40 #define LOADER_EXPORT __attribute__((visibility("default")))
41 #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)
42 #define LOADER_EXPORT __attribute__((visibility("default")))
43 #else
44 #define LOADER_EXPORT
45 #endif
46
47 // A debug option to disable allocators at compile time to investigate future issues.
48 #define DEBUG_DISABLE_APP_ALLOCATORS 0
49
50 #define MAX_STRING_SIZE 1024
51
52 // This is defined in vk_layer.h, but if there's problems we need to create the define
53 // here.
54 #ifndef MAX_NUM_UNKNOWN_EXTS
55 #define MAX_NUM_UNKNOWN_EXTS 250
56 #endif
57
58 enum layer_type_flags {
59     VK_LAYER_TYPE_FLAG_INSTANCE_LAYER = 0x1,  // If not set, indicates Device layer
60     VK_LAYER_TYPE_FLAG_EXPLICIT_LAYER = 0x2,  // If not set, indicates Implicit layer
61     VK_LAYER_TYPE_FLAG_META_LAYER = 0x4,      // If not set, indicates standard layer
62 };
63
64 typedef enum VkStringErrorFlagBits {
65     VK_STRING_ERROR_NONE = 0x00000000,
66     VK_STRING_ERROR_LENGTH = 0x00000001,
67     VK_STRING_ERROR_BAD_DATA = 0x00000002,
68 } VkStringErrorFlagBits;
69 typedef VkFlags VkStringErrorFlags;
70
71 static const int MaxLoaderStringLength = 256;
72 static const char UTF8_ONE_BYTE_CODE = 0xC0;
73 static const char UTF8_ONE_BYTE_MASK = 0xE0;
74 static const char UTF8_TWO_BYTE_CODE = 0xE0;
75 static const char UTF8_TWO_BYTE_MASK = 0xF0;
76 static const char UTF8_THREE_BYTE_CODE = 0xF0;
77 static const char UTF8_THREE_BYTE_MASK = 0xF8;
78 static const char UTF8_DATA_BYTE_CODE = 0x80;
79 static const char UTF8_DATA_BYTE_MASK = 0xC0;
80
81 struct VkStructureHeader {
82     VkStructureType sType;
83     const void *pNext;
84 };
85
86 // form of all dynamic lists/arrays
87 // only the list element should be changed
88 struct loader_generic_list {
89     size_t capacity;
90     uint32_t count;
91     void *list;
92 };
93
94 struct loader_extension_list {
95     size_t capacity;
96     uint32_t count;
97     VkExtensionProperties *list;
98 };
99
100 struct loader_dev_ext_props {
101     VkExtensionProperties props;
102     uint32_t entrypoint_count;
103     char **entrypoints;
104 };
105
106 struct loader_device_extension_list {
107     size_t capacity;
108     uint32_t count;
109     struct loader_dev_ext_props *list;
110 };
111
112 struct loader_name_value {
113     char name[MAX_STRING_SIZE];
114     char value[MAX_STRING_SIZE];
115 };
116
117 struct loader_layer_functions {
118     char str_gipa[MAX_STRING_SIZE];
119     char str_gdpa[MAX_STRING_SIZE];
120     char str_negotiate_interface[MAX_STRING_SIZE];
121     PFN_vkNegotiateLoaderLayerInterfaceVersion negotiate_layer_interface;
122     PFN_vkGetInstanceProcAddr get_instance_proc_addr;
123     PFN_vkGetDeviceProcAddr get_device_proc_addr;
124     PFN_GetPhysicalDeviceProcAddr get_physical_device_proc_addr;
125 };
126
127 struct loader_layer_properties {
128     VkLayerProperties info;
129     enum layer_type_flags type_flags;
130     uint32_t interface_version;  // PFN_vkNegotiateLoaderLayerInterfaceVersion
131     char lib_name[MAX_STRING_SIZE];
132     loader_platform_dl_handle lib_handle;
133     struct loader_layer_functions functions;
134     struct loader_extension_list instance_extension_list;
135     struct loader_device_extension_list device_extension_list;
136     struct loader_name_value disable_env_var;
137     struct loader_name_value enable_env_var;
138     uint32_t num_component_layers;
139     char (*component_layer_names)[MAX_STRING_SIZE];
140     struct {
141         char enumerate_instance_extension_properties[MAX_STRING_SIZE];
142         char enumerate_instance_layer_properties[MAX_STRING_SIZE];
143         char enumerate_instance_version[MAX_STRING_SIZE];
144     } pre_instance_functions;
145 };
146
147 struct loader_layer_list {
148     size_t capacity;
149     uint32_t count;
150     struct loader_layer_properties *list;
151 };
152
153 struct loader_dispatch_hash_list {
154     size_t capacity;
155     uint32_t count;
156     uint32_t *index;  // index into the dev_ext dispatch table
157 };
158
159 // loader_dispatch_hash_entry and loader_dev_ext_dispatch_table.dev_ext have
160 // one to one correspondence; one loader_dispatch_hash_entry for one dev_ext
161 // dispatch entry.
162 // Also have a one to one correspondence with functions in dev_ext_trampoline.c
163 struct loader_dispatch_hash_entry {
164     char *func_name;
165     struct loader_dispatch_hash_list list;  // to handle hashing collisions
166 };
167
168 typedef VkResult(VKAPI_PTR *PFN_vkDevExt)(VkDevice device);
169 struct loader_dev_ext_dispatch_table {
170     PFN_vkDevExt dev_ext[MAX_NUM_UNKNOWN_EXTS];
171 };
172
173 struct loader_dev_dispatch_table {
174     VkLayerDispatchTable core_dispatch;
175     struct loader_dev_ext_dispatch_table ext_dispatch;
176 };
177
178 // per CreateDevice structure
179 struct loader_device {
180     struct loader_dev_dispatch_table loader_dispatch;
181     VkDevice chain_device;  // device object from the dispatch chain
182     VkDevice icd_device;    // device object from the icd
183     struct loader_physical_device_term *phys_dev_term;
184
185     // List of activated layers.
186     //  app_      is the version based on exactly what the application asked for.
187     //            This is what must be returned to the application on Enumerate calls.
188     //  expanded_ is the version based on expanding meta-layers into their
189     //            individual component layers.  This is what is used internally.
190     struct loader_layer_list app_activated_layer_list;
191     struct loader_layer_list expanded_activated_layer_list;
192
193     VkAllocationCallbacks alloc_callbacks;
194
195     // List of activated device extensions that have terminators implemented in the loader
196     struct {
197         bool khr_swapchain_enabled;
198         bool khr_display_swapchain_enabled;
199         bool ext_debug_marker_enabled;
200         bool ext_debug_utils_enabled;
201     } extensions;
202
203     struct loader_device *next;
204 };
205
206 // Per ICD information
207
208 // Per ICD structure
209 struct loader_icd_term {
210     // pointers to find other structs
211     const struct loader_scanned_icd *scanned_icd;
212     const struct loader_instance *this_instance;
213     struct loader_device *logical_device_list;
214     VkInstance instance;  // instance object from the icd
215     struct loader_icd_term_dispatch dispatch;
216
217     struct loader_icd_term *next;
218
219     PFN_PhysDevExt phys_dev_ext[MAX_NUM_UNKNOWN_EXTS];
220 };
221
222 // Per ICD library structure
223 struct loader_icd_tramp_list {
224     size_t capacity;
225     uint32_t count;
226     struct loader_scanned_icd *scanned_list;
227 };
228
229 struct loader_instance_dispatch_table {
230     VkLayerInstanceDispatchTable layer_inst_disp;  // must be first entry in structure
231
232     // Physical device functions unknown to the loader
233     PFN_PhysDevExt phys_dev_ext[MAX_NUM_UNKNOWN_EXTS];
234 };
235
236 // Per instance structure
237 struct loader_instance {
238     struct loader_instance_dispatch_table *disp;  // must be first entry in structure
239
240     // Vulkan API version the app is intending to use.
241     uint16_t app_api_major_version;
242     uint16_t app_api_minor_version;
243
244     // We need to manually track physical devices over time.  If the user
245     // re-queries the information, we don't want to delete old data or
246     // create new data unless necessary.
247     uint32_t total_gpu_count;
248     uint32_t phys_dev_count_term;
249     struct loader_physical_device_term **phys_devs_term;
250     uint32_t phys_dev_count_tramp;
251     struct loader_physical_device_tramp **phys_devs_tramp;
252
253     // We also need to manually track physical device groups, but we don't need
254     // loader specific structures since we have that content in the physical
255     // device stored internal to the public structures.
256     uint32_t phys_dev_group_count_term;
257     struct VkPhysicalDeviceGroupProperties **phys_dev_groups_term;
258     uint32_t phys_dev_group_count_tramp;
259     struct VkPhysicalDeviceGroupProperties **phys_dev_groups_tramp;
260
261     struct loader_instance *next;
262
263     uint32_t total_icd_count;
264     struct loader_icd_term *icd_terms;
265     struct loader_icd_tramp_list icd_tramp_list;
266
267     struct loader_dispatch_hash_entry dev_ext_disp_hash[MAX_NUM_UNKNOWN_EXTS];
268     struct loader_dispatch_hash_entry phys_dev_ext_disp_hash[MAX_NUM_UNKNOWN_EXTS];
269
270     struct loader_msg_callback_map_entry *icd_msg_callback_map;
271
272     struct loader_layer_list instance_layer_list;
273
274     // List of activated layers.
275     //  app_      is the version based on exactly what the application asked for.
276     //            This is what must be returned to the application on Enumerate calls.
277     //  expanded_ is the version based on expanding meta-layers into their
278     //            individual component layers.  This is what is used internally.
279     struct loader_layer_list app_activated_layer_list;
280     struct loader_layer_list expanded_activated_layer_list;
281
282     VkInstance instance;  // layers/ICD instance returned to trampoline
283
284     struct loader_extension_list ext_list;  // icds and loaders extensions
285     union loader_instance_extension_enables enabled_known_extensions;
286
287     VkLayerDbgFunctionNode *DbgFunctionHead;
288     uint32_t num_tmp_report_callbacks;
289     VkDebugReportCallbackCreateInfoEXT *tmp_report_create_infos;
290     VkDebugReportCallbackEXT *tmp_report_callbacks;
291     uint32_t num_tmp_messengers;
292     VkDebugUtilsMessengerCreateInfoEXT *tmp_messenger_create_infos;
293     VkDebugUtilsMessengerEXT *tmp_messengers;
294
295     VkAllocationCallbacks alloc_callbacks;
296
297     bool wsi_surface_enabled;
298 #ifdef VK_USE_PLATFORM_WIN32_KHR
299     bool wsi_win32_surface_enabled;
300 #endif
301 #ifdef VK_USE_PLATFORM_MIR_KHR
302     bool wsi_mir_surface_enabled;
303 #endif
304 #ifdef VK_USE_PLATFORM_WAYLAND_KHR
305     bool wsi_wayland_surface_enabled;
306 #endif
307 #ifdef VK_USE_PLATFORM_XCB_KHR
308     bool wsi_xcb_surface_enabled;
309 #endif
310 #ifdef VK_USE_PLATFORM_XLIB_KHR
311     bool wsi_xlib_surface_enabled;
312 #endif
313 #ifdef VK_USE_PLATFORM_ANDROID_KHR
314     bool wsi_android_surface_enabled;
315 #endif
316 #ifdef VK_USE_PLATFORM_MACOS_MVK
317     bool wsi_macos_surface_enabled;
318 #endif
319 #ifdef VK_USE_PLATFORM_IOS_MVK
320     bool wsi_ios_surface_enabled;
321 #endif
322     bool wsi_display_enabled;
323 };
324
325 // VkPhysicalDevice requires special treatment by loader.  Firstly, terminator
326 // code must be able to get the struct loader_icd_term to call into the proper
327 // driver  (multiple ICD/gpu case). This can be accomplished by wrapping the
328 // created VkPhysicalDevice in loader terminate_EnumeratePhysicalDevices().
329 // Secondly, the loader must be able to handle wrapped by layer VkPhysicalDevice
330 // in trampoline code.  This implies, that the loader trampoline code must also
331 // wrap the VkPhysicalDevice object in trampoline code.  Thus, loader has to
332 // wrap the VkPhysicalDevice created object twice. In trampoline code it can't
333 // rely on the terminator object wrapping since a layer may also wrap. Since
334 // trampoline code wraps the VkPhysicalDevice this means all loader trampoline
335 // code that passes a VkPhysicalDevice should unwrap it.
336
337 // Per enumerated PhysicalDevice structure, used to wrap in trampoline code and
338 // also same structure used to wrap in terminator code
339 struct loader_physical_device_tramp {
340     struct loader_instance_dispatch_table *disp;  // must be first entry in structure
341     struct loader_instance *this_instance;
342     VkPhysicalDevice phys_dev;  // object from layers/loader terminator
343 };
344
345 // Per enumerated PhysicalDevice structure, used to wrap in terminator code
346 struct loader_physical_device_term {
347     struct loader_instance_dispatch_table *disp;  // must be first entry in structure
348     struct loader_icd_term *this_icd_term;
349     uint8_t icd_index;
350     VkPhysicalDevice phys_dev;  // object from ICD
351 };
352
353 struct loader_struct {
354     struct loader_instance *instances;
355 };
356
357 struct loader_scanned_icd {
358     char *lib_name;
359     loader_platform_dl_handle handle;
360     uint32_t api_version;
361     uint32_t interface_version;
362     PFN_vkGetInstanceProcAddr GetInstanceProcAddr;
363     PFN_GetPhysicalDeviceProcAddr GetPhysicalDeviceProcAddr;
364     PFN_vkCreateInstance CreateInstance;
365     PFN_vkEnumerateInstanceExtensionProperties EnumerateInstanceExtensionProperties;
366 };
367
368 static inline struct loader_instance *loader_instance(VkInstance instance) { return (struct loader_instance *)instance; }
369
370 static inline VkPhysicalDevice loader_unwrap_physical_device(VkPhysicalDevice physicalDevice) {
371     struct loader_physical_device_tramp *phys_dev = (struct loader_physical_device_tramp *)physicalDevice;
372     return phys_dev->phys_dev;
373 }
374
375 static inline void loader_set_dispatch(void *obj, const void *data) { *((const void **)obj) = data; }
376
377 static inline VkLayerDispatchTable *loader_get_dispatch(const void *obj) { return *((VkLayerDispatchTable **)obj); }
378
379 static inline struct loader_dev_dispatch_table *loader_get_dev_dispatch(const void *obj) {
380     return *((struct loader_dev_dispatch_table **)obj);
381 }
382
383 static inline VkLayerInstanceDispatchTable *loader_get_instance_layer_dispatch(const void *obj) {
384     return *((VkLayerInstanceDispatchTable **)obj);
385 }
386
387 static inline struct loader_instance_dispatch_table *loader_get_instance_dispatch(const void *obj) {
388     return *((struct loader_instance_dispatch_table **)obj);
389 }
390
391 static inline void loader_init_dispatch(void *obj, const void *data) {
392 #ifdef DEBUG
393     assert(valid_loader_magic_value(obj) &&
394            "Incompatible ICD, first dword must be initialized to "
395            "ICD_LOADER_MAGIC. See loader/README.md for details.");
396 #endif
397
398     loader_set_dispatch(obj, data);
399 }
400
401 // Global variables used across files
402 extern struct loader_struct loader;
403 extern THREAD_LOCAL_DECL struct loader_instance *tls_instance;
404 #if defined(_WIN32) && !defined(LOADER_DYNAMIC_LIB)
405 extern LOADER_PLATFORM_THREAD_ONCE_DEFINITION(once_init);
406 #endif
407 extern loader_platform_thread_mutex loader_lock;
408 extern loader_platform_thread_mutex loader_json_lock;
409
410 struct loader_msg_callback_map_entry {
411     VkDebugReportCallbackEXT icd_obj;
412     VkDebugReportCallbackEXT loader_obj;
413 };
414
415 // Helper function definitions
416 void *loader_instance_heap_alloc(const struct loader_instance *instance, size_t size, VkSystemAllocationScope allocationScope);
417 void loader_instance_heap_free(const struct loader_instance *instance, void *pMemory);
418 void *loader_instance_heap_realloc(const struct loader_instance *instance, void *pMemory, size_t orig_size, size_t size,
419                                    VkSystemAllocationScope alloc_scope);
420 void *loader_instance_tls_heap_alloc(size_t size);
421 void loader_instance_tls_heap_free(void *pMemory);
422 void *loader_device_heap_alloc(const struct loader_device *device, size_t size, VkSystemAllocationScope allocationScope);
423 void loader_device_heap_free(const struct loader_device *device, void *pMemory);
424 void *loader_device_heap_realloc(const struct loader_device *device, void *pMemory, size_t orig_size, size_t size,
425                                  VkSystemAllocationScope alloc_scope);
426
427 void loader_log(const struct loader_instance *inst, VkFlags msg_type, int32_t msg_code, const char *format, ...);
428
429 bool compare_vk_extension_properties(const VkExtensionProperties *op1, const VkExtensionProperties *op2);
430
431 VkResult loader_validate_layers(const struct loader_instance *inst, const uint32_t layer_count,
432                                 const char *const *ppEnabledLayerNames, const struct loader_layer_list *list);
433
434 VkResult loader_validate_instance_extensions(const struct loader_instance *inst, const struct loader_extension_list *icd_exts,
435                                              const struct loader_layer_list *instance_layer,
436                                              const VkInstanceCreateInfo *pCreateInfo);
437
438 void loader_initialize(void);
439 VkResult loader_copy_layer_properties(const struct loader_instance *inst, struct loader_layer_properties *dst,
440                                       struct loader_layer_properties *src);
441 bool has_vk_extension_property_array(const VkExtensionProperties *vk_ext_prop, const uint32_t count,
442                                      const VkExtensionProperties *ext_array);
443 bool has_vk_extension_property(const VkExtensionProperties *vk_ext_prop, const struct loader_extension_list *ext_list);
444
445 VkResult loader_add_to_ext_list(const struct loader_instance *inst, struct loader_extension_list *ext_list,
446                                 uint32_t prop_list_count, const VkExtensionProperties *props);
447 VkResult loader_add_to_dev_ext_list(const struct loader_instance *inst, struct loader_device_extension_list *ext_list,
448                                     const VkExtensionProperties *props, uint32_t entry_count, char **entrys);
449 VkResult loader_add_device_extensions(const struct loader_instance *inst,
450                                       PFN_vkEnumerateDeviceExtensionProperties fpEnumerateDeviceExtensionProperties,
451                                       VkPhysicalDevice physical_device, const char *lib_name,
452                                       struct loader_extension_list *ext_list);
453 VkResult loader_init_generic_list(const struct loader_instance *inst, struct loader_generic_list *list_info, size_t element_size);
454 void loader_destroy_generic_list(const struct loader_instance *inst, struct loader_generic_list *list);
455 void loader_destroy_layer_list(const struct loader_instance *inst, struct loader_device *device,
456                                struct loader_layer_list *layer_list);
457 void loader_delete_layer_properties(const struct loader_instance *inst, struct loader_layer_list *layer_list);
458 bool loader_find_layer_name_array(const char *name, uint32_t layer_count, const char layer_list[][VK_MAX_EXTENSION_NAME_SIZE]);
459 VkResult loader_add_to_layer_list(const struct loader_instance *inst, struct loader_layer_list *list, uint32_t prop_list_count,
460                                   const struct loader_layer_properties *props);
461 void loader_find_layer_name_add_list(const struct loader_instance *inst, const char *name, const enum layer_type_flags type_flags,
462                                      const struct loader_layer_list *source_list, struct loader_layer_list *target_list,
463                                      struct loader_layer_list *expanded_target_list);
464 void loader_scanned_icd_clear(const struct loader_instance *inst, struct loader_icd_tramp_list *icd_tramp_list);
465 VkResult loader_icd_scan(const struct loader_instance *inst, struct loader_icd_tramp_list *icd_tramp_list);
466 void loader_layer_scan(const struct loader_instance *inst, struct loader_layer_list *instance_layers);
467 void loader_implicit_layer_scan(const struct loader_instance *inst, struct loader_layer_list *instance_layers);
468 bool loader_is_implicit_layer_enabled(const struct loader_instance *inst, const struct loader_layer_properties *prop);
469 VkResult loader_get_icd_loader_instance_extensions(const struct loader_instance *inst, struct loader_icd_tramp_list *icd_tramp_list,
470                                                    struct loader_extension_list *inst_exts);
471 struct loader_icd_term *loader_get_icd_and_device(const VkDevice device, struct loader_device **found_dev, uint32_t *icd_index);
472 void loader_init_dispatch_dev_ext(struct loader_instance *inst, struct loader_device *dev);
473 void *loader_dev_ext_gpa(struct loader_instance *inst, const char *funcName);
474 void *loader_get_dev_ext_trampoline(uint32_t index);
475 bool loader_phys_dev_ext_gpa(struct loader_instance *inst, const char *funcName, bool perform_checking, void **tramp_addr,
476                              void **term_addr);
477 void *loader_get_phys_dev_ext_tramp(uint32_t index);
478 void *loader_get_phys_dev_ext_termin(uint32_t index);
479 struct loader_instance *loader_get_instance(const VkInstance instance);
480 void loader_deactivate_layers(const struct loader_instance *instance, struct loader_device *device, struct loader_layer_list *list);
481 struct loader_device *loader_create_logical_device(const struct loader_instance *inst, const VkAllocationCallbacks *pAllocator);
482 void loader_add_logical_device(const struct loader_instance *inst, struct loader_icd_term *icd_term,
483                                struct loader_device *found_dev);
484 void loader_remove_logical_device(const struct loader_instance *inst, struct loader_icd_term *icd_term,
485                                   struct loader_device *found_dev, const VkAllocationCallbacks *pAllocator);
486 // NOTE: Outside of loader, this entry-point is only provided for error
487 // cleanup.
488 void loader_destroy_logical_device(const struct loader_instance *inst, struct loader_device *dev,
489                                    const VkAllocationCallbacks *pAllocator);
490
491 VkResult loader_enable_instance_layers(struct loader_instance *inst, const VkInstanceCreateInfo *pCreateInfo,
492                                        const struct loader_layer_list *instance_layers);
493
494 VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator,
495                                       struct loader_instance *inst, VkInstance *created_instance);
496
497 void loader_activate_instance_layer_extensions(struct loader_instance *inst, VkInstance created_inst);
498
499 VkResult loader_create_device_chain(const struct loader_physical_device_tramp *pd, const VkDeviceCreateInfo *pCreateInfo,
500                                     const VkAllocationCallbacks *pAllocator, const struct loader_instance *inst,
501                                     struct loader_device *dev);
502
503 VkResult loader_validate_device_extensions(struct loader_physical_device_tramp *phys_dev,
504                                            const struct loader_layer_list *activated_device_layers,
505                                            const struct loader_extension_list *icd_exts, const VkDeviceCreateInfo *pCreateInfo);
506
507 VkResult setupLoaderTrampPhysDevs(VkInstance instance);
508 VkResult setupLoaderTermPhysDevs(struct loader_instance *inst);
509
510 VkStringErrorFlags vk_string_validate(const int max_length, const char *char_array);
511
512 #endif  // LOADER_H