blob: 0161d049737b0a9bca261bdaf1e30ede7718a03a [file] [log] [blame]
Chia-I Wuc1e0f962014-08-04 08:03:57 +08001/*
Courtney Goeltzenleuchter0b018602015-04-08 15:36:08 -06002 * Vulkan
Chia-I Wuc1e0f962014-08-04 08:03:57 +08003 *
4 * Copyright (C) 2014 LunarG, Inc.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
Chia-I Wud8ab1e62014-09-02 08:32:09 +080023 *
24 * Authors:
25 * Chia-I Wu <olv@lunarg.com>
Chia-I Wuc1e0f962014-08-04 08:03:57 +080026 */
27
28#ifndef LOADER_H
29#define LOADER_H
30
Courtney Goeltzenleuchter0b018602015-04-08 15:36:08 -060031#include <vulkan.h>
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -060032#include <vk_debug_report_lunarg.h>
Chia-I Wu73e9db32015-04-16 22:02:10 +080033#include <vk_wsi_lunarg.h>
Tobin Ehlis7ad5aca2015-07-03 09:42:57 -060034#include <vk_layer.h>
35#include <vk_icd.h>
Chia-I Wufe333ed2015-04-11 15:34:07 +080036#include <assert.h>
37
Chia-I Wuc1e0f962014-08-04 08:03:57 +080038#if defined(__GNUC__) && __GNUC__ >= 4
39# define LOADER_EXPORT __attribute__((visibility("default")))
40#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)
41# define LOADER_EXPORT __attribute__((visibility("default")))
42#else
43# define LOADER_EXPORT
44#endif
45
Courtney Goeltzenleuchter48403a92015-06-07 18:24:30 -060046#define MAX_EXTENSION_NAME_SIZE 255
Jon Ashburn10f4e822015-06-10 10:06:06 -060047#define MAX_GPUS_PER_ICD 16
Jon Ashburn13482452015-05-12 17:26:48 -060048
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -060049enum extension_origin {
50 VK_EXTENSION_ORIGIN_ICD,
51 VK_EXTENSION_ORIGIN_LAYER,
52 VK_EXTENSION_ORIGIN_LOADER
Jon Ashburn13482452015-05-12 17:26:48 -060053};
54
Jon Ashburn399c9162015-07-02 09:40:15 -060055enum layer_type {
56 VK_LAYER_TYPE_DEVICE_EXPLICIT,
57 VK_LAYER_TYPE_INSTANCE_EXPLICIT,
58 VK_LAYER_TYPE_GLOBAL_EXPLICIT, // both instance and device layer
59 VK_LAYER_TYPE_DEVICE_IMPLICIT,
60 VK_LAYER_TYPE_INSTANCE_IMPLICIT,
61 VK_LAYER_TYPE_GLOBAL_IMPLICIT, // both instance and device layer
62};
63
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -060064struct loader_extension_property {
65 VkExtensionProperties info;
66 const char *lib_name;
67 enum extension_origin origin;
Courtney Goeltzenleuchter99ad4482015-06-07 17:28:17 -060068 // An extension library can export the same extension
69 // under different names. Handy to provide a "grouping"
70 // such as Validation. However, the loader requires
71 // that a layer be included only once in a chain.
72 // During layer scanning the loader will check if
Jon Ashburn392c5622015-06-10 16:11:42 -060073 // the vkGetInstanceProcAddr is the same as an existing extension
Courtney Goeltzenleuchter99ad4482015-06-07 17:28:17 -060074 // If so, it will link them together via the alias pointer.
75 // At initialization time we'll follow the alias pointer
76 // to the "base" extension and then use that extension
77 // internally to ensure we reject duplicates
Jon Ashburn392c5622015-06-10 16:11:42 -060078 PFN_vkGPA get_proc_addr;
Courtney Goeltzenleuchter99ad4482015-06-07 17:28:17 -060079 struct loader_extension_property *alias;
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -060080};
81
82struct loader_extension_list {
83 size_t capacity;
84 uint32_t count;
85 struct loader_extension_property *list;
86};
87
Jon Ashburn399c9162015-07-02 09:40:15 -060088struct loader_name_value {
89 char *name;
90 char *value;
91};
92
93struct loader_lib_info {
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -060094 char *lib_name;
Jon Ashburn399c9162015-07-02 09:40:15 -060095 uint32_t ref_count;
96 loader_platform_dl_handle lib_handle;
97};
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -060098
Jon Ashburn399c9162015-07-02 09:40:15 -060099struct loader_layer_functions {
100 PFN_vkGetInstanceProcAddr get_instance_proc_addr;
101 PFN_vkGetDeviceProcAddr get_device_proc_addr;
102};
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -0600103
Jon Ashburn399c9162015-07-02 09:40:15 -0600104struct loader_layer_properties {
105 char *name;
106 enum layer_type type;
107 struct loader_lib_info lib_info;
108 char *abi_versions;
109 char *impl_version;
110 char *description;
111 struct loader_layer_functions functions;
112 struct loader_extension_list instance_extension_list;
113 struct loader_extension_list device_extension_list;
114 struct loader_name_value disable_env_var;
115 struct loader_name_value enable_env_var;
116};
117
118struct loader_layer_list {
119 size_t capacity;
120 uint32_t count;
121 struct loader_layer_properties *list;
Jon Ashburn13482452015-05-12 17:26:48 -0600122};
123
Jon Ashburn10f4e822015-06-10 10:06:06 -0600124/* per CreateDevice structure */
125struct loader_device {
126 VkLayerDispatchTable loader_dispatch;
127 VkDevice device; // device object from the icd
128
129 uint32_t app_extension_count;
130 VkExtensionProperties *app_extension_props;
131
Jon Ashburn10f4e822015-06-10 10:06:06 -0600132 struct loader_extension_list activated_layer_list;
133
134 struct loader_device *next;
135};
136
Jon Ashburn392c5622015-06-10 16:11:42 -0600137/* per ICD structure */
Jon Ashburnebfa25e2015-05-15 15:09:35 -0600138struct loader_icd {
139 const struct loader_scanned_icds *scanned_icds;
140
Jon Ashburn10f4e822015-06-10 10:06:06 -0600141 struct loader_device *logical_device_list;
Jon Ashburnebfa25e2015-05-15 15:09:35 -0600142 uint32_t gpu_count;
Jon Ashburn392c5622015-06-10 16:11:42 -0600143 VkPhysicalDevice *gpus; // enumerated PhysicalDevices
Jon Ashburnebfa25e2015-05-15 15:09:35 -0600144 VkInstance instance; // instance object from the icd
Jon Ashburnc89dd4a2015-05-18 13:20:15 -0600145 PFN_vkGetDeviceProcAddr GetDeviceProcAddr;
Jon Ashburnebfa25e2015-05-15 15:09:35 -0600146 PFN_vkDestroyInstance DestroyInstance;
147 PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices;
Chris Forbes1c946ec2015-06-21 22:55:02 +1200148 PFN_vkGetPhysicalDeviceFeatures GetPhysicalDeviceFeatures;
149 PFN_vkGetPhysicalDeviceFormatInfo GetPhysicalDeviceFormatInfo;
150 PFN_vkGetPhysicalDeviceLimits GetPhysicalDeviceLimits;
Jon Ashburnebfa25e2015-05-15 15:09:35 -0600151 PFN_vkCreateDevice CreateDevice;
Tony Barbour4e657ba2015-06-24 16:06:58 -0600152 PFN_vkGetPhysicalDeviceProperties GetPhysicalDeviceProperties;
153 PFN_vkGetPhysicalDevicePerformance GetPhysicalDevicePerformance;
154 PFN_vkGetPhysicalDeviceQueueCount GetPhysicalDeviceQueueCount;
155 PFN_vkGetPhysicalDeviceQueueProperties GetPhysicalDeviceQueueProperties;
156 PFN_vkGetPhysicalDeviceMemoryProperties GetPhysicalDeviceMemoryProperties;
157 PFN_vkGetPhysicalDeviceExtensionCount GetPhysicalDeviceExtensionCount;
158 PFN_vkGetPhysicalDeviceExtensionProperties GetPhysicalDeviceExtensionProperties;
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -0600159 PFN_vkDbgCreateMsgCallback DbgCreateMsgCallback;
160 PFN_vkDbgDestroyMsgCallback DbgDestroyMsgCallback;
Courtney Goeltzenleuchter1c512402015-06-17 20:51:59 -0600161 /*
162 * Fill in the cache of available extensions from all layers that
163 * operate with this physical device.
Tony Barbour4e657ba2015-06-24 16:06:58 -0600164 * This cache will be used to satisfy calls to GetPhysicalDeviceExtensionProperties
Courtney Goeltzenleuchter1c512402015-06-17 20:51:59 -0600165 */
Jon Ashburn10f4e822015-06-10 10:06:06 -0600166 struct loader_extension_list device_extension_cache[MAX_GPUS_PER_ICD];
167 struct loader_icd *next;
Jon Ashburnebfa25e2015-05-15 15:09:35 -0600168};
169
Jon Ashburn392c5622015-06-10 16:11:42 -0600170/* per instance structure */
Jon Ashburn13482452015-05-12 17:26:48 -0600171struct loader_instance {
Jon Ashburnebfa25e2015-05-15 15:09:35 -0600172 VkLayerInstanceDispatchTable *disp; // must be first entry in structure
173
Jon Ashburn13482452015-05-12 17:26:48 -0600174 uint32_t total_gpu_count;
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -0600175 uint32_t total_icd_count;
Jon Ashburn13482452015-05-12 17:26:48 -0600176 struct loader_icd *icds;
177 struct loader_instance *next;
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -0600178
179 /* TODO: Should keep track of application provided allocation functions */
180
181 /*
182 * CreateMsgCallback is global and needs to be
183 * applied to all layers and ICDs.
184 * What happens if a layer is enabled on both the instance chain
185 * as well as the device chain and a call to CreateMsgCallback is made?
186 * Do we need to make sure that each layer / driver only gets called once?
187 * Should a layer implementing support for CreateMsgCallback only be allowed (?)
188 * to live on one chain? Or maybe make it the application's responsibility.
189 * If the app enables DRAW_STATE on at both CreateInstance time and CreateDevice
190 * time, CreateMsgCallback will call the DRAW_STATE layer twice. Once via
191 * the instance chain and once via the device chain.
192 * The loader should only return the DEBUG_REPORT extension as supported
193 * for the GetGlobalExtensionSupport call. That should help eliminate one
194 * duplication.
195 * Since the instance chain requires us iterating over the available ICDs
196 * and each ICD will have it's own unique MsgCallback object we need to
197 * track those objects to give back the right one.
198 * This also implies that the loader has to intercept vkDestroyObject and
199 * if the extension is enabled and the object type is a MsgCallback then
200 * we must translate the object into the proper ICD specific ones.
201 * DestroyObject works on a device chain. Should not be what's destroying
202 * the MsgCallback object. That needs to be an instance thing. So, since
203 * we used an instance to create it, we need a custom Destroy that also
204 * takes an instance. That way we can iterate over the ICDs properly.
205 * Example use:
206 * CreateInstance: DEBUG_REPORT
207 * Loader will create instance chain with enabled extensions.
208 * TODO: Should validation layers be enabled here? If not, they will not be in the instance chain.
209 * fn = GetProcAddr(INSTANCE, "vkCreateMsgCallback") -> point to loader's vkCreateMsgCallback
210 * App creates a callback object: fn(..., &MsgCallbackObject1)
211 * Have only established the instance chain so far. Loader will call the instance chain.
212 * Each layer in the instance chain will call down to the next layer, terminating with
213 * the CreateMsgCallback loader terminator function that creates the actual MsgCallbackObject1 object.
214 * The loader CreateMsgCallback terminator will iterate over the ICDs.
215 * Calling each ICD that supports vkCreateMsgCallback and collect answers in icd_msg_callback_map here.
216 * As result is sent back up the chain each layer has opportunity to record the callback operation and
217 * appropriate MsgCallback object.
218 * ...
219 * Any reports matching the flags set in MsgCallbackObject1 will generate the defined callback behavior
220 * in the layer / ICD that initiated that report.
221 * ...
222 * CreateDevice: MemTracker:...
223 * App does not include DEBUG_REPORT as that is a global extension.
224 * TODO: GetExtensionSupport must not report DEBUG_REPORT when using instance.
225 * App MUST include any desired validation layers or they will not participate in the device call chain.
226 * App creates a callback object: fn(..., &MsgCallbackObject2)
227 * Loader's vkCreateMsgCallback is called.
228 * Loader sends call down instance chain - this is a global extension - any validation layer that was
229 * enabled at CreateInstance will be able to register the callback. Loader will iterate over the ICDs and
230 * will record the ICD's version of the MsgCallback2 object here.
231 * ...
232 * Any report will go to the layer's report function and it will check the flags for MsgCallbackObject1
233 * and MsgCallbackObject2 and take the appropriate action as indicated by the app.
234 * ...
235 * App calls vkDestroyMsgCallback( MsgCallbackObject1 )
236 * Loader's DestroyMsgCallback is where call starts. DestroyMsgCallback will be sent down instance chain
237 * ending in the loader's DestroyMsgCallback terminator which will iterate over the ICD's destroying each
238 * ICD version of that MsgCallback object and then destroy the loader's version of the object.
239 * Any reports generated after this will only have MsgCallbackObject2 available.
240 */
241 struct loader_msg_callback_map_entry *icd_msg_callback_map;
242
Courtney Goeltzenleuchter99ad4482015-06-07 17:28:17 -0600243 struct loader_extension_list activated_layer_list;
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -0600244
245 uint32_t app_extension_count;
246 VkExtensionProperties *app_extension_props;
247
248 bool debug_report_enabled;
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -0600249 VkLayerDbgFunctionNode *DbgFunctionHead;
250};
251
Jon Ashburn13482452015-05-12 17:26:48 -0600252struct loader_struct {
253 struct loader_instance *instances;
Jon Ashburn13482452015-05-12 17:26:48 -0600254 struct loader_scanned_icds *scanned_icd_list;
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -0600255
256 unsigned int loaded_layer_lib_count;
257 struct loader_lib_info *loaded_layer_lib_list;
258
Jon Ashburn13482452015-05-12 17:26:48 -0600259 char *layer_dirs;
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -0600260
Jon Ashburn399c9162015-07-02 09:40:15 -0600261 struct loader_layer_list scanned_layers;
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -0600262
Tony Barbour4e657ba2015-06-24 16:06:58 -0600263 /* Keep track of all the extensions available via GetGlobalExtensionProperties */
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -0600264 struct loader_extension_list global_extensions;
265};
266
267struct loader_scanned_icds {
268 char *lib_name;
269 loader_platform_dl_handle handle;
270
271 PFN_vkCreateInstance CreateInstance;
272 PFN_vkDestroyInstance DestroyInstance;
273 PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices;
Tony Barbour4e657ba2015-06-24 16:06:58 -0600274 PFN_vkGetGlobalExtensionCount GetGlobalExtensionCount;
275 PFN_vkGetGlobalExtensionProperties GetGlobalExtensionProperties;
276 PFN_vkGetPhysicalDeviceExtensionCount GetPhysicalDeviceExtensionCount;
277 PFN_vkGetPhysicalDeviceExtensionProperties GetPhysicalDeviceExtensionProperties;
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -0600278 VkInstance instance;
279 struct loader_scanned_icds *next;
280
281 /* cache of global extensions for specific ICD */
282 struct loader_extension_list global_extension_list;
283
284 /*
285 * cache of device extensions for specific ICD,
286 * filled in at CreateInstance time
287 */
Courtney Goeltzenleuchter1c512402015-06-17 20:51:59 -0600288 struct loader_extension_list device_extension_list;
Jon Ashburn13482452015-05-12 17:26:48 -0600289};
290
Jon Ashburn399c9162015-07-02 09:40:15 -0600291static inline struct loader_instance *loader_instance(VkInstance instance) {
292 return (struct loader_instance *) instance;
293}
294
Jon Ashburn62a54d12015-05-01 18:00:33 -0600295static inline void loader_set_dispatch(VkObject obj, const void *data)
Chia-I Wufe333ed2015-04-11 15:34:07 +0800296{
297 *((const void **) obj) = data;
298}
299
Jon Ashburn62a54d12015-05-01 18:00:33 -0600300static inline VkLayerDispatchTable *loader_get_dispatch(const VkObject obj)
Chia-I Wufe333ed2015-04-11 15:34:07 +0800301{
Jon Ashburn62a54d12015-05-01 18:00:33 -0600302 return *((VkLayerDispatchTable **) obj);
Chia-I Wufe333ed2015-04-11 15:34:07 +0800303}
304
Jon Ashburn13482452015-05-12 17:26:48 -0600305static inline VkLayerInstanceDispatchTable *loader_get_instance_dispatch(const VkObject obj)
306{
307 return *((VkLayerInstanceDispatchTable **) obj);
308}
309
Jon Ashburn62a54d12015-05-01 18:00:33 -0600310static inline void loader_init_dispatch(VkObject obj, const void *data)
Chia-I Wufe333ed2015-04-11 15:34:07 +0800311{
Jon Ashburn167b2b12015-04-15 13:34:33 -0600312#ifdef DEBUG
Chia-I Wufe333ed2015-04-11 15:34:07 +0800313 assert(valid_loader_magic_value(obj) &&
314 "Incompatible ICD, first dword must be initialized to ICD_LOADER_MAGIC. See loader/README.md for details.");
Jon Ashburn167b2b12015-04-15 13:34:33 -0600315#endif
Chia-I Wufe333ed2015-04-11 15:34:07 +0800316
Jon Ashburn62a54d12015-05-01 18:00:33 -0600317 loader_set_dispatch(obj, data);
Chia-I Wufe333ed2015-04-11 15:34:07 +0800318}
319
Jon Ashburn13482452015-05-12 17:26:48 -0600320/* global variables used across files */
321extern struct loader_struct loader;
322extern LOADER_PLATFORM_THREAD_ONCE_DEFINITION(once_icd);
323extern LOADER_PLATFORM_THREAD_ONCE_DEFINITION(once_layer);
324extern LOADER_PLATFORM_THREAD_ONCE_DEFINITION(once_exts);
Jon Ashburn7e8d8b42015-05-29 13:15:39 -0600325extern loader_platform_thread_mutex loader_lock;
326extern const VkLayerInstanceDispatchTable instance_disp;
Jon Ashburn37e7f972015-04-06 10:58:22 -0600327
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -0600328struct loader_msg_callback_map_entry {
329 VkDbgMsgCallback icd_obj;
330 VkDbgMsgCallback loader_obj;
331};
332
333bool compare_vk_extension_properties(
334 const VkExtensionProperties* op1,
335 const VkExtensionProperties* op2);
336
Jon Ashburn13482452015-05-12 17:26:48 -0600337/* instance layer chain termination entrypoint definitions */
338VkResult loader_CreateInstance(
339 const VkInstanceCreateInfo* pCreateInfo,
340 VkInstance* pInstance);
Chia-I Wufe333ed2015-04-11 15:34:07 +0800341
Jon Ashburn13482452015-05-12 17:26:48 -0600342VkResult loader_DestroyInstance(
343 VkInstance instance);
344
345VkResult loader_EnumeratePhysicalDevices(
346 VkInstance instance,
347 uint32_t* pPhysicalDeviceCount,
348 VkPhysicalDevice* pPhysicalDevices);
Chris Forbes1c946ec2015-06-21 22:55:02 +1200349
Chris Forbes1c946ec2015-06-21 22:55:02 +1200350VkResult loader_GetPhysicalDeviceFeatures(
351 VkPhysicalDevice physicalDevice,
352 VkPhysicalDeviceFeatures* pFeatures);
353
354VkResult loader_GetPhysicalDeviceFormatInfo(
355 VkPhysicalDevice physicalDevice,
356 VkFormat format,
357 VkFormatProperties* pFormatInfo);
358
359VkResult loader_GetPhysicalDeviceLimits(
360 VkPhysicalDevice physicalDevice,
361 VkPhysicalDeviceLimits* pLimits);
362
Tony Barbour4e657ba2015-06-24 16:06:58 -0600363
364VkResult loader_GetPhysicalDeviceProperties (
365 VkPhysicalDevice physicalDevice,
366 VkPhysicalDeviceProperties* pProperties);
367
368VkResult loader_GetPhysicalDevicePerformance (
369 VkPhysicalDevice physicalDevice,
370 VkPhysicalDevicePerformance* pPerformance);
371
372VkResult loader_GetPhysicalDeviceExtensionProperties (
373 VkPhysicalDevice physicalDevice,
374 uint32_t extensionIndex,
375 VkExtensionProperties* pProperties);
376
377VkResult loader_GetPhysicalDeviceExtensionCount (
378 VkPhysicalDevice physicalDevice,
379 uint32_t* pCount);
380
381VkResult loader_GetPhysicalDeviceQueueCount (
382 VkPhysicalDevice physicalDevice,
383 uint32_t* pCount);
384
385VkResult loader_GetPhysicalDeviceQueueProperties (
386 VkPhysicalDevice physicalDevice,
387 uint32_t count,
388 VkPhysicalDeviceQueueProperties * pProperties);
389
390VkResult loader_GetPhysicalDeviceMemoryProperties (
391 VkPhysicalDevice physicalDevice,
392 VkPhysicalDeviceMemoryProperties * pProperties);
Jon Ashburn7e8d8b42015-05-29 13:15:39 -0600393
Jon Ashburnebfa25e2015-05-15 15:09:35 -0600394VkResult loader_CreateDevice(
395 VkPhysicalDevice gpu,
396 const VkDeviceCreateInfo* pCreateInfo,
397 VkDevice* pDevice);
Jon Ashburn13482452015-05-12 17:26:48 -0600398
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -0600399/* helper function definitions */
Jon Ashburn02a8d6e2015-07-02 12:59:25 -0600400bool has_vk_extension_property_array(
401 const VkExtensionProperties *vk_ext_prop,
402 const uint32_t count,
403 const VkExtensionProperties *ext_array);
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -0600404bool has_vk_extension_property(
405 const VkExtensionProperties *vk_ext_prop,
406 const struct loader_extension_list *ext_list);
Jon Ashburn13482452015-05-12 17:26:48 -0600407
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -0600408void loader_add_to_ext_list(
409 struct loader_extension_list *ext_list,
410 uint32_t prop_list_count,
411 const struct loader_extension_property *props);
Courtney Goeltzenleuchter54fcee12015-06-08 15:09:22 -0600412void loader_destroy_ext_list(struct loader_extension_list *ext_info);
Jon Ashburn13482452015-05-12 17:26:48 -0600413
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -0600414bool loader_is_extension_scanned(const VkExtensionProperties *ext_prop);
Jon Ashburn13482452015-05-12 17:26:48 -0600415void loader_icd_scan(void);
Jon Ashburn399c9162015-07-02 09:40:15 -0600416void loader_layer_scan(void);
Jon Ashburn13482452015-05-12 17:26:48 -0600417void loader_coalesce_extensions(void);
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -0600418
Jon Ashburn540a90d2015-05-28 19:16:58 -0600419struct loader_icd * loader_get_icd(const VkPhysicalDevice gpu,
Jon Ashburnebfa25e2015-05-15 15:09:35 -0600420 uint32_t *gpu_index);
Jon Ashburn10f4e822015-06-10 10:06:06 -0600421void loader_remove_logical_device(VkDevice device);
422void loader_enable_instance_layers(struct loader_instance *inst);
423void loader_deactivate_instance_layers(struct loader_instance *instance);
Jon Ashburn13482452015-05-12 17:26:48 -0600424uint32_t loader_activate_instance_layers(struct loader_instance *inst);
Courtney Goeltzenleuchter1c512402015-06-17 20:51:59 -0600425void loader_activate_instance_layer_extensions(struct loader_instance *inst);
Chia-I Wuc1e0f962014-08-04 08:03:57 +0800426#endif /* LOADER_H */