Chia-I Wu | 1930060 | 2014-08-04 08:03:57 +0800 | [diff] [blame] | 1 | /* |
Chia-I Wu | 1930060 | 2014-08-04 08:03:57 +0800 | [diff] [blame] | 2 | * |
Courtney Goeltzenleuchter | fcbe16f | 2015-10-29 13:50:34 -0600 | [diff] [blame] | 3 | * Copyright (C) 2015 Valve Corporation |
Chia-I Wu | 1930060 | 2014-08-04 08:03:57 +0800 | [diff] [blame] | 4 | * |
| 5 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 6 | * copy of this software and associated documentation files (the "Software"), |
| 7 | * to deal in the Software without restriction, including without limitation |
| 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 9 | * and/or sell copies of the Software, and to permit persons to whom the |
| 10 | * Software is furnished to do so, subject to the following conditions: |
| 11 | * |
| 12 | * The above copyright notice and this permission notice shall be included |
| 13 | * in all copies or substantial portions of the Software. |
| 14 | * |
| 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 18 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 20 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 21 | * DEALINGS IN THE SOFTWARE. |
Chia-I Wu | 701f3f6 | 2014-09-02 08:32:09 +0800 | [diff] [blame] | 22 | * |
Courtney Goeltzenleuchter | 0555952 | 2015-10-30 11:14:30 -0600 | [diff] [blame] | 23 | * Author: Chia-I Wu <olvaffe@gmail.com> |
| 24 | * Author: Chia-I Wu <olv@lunarg.com> |
| 25 | * Author: Chris Forbes <chrisf@ijw.co.nz> |
| 26 | * Author: Courtney Goeltzenleuchter <courtney@LunarG.com> |
| 27 | * Author: Jon Ashburn <jon@lunarg.com> |
| 28 | * Author: Tony Barbour <tony@LunarG.com> |
| 29 | * |
Chia-I Wu | 1930060 | 2014-08-04 08:03:57 +0800 | [diff] [blame] | 30 | */ |
| 31 | |
| 32 | #ifndef LOADER_H |
| 33 | #define LOADER_H |
| 34 | |
David Pinedo | 9316d3b | 2015-11-06 12:54:48 -0700 | [diff] [blame] | 35 | #include <vulkan/vulkan.h> |
Jon Ashburn | 8a39efc | 2015-11-06 11:02:40 -0700 | [diff] [blame] | 36 | #include <vk_loader_platform.h> |
Ian Elliott | 1dcd109 | 2015-11-17 17:29:40 -0700 | [diff] [blame] | 37 | |
David Pinedo | abd0772 | 2015-11-24 09:00:24 -0700 | [diff] [blame] | 38 | #include <vulkan/vk_lunarg_debug_report.h> |
Ian Elliott | ba04233 | 2015-11-18 14:57:08 -0700 | [diff] [blame] | 39 | |
David Pinedo | 9316d3b | 2015-11-06 12:54:48 -0700 | [diff] [blame] | 40 | #include <vulkan/vk_layer.h> |
| 41 | #include <vulkan/vk_icd.h> |
Chia-I Wu | 5291c76 | 2015-04-11 15:34:07 +0800 | [diff] [blame] | 42 | #include <assert.h> |
| 43 | |
Chia-I Wu | 1930060 | 2014-08-04 08:03:57 +0800 | [diff] [blame] | 44 | #if defined(__GNUC__) && __GNUC__ >= 4 |
| 45 | # define LOADER_EXPORT __attribute__((visibility("default"))) |
| 46 | #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590) |
| 47 | # define LOADER_EXPORT __attribute__((visibility("default"))) |
| 48 | #else |
| 49 | # define LOADER_EXPORT |
| 50 | #endif |
| 51 | |
Jon Ashburn | f73e921 | 2015-08-04 10:22:33 -0600 | [diff] [blame] | 52 | #define MAX_STRING_SIZE 1024 |
Courtney Goeltzenleuchter | 110fdf9 | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 53 | #define VK_MAJOR(version) (version >> 22) |
| 54 | #define VK_MINOR(version) ((version >> 12) & 0x3ff) |
| 55 | #define VK_PATCH(version) (version & 0xfff) |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 56 | |
Jon Ashburn | 5ef2060 | 2015-07-02 09:40:15 -0600 | [diff] [blame] | 57 | enum layer_type { |
Jon Ashburn | 0c26e71 | 2015-07-02 16:10:32 -0600 | [diff] [blame] | 58 | VK_LAYER_TYPE_DEVICE_EXPLICIT = 0x1, |
| 59 | VK_LAYER_TYPE_INSTANCE_EXPLICIT = 0x2, |
| 60 | VK_LAYER_TYPE_GLOBAL_EXPLICIT = 0x3, // both instance and device layer, bitwise |
| 61 | VK_LAYER_TYPE_DEVICE_IMPLICIT = 0x4, |
| 62 | VK_LAYER_TYPE_INSTANCE_IMPLICIT = 0x8, |
| 63 | VK_LAYER_TYPE_GLOBAL_IMPLICIT = 0xc, // both instance and device layer, bitwise |
Jon Ashburn | 5ef2060 | 2015-07-02 09:40:15 -0600 | [diff] [blame] | 64 | }; |
| 65 | |
Jon Ashburn | 6e6a216 | 2015-12-10 08:51:10 -0700 | [diff] [blame] | 66 | // form of all dynamic lists/arrays |
| 67 | // only the list element should be changed |
| 68 | struct loader_generic_list { |
| 69 | size_t capacity; |
| 70 | uint32_t count; |
| 71 | void *list; |
| 72 | }; |
| 73 | |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 74 | struct loader_extension_list { |
| 75 | size_t capacity; |
| 76 | uint32_t count; |
Jon Ashburn | 5c042ea | 2015-08-04 11:14:18 -0600 | [diff] [blame] | 77 | VkExtensionProperties *list; |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 78 | }; |
| 79 | |
Jon Ashburn | 39fbd4e | 2015-12-10 18:17:34 -0700 | [diff] [blame] | 80 | struct loader_dev_ext_props { |
| 81 | VkExtensionProperties props; |
| 82 | uint32_t entrypoint_count; |
| 83 | char **entrypoints; |
| 84 | }; |
| 85 | |
| 86 | struct loader_device_extension_list { |
| 87 | size_t capacity; |
| 88 | uint32_t count; |
| 89 | struct loader_dev_ext_props *list; |
| 90 | }; |
| 91 | |
Jon Ashburn | 5ef2060 | 2015-07-02 09:40:15 -0600 | [diff] [blame] | 92 | struct loader_name_value { |
Jon Ashburn | f73e921 | 2015-08-04 10:22:33 -0600 | [diff] [blame] | 93 | char name[MAX_STRING_SIZE]; |
| 94 | char value[MAX_STRING_SIZE]; |
Jon Ashburn | 5ef2060 | 2015-07-02 09:40:15 -0600 | [diff] [blame] | 95 | }; |
| 96 | |
| 97 | struct loader_lib_info { |
Jon Ashburn | 3d00233 | 2015-08-20 16:35:30 -0600 | [diff] [blame] | 98 | char lib_name[MAX_STRING_SIZE]; |
Jon Ashburn | 5ef2060 | 2015-07-02 09:40:15 -0600 | [diff] [blame] | 99 | uint32_t ref_count; |
| 100 | loader_platform_dl_handle lib_handle; |
| 101 | }; |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 102 | |
Jon Ashburn | 5ef2060 | 2015-07-02 09:40:15 -0600 | [diff] [blame] | 103 | struct loader_layer_functions { |
Jon Ashburn | f73e921 | 2015-08-04 10:22:33 -0600 | [diff] [blame] | 104 | char str_gipa[MAX_STRING_SIZE]; |
| 105 | char str_gdpa[MAX_STRING_SIZE]; |
Jon Ashburn | 5ef2060 | 2015-07-02 09:40:15 -0600 | [diff] [blame] | 106 | PFN_vkGetInstanceProcAddr get_instance_proc_addr; |
| 107 | PFN_vkGetDeviceProcAddr get_device_proc_addr; |
| 108 | }; |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 109 | |
Jon Ashburn | 5ef2060 | 2015-07-02 09:40:15 -0600 | [diff] [blame] | 110 | struct loader_layer_properties { |
Courtney Goeltzenleuchter | 110fdf9 | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 111 | VkLayerProperties info; |
Jon Ashburn | 5ef2060 | 2015-07-02 09:40:15 -0600 | [diff] [blame] | 112 | enum layer_type type; |
Jon Ashburn | 3d00233 | 2015-08-20 16:35:30 -0600 | [diff] [blame] | 113 | char lib_name[MAX_STRING_SIZE]; |
Jon Ashburn | 5ef2060 | 2015-07-02 09:40:15 -0600 | [diff] [blame] | 114 | struct loader_layer_functions functions; |
| 115 | struct loader_extension_list instance_extension_list; |
Jon Ashburn | 39fbd4e | 2015-12-10 18:17:34 -0700 | [diff] [blame] | 116 | struct loader_device_extension_list device_extension_list; |
Jon Ashburn | 5ef2060 | 2015-07-02 09:40:15 -0600 | [diff] [blame] | 117 | struct loader_name_value disable_env_var; |
| 118 | struct loader_name_value enable_env_var; |
| 119 | }; |
| 120 | |
| 121 | struct loader_layer_list { |
| 122 | size_t capacity; |
| 123 | uint32_t count; |
| 124 | struct loader_layer_properties *list; |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 125 | }; |
| 126 | |
Courtney Goeltzenleuchter | 371de70 | 2015-07-05 12:53:31 -0600 | [diff] [blame] | 127 | struct loader_layer_library_list { |
| 128 | size_t capacity; |
| 129 | uint32_t count; |
| 130 | struct loader_lib_info *list; |
| 131 | }; |
| 132 | |
Jon Ashburn | fc1031e | 2015-11-17 15:31:02 -0700 | [diff] [blame] | 133 | struct loader_dispatch_hash_list { |
| 134 | size_t capacity; |
| 135 | uint32_t count; |
| 136 | uint32_t *index; // index into the dev_ext dispatch table |
| 137 | }; |
| 138 | |
| 139 | #define MAX_NUM_DEV_EXTS 250 |
| 140 | // loader_dispatch_hash_entry and loader_dev_ext_dispatch_table.DevExt have one to one |
| 141 | // correspondence; one loader_dispatch_hash_entry for one DevExt dispatch entry. |
| 142 | // Also have a one to one correspondence with functions in dev_ext_trampoline.c |
| 143 | struct loader_dispatch_hash_entry { |
| 144 | char *func_name; |
| 145 | struct loader_dispatch_hash_list list; // to handle hashing collisions |
| 146 | }; |
| 147 | |
| 148 | typedef void (VKAPI_PTR *PFN_vkDevExt)(VkDevice device); |
| 149 | struct loader_dev_ext_dispatch_table { |
| 150 | PFN_vkDevExt DevExt[MAX_NUM_DEV_EXTS]; |
| 151 | }; |
| 152 | |
| 153 | struct loader_dev_dispatch_table { |
| 154 | VkLayerDispatchTable core_dispatch; |
| 155 | struct loader_dev_ext_dispatch_table ext_dispatch; |
| 156 | }; |
| 157 | |
Jon Ashburn | dc6fcad | 2015-06-10 10:06:06 -0600 | [diff] [blame] | 158 | /* per CreateDevice structure */ |
| 159 | struct loader_device { |
Jon Ashburn | fc1031e | 2015-11-17 15:31:02 -0700 | [diff] [blame] | 160 | struct loader_dev_dispatch_table loader_dispatch; |
Jon Ashburn | dc6fcad | 2015-06-10 10:06:06 -0600 | [diff] [blame] | 161 | VkDevice device; // device object from the icd |
| 162 | |
| 163 | uint32_t app_extension_count; |
| 164 | VkExtensionProperties *app_extension_props; |
| 165 | |
Courtney Goeltzenleuchter | 110fdf9 | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 166 | struct loader_layer_list activated_layer_list; |
Jon Ashburn | dc6fcad | 2015-06-10 10:06:06 -0600 | [diff] [blame] | 167 | |
| 168 | struct loader_device *next; |
| 169 | }; |
| 170 | |
Jon Ashburn | 953bb3c | 2015-06-10 16:11:42 -0600 | [diff] [blame] | 171 | /* per ICD structure */ |
Jon Ashburn | 95a77ba | 2015-05-15 15:09:35 -0600 | [diff] [blame] | 172 | struct loader_icd { |
Jon Ashburn | 3d00233 | 2015-08-20 16:35:30 -0600 | [diff] [blame] | 173 | // pointers to find other structs |
| 174 | const struct loader_scanned_icds *this_icd_lib; |
| 175 | const struct loader_instance *this_instance; |
Jon Ashburn | 95a77ba | 2015-05-15 15:09:35 -0600 | [diff] [blame] | 176 | |
Jon Ashburn | dc6fcad | 2015-06-10 10:06:06 -0600 | [diff] [blame] | 177 | struct loader_device *logical_device_list; |
Jon Ashburn | 95a77ba | 2015-05-15 15:09:35 -0600 | [diff] [blame] | 178 | VkInstance instance; // instance object from the icd |
Jon Ashburn | 8d1b0b5 | 2015-05-18 13:20:15 -0600 | [diff] [blame] | 179 | PFN_vkGetDeviceProcAddr GetDeviceProcAddr; |
Jon Ashburn | 95a77ba | 2015-05-15 15:09:35 -0600 | [diff] [blame] | 180 | PFN_vkDestroyInstance DestroyInstance; |
| 181 | PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices; |
Chris Forbes | bc0bb77 | 2015-06-21 22:55:02 +1200 | [diff] [blame] | 182 | PFN_vkGetPhysicalDeviceFeatures GetPhysicalDeviceFeatures; |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 183 | PFN_vkGetPhysicalDeviceFormatProperties GetPhysicalDeviceFormatProperties; |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 184 | PFN_vkGetPhysicalDeviceImageFormatProperties GetPhysicalDeviceImageFormatProperties; |
Jon Ashburn | 95a77ba | 2015-05-15 15:09:35 -0600 | [diff] [blame] | 185 | PFN_vkCreateDevice CreateDevice; |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 186 | PFN_vkGetPhysicalDeviceProperties GetPhysicalDeviceProperties; |
Cody Northrop | d080288 | 2015-08-03 17:04:53 -0600 | [diff] [blame] | 187 | PFN_vkGetPhysicalDeviceQueueFamilyProperties GetPhysicalDeviceQueueFamilyProperties; |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 188 | PFN_vkGetPhysicalDeviceMemoryProperties GetPhysicalDeviceMemoryProperties; |
Courtney Goeltzenleuchter | 35985f6 | 2015-09-14 17:22:16 -0600 | [diff] [blame] | 189 | PFN_vkEnumerateDeviceExtensionProperties EnumerateDeviceExtensionProperties; |
Mark Lobodzinski | 16e8bef | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 190 | PFN_vkGetPhysicalDeviceSparseImageFormatProperties GetPhysicalDeviceSparseImageFormatProperties; |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 191 | PFN_vkDbgCreateMsgCallback DbgCreateMsgCallback; |
| 192 | PFN_vkDbgDestroyMsgCallback DbgDestroyMsgCallback; |
Ian Elliott | 7e40db9 | 2015-08-21 15:09:33 -0600 | [diff] [blame] | 193 | PFN_vkGetPhysicalDeviceSurfaceSupportKHR GetPhysicalDeviceSurfaceSupportKHR; |
Ian Elliott | 486c550 | 2015-11-19 16:05:09 -0700 | [diff] [blame] | 194 | PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR GetPhysicalDeviceSurfaceCapabilitiesKHR; |
| 195 | PFN_vkGetPhysicalDeviceSurfaceFormatsKHR GetPhysicalDeviceSurfaceFormatsKHR; |
| 196 | PFN_vkGetPhysicalDeviceSurfacePresentModesKHR GetPhysicalDeviceSurfacePresentModesKHR; |
Ian Elliott | 919fa30 | 2015-11-24 15:39:10 -0700 | [diff] [blame] | 197 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 198 | PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR GetPhysicalDeviceWin32PresentationSupportKHR; |
| 199 | #endif |
| 200 | #ifdef VK_USE_PLATFORM_MIR_KHR |
| 201 | PFN_vkGetPhysicalDeviceMirPresentationSupportKHR GetPhysicalDeviceMirPresentvationSupportKHR; |
| 202 | #endif |
| 203 | #ifdef VK_USE_PLATFORM_WAYLAND_KHR |
| 204 | PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR GetPhysicalDeviceWaylandPresentationSupportKHR; |
| 205 | #endif |
| 206 | #ifdef VK_USE_PLATFORM_XCB_KHR |
| 207 | PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR GetPhysicalDeviceXcbPresentationSupportKHR; |
Mark Lobodzinski | faa9081 | 2015-11-25 13:26:15 -0700 | [diff] [blame] | 208 | PFN_vkCreateXcbSurfaceKHR vkCreateXcbSurfaceKHR; |
Ian Elliott | 919fa30 | 2015-11-24 15:39:10 -0700 | [diff] [blame] | 209 | #endif |
| 210 | #ifdef VK_USE_PLATFORM_XLIB_KHR |
| 211 | PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR GetPhysicalDeviceXlibPresentationSupportKHR; |
| 212 | #endif |
Courtney Goeltzenleuchter | 110fdf9 | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 213 | |
Jon Ashburn | dc6fcad | 2015-06-10 10:06:06 -0600 | [diff] [blame] | 214 | struct loader_icd *next; |
Jon Ashburn | 95a77ba | 2015-05-15 15:09:35 -0600 | [diff] [blame] | 215 | }; |
| 216 | |
Jon Ashburn | 8810c5f | 2015-08-18 18:04:47 -0600 | [diff] [blame] | 217 | /* per ICD library structure */ |
| 218 | struct loader_icd_libs { |
| 219 | size_t capacity; |
| 220 | uint32_t count; |
| 221 | struct loader_scanned_icds *list; |
| 222 | }; |
| 223 | |
Jon Ashburn | 953bb3c | 2015-06-10 16:11:42 -0600 | [diff] [blame] | 224 | /* per instance structure */ |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 225 | struct loader_instance { |
Jon Ashburn | 95a77ba | 2015-05-15 15:09:35 -0600 | [diff] [blame] | 226 | VkLayerInstanceDispatchTable *disp; // must be first entry in structure |
| 227 | |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 228 | uint32_t total_gpu_count; |
Jon Ashburn | 24cd4be | 2015-11-01 14:04:06 -0700 | [diff] [blame] | 229 | struct loader_physical_device *phys_devs; |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 230 | uint32_t total_icd_count; |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 231 | struct loader_icd *icds; |
| 232 | struct loader_instance *next; |
Jon Ashburn | 5c6a46f | 2015-08-14 14:49:22 -0600 | [diff] [blame] | 233 | struct loader_extension_list ext_list; // icds and loaders extensions |
Jon Ashburn | 8810c5f | 2015-08-18 18:04:47 -0600 | [diff] [blame] | 234 | struct loader_icd_libs icd_libs; |
Jon Ashburn | 3d00233 | 2015-08-20 16:35:30 -0600 | [diff] [blame] | 235 | struct loader_layer_list instance_layer_list; |
| 236 | struct loader_layer_list device_layer_list; |
Jon Ashburn | fc1031e | 2015-11-17 15:31:02 -0700 | [diff] [blame] | 237 | struct loader_dispatch_hash_entry disp_hash[MAX_NUM_DEV_EXTS]; |
Jon Ashburn | 3d00233 | 2015-08-20 16:35:30 -0600 | [diff] [blame] | 238 | |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 239 | struct loader_msg_callback_map_entry *icd_msg_callback_map; |
| 240 | |
Courtney Goeltzenleuchter | 110fdf9 | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 241 | struct loader_layer_list activated_layer_list; |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 242 | |
| 243 | bool debug_report_enabled; |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 244 | VkLayerDbgFunctionNode *DbgFunctionHead; |
Courtney Goeltzenleuchter | 7f5aafc | 2015-07-05 11:28:29 -0600 | [diff] [blame] | 245 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 246 | VkAllocationCallbacks alloc_callbacks; |
Ian Elliott | d3ef02f | 2015-07-06 14:36:13 -0600 | [diff] [blame] | 247 | |
Ian Elliott | 954fa34 | 2015-10-30 15:28:23 -0600 | [diff] [blame] | 248 | bool wsi_surface_enabled; |
| 249 | #ifdef _WIN32 |
| 250 | bool wsi_win32_surface_enabled; |
| 251 | #else // _WIN32 |
| 252 | bool wsi_mir_surface_enabled; |
| 253 | bool wsi_wayland_surface_enabled; |
| 254 | bool wsi_xcb_surface_enabled; |
| 255 | bool wsi_xlib_surface_enabled; |
| 256 | #endif // _WIN32 |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 257 | }; |
| 258 | |
Jon Ashburn | 24cd4be | 2015-11-01 14:04:06 -0700 | [diff] [blame] | 259 | /* per enumerated PhysicalDevice structure */ |
| 260 | struct loader_physical_device { |
| 261 | VkLayerInstanceDispatchTable *disp; // must be first entry in structure |
| 262 | struct loader_instance *this_instance; |
| 263 | struct loader_icd *this_icd; |
| 264 | VkPhysicalDevice phys_dev; // object from ICD |
| 265 | /* |
| 266 | * Fill in the cache of available device extensions from |
Jon Ashburn | 00eb6c0 | 2015-11-02 17:40:01 -0700 | [diff] [blame] | 267 | * this physical device. This cache can be used during CreateDevice |
Jon Ashburn | 24cd4be | 2015-11-01 14:04:06 -0700 | [diff] [blame] | 268 | */ |
| 269 | struct loader_extension_list device_extension_cache; |
| 270 | }; |
| 271 | |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 272 | struct loader_struct { |
| 273 | struct loader_instance *instances; |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 274 | |
| 275 | unsigned int loaded_layer_lib_count; |
Courtney Goeltzenleuchter | dad30df | 2015-10-07 09:00:34 -0600 | [diff] [blame] | 276 | size_t loaded_layer_lib_capacity; |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 277 | struct loader_lib_info *loaded_layer_lib_list; |
Jon Ashburn | 8810c5f | 2015-08-18 18:04:47 -0600 | [diff] [blame] | 278 | // TODO add ref counting of ICD libraries |
Jon Ashburn | 2d0c4bb | 2015-07-06 15:40:35 -0600 | [diff] [blame] | 279 | // TODO use this struct loader_layer_library_list scanned_layer_libraries; |
Jon Ashburn | 8810c5f | 2015-08-18 18:04:47 -0600 | [diff] [blame] | 280 | // TODO add list of icd libraries for ref counting them for closure |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 281 | }; |
| 282 | |
| 283 | struct loader_scanned_icds { |
| 284 | char *lib_name; |
| 285 | loader_platform_dl_handle handle; |
Jon Ashburn | 005617f | 2015-11-17 17:35:40 -0700 | [diff] [blame] | 286 | uint32_t api_version; |
Jon Ashburn | c624c88 | 2015-07-16 10:17:29 -0600 | [diff] [blame] | 287 | PFN_vkGetInstanceProcAddr GetInstanceProcAddr; |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 288 | PFN_vkCreateInstance CreateInstance; |
Courtney Goeltzenleuchter | 35985f6 | 2015-09-14 17:22:16 -0600 | [diff] [blame] | 289 | PFN_vkEnumerateInstanceExtensionProperties EnumerateInstanceExtensionProperties; |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 290 | }; |
| 291 | |
Jon Ashburn | 5ef2060 | 2015-07-02 09:40:15 -0600 | [diff] [blame] | 292 | static inline struct loader_instance *loader_instance(VkInstance instance) { |
| 293 | return (struct loader_instance *) instance; |
| 294 | } |
| 295 | |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 296 | static inline void loader_set_dispatch(void* obj, const void *data) |
Chia-I Wu | 5291c76 | 2015-04-11 15:34:07 +0800 | [diff] [blame] | 297 | { |
| 298 | *((const void **) obj) = data; |
| 299 | } |
| 300 | |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 301 | static inline VkLayerDispatchTable *loader_get_dispatch(const void* obj) |
Chia-I Wu | 5291c76 | 2015-04-11 15:34:07 +0800 | [diff] [blame] | 302 | { |
Jon Ashburn | 1ed042c | 2015-05-01 18:00:33 -0600 | [diff] [blame] | 303 | return *((VkLayerDispatchTable **) obj); |
Chia-I Wu | 5291c76 | 2015-04-11 15:34:07 +0800 | [diff] [blame] | 304 | } |
| 305 | |
Jon Ashburn | fc1031e | 2015-11-17 15:31:02 -0700 | [diff] [blame] | 306 | static inline struct loader_dev_dispatch_table *loader_get_dev_dispatch(const void* obj) |
| 307 | { |
| 308 | return *((struct loader_dev_dispatch_table **) obj); |
| 309 | } |
| 310 | |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 311 | static inline VkLayerInstanceDispatchTable *loader_get_instance_dispatch(const void* obj) |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 312 | { |
| 313 | return *((VkLayerInstanceDispatchTable **) obj); |
| 314 | } |
| 315 | |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 316 | static inline void loader_init_dispatch(void* obj, const void *data) |
Chia-I Wu | 5291c76 | 2015-04-11 15:34:07 +0800 | [diff] [blame] | 317 | { |
Jon Ashburn | 4006664 | 2015-04-15 13:34:33 -0600 | [diff] [blame] | 318 | #ifdef DEBUG |
Chia-I Wu | 5291c76 | 2015-04-11 15:34:07 +0800 | [diff] [blame] | 319 | assert(valid_loader_magic_value(obj) && |
| 320 | "Incompatible ICD, first dword must be initialized to ICD_LOADER_MAGIC. See loader/README.md for details."); |
Jon Ashburn | 4006664 | 2015-04-15 13:34:33 -0600 | [diff] [blame] | 321 | #endif |
Chia-I Wu | 5291c76 | 2015-04-11 15:34:07 +0800 | [diff] [blame] | 322 | |
Jon Ashburn | 1ed042c | 2015-05-01 18:00:33 -0600 | [diff] [blame] | 323 | loader_set_dispatch(obj, data); |
Chia-I Wu | 5291c76 | 2015-04-11 15:34:07 +0800 | [diff] [blame] | 324 | } |
| 325 | |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 326 | /* global variables used across files */ |
| 327 | extern struct loader_struct loader; |
Jon Ashburn | 87d6aa9 | 2015-08-28 15:19:27 -0600 | [diff] [blame] | 328 | extern THREAD_LOCAL_DECL struct loader_instance *tls_instance; |
Jon Ashburn | 8810c5f | 2015-08-18 18:04:47 -0600 | [diff] [blame] | 329 | extern LOADER_PLATFORM_THREAD_ONCE_DEFINITION(once_init); |
Jon Ashburn | 6301a0f | 2015-05-29 13:15:39 -0600 | [diff] [blame] | 330 | extern loader_platform_thread_mutex loader_lock; |
Jon Ashburn | 6461ef2 | 2015-09-22 13:11:00 -0600 | [diff] [blame] | 331 | extern loader_platform_thread_mutex loader_json_lock; |
Jon Ashburn | 6301a0f | 2015-05-29 13:15:39 -0600 | [diff] [blame] | 332 | extern const VkLayerInstanceDispatchTable instance_disp; |
Jon Ashburn | bacb0f5 | 2015-04-06 10:58:22 -0600 | [diff] [blame] | 333 | |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 334 | struct loader_msg_callback_map_entry { |
| 335 | VkDbgMsgCallback icd_obj; |
| 336 | VkDbgMsgCallback loader_obj; |
| 337 | }; |
| 338 | |
| 339 | bool compare_vk_extension_properties( |
| 340 | const VkExtensionProperties* op1, |
| 341 | const VkExtensionProperties* op2); |
| 342 | |
Jon Ashburn | 3d00233 | 2015-08-20 16:35:30 -0600 | [diff] [blame] | 343 | VkResult loader_validate_layers( |
| 344 | const uint32_t layer_count, |
| 345 | const char * const *ppEnabledLayerNames, |
| 346 | const struct loader_layer_list *list); |
Courtney Goeltzenleuchter | 3b8c5ff | 2015-07-06 17:45:08 -0600 | [diff] [blame] | 347 | |
| 348 | VkResult loader_validate_instance_extensions( |
Jon Ashburn | 9a4c6aa | 2015-08-14 11:57:54 -0600 | [diff] [blame] | 349 | const struct loader_extension_list *icd_exts, |
Jon Ashburn | b82c185 | 2015-08-11 14:49:54 -0600 | [diff] [blame] | 350 | const struct loader_layer_list *instance_layer, |
Courtney Goeltzenleuchter | 3b8c5ff | 2015-07-06 17:45:08 -0600 | [diff] [blame] | 351 | const VkInstanceCreateInfo* pCreateInfo); |
| 352 | |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 353 | /* instance layer chain termination entrypoint definitions */ |
Chia-I Wu | 9ab6150 | 2015-11-06 06:42:02 +0800 | [diff] [blame] | 354 | VKAPI_ATTR VkResult VKAPI_CALL loader_CreateInstance( |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 355 | const VkInstanceCreateInfo* pCreateInfo, |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 356 | const VkAllocationCallbacks* pAllocator, |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 357 | VkInstance* pInstance); |
Chia-I Wu | 5291c76 | 2015-04-11 15:34:07 +0800 | [diff] [blame] | 358 | |
Chia-I Wu | 9ab6150 | 2015-11-06 06:42:02 +0800 | [diff] [blame] | 359 | VKAPI_ATTR void VKAPI_CALL loader_DestroyInstance( |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 360 | VkInstance instance, |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 361 | const VkAllocationCallbacks* pAllocator); |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 362 | |
Chia-I Wu | 9ab6150 | 2015-11-06 06:42:02 +0800 | [diff] [blame] | 363 | VKAPI_ATTR VkResult VKAPI_CALL loader_EnumeratePhysicalDevices( |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 364 | VkInstance instance, |
| 365 | uint32_t* pPhysicalDeviceCount, |
| 366 | VkPhysicalDevice* pPhysicalDevices); |
Chris Forbes | bc0bb77 | 2015-06-21 22:55:02 +1200 | [diff] [blame] | 367 | |
Chia-I Wu | 9ab6150 | 2015-11-06 06:42:02 +0800 | [diff] [blame] | 368 | VKAPI_ATTR void VKAPI_CALL loader_GetPhysicalDeviceFeatures( |
Chris Forbes | bc0bb77 | 2015-06-21 22:55:02 +1200 | [diff] [blame] | 369 | VkPhysicalDevice physicalDevice, |
| 370 | VkPhysicalDeviceFeatures* pFeatures); |
| 371 | |
Chia-I Wu | 9ab6150 | 2015-11-06 06:42:02 +0800 | [diff] [blame] | 372 | VKAPI_ATTR void VKAPI_CALL loader_GetPhysicalDeviceFormatProperties( |
Chris Forbes | bc0bb77 | 2015-06-21 22:55:02 +1200 | [diff] [blame] | 373 | VkPhysicalDevice physicalDevice, |
| 374 | VkFormat format, |
| 375 | VkFormatProperties* pFormatInfo); |
| 376 | |
Chia-I Wu | 9ab6150 | 2015-11-06 06:42:02 +0800 | [diff] [blame] | 377 | VKAPI_ATTR VkResult VKAPI_CALL loader_GetPhysicalDeviceImageFormatProperties( |
Chia-I Wu | 1724104 | 2015-10-31 00:31:16 +0800 | [diff] [blame] | 378 | VkPhysicalDevice physicalDevice, |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 379 | VkFormat format, |
| 380 | VkImageType type, |
| 381 | VkImageTiling tiling, |
| 382 | VkImageUsageFlags usage, |
Courtney Goeltzenleuchter | a22097a | 2015-09-10 13:44:12 -0600 | [diff] [blame] | 383 | VkImageCreateFlags flags, |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 384 | VkImageFormatProperties* pImageFormatProperties); |
| 385 | |
Chia-I Wu | 9ab6150 | 2015-11-06 06:42:02 +0800 | [diff] [blame] | 386 | VKAPI_ATTR void VKAPI_CALL loader_GetPhysicalDeviceSparseImageFormatProperties( |
Mark Lobodzinski | 16e8bef | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 387 | VkPhysicalDevice physicalDevice, |
| 388 | VkFormat format, |
| 389 | VkImageType type, |
Chia-I Wu | 5c17c96 | 2015-10-31 00:31:16 +0800 | [diff] [blame] | 390 | VkSampleCountFlagBits samples, |
Mark Lobodzinski | 16e8bef | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 391 | VkImageUsageFlags usage, |
| 392 | VkImageTiling tiling, |
| 393 | uint32_t* pNumProperties, |
| 394 | VkSparseImageFormatProperties* pProperties); |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 395 | |
Chia-I Wu | 9ab6150 | 2015-11-06 06:42:02 +0800 | [diff] [blame] | 396 | VKAPI_ATTR void VKAPI_CALL loader_GetPhysicalDeviceProperties ( |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 397 | VkPhysicalDevice physicalDevice, |
| 398 | VkPhysicalDeviceProperties* pProperties); |
| 399 | |
Chia-I Wu | 9ab6150 | 2015-11-06 06:42:02 +0800 | [diff] [blame] | 400 | VKAPI_ATTR VkResult VKAPI_CALL loader_EnumerateDeviceExtensionProperties (VkPhysicalDevice physicalDevice, |
Courtney Goeltzenleuchter | 110fdf9 | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 401 | const char *pLayerName, uint32_t *pCount, |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 402 | VkExtensionProperties* pProperties); |
| 403 | |
Chia-I Wu | 9ab6150 | 2015-11-06 06:42:02 +0800 | [diff] [blame] | 404 | VKAPI_ATTR VkResult VKAPI_CALL loader_EnumerateDeviceLayerProperties (VkPhysicalDevice physicalDevice, |
Courtney Goeltzenleuchter | 110fdf9 | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 405 | uint32_t *pCount, |
| 406 | VkLayerProperties* pProperties); |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 407 | |
Chia-I Wu | 9ab6150 | 2015-11-06 06:42:02 +0800 | [diff] [blame] | 408 | VKAPI_ATTR void VKAPI_CALL loader_GetPhysicalDeviceQueueFamilyProperties ( |
Cody Northrop | d080288 | 2015-08-03 17:04:53 -0600 | [diff] [blame] | 409 | VkPhysicalDevice physicalDevice, |
| 410 | uint32_t* pCount, |
| 411 | VkQueueFamilyProperties* pProperties); |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 412 | |
Chia-I Wu | 9ab6150 | 2015-11-06 06:42:02 +0800 | [diff] [blame] | 413 | VKAPI_ATTR void VKAPI_CALL loader_GetPhysicalDeviceMemoryProperties ( |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 414 | VkPhysicalDevice physicalDevice, |
| 415 | VkPhysicalDeviceMemoryProperties * pProperties); |
Jon Ashburn | 6301a0f | 2015-05-29 13:15:39 -0600 | [diff] [blame] | 416 | |
Chia-I Wu | 9ab6150 | 2015-11-06 06:42:02 +0800 | [diff] [blame] | 417 | VKAPI_ATTR VkResult VKAPI_CALL loader_CreateDevice( |
Jon Ashburn | 95a77ba | 2015-05-15 15:09:35 -0600 | [diff] [blame] | 418 | VkPhysicalDevice gpu, |
| 419 | const VkDeviceCreateInfo* pCreateInfo, |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 420 | const VkAllocationCallbacks* pAllocator, |
Jon Ashburn | 95a77ba | 2015-05-15 15:09:35 -0600 | [diff] [blame] | 421 | VkDevice* pDevice); |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 422 | |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 423 | /* helper function definitions */ |
Jon Ashburn | 8810c5f | 2015-08-18 18:04:47 -0600 | [diff] [blame] | 424 | void loader_initialize(void); |
Jon Ashburn | bd6c488 | 2015-07-02 12:59:25 -0600 | [diff] [blame] | 425 | bool has_vk_extension_property_array( |
| 426 | const VkExtensionProperties *vk_ext_prop, |
| 427 | const uint32_t count, |
| 428 | const VkExtensionProperties *ext_array); |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 429 | bool has_vk_extension_property( |
| 430 | const VkExtensionProperties *vk_ext_prop, |
| 431 | const struct loader_extension_list *ext_list); |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 432 | |
Jon Ashburn | 24cd4be | 2015-11-01 14:04:06 -0700 | [diff] [blame] | 433 | VkResult loader_add_to_ext_list( |
Jon Ashburn | e39a4f8 | 2015-08-28 13:38:21 -0600 | [diff] [blame] | 434 | const struct loader_instance *inst, |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 435 | struct loader_extension_list *ext_list, |
| 436 | uint32_t prop_list_count, |
Jon Ashburn | 5c042ea | 2015-08-04 11:14:18 -0600 | [diff] [blame] | 437 | const VkExtensionProperties *props); |
Jon Ashburn | 6e6a216 | 2015-12-10 08:51:10 -0700 | [diff] [blame] | 438 | void loader_destroy_generic_list( |
Jon Ashburn | e39a4f8 | 2015-08-28 13:38:21 -0600 | [diff] [blame] | 439 | const struct loader_instance *inst, |
Jon Ashburn | 6e6a216 | 2015-12-10 08:51:10 -0700 | [diff] [blame] | 440 | struct loader_generic_list *list); |
Jon Ashburn | e39a4f8 | 2015-08-28 13:38:21 -0600 | [diff] [blame] | 441 | void loader_delete_layer_properties( |
| 442 | const struct loader_instance *inst, |
| 443 | struct loader_layer_list *layer_list); |
Courtney Goeltzenleuchter | 110fdf9 | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 444 | void loader_add_to_layer_list( |
Jon Ashburn | e39a4f8 | 2015-08-28 13:38:21 -0600 | [diff] [blame] | 445 | const struct loader_instance *inst, |
Courtney Goeltzenleuchter | 110fdf9 | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 446 | struct loader_layer_list *list, |
| 447 | uint32_t prop_list_count, |
| 448 | const struct loader_layer_properties *props); |
Jon Ashburn | e39a4f8 | 2015-08-28 13:38:21 -0600 | [diff] [blame] | 449 | void loader_scanned_icd_clear( |
| 450 | const struct loader_instance *inst, |
| 451 | struct loader_icd_libs *icd_libs); |
| 452 | void loader_icd_scan( |
| 453 | const struct loader_instance *inst, |
| 454 | struct loader_icd_libs *icds); |
Jon Ashburn | b82c185 | 2015-08-11 14:49:54 -0600 | [diff] [blame] | 455 | void loader_layer_scan( |
Jon Ashburn | e39a4f8 | 2015-08-28 13:38:21 -0600 | [diff] [blame] | 456 | const struct loader_instance *inst, |
Jon Ashburn | b82c185 | 2015-08-11 14:49:54 -0600 | [diff] [blame] | 457 | struct loader_layer_list *instance_layers, |
| 458 | struct loader_layer_list *device_layers); |
Jon Ashburn | 8810c5f | 2015-08-18 18:04:47 -0600 | [diff] [blame] | 459 | void loader_get_icd_loader_instance_extensions( |
Jon Ashburn | e39a4f8 | 2015-08-28 13:38:21 -0600 | [diff] [blame] | 460 | const struct loader_instance *inst, |
Jon Ashburn | 8810c5f | 2015-08-18 18:04:47 -0600 | [diff] [blame] | 461 | struct loader_icd_libs *icd_libs, |
| 462 | struct loader_extension_list *inst_exts); |
Jon Ashburn | e39a4f8 | 2015-08-28 13:38:21 -0600 | [diff] [blame] | 463 | struct loader_icd *loader_get_icd_and_device( |
| 464 | const VkDevice device, |
| 465 | struct loader_device **found_dev); |
Jon Ashburn | fc1031e | 2015-11-17 15:31:02 -0700 | [diff] [blame] | 466 | void *loader_dev_ext_gpa( |
| 467 | struct loader_instance *inst, |
| 468 | const char *funcName); |
| 469 | void *loader_get_dev_ext_trampoline( |
| 470 | uint32_t index); |
Jon Ashburn | e0e6457 | 2015-09-30 12:56:42 -0600 | [diff] [blame] | 471 | struct loader_instance *loader_get_instance( |
| 472 | const VkInstance instance); |
Jon Ashburn | e39a4f8 | 2015-08-28 13:38:21 -0600 | [diff] [blame] | 473 | void loader_remove_logical_device( |
| 474 | const struct loader_instance *inst, |
Jon Ashburn | 781a7ae | 2015-11-19 15:43:26 -0700 | [diff] [blame] | 475 | struct loader_icd *icd, |
| 476 | struct loader_device *found_dev); |
Jon Ashburn | b82c185 | 2015-08-11 14:49:54 -0600 | [diff] [blame] | 477 | VkResult loader_enable_instance_layers( |
| 478 | struct loader_instance *inst, |
| 479 | const VkInstanceCreateInfo *pCreateInfo, |
| 480 | const struct loader_layer_list *instance_layers); |
Jon Ashburn | dc6fcad | 2015-06-10 10:06:06 -0600 | [diff] [blame] | 481 | void loader_deactivate_instance_layers(struct loader_instance *instance); |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 482 | uint32_t loader_activate_instance_layers(struct loader_instance *inst); |
Courtney Goeltzenleuchter | d971b61 | 2015-06-17 20:51:59 -0600 | [diff] [blame] | 483 | void loader_activate_instance_layer_extensions(struct loader_instance *inst); |
Courtney Goeltzenleuchter | 7f5aafc | 2015-07-05 11:28:29 -0600 | [diff] [blame] | 484 | |
| 485 | void* loader_heap_alloc( |
Jon Ashburn | e39a4f8 | 2015-08-28 13:38:21 -0600 | [diff] [blame] | 486 | const struct loader_instance *instance, |
Jon Ashburn | b82c185 | 2015-08-11 14:49:54 -0600 | [diff] [blame] | 487 | size_t size, |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 488 | VkSystemAllocationScope allocationScope); |
Courtney Goeltzenleuchter | 7f5aafc | 2015-07-05 11:28:29 -0600 | [diff] [blame] | 489 | |
Courtney Goeltzenleuchter | 7f5aafc | 2015-07-05 11:28:29 -0600 | [diff] [blame] | 490 | void loader_heap_free( |
Jon Ashburn | e39a4f8 | 2015-08-28 13:38:21 -0600 | [diff] [blame] | 491 | const struct loader_instance *instance, |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 492 | void *pMemory); |
Jon Ashburn | 87d6aa9 | 2015-08-28 15:19:27 -0600 | [diff] [blame] | 493 | |
| 494 | void *loader_tls_heap_alloc(size_t size); |
| 495 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 496 | void loader_tls_heap_free(void *pMemory); |
Chia-I Wu | 1930060 | 2014-08-04 08:03:57 +0800 | [diff] [blame] | 497 | #endif /* LOADER_H */ |