• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // *** THIS FILE IS GENERATED - DO NOT EDIT ***
2 // See loader_extension_generator.py for modifications
3 
4 /*
5  * Copyright (c) 2015-2022 The Khronos Group Inc.
6  * Copyright (c) 2015-2022 Valve Corporation
7  * Copyright (c) 2015-2022 LunarG, Inc.
8  * Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
9  * Copyright (c) 2023-2023 RasterGrid Kft.
10  *
11  * Licensed under the Apache License, Version 2.0 (the "License");
12  * you may not use this file except in compliance with the License.
13  * You may obtain a copy of the License at
14  *
15  *     http://www.apache.org/licenses/LICENSE-2.0
16  *
17  * Unless required by applicable law or agreed to in writing, software
18  * distributed under the License is distributed on an "AS IS" BASIS,
19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  * See the License for the specific language governing permissions and
21  * limitations under the License.
22  *
23  * Author: Mark Lobodzinski <mark@lunarg.com>
24  * Author: Mark Young <marky@lunarg.com>
25  */
26 
27 // clang-format off
28 #pragma once
29 
30 #include <stdbool.h>
31 #include <vulkan/vulkan.h>
32 #include <vulkan/vk_layer.h>
33 #include "vk_layer_dispatch_table.h"
34 
35 
36 // Structures defined externally, but used here
37 struct loader_instance;
38 struct loader_device;
39 struct loader_icd_term;
40 struct loader_dev_dispatch_table;
41 
42 // Device extension error function
43 VKAPI_ATTR VkResult VKAPI_CALL vkDevExtError(VkDevice dev);
44 
45 // Extension interception for vkGetInstanceProcAddr function, so we can return
46 // the appropriate information for any instance extensions we know about.
47 bool extension_instance_gpa(struct loader_instance *ptr_instance, const char *name, void **addr);
48 
49 // Extension interception for vkCreateInstance function, so we can properly
50 // detect and enable any instance extension information for extensions we know
51 // about.
52 void extensions_create_instance(struct loader_instance *ptr_instance, const VkInstanceCreateInfo *pCreateInfo);
53 
54 // Extension interception for vkGetDeviceProcAddr function, so we can return
55 // an appropriate terminator if this is one of those few device commands requiring
56 // a terminator.
57 PFN_vkVoidFunction get_extension_device_proc_terminator(struct loader_device *dev, const char *name, bool* found_name);
58 
59 // Dispatch table properly filled in with appropriate terminators for the
60 // supported extensions.
61 extern const VkLayerInstanceDispatchTable instance_disp;
62 
63 // Array of extension strings for instance extensions we support.
64 extern const char *const LOADER_INSTANCE_EXTENSIONS[];
65 
66 VKAPI_ATTR bool VKAPI_CALL loader_icd_init_entries(struct loader_instance* inst, struct loader_icd_term *icd_term);
67 
68 // Init Device function pointer dispatch table with core commands
69 VKAPI_ATTR void VKAPI_CALL loader_init_device_dispatch_table(struct loader_dev_dispatch_table *dev_table, PFN_vkGetDeviceProcAddr gpa,
70                                                              VkDevice dev);
71 
72 // Init Device function pointer dispatch table with extension commands
73 VKAPI_ATTR void VKAPI_CALL loader_init_device_extension_dispatch_table(struct loader_dev_dispatch_table *dev_table,
74                                                                        PFN_vkGetInstanceProcAddr gipa,
75                                                                        PFN_vkGetDeviceProcAddr gdpa,
76                                                                        VkInstance inst,
77                                                                        VkDevice dev);
78 
79 // Init Instance function pointer dispatch table with core commands
80 VKAPI_ATTR void VKAPI_CALL loader_init_instance_core_dispatch_table(VkLayerInstanceDispatchTable *table, PFN_vkGetInstanceProcAddr gpa,
81                                                                     VkInstance inst);
82 
83 // Init Instance function pointer dispatch table with core commands
84 VKAPI_ATTR void VKAPI_CALL loader_init_instance_extension_dispatch_table(VkLayerInstanceDispatchTable *table, PFN_vkGetInstanceProcAddr gpa,
85                                                                          VkInstance inst);
86 
87 // Device command lookup function
88 VKAPI_ATTR void* VKAPI_CALL loader_lookup_device_dispatch_table(const VkLayerDispatchTable *table, const char *name, bool* name_found);
89 
90 // Instance command lookup function
91 VKAPI_ATTR void* VKAPI_CALL loader_lookup_instance_dispatch_table(const VkLayerInstanceDispatchTable *table, const char *name,
92                                                                   bool *found_name);
93 
94 // Loader core instance terminators
95 VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateInstance(
96     const VkInstanceCreateInfo*                 pCreateInfo,
97     const VkAllocationCallbacks*                pAllocator,
98     VkInstance*                                 pInstance);
99 VKAPI_ATTR void VKAPI_CALL terminator_DestroyInstance(
100     VkInstance                                  instance,
101     const VkAllocationCallbacks*                pAllocator);
102 VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumeratePhysicalDevices(
103     VkInstance                                  instance,
104     uint32_t*                                   pPhysicalDeviceCount,
105     VkPhysicalDevice*                           pPhysicalDevices);
106 VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFeatures(
107     VkPhysicalDevice                            physicalDevice,
108     VkPhysicalDeviceFeatures*                   pFeatures);
109 VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFormatProperties(
110     VkPhysicalDevice                            physicalDevice,
111     VkFormat                                    format,
112     VkFormatProperties*                         pFormatProperties);
113 VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceImageFormatProperties(
114     VkPhysicalDevice                            physicalDevice,
115     VkFormat                                    format,
116     VkImageType                                 type,
117     VkImageTiling                               tiling,
118     VkImageUsageFlags                           usage,
119     VkImageCreateFlags                          flags,
120     VkImageFormatProperties*                    pImageFormatProperties);
121 VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceProperties(
122     VkPhysicalDevice                            physicalDevice,
123     VkPhysicalDeviceProperties*                 pProperties);
124 VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceQueueFamilyProperties(
125     VkPhysicalDevice                            physicalDevice,
126     uint32_t*                                   pQueueFamilyPropertyCount,
127     VkQueueFamilyProperties*                    pQueueFamilyProperties);
128 VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceMemoryProperties(
129     VkPhysicalDevice                            physicalDevice,
130     VkPhysicalDeviceMemoryProperties*           pMemoryProperties);
131 VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL terminator_GetInstanceProcAddr(
132     VkInstance                                  instance,
133     const char*                                 pName);
134 VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDevice(
135     VkPhysicalDevice                            physicalDevice,
136     const VkDeviceCreateInfo*                   pCreateInfo,
137     const VkAllocationCallbacks*                pAllocator,
138     VkDevice*                                   pDevice);
139 VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateInstanceExtensionProperties(
140     const char*                                 pLayerName,
141     uint32_t*                                   pPropertyCount,
142     VkExtensionProperties*                      pProperties);
143 VKAPI_ATTR VkResult VKAPI_CALL terminator_pre_instance_EnumerateInstanceExtensionProperties(
144     const VkEnumerateInstanceExtensionPropertiesChain* chain,
145     const char*                                 pLayerName,
146     uint32_t*                                   pPropertyCount,
147     VkExtensionProperties*                      pProperties);
148 VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateDeviceExtensionProperties(
149     VkPhysicalDevice                            physicalDevice,
150     const char*                                 pLayerName,
151     uint32_t*                                   pPropertyCount,
152     VkExtensionProperties*                      pProperties);
153 VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateInstanceLayerProperties(
154     uint32_t*                                   pPropertyCount,
155     VkLayerProperties*                          pProperties);
156 VKAPI_ATTR VkResult VKAPI_CALL terminator_pre_instance_EnumerateInstanceLayerProperties(
157     const VkEnumerateInstanceLayerPropertiesChain* chain,
158     uint32_t*                                   pPropertyCount,
159     VkLayerProperties*                          pProperties);
160 VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateDeviceLayerProperties(
161     VkPhysicalDevice                            physicalDevice,
162     uint32_t*                                   pPropertyCount,
163     VkLayerProperties*                          pProperties);
164 VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceSparseImageFormatProperties(
165     VkPhysicalDevice                            physicalDevice,
166     VkFormat                                    format,
167     VkImageType                                 type,
168     VkSampleCountFlagBits                       samples,
169     VkImageUsageFlags                           usage,
170     VkImageTiling                               tiling,
171     uint32_t*                                   pPropertyCount,
172     VkSparseImageFormatProperties*              pProperties);
173 VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateInstanceVersion(
174     uint32_t*                                   pApiVersion);
175 VKAPI_ATTR VkResult VKAPI_CALL terminator_pre_instance_EnumerateInstanceVersion(
176     const VkEnumerateInstanceVersionChain* chain,
177     uint32_t*                                   pApiVersion);
178 VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumeratePhysicalDeviceGroups(
179     VkInstance                                  instance,
180     uint32_t*                                   pPhysicalDeviceGroupCount,
181     VkPhysicalDeviceGroupProperties*            pPhysicalDeviceGroupProperties);
182 VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFeatures2(
183     VkPhysicalDevice                            physicalDevice,
184     VkPhysicalDeviceFeatures2*                  pFeatures);
185 VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceProperties2(
186     VkPhysicalDevice                            physicalDevice,
187     VkPhysicalDeviceProperties2*                pProperties);
188 VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFormatProperties2(
189     VkPhysicalDevice                            physicalDevice,
190     VkFormat                                    format,
191     VkFormatProperties2*                        pFormatProperties);
192 VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceImageFormatProperties2(
193     VkPhysicalDevice                            physicalDevice,
194     const VkPhysicalDeviceImageFormatInfo2*     pImageFormatInfo,
195     VkImageFormatProperties2*                   pImageFormatProperties);
196 VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceQueueFamilyProperties2(
197     VkPhysicalDevice                            physicalDevice,
198     uint32_t*                                   pQueueFamilyPropertyCount,
199     VkQueueFamilyProperties2*                   pQueueFamilyProperties);
200 VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceMemoryProperties2(
201     VkPhysicalDevice                            physicalDevice,
202     VkPhysicalDeviceMemoryProperties2*          pMemoryProperties);
203 VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceSparseImageFormatProperties2(
204     VkPhysicalDevice                            physicalDevice,
205     const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo,
206     uint32_t*                                   pPropertyCount,
207     VkSparseImageFormatProperties2*             pProperties);
208 VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceExternalBufferProperties(
209     VkPhysicalDevice                            physicalDevice,
210     const VkPhysicalDeviceExternalBufferInfo*   pExternalBufferInfo,
211     VkExternalBufferProperties*                 pExternalBufferProperties);
212 VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceExternalFenceProperties(
213     VkPhysicalDevice                            physicalDevice,
214     const VkPhysicalDeviceExternalFenceInfo*    pExternalFenceInfo,
215     VkExternalFenceProperties*                  pExternalFenceProperties);
216 VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceExternalSemaphoreProperties(
217     VkPhysicalDevice                            physicalDevice,
218     const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo,
219     VkExternalSemaphoreProperties*              pExternalSemaphoreProperties);
220 VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceToolProperties(
221     VkPhysicalDevice                            physicalDevice,
222     uint32_t*                                   pToolCount,
223     VkPhysicalDeviceToolProperties*             pToolProperties);
224 
225 // ICD function pointer dispatch table
226 struct loader_icd_term_dispatch {
227 
228     // ---- Core Vulkan 1.0 commands
229     PFN_vkCreateInstance CreateInstance;
230     PFN_vkDestroyInstance DestroyInstance;
231     PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices;
232     PFN_vkGetPhysicalDeviceFeatures GetPhysicalDeviceFeatures;
233     PFN_vkGetPhysicalDeviceFormatProperties GetPhysicalDeviceFormatProperties;
234     PFN_vkGetPhysicalDeviceImageFormatProperties GetPhysicalDeviceImageFormatProperties;
235     PFN_vkGetPhysicalDeviceProperties GetPhysicalDeviceProperties;
236     PFN_vkGetPhysicalDeviceQueueFamilyProperties GetPhysicalDeviceQueueFamilyProperties;
237     PFN_vkGetPhysicalDeviceMemoryProperties GetPhysicalDeviceMemoryProperties;
238     PFN_vkGetDeviceProcAddr GetDeviceProcAddr;
239     PFN_vkCreateDevice CreateDevice;
240     PFN_vkEnumerateInstanceExtensionProperties EnumerateInstanceExtensionProperties;
241     PFN_vkEnumerateDeviceExtensionProperties EnumerateDeviceExtensionProperties;
242     PFN_vkEnumerateInstanceLayerProperties EnumerateInstanceLayerProperties;
243     PFN_vkGetPhysicalDeviceSparseImageFormatProperties GetPhysicalDeviceSparseImageFormatProperties;
244 
245     // ---- Core Vulkan 1.1 commands
246     PFN_vkEnumerateInstanceVersion EnumerateInstanceVersion;
247     PFN_vkEnumeratePhysicalDeviceGroups EnumeratePhysicalDeviceGroups;
248     PFN_vkGetPhysicalDeviceFeatures2 GetPhysicalDeviceFeatures2;
249     PFN_vkGetPhysicalDeviceProperties2 GetPhysicalDeviceProperties2;
250     PFN_vkGetPhysicalDeviceFormatProperties2 GetPhysicalDeviceFormatProperties2;
251     PFN_vkGetPhysicalDeviceImageFormatProperties2 GetPhysicalDeviceImageFormatProperties2;
252     PFN_vkGetPhysicalDeviceQueueFamilyProperties2 GetPhysicalDeviceQueueFamilyProperties2;
253     PFN_vkGetPhysicalDeviceMemoryProperties2 GetPhysicalDeviceMemoryProperties2;
254     PFN_vkGetPhysicalDeviceSparseImageFormatProperties2 GetPhysicalDeviceSparseImageFormatProperties2;
255     PFN_vkGetPhysicalDeviceExternalBufferProperties GetPhysicalDeviceExternalBufferProperties;
256     PFN_vkGetPhysicalDeviceExternalFenceProperties GetPhysicalDeviceExternalFenceProperties;
257     PFN_vkGetPhysicalDeviceExternalSemaphoreProperties GetPhysicalDeviceExternalSemaphoreProperties;
258 
259     // ---- Core Vulkan 1.3 commands
260     PFN_vkGetPhysicalDeviceToolProperties GetPhysicalDeviceToolProperties;
261 
262     // ---- VK_KHR_surface extension commands
263     PFN_vkDestroySurfaceKHR DestroySurfaceKHR;
264     PFN_vkGetPhysicalDeviceSurfaceSupportKHR GetPhysicalDeviceSurfaceSupportKHR;
265     PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR GetPhysicalDeviceSurfaceCapabilitiesKHR;
266     PFN_vkGetPhysicalDeviceSurfaceFormatsKHR GetPhysicalDeviceSurfaceFormatsKHR;
267     PFN_vkGetPhysicalDeviceSurfacePresentModesKHR GetPhysicalDeviceSurfacePresentModesKHR;
268 
269     // ---- VK_KHR_swapchain extension commands
270     PFN_vkGetPhysicalDevicePresentRectanglesKHR GetPhysicalDevicePresentRectanglesKHR;
271 
272     // ---- VK_KHR_display extension commands
273     PFN_vkGetPhysicalDeviceDisplayPropertiesKHR GetPhysicalDeviceDisplayPropertiesKHR;
274     PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR GetPhysicalDeviceDisplayPlanePropertiesKHR;
275     PFN_vkGetDisplayPlaneSupportedDisplaysKHR GetDisplayPlaneSupportedDisplaysKHR;
276     PFN_vkGetDisplayModePropertiesKHR GetDisplayModePropertiesKHR;
277     PFN_vkCreateDisplayModeKHR CreateDisplayModeKHR;
278     PFN_vkGetDisplayPlaneCapabilitiesKHR GetDisplayPlaneCapabilitiesKHR;
279     PFN_vkCreateDisplayPlaneSurfaceKHR CreateDisplayPlaneSurfaceKHR;
280 
281     // ---- VK_KHR_xlib_surface extension commands
282 #if defined(VK_USE_PLATFORM_XLIB_KHR)
283     PFN_vkCreateXlibSurfaceKHR CreateXlibSurfaceKHR;
284 #endif // VK_USE_PLATFORM_XLIB_KHR
285 #if defined(VK_USE_PLATFORM_XLIB_KHR)
286     PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR GetPhysicalDeviceXlibPresentationSupportKHR;
287 #endif // VK_USE_PLATFORM_XLIB_KHR
288 
289     // ---- VK_KHR_xcb_surface extension commands
290 #if defined(VK_USE_PLATFORM_XCB_KHR)
291     PFN_vkCreateXcbSurfaceKHR CreateXcbSurfaceKHR;
292 #endif // VK_USE_PLATFORM_XCB_KHR
293 #if defined(VK_USE_PLATFORM_XCB_KHR)
294     PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR GetPhysicalDeviceXcbPresentationSupportKHR;
295 #endif // VK_USE_PLATFORM_XCB_KHR
296 
297     // ---- VK_KHR_wayland_surface extension commands
298 #if defined(VK_USE_PLATFORM_WAYLAND_KHR)
299     PFN_vkCreateWaylandSurfaceKHR CreateWaylandSurfaceKHR;
300 #endif // VK_USE_PLATFORM_WAYLAND_KHR
301 #if defined(VK_USE_PLATFORM_WAYLAND_KHR)
302     PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR GetPhysicalDeviceWaylandPresentationSupportKHR;
303 #endif // VK_USE_PLATFORM_WAYLAND_KHR
304 
305     // ---- VK_KHR_android_surface extension commands
306 #if defined(VK_USE_PLATFORM_ANDROID_KHR)
307     PFN_vkCreateAndroidSurfaceKHR CreateAndroidSurfaceKHR;
308 #endif // VK_USE_PLATFORM_ANDROID_KHR
309 
310     // ---- VK_KHR_win32_surface extension commands
311 #if defined(VK_USE_PLATFORM_WIN32_KHR)
312     PFN_vkCreateWin32SurfaceKHR CreateWin32SurfaceKHR;
313 #endif // VK_USE_PLATFORM_WIN32_KHR
314 #if defined(VK_USE_PLATFORM_WIN32_KHR)
315     PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR GetPhysicalDeviceWin32PresentationSupportKHR;
316 #endif // VK_USE_PLATFORM_WIN32_KHR
317 
318     // ---- VK_KHR_video_queue extension commands
319     PFN_vkGetPhysicalDeviceVideoCapabilitiesKHR GetPhysicalDeviceVideoCapabilitiesKHR;
320     PFN_vkGetPhysicalDeviceVideoFormatPropertiesKHR GetPhysicalDeviceVideoFormatPropertiesKHR;
321 
322     // ---- VK_KHR_get_physical_device_properties2 extension commands
323     PFN_vkGetPhysicalDeviceFeatures2KHR GetPhysicalDeviceFeatures2KHR;
324     PFN_vkGetPhysicalDeviceProperties2KHR GetPhysicalDeviceProperties2KHR;
325     PFN_vkGetPhysicalDeviceFormatProperties2KHR GetPhysicalDeviceFormatProperties2KHR;
326     PFN_vkGetPhysicalDeviceImageFormatProperties2KHR GetPhysicalDeviceImageFormatProperties2KHR;
327     PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR GetPhysicalDeviceQueueFamilyProperties2KHR;
328     PFN_vkGetPhysicalDeviceMemoryProperties2KHR GetPhysicalDeviceMemoryProperties2KHR;
329     PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR GetPhysicalDeviceSparseImageFormatProperties2KHR;
330 
331     // ---- VK_KHR_device_group_creation extension commands
332     PFN_vkEnumeratePhysicalDeviceGroupsKHR EnumeratePhysicalDeviceGroupsKHR;
333 
334     // ---- VK_KHR_external_memory_capabilities extension commands
335     PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR GetPhysicalDeviceExternalBufferPropertiesKHR;
336 
337     // ---- VK_KHR_external_semaphore_capabilities extension commands
338     PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR GetPhysicalDeviceExternalSemaphorePropertiesKHR;
339 
340     // ---- VK_KHR_external_fence_capabilities extension commands
341     PFN_vkGetPhysicalDeviceExternalFencePropertiesKHR GetPhysicalDeviceExternalFencePropertiesKHR;
342 
343     // ---- VK_KHR_performance_query extension commands
344     PFN_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR EnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR;
345     PFN_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR GetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR;
346 
347     // ---- VK_KHR_get_surface_capabilities2 extension commands
348     PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR GetPhysicalDeviceSurfaceCapabilities2KHR;
349     PFN_vkGetPhysicalDeviceSurfaceFormats2KHR GetPhysicalDeviceSurfaceFormats2KHR;
350 
351     // ---- VK_KHR_get_display_properties2 extension commands
352     PFN_vkGetPhysicalDeviceDisplayProperties2KHR GetPhysicalDeviceDisplayProperties2KHR;
353     PFN_vkGetPhysicalDeviceDisplayPlaneProperties2KHR GetPhysicalDeviceDisplayPlaneProperties2KHR;
354     PFN_vkGetDisplayModeProperties2KHR GetDisplayModeProperties2KHR;
355     PFN_vkGetDisplayPlaneCapabilities2KHR GetDisplayPlaneCapabilities2KHR;
356 
357     // ---- VK_KHR_fragment_shading_rate extension commands
358     PFN_vkGetPhysicalDeviceFragmentShadingRatesKHR GetPhysicalDeviceFragmentShadingRatesKHR;
359 
360     // ---- VK_KHR_video_encode_queue extension commands
361     PFN_vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR GetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR;
362 
363     // ---- VK_KHR_cooperative_matrix extension commands
364     PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR GetPhysicalDeviceCooperativeMatrixPropertiesKHR;
365 
366     // ---- VK_KHR_calibrated_timestamps extension commands
367     PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsKHR GetPhysicalDeviceCalibrateableTimeDomainsKHR;
368 
369     // ---- VK_EXT_debug_report extension commands
370     PFN_vkCreateDebugReportCallbackEXT CreateDebugReportCallbackEXT;
371     PFN_vkDestroyDebugReportCallbackEXT DestroyDebugReportCallbackEXT;
372     PFN_vkDebugReportMessageEXT DebugReportMessageEXT;
373 
374     // ---- VK_GGP_stream_descriptor_surface extension commands
375 #if defined(VK_USE_PLATFORM_GGP)
376     PFN_vkCreateStreamDescriptorSurfaceGGP CreateStreamDescriptorSurfaceGGP;
377 #endif // VK_USE_PLATFORM_GGP
378 
379     // ---- VK_NV_external_memory_capabilities extension commands
380     PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV GetPhysicalDeviceExternalImageFormatPropertiesNV;
381 
382     // ---- VK_NN_vi_surface extension commands
383 #if defined(VK_USE_PLATFORM_VI_NN)
384     PFN_vkCreateViSurfaceNN CreateViSurfaceNN;
385 #endif // VK_USE_PLATFORM_VI_NN
386 
387     // ---- VK_EXT_direct_mode_display extension commands
388     PFN_vkReleaseDisplayEXT ReleaseDisplayEXT;
389 
390     // ---- VK_EXT_acquire_xlib_display extension commands
391 #if defined(VK_USE_PLATFORM_XLIB_XRANDR_EXT)
392     PFN_vkAcquireXlibDisplayEXT AcquireXlibDisplayEXT;
393 #endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT
394 #if defined(VK_USE_PLATFORM_XLIB_XRANDR_EXT)
395     PFN_vkGetRandROutputDisplayEXT GetRandROutputDisplayEXT;
396 #endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT
397 
398     // ---- VK_EXT_display_surface_counter extension commands
399     PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT GetPhysicalDeviceSurfaceCapabilities2EXT;
400 
401     // ---- VK_MVK_ios_surface extension commands
402 #if defined(VK_USE_PLATFORM_IOS_MVK)
403     PFN_vkCreateIOSSurfaceMVK CreateIOSSurfaceMVK;
404 #endif // VK_USE_PLATFORM_IOS_MVK
405 
406     // ---- VK_MVK_macos_surface extension commands
407 #if defined(VK_USE_PLATFORM_MACOS_MVK)
408     PFN_vkCreateMacOSSurfaceMVK CreateMacOSSurfaceMVK;
409 #endif // VK_USE_PLATFORM_MACOS_MVK
410 
411     // ---- VK_EXT_debug_utils extension commands
412     PFN_vkCreateDebugUtilsMessengerEXT CreateDebugUtilsMessengerEXT;
413     PFN_vkDestroyDebugUtilsMessengerEXT DestroyDebugUtilsMessengerEXT;
414     PFN_vkSubmitDebugUtilsMessageEXT SubmitDebugUtilsMessageEXT;
415 
416     // ---- VK_EXT_sample_locations extension commands
417     PFN_vkGetPhysicalDeviceMultisamplePropertiesEXT GetPhysicalDeviceMultisamplePropertiesEXT;
418 
419     // ---- VK_EXT_calibrated_timestamps extension commands
420     PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT GetPhysicalDeviceCalibrateableTimeDomainsEXT;
421 
422     // ---- VK_FUCHSIA_imagepipe_surface extension commands
423 #if defined(VK_USE_PLATFORM_FUCHSIA)
424     PFN_vkCreateImagePipeSurfaceFUCHSIA CreateImagePipeSurfaceFUCHSIA;
425 #endif // VK_USE_PLATFORM_FUCHSIA
426 
427     // ---- VK_EXT_metal_surface extension commands
428 #if defined(VK_USE_PLATFORM_METAL_EXT)
429     PFN_vkCreateMetalSurfaceEXT CreateMetalSurfaceEXT;
430 #endif // VK_USE_PLATFORM_METAL_EXT
431 
432     // ---- VK_EXT_tooling_info extension commands
433     PFN_vkGetPhysicalDeviceToolPropertiesEXT GetPhysicalDeviceToolPropertiesEXT;
434 
435     // ---- VK_NV_cooperative_matrix extension commands
436     PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV GetPhysicalDeviceCooperativeMatrixPropertiesNV;
437 
438     // ---- VK_NV_coverage_reduction_mode extension commands
439     PFN_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV GetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV;
440 
441     // ---- VK_EXT_full_screen_exclusive extension commands
442 #if defined(VK_USE_PLATFORM_WIN32_KHR)
443     PFN_vkGetPhysicalDeviceSurfacePresentModes2EXT GetPhysicalDeviceSurfacePresentModes2EXT;
444 #endif // VK_USE_PLATFORM_WIN32_KHR
445 
446     // ---- VK_EXT_headless_surface extension commands
447     PFN_vkCreateHeadlessSurfaceEXT CreateHeadlessSurfaceEXT;
448 
449     // ---- VK_EXT_acquire_drm_display extension commands
450     PFN_vkAcquireDrmDisplayEXT AcquireDrmDisplayEXT;
451     PFN_vkGetDrmDisplayEXT GetDrmDisplayEXT;
452 
453     // ---- VK_NV_acquire_winrt_display extension commands
454 #if defined(VK_USE_PLATFORM_WIN32_KHR)
455     PFN_vkAcquireWinrtDisplayNV AcquireWinrtDisplayNV;
456 #endif // VK_USE_PLATFORM_WIN32_KHR
457 #if defined(VK_USE_PLATFORM_WIN32_KHR)
458     PFN_vkGetWinrtDisplayNV GetWinrtDisplayNV;
459 #endif // VK_USE_PLATFORM_WIN32_KHR
460 
461     // ---- VK_EXT_directfb_surface extension commands
462 #if defined(VK_USE_PLATFORM_DIRECTFB_EXT)
463     PFN_vkCreateDirectFBSurfaceEXT CreateDirectFBSurfaceEXT;
464 #endif // VK_USE_PLATFORM_DIRECTFB_EXT
465 #if defined(VK_USE_PLATFORM_DIRECTFB_EXT)
466     PFN_vkGetPhysicalDeviceDirectFBPresentationSupportEXT GetPhysicalDeviceDirectFBPresentationSupportEXT;
467 #endif // VK_USE_PLATFORM_DIRECTFB_EXT
468 
469     // ---- VK_QNX_screen_surface extension commands
470 #if defined(VK_USE_PLATFORM_SCREEN_QNX)
471     PFN_vkCreateScreenSurfaceQNX CreateScreenSurfaceQNX;
472 #endif // VK_USE_PLATFORM_SCREEN_QNX
473 #if defined(VK_USE_PLATFORM_SCREEN_QNX)
474     PFN_vkGetPhysicalDeviceScreenPresentationSupportQNX GetPhysicalDeviceScreenPresentationSupportQNX;
475 #endif // VK_USE_PLATFORM_SCREEN_QNX
476 
477     // ---- VK_NV_optical_flow extension commands
478     PFN_vkGetPhysicalDeviceOpticalFlowImageFormatsNV GetPhysicalDeviceOpticalFlowImageFormatsNV;
479 
480     // ---- VK_OHOS_surface extension commands
481 #ifdef VK_USE_PLATFORM_OHOS
482     PFN_vkCreateSurfaceOHOS CreateSurfaceOHOS;
483 #endif // VK_USE_PLATFORM_OHOS
484 
485     // ---- VK_NV_cooperative_vector extension commands
486     PFN_vkGetPhysicalDeviceCooperativeVectorPropertiesNV GetPhysicalDeviceCooperativeVectorPropertiesNV;
487 
488     // ---- VK_NV_cooperative_matrix2 extension commands
489     PFN_vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV GetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV;
490 };
491 
492 struct loader_instance_extension_enables {
493     uint8_t khr_get_physical_device_properties2;
494     uint8_t khr_device_group_creation;
495     uint8_t khr_external_memory_capabilities;
496     uint8_t khr_external_semaphore_capabilities;
497     uint8_t khr_external_fence_capabilities;
498     uint8_t ext_debug_report;
499     uint8_t nv_external_memory_capabilities;
500     uint8_t ext_direct_mode_display;
501     uint8_t ext_acquire_xlib_display;
502     uint8_t ext_display_surface_counter;
503     uint8_t ext_debug_utils;
504     uint8_t ext_acquire_drm_display;
505 };
506 
507 // Functions that required a terminator need to have a separate dispatch table which contains their corresponding
508 // device function. This is used in the terminators themselves.
509 struct loader_device_terminator_dispatch {
510     // ---- VK_KHR_swapchain extension commands
511     PFN_vkCreateSwapchainKHR CreateSwapchainKHR;
512     PFN_vkGetDeviceGroupSurfacePresentModesKHR GetDeviceGroupSurfacePresentModesKHR;
513     // ---- VK_KHR_display_swapchain extension commands
514     PFN_vkCreateSharedSwapchainsKHR CreateSharedSwapchainsKHR;
515     // ---- VK_EXT_debug_marker extension commands
516     PFN_vkDebugMarkerSetObjectTagEXT DebugMarkerSetObjectTagEXT;
517     PFN_vkDebugMarkerSetObjectNameEXT DebugMarkerSetObjectNameEXT;
518     // ---- VK_EXT_debug_utils extension commands
519     PFN_vkSetDebugUtilsObjectNameEXT SetDebugUtilsObjectNameEXT;
520     PFN_vkSetDebugUtilsObjectTagEXT SetDebugUtilsObjectTagEXT;
521     PFN_vkQueueBeginDebugUtilsLabelEXT QueueBeginDebugUtilsLabelEXT;
522     PFN_vkQueueEndDebugUtilsLabelEXT QueueEndDebugUtilsLabelEXT;
523     PFN_vkQueueInsertDebugUtilsLabelEXT QueueInsertDebugUtilsLabelEXT;
524     PFN_vkCmdBeginDebugUtilsLabelEXT CmdBeginDebugUtilsLabelEXT;
525     PFN_vkCmdEndDebugUtilsLabelEXT CmdEndDebugUtilsLabelEXT;
526     PFN_vkCmdInsertDebugUtilsLabelEXT CmdInsertDebugUtilsLabelEXT;
527 #if defined(VK_USE_PLATFORM_WIN32_KHR)
528     // ---- VK_EXT_full_screen_exclusive extension commands
529     PFN_vkGetDeviceGroupSurfacePresentModes2EXT GetDeviceGroupSurfacePresentModes2EXT;
530 #endif // VK_USE_PLATFORM_WIN32_KHR
531 };
532 
533 // clang-format on
534