blob: f54f44f9c0d036724e8c59fae230a33e0696d8dc [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
132 struct loader_extension_list enabled_device_extensions;
133 struct loader_extension_list activated_layer_list;
134
135 struct loader_device *next;
136};
137
Jon Ashburn392c5622015-06-10 16:11:42 -0600138/* per ICD structure */
Jon Ashburnebfa25e2015-05-15 15:09:35 -0600139struct loader_icd {
140 const struct loader_scanned_icds *scanned_icds;
141
Jon Ashburn10f4e822015-06-10 10:06:06 -0600142 struct loader_device *logical_device_list;
Jon Ashburnebfa25e2015-05-15 15:09:35 -0600143 uint32_t gpu_count;
Jon Ashburn392c5622015-06-10 16:11:42 -0600144 VkPhysicalDevice *gpus; // enumerated PhysicalDevices
Jon Ashburnebfa25e2015-05-15 15:09:35 -0600145 VkInstance instance; // instance object from the icd
Jon Ashburnc89dd4a2015-05-18 13:20:15 -0600146 PFN_vkGetDeviceProcAddr GetDeviceProcAddr;
Jon Ashburnebfa25e2015-05-15 15:09:35 -0600147 PFN_vkDestroyInstance DestroyInstance;
148 PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices;
Chris Forbes1c946ec2015-06-21 22:55:02 +1200149 PFN_vkGetPhysicalDeviceFeatures GetPhysicalDeviceFeatures;
150 PFN_vkGetPhysicalDeviceFormatInfo GetPhysicalDeviceFormatInfo;
151 PFN_vkGetPhysicalDeviceLimits GetPhysicalDeviceLimits;
Jon Ashburnebfa25e2015-05-15 15:09:35 -0600152 PFN_vkCreateDevice CreateDevice;
Tony Barbour4e657ba2015-06-24 16:06:58 -0600153 PFN_vkGetPhysicalDeviceProperties GetPhysicalDeviceProperties;
154 PFN_vkGetPhysicalDevicePerformance GetPhysicalDevicePerformance;
155 PFN_vkGetPhysicalDeviceQueueCount GetPhysicalDeviceQueueCount;
156 PFN_vkGetPhysicalDeviceQueueProperties GetPhysicalDeviceQueueProperties;
157 PFN_vkGetPhysicalDeviceMemoryProperties GetPhysicalDeviceMemoryProperties;
158 PFN_vkGetPhysicalDeviceExtensionCount GetPhysicalDeviceExtensionCount;
159 PFN_vkGetPhysicalDeviceExtensionProperties GetPhysicalDeviceExtensionProperties;
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -0600160 PFN_vkDbgCreateMsgCallback DbgCreateMsgCallback;
161 PFN_vkDbgDestroyMsgCallback DbgDestroyMsgCallback;
Courtney Goeltzenleuchter1c512402015-06-17 20:51:59 -0600162 /*
163 * Fill in the cache of available extensions from all layers that
164 * operate with this physical device.
Tony Barbour4e657ba2015-06-24 16:06:58 -0600165 * This cache will be used to satisfy calls to GetPhysicalDeviceExtensionProperties
Courtney Goeltzenleuchter1c512402015-06-17 20:51:59 -0600166 */
Jon Ashburn10f4e822015-06-10 10:06:06 -0600167 struct loader_extension_list device_extension_cache[MAX_GPUS_PER_ICD];
168 struct loader_icd *next;
Jon Ashburnebfa25e2015-05-15 15:09:35 -0600169};
170
Jon Ashburn392c5622015-06-10 16:11:42 -0600171/* per instance structure */
Jon Ashburn13482452015-05-12 17:26:48 -0600172struct loader_instance {
Jon Ashburnebfa25e2015-05-15 15:09:35 -0600173 VkLayerInstanceDispatchTable *disp; // must be first entry in structure
174
Jon Ashburn13482452015-05-12 17:26:48 -0600175 uint32_t layer_count;
Jon Ashburn13482452015-05-12 17:26:48 -0600176 uint32_t total_gpu_count;
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -0600177 uint32_t total_icd_count;
Jon Ashburn13482452015-05-12 17:26:48 -0600178 struct loader_icd *icds;
179 struct loader_instance *next;
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -0600180
181 /* TODO: Should keep track of application provided allocation functions */
182
183 /*
184 * CreateMsgCallback is global and needs to be
185 * applied to all layers and ICDs.
186 * What happens if a layer is enabled on both the instance chain
187 * as well as the device chain and a call to CreateMsgCallback is made?
188 * Do we need to make sure that each layer / driver only gets called once?
189 * Should a layer implementing support for CreateMsgCallback only be allowed (?)
190 * to live on one chain? Or maybe make it the application's responsibility.
191 * If the app enables DRAW_STATE on at both CreateInstance time and CreateDevice
192 * time, CreateMsgCallback will call the DRAW_STATE layer twice. Once via
193 * the instance chain and once via the device chain.
194 * The loader should only return the DEBUG_REPORT extension as supported
195 * for the GetGlobalExtensionSupport call. That should help eliminate one
196 * duplication.
197 * Since the instance chain requires us iterating over the available ICDs
198 * and each ICD will have it's own unique MsgCallback object we need to
199 * track those objects to give back the right one.
200 * This also implies that the loader has to intercept vkDestroyObject and
201 * if the extension is enabled and the object type is a MsgCallback then
202 * we must translate the object into the proper ICD specific ones.
203 * DestroyObject works on a device chain. Should not be what's destroying
204 * the MsgCallback object. That needs to be an instance thing. So, since
205 * we used an instance to create it, we need a custom Destroy that also
206 * takes an instance. That way we can iterate over the ICDs properly.
207 * Example use:
208 * CreateInstance: DEBUG_REPORT
209 * Loader will create instance chain with enabled extensions.
210 * TODO: Should validation layers be enabled here? If not, they will not be in the instance chain.
211 * fn = GetProcAddr(INSTANCE, "vkCreateMsgCallback") -> point to loader's vkCreateMsgCallback
212 * App creates a callback object: fn(..., &MsgCallbackObject1)
213 * Have only established the instance chain so far. Loader will call the instance chain.
214 * Each layer in the instance chain will call down to the next layer, terminating with
215 * the CreateMsgCallback loader terminator function that creates the actual MsgCallbackObject1 object.
216 * The loader CreateMsgCallback terminator will iterate over the ICDs.
217 * Calling each ICD that supports vkCreateMsgCallback and collect answers in icd_msg_callback_map here.
218 * As result is sent back up the chain each layer has opportunity to record the callback operation and
219 * appropriate MsgCallback object.
220 * ...
221 * Any reports matching the flags set in MsgCallbackObject1 will generate the defined callback behavior
222 * in the layer / ICD that initiated that report.
223 * ...
224 * CreateDevice: MemTracker:...
225 * App does not include DEBUG_REPORT as that is a global extension.
226 * TODO: GetExtensionSupport must not report DEBUG_REPORT when using instance.
227 * App MUST include any desired validation layers or they will not participate in the device call chain.
228 * App creates a callback object: fn(..., &MsgCallbackObject2)
229 * Loader's vkCreateMsgCallback is called.
230 * Loader sends call down instance chain - this is a global extension - any validation layer that was
231 * enabled at CreateInstance will be able to register the callback. Loader will iterate over the ICDs and
232 * will record the ICD's version of the MsgCallback2 object here.
233 * ...
234 * Any report will go to the layer's report function and it will check the flags for MsgCallbackObject1
235 * and MsgCallbackObject2 and take the appropriate action as indicated by the app.
236 * ...
237 * App calls vkDestroyMsgCallback( MsgCallbackObject1 )
238 * Loader's DestroyMsgCallback is where call starts. DestroyMsgCallback will be sent down instance chain
239 * ending in the loader's DestroyMsgCallback terminator which will iterate over the ICD's destroying each
240 * ICD version of that MsgCallback object and then destroy the loader's version of the object.
241 * Any reports generated after this will only have MsgCallbackObject2 available.
242 */
243 struct loader_msg_callback_map_entry *icd_msg_callback_map;
244
245 struct loader_extension_list enabled_instance_extensions;
Courtney Goeltzenleuchter99ad4482015-06-07 17:28:17 -0600246 struct loader_extension_list activated_layer_list;
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -0600247
248 uint32_t app_extension_count;
249 VkExtensionProperties *app_extension_props;
250
251 bool debug_report_enabled;
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -0600252 VkLayerDbgFunctionNode *DbgFunctionHead;
253};
254
Jon Ashburn13482452015-05-12 17:26:48 -0600255struct loader_struct {
256 struct loader_instance *instances;
Jon Ashburn13482452015-05-12 17:26:48 -0600257 struct loader_scanned_icds *scanned_icd_list;
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -0600258
259 unsigned int loaded_layer_lib_count;
260 struct loader_lib_info *loaded_layer_lib_list;
261
Jon Ashburn13482452015-05-12 17:26:48 -0600262 char *layer_dirs;
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -0600263
Jon Ashburn399c9162015-07-02 09:40:15 -0600264 struct loader_layer_list scanned_layers;
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -0600265
Tony Barbour4e657ba2015-06-24 16:06:58 -0600266 /* Keep track of all the extensions available via GetGlobalExtensionProperties */
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -0600267 struct loader_extension_list global_extensions;
268};
269
270struct loader_scanned_icds {
271 char *lib_name;
272 loader_platform_dl_handle handle;
273
274 PFN_vkCreateInstance CreateInstance;
275 PFN_vkDestroyInstance DestroyInstance;
276 PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices;
Tony Barbour4e657ba2015-06-24 16:06:58 -0600277 PFN_vkGetGlobalExtensionCount GetGlobalExtensionCount;
278 PFN_vkGetGlobalExtensionProperties GetGlobalExtensionProperties;
279 PFN_vkGetPhysicalDeviceExtensionCount GetPhysicalDeviceExtensionCount;
280 PFN_vkGetPhysicalDeviceExtensionProperties GetPhysicalDeviceExtensionProperties;
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -0600281 VkInstance instance;
282 struct loader_scanned_icds *next;
283
284 /* cache of global extensions for specific ICD */
285 struct loader_extension_list global_extension_list;
286
287 /*
288 * cache of device extensions for specific ICD,
289 * filled in at CreateInstance time
290 */
Courtney Goeltzenleuchter1c512402015-06-17 20:51:59 -0600291 struct loader_extension_list device_extension_list;
Jon Ashburn13482452015-05-12 17:26:48 -0600292};
293
Jon Ashburn399c9162015-07-02 09:40:15 -0600294static inline struct loader_instance *loader_instance(VkInstance instance) {
295 return (struct loader_instance *) instance;
296}
297
Jon Ashburn62a54d12015-05-01 18:00:33 -0600298static inline void loader_set_dispatch(VkObject obj, const void *data)
Chia-I Wufe333ed2015-04-11 15:34:07 +0800299{
300 *((const void **) obj) = data;
301}
302
Jon Ashburn62a54d12015-05-01 18:00:33 -0600303static inline VkLayerDispatchTable *loader_get_dispatch(const VkObject obj)
Chia-I Wufe333ed2015-04-11 15:34:07 +0800304{
Jon Ashburn62a54d12015-05-01 18:00:33 -0600305 return *((VkLayerDispatchTable **) obj);
Chia-I Wufe333ed2015-04-11 15:34:07 +0800306}
307
Jon Ashburn13482452015-05-12 17:26:48 -0600308static inline VkLayerInstanceDispatchTable *loader_get_instance_dispatch(const VkObject obj)
309{
310 return *((VkLayerInstanceDispatchTable **) obj);
311}
312
Jon Ashburn62a54d12015-05-01 18:00:33 -0600313static inline void loader_init_dispatch(VkObject obj, const void *data)
Chia-I Wufe333ed2015-04-11 15:34:07 +0800314{
Jon Ashburn167b2b12015-04-15 13:34:33 -0600315#ifdef DEBUG
Chia-I Wufe333ed2015-04-11 15:34:07 +0800316 assert(valid_loader_magic_value(obj) &&
317 "Incompatible ICD, first dword must be initialized to ICD_LOADER_MAGIC. See loader/README.md for details.");
Jon Ashburn167b2b12015-04-15 13:34:33 -0600318#endif
Chia-I Wufe333ed2015-04-11 15:34:07 +0800319
Jon Ashburn62a54d12015-05-01 18:00:33 -0600320 loader_set_dispatch(obj, data);
Chia-I Wufe333ed2015-04-11 15:34:07 +0800321}
322
Jon Ashburn13482452015-05-12 17:26:48 -0600323/* global variables used across files */
324extern struct loader_struct loader;
325extern LOADER_PLATFORM_THREAD_ONCE_DEFINITION(once_icd);
326extern LOADER_PLATFORM_THREAD_ONCE_DEFINITION(once_layer);
327extern LOADER_PLATFORM_THREAD_ONCE_DEFINITION(once_exts);
Jon Ashburn7e8d8b42015-05-29 13:15:39 -0600328extern loader_platform_thread_mutex loader_lock;
329extern const VkLayerInstanceDispatchTable instance_disp;
Jon Ashburn37e7f972015-04-06 10:58:22 -0600330
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -0600331struct loader_msg_callback_map_entry {
332 VkDbgMsgCallback icd_obj;
333 VkDbgMsgCallback loader_obj;
334};
335
336bool compare_vk_extension_properties(
337 const VkExtensionProperties* op1,
338 const VkExtensionProperties* op2);
339
Jon Ashburn13482452015-05-12 17:26:48 -0600340/* instance layer chain termination entrypoint definitions */
341VkResult loader_CreateInstance(
342 const VkInstanceCreateInfo* pCreateInfo,
343 VkInstance* pInstance);
Chia-I Wufe333ed2015-04-11 15:34:07 +0800344
Jon Ashburn13482452015-05-12 17:26:48 -0600345VkResult loader_DestroyInstance(
346 VkInstance instance);
347
348VkResult loader_EnumeratePhysicalDevices(
349 VkInstance instance,
350 uint32_t* pPhysicalDeviceCount,
351 VkPhysicalDevice* pPhysicalDevices);
Chris Forbes1c946ec2015-06-21 22:55:02 +1200352
Chris Forbes1c946ec2015-06-21 22:55:02 +1200353VkResult loader_GetPhysicalDeviceFeatures(
354 VkPhysicalDevice physicalDevice,
355 VkPhysicalDeviceFeatures* pFeatures);
356
357VkResult loader_GetPhysicalDeviceFormatInfo(
358 VkPhysicalDevice physicalDevice,
359 VkFormat format,
360 VkFormatProperties* pFormatInfo);
361
362VkResult loader_GetPhysicalDeviceLimits(
363 VkPhysicalDevice physicalDevice,
364 VkPhysicalDeviceLimits* pLimits);
365
Tony Barbour4e657ba2015-06-24 16:06:58 -0600366
367VkResult loader_GetPhysicalDeviceProperties (
368 VkPhysicalDevice physicalDevice,
369 VkPhysicalDeviceProperties* pProperties);
370
371VkResult loader_GetPhysicalDevicePerformance (
372 VkPhysicalDevice physicalDevice,
373 VkPhysicalDevicePerformance* pPerformance);
374
375VkResult loader_GetPhysicalDeviceExtensionProperties (
376 VkPhysicalDevice physicalDevice,
377 uint32_t extensionIndex,
378 VkExtensionProperties* pProperties);
379
380VkResult loader_GetPhysicalDeviceExtensionCount (
381 VkPhysicalDevice physicalDevice,
382 uint32_t* pCount);
383
384VkResult loader_GetPhysicalDeviceQueueCount (
385 VkPhysicalDevice physicalDevice,
386 uint32_t* pCount);
387
388VkResult loader_GetPhysicalDeviceQueueProperties (
389 VkPhysicalDevice physicalDevice,
390 uint32_t count,
391 VkPhysicalDeviceQueueProperties * pProperties);
392
393VkResult loader_GetPhysicalDeviceMemoryProperties (
394 VkPhysicalDevice physicalDevice,
395 VkPhysicalDeviceMemoryProperties * pProperties);
Jon Ashburn7e8d8b42015-05-29 13:15:39 -0600396
Jon Ashburnebfa25e2015-05-15 15:09:35 -0600397VkResult loader_CreateDevice(
398 VkPhysicalDevice gpu,
399 const VkDeviceCreateInfo* pCreateInfo,
400 VkDevice* pDevice);
Jon Ashburn13482452015-05-12 17:26:48 -0600401
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -0600402/* helper function definitions */
403bool has_vk_extension_property(
404 const VkExtensionProperties *vk_ext_prop,
405 const struct loader_extension_list *ext_list);
Jon Ashburn13482452015-05-12 17:26:48 -0600406
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -0600407void loader_add_to_ext_list(
408 struct loader_extension_list *ext_list,
409 uint32_t prop_list_count,
410 const struct loader_extension_property *props);
Courtney Goeltzenleuchter54fcee12015-06-08 15:09:22 -0600411void loader_destroy_ext_list(struct loader_extension_list *ext_info);
Jon Ashburn13482452015-05-12 17:26:48 -0600412
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -0600413bool loader_is_extension_scanned(const VkExtensionProperties *ext_prop);
Jon Ashburn13482452015-05-12 17:26:48 -0600414void loader_icd_scan(void);
Jon Ashburn399c9162015-07-02 09:40:15 -0600415void loader_layer_scan(void);
Jon Ashburn13482452015-05-12 17:26:48 -0600416void loader_coalesce_extensions(void);
Courtney Goeltzenleuchter67146d02015-06-10 17:39:03 -0600417
Jon Ashburn540a90d2015-05-28 19:16:58 -0600418struct loader_icd * loader_get_icd(const VkPhysicalDevice gpu,
Jon Ashburnebfa25e2015-05-15 15:09:35 -0600419 uint32_t *gpu_index);
Jon Ashburn10f4e822015-06-10 10:06:06 -0600420void loader_remove_logical_device(VkDevice device);
421void loader_enable_instance_layers(struct loader_instance *inst);
422void loader_deactivate_instance_layers(struct loader_instance *instance);
Jon Ashburn13482452015-05-12 17:26:48 -0600423uint32_t loader_activate_instance_layers(struct loader_instance *inst);
Courtney Goeltzenleuchter1c512402015-06-17 20:51:59 -0600424void loader_activate_instance_layer_extensions(struct loader_instance *inst);
Chia-I Wuc1e0f962014-08-04 08:03:57 +0800425#endif /* LOADER_H */