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 | * |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 3 | * Copyright (c) 2014-2016 The Khronos Group Inc. |
| 4 | * Copyright (c) 2014-2016 Valve Corporation |
| 5 | * Copyright (c) 2014-2016 LunarG, Inc. |
Courtney Goeltzenleuchter | f821dad | 2015-12-02 14:53:22 -0700 | [diff] [blame] | 6 | * Copyright (C) 2015 Google Inc. |
Chia-I Wu | 1930060 | 2014-08-04 08:03:57 +0800 | [diff] [blame] | 7 | * |
Jon Ashburn | 3ebf125 | 2016-04-19 11:30:31 -0600 | [diff] [blame] | 8 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 9 | * you may not use this file except in compliance with the License. |
| 10 | * You may obtain a copy of the License at |
Chia-I Wu | 1930060 | 2014-08-04 08:03:57 +0800 | [diff] [blame] | 11 | * |
Jon Ashburn | 3ebf125 | 2016-04-19 11:30:31 -0600 | [diff] [blame] | 12 | * http://www.apache.org/licenses/LICENSE-2.0 |
Chia-I Wu | 1930060 | 2014-08-04 08:03:57 +0800 | [diff] [blame] | 13 | * |
Jon Ashburn | 3ebf125 | 2016-04-19 11:30:31 -0600 | [diff] [blame] | 14 | * Unless required by applicable law or agreed to in writing, software |
| 15 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 17 | * See the License for the specific language governing permissions and |
| 18 | * limitations under the License. |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 19 | * |
| 20 | * Author: Jon Ashburn <jon@lunarg.com> |
| 21 | * Author: Courtney Goeltzenleuchter <courtney@LunarG.com> |
Courtney Goeltzenleuchter | 0555952 | 2015-10-30 11:14:30 -0600 | [diff] [blame] | 22 | * Author: Chia-I Wu <olvaffe@gmail.com> |
| 23 | * Author: Chia-I Wu <olv@lunarg.com> |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 24 | * Author: Mark Lobodzinski <mark@LunarG.com> |
Courtney Goeltzenleuchter | 0555952 | 2015-10-30 11:14:30 -0600 | [diff] [blame] | 25 | * |
Chia-I Wu | 1930060 | 2014-08-04 08:03:57 +0800 | [diff] [blame] | 26 | */ |
| 27 | |
| 28 | #ifndef LOADER_H |
| 29 | #define LOADER_H |
| 30 | |
David Pinedo | 9316d3b | 2015-11-06 12:54:48 -0700 | [diff] [blame] | 31 | #include <vulkan/vulkan.h> |
Aaron Karp | 848bad4 | 2016-03-13 16:41:59 -0400 | [diff] [blame] | 32 | #include "vk_loader_platform.h" |
Mark Lobodzinski | b87f902 | 2016-05-24 16:04:56 -0600 | [diff] [blame] | 33 | #include "vk_loader_layer.h" |
David Pinedo | 9316d3b | 2015-11-06 12:54:48 -0700 | [diff] [blame] | 34 | #include <vulkan/vk_layer.h> |
Mark Lobodzinski | b87f902 | 2016-05-24 16:04:56 -0600 | [diff] [blame] | 35 | |
David Pinedo | 9316d3b | 2015-11-06 12:54:48 -0700 | [diff] [blame] | 36 | #include <vulkan/vk_icd.h> |
Chia-I Wu | 5291c76 | 2015-04-11 15:34:07 +0800 | [diff] [blame] | 37 | #include <assert.h> |
| 38 | |
Chia-I Wu | 1930060 | 2014-08-04 08:03:57 +0800 | [diff] [blame] | 39 | #if defined(__GNUC__) && __GNUC__ >= 4 |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 40 | #define LOADER_EXPORT __attribute__((visibility("default"))) |
Chia-I Wu | 1930060 | 2014-08-04 08:03:57 +0800 | [diff] [blame] | 41 | #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 42 | #define LOADER_EXPORT __attribute__((visibility("default"))) |
Chia-I Wu | 1930060 | 2014-08-04 08:03:57 +0800 | [diff] [blame] | 43 | #else |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 44 | #define LOADER_EXPORT |
Chia-I Wu | 1930060 | 2014-08-04 08:03:57 +0800 | [diff] [blame] | 45 | #endif |
| 46 | |
Mark Young | 0ad8313 | 2016-06-30 13:02:42 -0600 | [diff] [blame] | 47 | // A debug option to disable allocators at compile time to investigate future issues. |
| 48 | #define DEBUG_DISABLE_APP_ALLOCATORS 0 |
| 49 | |
Jon Ashburn | f73e921 | 2015-08-04 10:22:33 -0600 | [diff] [blame] | 50 | #define MAX_STRING_SIZE 1024 |
Courtney Goeltzenleuchter | 110fdf9 | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 51 | #define VK_MAJOR(version) (version >> 22) |
| 52 | #define VK_MINOR(version) ((version >> 12) & 0x3ff) |
| 53 | #define VK_PATCH(version) (version & 0xfff) |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 54 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 55 | // This is defined in vk_layer.h, but if there's problems we need to create the define |
| 56 | // here. |
| 57 | #ifndef MAX_NUM_UNKNOWN_EXTS |
| 58 | #define MAX_NUM_UNKNOWN_EXTS 250 |
| 59 | #endif |
| 60 | |
Jon Ashburn | 5ef2060 | 2015-07-02 09:40:15 -0600 | [diff] [blame] | 61 | enum layer_type { |
Jon Ashburn | 491cd04 | 2016-05-16 14:01:18 -0600 | [diff] [blame] | 62 | VK_LAYER_TYPE_INSTANCE_EXPLICIT = 0x1, |
| 63 | VK_LAYER_TYPE_INSTANCE_IMPLICIT = 0x2, |
| 64 | VK_LAYER_TYPE_META_EXPLICT = 0x4, |
Jon Ashburn | 5ef2060 | 2015-07-02 09:40:15 -0600 | [diff] [blame] | 65 | }; |
| 66 | |
Mark Lobodzinski | e9f09ef | 2016-02-02 18:53:34 -0700 | [diff] [blame] | 67 | typedef enum VkStringErrorFlagBits { |
Jon Ashburn | f2b4e38 | 2016-02-10 20:50:19 -0700 | [diff] [blame] | 68 | VK_STRING_ERROR_NONE = 0x00000000, |
| 69 | VK_STRING_ERROR_LENGTH = 0x00000001, |
| 70 | VK_STRING_ERROR_BAD_DATA = 0x00000002, |
Mark Lobodzinski | e9f09ef | 2016-02-02 18:53:34 -0700 | [diff] [blame] | 71 | } VkStringErrorFlagBits; |
| 72 | typedef VkFlags VkStringErrorFlags; |
| 73 | |
Jon Ashburn | f2b4e38 | 2016-02-10 20:50:19 -0700 | [diff] [blame] | 74 | static const int MaxLoaderStringLength = 256; |
| 75 | static const char UTF8_ONE_BYTE_CODE = 0xC0; |
| 76 | static const char UTF8_ONE_BYTE_MASK = 0xE0; |
| 77 | static const char UTF8_TWO_BYTE_CODE = 0xE0; |
| 78 | static const char UTF8_TWO_BYTE_MASK = 0xF0; |
| 79 | static const char UTF8_THREE_BYTE_CODE = 0xF0; |
| 80 | static const char UTF8_THREE_BYTE_MASK = 0xF8; |
| 81 | static const char UTF8_DATA_BYTE_CODE = 0x80; |
| 82 | static const char UTF8_DATA_BYTE_MASK = 0xC0; |
Mark Lobodzinski | e9f09ef | 2016-02-02 18:53:34 -0700 | [diff] [blame] | 83 | |
Mark Lobodzinski | ed566c3 | 2016-06-29 14:18:30 -0600 | [diff] [blame] | 84 | static const char std_validation_names[7][VK_MAX_EXTENSION_NAME_SIZE] = { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 85 | "VK_LAYER_GOOGLE_threading", "VK_LAYER_LUNARG_parameter_validation", "VK_LAYER_LUNARG_object_tracker", |
| 86 | "VK_LAYER_LUNARG_image", "VK_LAYER_LUNARG_core_validation", "VK_LAYER_LUNARG_swapchain", |
| 87 | "VK_LAYER_GOOGLE_unique_objects"}; |
Jon Ashburn | 86a527a | 2016-02-10 20:59:26 -0700 | [diff] [blame] | 88 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 89 | struct VkStructureHeader { |
| 90 | VkStructureType sType; |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 91 | const void *pNext; |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 92 | }; |
| 93 | |
Jon Ashburn | 6e6a216 | 2015-12-10 08:51:10 -0700 | [diff] [blame] | 94 | // form of all dynamic lists/arrays |
| 95 | // only the list element should be changed |
| 96 | struct loader_generic_list { |
| 97 | size_t capacity; |
| 98 | uint32_t count; |
| 99 | void *list; |
| 100 | }; |
| 101 | |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 102 | struct loader_extension_list { |
| 103 | size_t capacity; |
| 104 | uint32_t count; |
Jon Ashburn | 5c042ea | 2015-08-04 11:14:18 -0600 | [diff] [blame] | 105 | VkExtensionProperties *list; |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 106 | }; |
| 107 | |
Jon Ashburn | 39fbd4e | 2015-12-10 18:17:34 -0700 | [diff] [blame] | 108 | struct loader_dev_ext_props { |
| 109 | VkExtensionProperties props; |
| 110 | uint32_t entrypoint_count; |
| 111 | char **entrypoints; |
| 112 | }; |
| 113 | |
| 114 | struct loader_device_extension_list { |
| 115 | size_t capacity; |
| 116 | uint32_t count; |
| 117 | struct loader_dev_ext_props *list; |
| 118 | }; |
| 119 | |
Jon Ashburn | 5ef2060 | 2015-07-02 09:40:15 -0600 | [diff] [blame] | 120 | struct loader_name_value { |
Jon Ashburn | f73e921 | 2015-08-04 10:22:33 -0600 | [diff] [blame] | 121 | char name[MAX_STRING_SIZE]; |
| 122 | char value[MAX_STRING_SIZE]; |
Jon Ashburn | 5ef2060 | 2015-07-02 09:40:15 -0600 | [diff] [blame] | 123 | }; |
| 124 | |
Jon Ashburn | 5ef2060 | 2015-07-02 09:40:15 -0600 | [diff] [blame] | 125 | struct loader_layer_functions { |
Jon Ashburn | f73e921 | 2015-08-04 10:22:33 -0600 | [diff] [blame] | 126 | char str_gipa[MAX_STRING_SIZE]; |
| 127 | char str_gdpa[MAX_STRING_SIZE]; |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 128 | char str_negotiate_interface[MAX_STRING_SIZE]; |
| 129 | PFN_vkNegotiateLoaderLayerInterfaceVersion negotiate_layer_interface; |
Jon Ashburn | 5ef2060 | 2015-07-02 09:40:15 -0600 | [diff] [blame] | 130 | PFN_vkGetInstanceProcAddr get_instance_proc_addr; |
| 131 | PFN_vkGetDeviceProcAddr get_device_proc_addr; |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 132 | PFN_GetPhysicalDeviceProcAddr get_physical_device_proc_addr; |
Jon Ashburn | 5ef2060 | 2015-07-02 09:40:15 -0600 | [diff] [blame] | 133 | }; |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 134 | |
Jon Ashburn | 5ef2060 | 2015-07-02 09:40:15 -0600 | [diff] [blame] | 135 | struct loader_layer_properties { |
Courtney Goeltzenleuchter | 110fdf9 | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 136 | VkLayerProperties info; |
Jon Ashburn | 5ef2060 | 2015-07-02 09:40:15 -0600 | [diff] [blame] | 137 | enum layer_type type; |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 138 | uint32_t interface_version; // PFN_vkNegotiateLoaderLayerInterfaceVersion |
Jon Ashburn | 3d00233 | 2015-08-20 16:35:30 -0600 | [diff] [blame] | 139 | char lib_name[MAX_STRING_SIZE]; |
Jon Ashburn | 4dc1d8a | 2016-04-20 13:21:17 -0600 | [diff] [blame] | 140 | loader_platform_dl_handle lib_handle; |
Jon Ashburn | 5ef2060 | 2015-07-02 09:40:15 -0600 | [diff] [blame] | 141 | struct loader_layer_functions functions; |
| 142 | struct loader_extension_list instance_extension_list; |
Jon Ashburn | 39fbd4e | 2015-12-10 18:17:34 -0700 | [diff] [blame] | 143 | struct loader_device_extension_list device_extension_list; |
Jon Ashburn | 5ef2060 | 2015-07-02 09:40:15 -0600 | [diff] [blame] | 144 | struct loader_name_value disable_env_var; |
| 145 | struct loader_name_value enable_env_var; |
| 146 | }; |
| 147 | |
| 148 | struct loader_layer_list { |
| 149 | size_t capacity; |
| 150 | uint32_t count; |
| 151 | struct loader_layer_properties *list; |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 152 | }; |
| 153 | |
Jon Ashburn | fc1031e | 2015-11-17 15:31:02 -0700 | [diff] [blame] | 154 | struct loader_dispatch_hash_list { |
| 155 | size_t capacity; |
| 156 | uint32_t count; |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 157 | uint32_t *index; // index into the dev_ext dispatch table |
Jon Ashburn | fc1031e | 2015-11-17 15:31:02 -0700 | [diff] [blame] | 158 | }; |
| 159 | |
Mark Young | 8191d9f | 2016-09-02 11:41:28 -0600 | [diff] [blame] | 160 | // loader_dispatch_hash_entry and loader_dev_ext_dispatch_table.dev_ext have |
| 161 | // one to one correspondence; one loader_dispatch_hash_entry for one dev_ext |
| 162 | // dispatch entry. |
Jon Ashburn | fc1031e | 2015-11-17 15:31:02 -0700 | [diff] [blame] | 163 | // Also have a one to one correspondence with functions in dev_ext_trampoline.c |
| 164 | struct loader_dispatch_hash_entry { |
| 165 | char *func_name; |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 166 | struct loader_dispatch_hash_list list; // to handle hashing collisions |
Jon Ashburn | fc1031e | 2015-11-17 15:31:02 -0700 | [diff] [blame] | 167 | }; |
| 168 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 169 | typedef void(VKAPI_PTR *PFN_vkDevExt)(VkDevice device); |
Jon Ashburn | fc1031e | 2015-11-17 15:31:02 -0700 | [diff] [blame] | 170 | struct loader_dev_ext_dispatch_table { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 171 | PFN_vkDevExt dev_ext[MAX_NUM_UNKNOWN_EXTS]; |
Jon Ashburn | fc1031e | 2015-11-17 15:31:02 -0700 | [diff] [blame] | 172 | }; |
| 173 | |
| 174 | struct loader_dev_dispatch_table { |
| 175 | VkLayerDispatchTable core_dispatch; |
| 176 | struct loader_dev_ext_dispatch_table ext_dispatch; |
| 177 | }; |
| 178 | |
Mark Young | 35159af | 2016-09-07 08:50:32 -0600 | [diff] [blame] | 179 | // per CreateDevice structure |
Jon Ashburn | dc6fcad | 2015-06-10 10:06:06 -0600 | [diff] [blame] | 180 | struct loader_device { |
Jon Ashburn | fc1031e | 2015-11-17 15:31:02 -0700 | [diff] [blame] | 181 | struct loader_dev_dispatch_table loader_dispatch; |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 182 | VkDevice chain_device; // device object from the dispatch chain |
| 183 | VkDevice icd_device; // device object from the icd |
Mark Young | 65cb366 | 2016-11-07 13:27:02 -0700 | [diff] [blame] | 184 | struct loader_physical_device_term *phys_dev_term; |
Jon Ashburn | dc6fcad | 2015-06-10 10:06:06 -0600 | [diff] [blame] | 185 | |
Courtney Goeltzenleuchter | 110fdf9 | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 186 | struct loader_layer_list activated_layer_list; |
Jon Ashburn | dc6fcad | 2015-06-10 10:06:06 -0600 | [diff] [blame] | 187 | |
Mark Young | 0ad8313 | 2016-06-30 13:02:42 -0600 | [diff] [blame] | 188 | VkAllocationCallbacks alloc_callbacks; |
| 189 | |
Jon Ashburn | dc6fcad | 2015-06-10 10:06:06 -0600 | [diff] [blame] | 190 | struct loader_device *next; |
| 191 | }; |
| 192 | |
Jon Ashburn | 953bb3c | 2015-06-10 16:11:42 -0600 | [diff] [blame] | 193 | /* per ICD structure */ |
Mark Young | 0153e0b | 2016-11-03 14:27:13 -0600 | [diff] [blame] | 194 | struct loader_icd_term { |
Jon Ashburn | 3d00233 | 2015-08-20 16:35:30 -0600 | [diff] [blame] | 195 | // pointers to find other structs |
Mark Young | 0153e0b | 2016-11-03 14:27:13 -0600 | [diff] [blame] | 196 | const struct loader_scanned_icd *scanned_icd; |
Jon Ashburn | 3d00233 | 2015-08-20 16:35:30 -0600 | [diff] [blame] | 197 | const struct loader_instance *this_instance; |
Jon Ashburn | dc6fcad | 2015-06-10 10:06:06 -0600 | [diff] [blame] | 198 | struct loader_device *logical_device_list; |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 199 | VkInstance instance; // instance object from the icd |
Jon Ashburn | 8d1b0b5 | 2015-05-18 13:20:15 -0600 | [diff] [blame] | 200 | PFN_vkGetDeviceProcAddr GetDeviceProcAddr; |
Jon Ashburn | 95a77ba | 2015-05-15 15:09:35 -0600 | [diff] [blame] | 201 | PFN_vkDestroyInstance DestroyInstance; |
| 202 | PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices; |
Chris Forbes | bc0bb77 | 2015-06-21 22:55:02 +1200 | [diff] [blame] | 203 | PFN_vkGetPhysicalDeviceFeatures GetPhysicalDeviceFeatures; |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 204 | PFN_vkGetPhysicalDeviceFormatProperties GetPhysicalDeviceFormatProperties; |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 205 | PFN_vkGetPhysicalDeviceImageFormatProperties GetPhysicalDeviceImageFormatProperties; |
Jon Ashburn | 95a77ba | 2015-05-15 15:09:35 -0600 | [diff] [blame] | 206 | PFN_vkCreateDevice CreateDevice; |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 207 | PFN_vkGetPhysicalDeviceProperties GetPhysicalDeviceProperties; |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 208 | PFN_vkGetPhysicalDeviceQueueFamilyProperties GetPhysicalDeviceQueueFamilyProperties; |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 209 | PFN_vkGetPhysicalDeviceMemoryProperties GetPhysicalDeviceMemoryProperties; |
Courtney Goeltzenleuchter | 35985f6 | 2015-09-14 17:22:16 -0600 | [diff] [blame] | 210 | PFN_vkEnumerateDeviceExtensionProperties EnumerateDeviceExtensionProperties; |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 211 | PFN_vkGetPhysicalDeviceSparseImageFormatProperties GetPhysicalDeviceSparseImageFormatProperties; |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 212 | // WSI extensions |
Ian Elliott | 7e40db9 | 2015-08-21 15:09:33 -0600 | [diff] [blame] | 213 | PFN_vkGetPhysicalDeviceSurfaceSupportKHR GetPhysicalDeviceSurfaceSupportKHR; |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 214 | PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR GetPhysicalDeviceSurfaceCapabilitiesKHR; |
Ian Elliott | 486c550 | 2015-11-19 16:05:09 -0700 | [diff] [blame] | 215 | PFN_vkGetPhysicalDeviceSurfaceFormatsKHR GetPhysicalDeviceSurfaceFormatsKHR; |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 216 | PFN_vkGetPhysicalDeviceSurfacePresentModesKHR GetPhysicalDeviceSurfacePresentModesKHR; |
Ian Elliott | 919fa30 | 2015-11-24 15:39:10 -0700 | [diff] [blame] | 217 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
Mark Young | 16573c7 | 2016-06-28 10:52:43 -0600 | [diff] [blame] | 218 | PFN_vkCreateWin32SurfaceKHR CreateWin32SurfaceKHR; |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 219 | PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR GetPhysicalDeviceWin32PresentationSupportKHR; |
Ian Elliott | 919fa30 | 2015-11-24 15:39:10 -0700 | [diff] [blame] | 220 | #endif |
| 221 | #ifdef VK_USE_PLATFORM_MIR_KHR |
Mark Young | 16573c7 | 2016-06-28 10:52:43 -0600 | [diff] [blame] | 222 | PFN_vkCreateMirSurfaceKHR CreateMirSurfaceKHR; |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 223 | PFN_vkGetPhysicalDeviceMirPresentationSupportKHR GetPhysicalDeviceMirPresentationSupportKHR; |
Ian Elliott | 919fa30 | 2015-11-24 15:39:10 -0700 | [diff] [blame] | 224 | #endif |
| 225 | #ifdef VK_USE_PLATFORM_WAYLAND_KHR |
Mark Young | 16573c7 | 2016-06-28 10:52:43 -0600 | [diff] [blame] | 226 | PFN_vkCreateWaylandSurfaceKHR CreateWaylandSurfaceKHR; |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 227 | PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR GetPhysicalDeviceWaylandPresentationSupportKHR; |
Ian Elliott | 919fa30 | 2015-11-24 15:39:10 -0700 | [diff] [blame] | 228 | #endif |
| 229 | #ifdef VK_USE_PLATFORM_XCB_KHR |
Mark Young | 16573c7 | 2016-06-28 10:52:43 -0600 | [diff] [blame] | 230 | PFN_vkCreateXcbSurfaceKHR CreateXcbSurfaceKHR; |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 231 | PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR GetPhysicalDeviceXcbPresentationSupportKHR; |
Ian Elliott | 919fa30 | 2015-11-24 15:39:10 -0700 | [diff] [blame] | 232 | #endif |
| 233 | #ifdef VK_USE_PLATFORM_XLIB_KHR |
Mark Young | 16573c7 | 2016-06-28 10:52:43 -0600 | [diff] [blame] | 234 | PFN_vkCreateXlibSurfaceKHR CreateXlibSurfaceKHR; |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 235 | PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR GetPhysicalDeviceXlibPresentationSupportKHR; |
Ian Elliott | 919fa30 | 2015-11-24 15:39:10 -0700 | [diff] [blame] | 236 | #endif |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 237 | PFN_vkGetPhysicalDeviceDisplayPropertiesKHR GetPhysicalDeviceDisplayPropertiesKHR; |
| 238 | PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR GetPhysicalDeviceDisplayPlanePropertiesKHR; |
| 239 | PFN_vkGetDisplayPlaneSupportedDisplaysKHR GetDisplayPlaneSupportedDisplaysKHR; |
Jon Ashburn | cc407a2 | 2016-04-15 09:25:03 -0600 | [diff] [blame] | 240 | PFN_vkGetDisplayModePropertiesKHR GetDisplayModePropertiesKHR; |
| 241 | PFN_vkCreateDisplayModeKHR CreateDisplayModeKHR; |
| 242 | PFN_vkGetDisplayPlaneCapabilitiesKHR GetDisplayPlaneCapabilitiesKHR; |
| 243 | PFN_vkCreateDisplayPlaneSurfaceKHR CreateDisplayPlaneSurfaceKHR; |
| 244 | PFN_vkDestroySurfaceKHR DestroySurfaceKHR; |
Mark Young | 16573c7 | 2016-06-28 10:52:43 -0600 | [diff] [blame] | 245 | PFN_vkCreateSwapchainKHR CreateSwapchainKHR; |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 246 | PFN_vkCreateSharedSwapchainsKHR CreateSharedSwapchainsKHR; |
| 247 | |
| 248 | // KHR_get_physical_device_properties2 |
| 249 | PFN_vkGetPhysicalDeviceFeatures2KHR GetPhysicalDeviceFeatures2KHR; |
| 250 | PFN_vkGetPhysicalDeviceProperties2KHR GetPhysicalDeviceProperties2KHR; |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 251 | PFN_vkGetPhysicalDeviceFormatProperties2KHR GetPhysicalDeviceFormatProperties2KHR; |
| 252 | PFN_vkGetPhysicalDeviceImageFormatProperties2KHR GetPhysicalDeviceImageFormatProperties2KHR; |
| 253 | PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR GetPhysicalDeviceQueueFamilyProperties2KHR; |
| 254 | PFN_vkGetPhysicalDeviceMemoryProperties2KHR GetPhysicalDeviceMemoryProperties2KHR; |
| 255 | PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR GetPhysicalDeviceSparseImageFormatProperties2KHR; |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 256 | |
| 257 | #ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT |
| 258 | // EXT_acquire_xlib_display |
| 259 | PFN_vkAcquireXlibDisplayEXT AcquireXlibDisplayEXT; |
| 260 | PFN_vkGetRandROutputDisplayEXT GetRandROutputDisplayEXT; |
| 261 | #endif |
| 262 | |
| 263 | // EXT_debug_report |
| 264 | PFN_vkCreateDebugReportCallbackEXT CreateDebugReportCallbackEXT; |
| 265 | PFN_vkDestroyDebugReportCallbackEXT DestroyDebugReportCallbackEXT; |
| 266 | PFN_vkDebugReportMessageEXT DebugReportMessageEXT; |
| 267 | |
| 268 | // EXT_debug_marker (items needing a trampoline/terminator) |
| 269 | PFN_vkDebugMarkerSetObjectTagEXT DebugMarkerSetObjectTagEXT; |
| 270 | PFN_vkDebugMarkerSetObjectNameEXT DebugMarkerSetObjectNameEXT; |
| 271 | |
| 272 | // EXT_direct_mode_display |
| 273 | PFN_vkReleaseDisplayEXT ReleaseDisplayEXT; |
| 274 | |
| 275 | // EXT_display_surface_counter |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 276 | PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT GetPhysicalDeviceSurfaceCapabilities2EXT; |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 277 | |
| 278 | // NV_external_memory_capabilities |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 279 | PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV GetPhysicalDeviceExternalImageFormatPropertiesNV; |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 280 | |
| 281 | // NVX_device_generated_commands |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 282 | PFN_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX GetPhysicalDeviceGeneratedCommandsPropertiesNVX; |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 283 | |
Mark Young | 0153e0b | 2016-11-03 14:27:13 -0600 | [diff] [blame] | 284 | struct loader_icd_term *next; |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 285 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 286 | PFN_PhysDevExt phys_dev_ext[MAX_NUM_UNKNOWN_EXTS]; |
Jon Ashburn | 95a77ba | 2015-05-15 15:09:35 -0600 | [diff] [blame] | 287 | }; |
| 288 | |
Mark Young | 35159af | 2016-09-07 08:50:32 -0600 | [diff] [blame] | 289 | // per ICD library structure |
Mark Young | 0153e0b | 2016-11-03 14:27:13 -0600 | [diff] [blame] | 290 | struct loader_icd_tramp_list { |
Jon Ashburn | 8810c5f | 2015-08-18 18:04:47 -0600 | [diff] [blame] | 291 | size_t capacity; |
| 292 | uint32_t count; |
Mark Young | 0153e0b | 2016-11-03 14:27:13 -0600 | [diff] [blame] | 293 | struct loader_scanned_icd *scanned_list; |
Jon Ashburn | 8810c5f | 2015-08-18 18:04:47 -0600 | [diff] [blame] | 294 | }; |
| 295 | |
Mark Young | 35159af | 2016-09-07 08:50:32 -0600 | [diff] [blame] | 296 | union loader_instance_extension_enables { |
| 297 | struct { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 298 | uint8_t khr_get_physical_device_properties2 : 1; |
| 299 | uint8_t ext_acquire_xlib_display : 1; |
Mark Young | 0153e0b | 2016-11-03 14:27:13 -0600 | [diff] [blame] | 300 | uint8_t ext_debug_report : 1; |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 301 | uint8_t ext_direct_mode_display : 1; |
| 302 | uint8_t ext_display_surface_counter : 1; |
Mark Young | 35159af | 2016-09-07 08:50:32 -0600 | [diff] [blame] | 303 | uint8_t nv_external_memory_capabilities : 1; |
| 304 | }; |
| 305 | uint64_t padding[4]; |
| 306 | }; |
| 307 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 308 | struct loader_instance_dispatch_table { |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 309 | VkLayerInstanceDispatchTable layer_inst_disp; // must be first entry in structure |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 310 | |
| 311 | // Physical device functions unknown to the loader |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 312 | PFN_PhysDevExt phys_dev_ext[MAX_NUM_UNKNOWN_EXTS]; |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 313 | }; |
| 314 | |
Mark Young | 35159af | 2016-09-07 08:50:32 -0600 | [diff] [blame] | 315 | // per instance structure |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 316 | struct loader_instance { |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 317 | struct loader_instance_dispatch_table *disp; // must be first entry in structure |
Jon Ashburn | 95a77ba | 2015-05-15 15:09:35 -0600 | [diff] [blame] | 318 | |
Mark Young | 0153e0b | 2016-11-03 14:27:13 -0600 | [diff] [blame] | 319 | uint32_t total_gpu_count; |
Lenny Komow | 8a1f8a5 | 2016-12-20 15:35:11 -0700 | [diff] [blame] | 320 | uint32_t phys_dev_count_term; |
| 321 | struct loader_physical_device_term **phys_devs_term; |
Lenny Komow | b9f70c3 | 2016-12-19 17:11:40 -0700 | [diff] [blame] | 322 | uint32_t phys_dev_count_tramp; |
| 323 | struct loader_physical_device_tramp **phys_devs_tramp; |
Mark Young | 0153e0b | 2016-11-03 14:27:13 -0600 | [diff] [blame] | 324 | |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 325 | struct loader_instance *next; |
Mark Young | 0153e0b | 2016-11-03 14:27:13 -0600 | [diff] [blame] | 326 | |
| 327 | uint32_t total_icd_count; |
| 328 | struct loader_icd_term *icd_terms; |
| 329 | struct loader_icd_tramp_list icd_tramp_list; |
| 330 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 331 | struct loader_dispatch_hash_entry dev_ext_disp_hash[MAX_NUM_UNKNOWN_EXTS]; |
| 332 | struct loader_dispatch_hash_entry phys_dev_ext_disp_hash[MAX_NUM_UNKNOWN_EXTS]; |
Jon Ashburn | 3d00233 | 2015-08-20 16:35:30 -0600 | [diff] [blame] | 333 | |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 334 | struct loader_msg_callback_map_entry *icd_msg_callback_map; |
| 335 | |
Mark Young | 0153e0b | 2016-11-03 14:27:13 -0600 | [diff] [blame] | 336 | struct loader_layer_list instance_layer_list; |
Courtney Goeltzenleuchter | 110fdf9 | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 337 | struct loader_layer_list activated_layer_list; |
Jon Ashburn | 491cd04 | 2016-05-16 14:01:18 -0600 | [diff] [blame] | 338 | bool activated_layers_are_std_val; |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 339 | VkInstance instance; // layers/ICD instance returned to trampoline |
Courtney Goeltzenleuchter | 00150eb | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 340 | |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 341 | struct loader_extension_list ext_list; // icds and loaders extensions |
Mark Young | 0153e0b | 2016-11-03 14:27:13 -0600 | [diff] [blame] | 342 | union loader_instance_extension_enables enabled_known_extensions; |
| 343 | |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 344 | VkLayerDbgFunctionNode *DbgFunctionHead; |
Ian Elliott | ad6300f | 2016-03-31 10:48:19 -0600 | [diff] [blame] | 345 | uint32_t num_tmp_callbacks; |
| 346 | VkDebugReportCallbackCreateInfoEXT *tmp_dbg_create_infos; |
| 347 | VkDebugReportCallbackEXT *tmp_callbacks; |
Courtney Goeltzenleuchter | 7f5aafc | 2015-07-05 11:28:29 -0600 | [diff] [blame] | 348 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 349 | VkAllocationCallbacks alloc_callbacks; |
Ian Elliott | d3ef02f | 2015-07-06 14:36:13 -0600 | [diff] [blame] | 350 | |
Ian Elliott | 954fa34 | 2015-10-30 15:28:23 -0600 | [diff] [blame] | 351 | bool wsi_surface_enabled; |
Mark Lobodzinski | a8a5f85 | 2015-12-10 16:25:21 -0700 | [diff] [blame] | 352 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
Ian Elliott | 954fa34 | 2015-10-30 15:28:23 -0600 | [diff] [blame] | 353 | bool wsi_win32_surface_enabled; |
Mark Lobodzinski | a8a5f85 | 2015-12-10 16:25:21 -0700 | [diff] [blame] | 354 | #endif |
| 355 | #ifdef VK_USE_PLATFORM_MIR_KHR |
Ian Elliott | 954fa34 | 2015-10-30 15:28:23 -0600 | [diff] [blame] | 356 | bool wsi_mir_surface_enabled; |
Mark Lobodzinski | a8a5f85 | 2015-12-10 16:25:21 -0700 | [diff] [blame] | 357 | #endif |
| 358 | #ifdef VK_USE_PLATFORM_WAYLAND_KHR |
Ian Elliott | 954fa34 | 2015-10-30 15:28:23 -0600 | [diff] [blame] | 359 | bool wsi_wayland_surface_enabled; |
Mark Lobodzinski | a8a5f85 | 2015-12-10 16:25:21 -0700 | [diff] [blame] | 360 | #endif |
| 361 | #ifdef VK_USE_PLATFORM_XCB_KHR |
Ian Elliott | 954fa34 | 2015-10-30 15:28:23 -0600 | [diff] [blame] | 362 | bool wsi_xcb_surface_enabled; |
Mark Lobodzinski | a8a5f85 | 2015-12-10 16:25:21 -0700 | [diff] [blame] | 363 | #endif |
| 364 | #ifdef VK_USE_PLATFORM_XLIB_KHR |
Ian Elliott | 954fa34 | 2015-10-30 15:28:23 -0600 | [diff] [blame] | 365 | bool wsi_xlib_surface_enabled; |
Mark Lobodzinski | a8a5f85 | 2015-12-10 16:25:21 -0700 | [diff] [blame] | 366 | #endif |
| 367 | #ifdef VK_USE_PLATFORM_ANDROID_KHR |
| 368 | bool wsi_android_surface_enabled; |
| 369 | #endif |
Jon Ashburn | c7d3e73 | 2016-03-08 09:30:30 -0700 | [diff] [blame] | 370 | bool wsi_display_enabled; |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 371 | }; |
| 372 | |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 373 | /* VkPhysicalDevice requires special treatment by loader. Firstly, terminator |
Mark Young | 0153e0b | 2016-11-03 14:27:13 -0600 | [diff] [blame] | 374 | * code must be able to get the struct loader_icd_term to call into the proper |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 375 | * driver (multiple ICD/gpu case). This can be accomplished by wrapping the |
| 376 | * created VkPhysicalDevice in loader terminate_EnumeratePhysicalDevices(). |
Piers Daniell | 295fe40 | 2016-03-29 11:51:11 -0600 | [diff] [blame] | 377 | * Secondly, the loader must be able to handle wrapped by layer VkPhysicalDevice |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 378 | * in trampoline code. This implies, that the loader trampoline code must also |
| 379 | * wrap the VkPhysicalDevice object in trampoline code. Thus, loader has to |
| 380 | * wrap the VkPhysicalDevice created object twice. In trampoline code it can't |
| 381 | * rely on the terminator object wrapping since a layer may also wrap. Since |
| 382 | * trampoline code wraps the VkPhysicalDevice this means all loader trampoline |
| 383 | * code that passes a VkPhysicalDevice should unwrap it. */ |
| 384 | |
| 385 | /* per enumerated PhysicalDevice structure, used to wrap in trampoline code and |
| 386 | also same structure used to wrap in terminator code */ |
Jon Ashburn | 787eb25 | 2016-03-24 15:49:57 -0600 | [diff] [blame] | 387 | struct loader_physical_device_tramp { |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 388 | struct loader_instance_dispatch_table *disp; // must be first entry in structure |
Piers Daniell | 295fe40 | 2016-03-29 11:51:11 -0600 | [diff] [blame] | 389 | struct loader_instance *this_instance; |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 390 | VkPhysicalDevice phys_dev; // object from layers/loader terminator |
Jon Ashburn | 787eb25 | 2016-03-24 15:49:57 -0600 | [diff] [blame] | 391 | }; |
| 392 | |
| 393 | /* per enumerated PhysicalDevice structure, used to wrap in terminator code */ |
Mark Young | 0153e0b | 2016-11-03 14:27:13 -0600 | [diff] [blame] | 394 | struct loader_physical_device_term { |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 395 | struct loader_instance_dispatch_table *disp; // must be first entry in structure |
Mark Young | 0153e0b | 2016-11-03 14:27:13 -0600 | [diff] [blame] | 396 | struct loader_icd_term *this_icd_term; |
Mark Young | 16573c7 | 2016-06-28 10:52:43 -0600 | [diff] [blame] | 397 | uint8_t icd_index; |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 398 | VkPhysicalDevice phys_dev; // object from ICD |
Jon Ashburn | 24cd4be | 2015-11-01 14:04:06 -0700 | [diff] [blame] | 399 | }; |
| 400 | |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 401 | struct loader_struct { |
| 402 | struct loader_instance *instances; |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 403 | }; |
| 404 | |
Mark Young | 0153e0b | 2016-11-03 14:27:13 -0600 | [diff] [blame] | 405 | struct loader_scanned_icd { |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 406 | char *lib_name; |
| 407 | loader_platform_dl_handle handle; |
Jon Ashburn | 005617f | 2015-11-17 17:35:40 -0700 | [diff] [blame] | 408 | uint32_t api_version; |
Jon Ashburn | 17b4c86 | 2016-04-25 11:09:37 -0600 | [diff] [blame] | 409 | uint32_t interface_version; |
Jon Ashburn | c624c88 | 2015-07-16 10:17:29 -0600 | [diff] [blame] | 410 | PFN_vkGetInstanceProcAddr GetInstanceProcAddr; |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 411 | PFN_GetPhysicalDeviceProcAddr GetPhysicalDeviceProcAddr; |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 412 | PFN_vkCreateInstance CreateInstance; |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 413 | PFN_vkEnumerateInstanceExtensionProperties EnumerateInstanceExtensionProperties; |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 414 | }; |
| 415 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 416 | static inline struct loader_instance *loader_instance(VkInstance instance) { return (struct loader_instance *)instance; } |
Jon Ashburn | 5ef2060 | 2015-07-02 09:40:15 -0600 | [diff] [blame] | 417 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 418 | static inline VkPhysicalDevice loader_unwrap_physical_device(VkPhysicalDevice physicalDevice) { |
| 419 | struct loader_physical_device_tramp *phys_dev = (struct loader_physical_device_tramp *)physicalDevice; |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 420 | return phys_dev->phys_dev; |
| 421 | } |
| 422 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 423 | static inline void loader_set_dispatch(void *obj, const void *data) { *((const void **)obj) = data; } |
Chia-I Wu | 5291c76 | 2015-04-11 15:34:07 +0800 | [diff] [blame] | 424 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 425 | static inline VkLayerDispatchTable *loader_get_dispatch(const void *obj) { return *((VkLayerDispatchTable **)obj); } |
Chia-I Wu | 5291c76 | 2015-04-11 15:34:07 +0800 | [diff] [blame] | 426 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 427 | static inline struct loader_dev_dispatch_table *loader_get_dev_dispatch(const void *obj) { |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 428 | return *((struct loader_dev_dispatch_table **)obj); |
Jon Ashburn | fc1031e | 2015-11-17 15:31:02 -0700 | [diff] [blame] | 429 | } |
| 430 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 431 | static inline VkLayerInstanceDispatchTable *loader_get_instance_layer_dispatch(const void *obj) { |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 432 | return *((VkLayerInstanceDispatchTable **)obj); |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 433 | } |
| 434 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 435 | static inline struct loader_instance_dispatch_table *loader_get_instance_dispatch(const void *obj) { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 436 | return *((struct loader_instance_dispatch_table **)obj); |
| 437 | } |
| 438 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 439 | static inline void loader_init_dispatch(void *obj, const void *data) { |
Jon Ashburn | 4006664 | 2015-04-15 13:34:33 -0600 | [diff] [blame] | 440 | #ifdef DEBUG |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 441 | assert(valid_loader_magic_value(obj) && |
| 442 | "Incompatible ICD, first dword must be initialized to " |
| 443 | "ICD_LOADER_MAGIC. See loader/README.md for details."); |
Jon Ashburn | 4006664 | 2015-04-15 13:34:33 -0600 | [diff] [blame] | 444 | #endif |
Chia-I Wu | 5291c76 | 2015-04-11 15:34:07 +0800 | [diff] [blame] | 445 | |
Jon Ashburn | 1ed042c | 2015-05-01 18:00:33 -0600 | [diff] [blame] | 446 | loader_set_dispatch(obj, data); |
Chia-I Wu | 5291c76 | 2015-04-11 15:34:07 +0800 | [diff] [blame] | 447 | } |
| 448 | |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 449 | /* global variables used across files */ |
| 450 | extern struct loader_struct loader; |
Jon Ashburn | 87d6aa9 | 2015-08-28 15:19:27 -0600 | [diff] [blame] | 451 | extern THREAD_LOCAL_DECL struct loader_instance *tls_instance; |
Jon Ashburn | 8810c5f | 2015-08-18 18:04:47 -0600 | [diff] [blame] | 452 | extern LOADER_PLATFORM_THREAD_ONCE_DEFINITION(once_init); |
Jon Ashburn | 6301a0f | 2015-05-29 13:15:39 -0600 | [diff] [blame] | 453 | extern loader_platform_thread_mutex loader_lock; |
Jon Ashburn | 6461ef2 | 2015-09-22 13:11:00 -0600 | [diff] [blame] | 454 | extern loader_platform_thread_mutex loader_json_lock; |
Jon Ashburn | 6301a0f | 2015-05-29 13:15:39 -0600 | [diff] [blame] | 455 | extern const VkLayerInstanceDispatchTable instance_disp; |
Jon Ashburn | 86a527a | 2016-02-10 20:59:26 -0700 | [diff] [blame] | 456 | extern const char *std_validation_str; |
Jon Ashburn | bacb0f5 | 2015-04-06 10:58:22 -0600 | [diff] [blame] | 457 | |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 458 | struct loader_msg_callback_map_entry { |
Courtney Goeltzenleuchter | 7415d5a | 2015-12-09 15:48:16 -0700 | [diff] [blame] | 459 | VkDebugReportCallbackEXT icd_obj; |
| 460 | VkDebugReportCallbackEXT loader_obj; |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 461 | }; |
| 462 | |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 463 | /* helper function definitions */ |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 464 | void *loader_instance_heap_alloc(const struct loader_instance *instance, size_t size, VkSystemAllocationScope allocationScope); |
| 465 | void loader_instance_heap_free(const struct loader_instance *instance, void *pMemory); |
| 466 | void *loader_instance_heap_realloc(const struct loader_instance *instance, void *pMemory, size_t orig_size, size_t size, |
Mark Young | 0153e0b | 2016-11-03 14:27:13 -0600 | [diff] [blame] | 467 | VkSystemAllocationScope alloc_scope); |
Mark Young | 0ad8313 | 2016-06-30 13:02:42 -0600 | [diff] [blame] | 468 | void *loader_instance_tls_heap_alloc(size_t size); |
| 469 | void loader_instance_tls_heap_free(void *pMemory); |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 470 | void *loader_device_heap_alloc(const struct loader_device *device, size_t size, VkSystemAllocationScope allocationScope); |
Mark Young | 0ad8313 | 2016-06-30 13:02:42 -0600 | [diff] [blame] | 471 | void loader_device_heap_free(const struct loader_device *device, void *pMemory); |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 472 | void *loader_device_heap_realloc(const struct loader_device *device, void *pMemory, size_t orig_size, size_t size, |
Mark Young | 0153e0b | 2016-11-03 14:27:13 -0600 | [diff] [blame] | 473 | VkSystemAllocationScope alloc_scope); |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 474 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 475 | void loader_log(const struct loader_instance *inst, VkFlags msg_type, int32_t msg_code, const char *format, ...); |
Jon Ashburn | 2e37d75 | 2016-02-12 08:20:06 -0700 | [diff] [blame] | 476 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 477 | bool compare_vk_extension_properties(const VkExtensionProperties *op1, const VkExtensionProperties *op2); |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 478 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 479 | VkResult loader_validate_layers(const struct loader_instance *inst, const uint32_t layer_count, |
| 480 | const char *const *ppEnabledLayerNames, const struct loader_layer_list *list); |
Courtney Goeltzenleuchter | 3b8c5ff | 2015-07-06 17:45:08 -0600 | [diff] [blame] | 481 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 482 | VkResult loader_validate_instance_extensions(const struct loader_instance *inst, const struct loader_extension_list *icd_exts, |
| 483 | const struct loader_layer_list *instance_layer, |
| 484 | const VkInstanceCreateInfo *pCreateInfo); |
Courtney Goeltzenleuchter | 3b8c5ff | 2015-07-06 17:45:08 -0600 | [diff] [blame] | 485 | |
Jon Ashburn | 8810c5f | 2015-08-18 18:04:47 -0600 | [diff] [blame] | 486 | void loader_initialize(void); |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 487 | VkResult loader_copy_layer_properties(const struct loader_instance *inst, struct loader_layer_properties *dst, |
Mark Young | 0ad8313 | 2016-06-30 13:02:42 -0600 | [diff] [blame] | 488 | struct loader_layer_properties *src); |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 489 | bool has_vk_extension_property_array(const VkExtensionProperties *vk_ext_prop, const uint32_t count, |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 490 | const VkExtensionProperties *ext_array); |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 491 | bool has_vk_extension_property(const VkExtensionProperties *vk_ext_prop, const struct loader_extension_list *ext_list); |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 492 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 493 | VkResult loader_add_to_ext_list(const struct loader_instance *inst, struct loader_extension_list *ext_list, |
| 494 | uint32_t prop_list_count, const VkExtensionProperties *props); |
| 495 | VkResult loader_add_to_dev_ext_list(const struct loader_instance *inst, struct loader_device_extension_list *ext_list, |
| 496 | const VkExtensionProperties *props, uint32_t entry_count, char **entrys); |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 497 | VkResult loader_add_device_extensions(const struct loader_instance *inst, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 498 | PFN_vkEnumerateDeviceExtensionProperties fpEnumerateDeviceExtensionProperties, |
| 499 | VkPhysicalDevice physical_device, const char *lib_name, |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 500 | struct loader_extension_list *ext_list); |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 501 | VkResult loader_init_generic_list(const struct loader_instance *inst, struct loader_generic_list *list_info, size_t element_size); |
| 502 | void loader_destroy_generic_list(const struct loader_instance *inst, struct loader_generic_list *list); |
| 503 | void loader_destroy_layer_list(const struct loader_instance *inst, struct loader_device *device, |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 504 | struct loader_layer_list *layer_list); |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 505 | void loader_delete_layer_properties(const struct loader_instance *inst, struct loader_layer_list *layer_list); |
| 506 | bool loader_find_layer_name_array(const char *name, uint32_t layer_count, const char layer_list[][VK_MAX_EXTENSION_NAME_SIZE]); |
| 507 | VkResult loader_expand_layer_names(struct loader_instance *inst, const char *key_name, uint32_t expand_count, |
| 508 | const char expand_names[][VK_MAX_EXTENSION_NAME_SIZE], uint32_t *layer_count, |
| 509 | char const *const **ppp_layer_names); |
Jon Ashburn | 491cd04 | 2016-05-16 14:01:18 -0600 | [diff] [blame] | 510 | void loader_init_std_validation_props(struct loader_layer_properties *props); |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 511 | void loader_delete_shadow_dev_layer_names(const struct loader_instance *inst, const VkDeviceCreateInfo *orig, |
Chris Forbes | bd9de05 | 2016-04-06 20:49:02 +1200 | [diff] [blame] | 512 | VkDeviceCreateInfo *ours); |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 513 | void loader_delete_shadow_inst_layer_names(const struct loader_instance *inst, const VkInstanceCreateInfo *orig, |
Chris Forbes | bd9de05 | 2016-04-06 20:49:02 +1200 | [diff] [blame] | 514 | VkInstanceCreateInfo *ours); |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 515 | VkResult loader_add_to_layer_list(const struct loader_instance *inst, struct loader_layer_list *list, uint32_t prop_list_count, |
Mark Young | 0ad8313 | 2016-06-30 13:02:42 -0600 | [diff] [blame] | 516 | const struct loader_layer_properties *props); |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 517 | void loader_find_layer_name_add_list(const struct loader_instance *inst, const char *name, const enum layer_type type, |
| 518 | const struct loader_layer_list *search_list, struct loader_layer_list *found_list); |
| 519 | void loader_scanned_icd_clear(const struct loader_instance *inst, struct loader_icd_tramp_list *icd_tramp_list); |
| 520 | VkResult loader_icd_scan(const struct loader_instance *inst, struct loader_icd_tramp_list *icd_tramp_list); |
| 521 | void loader_layer_scan(const struct loader_instance *inst, struct loader_layer_list *instance_layers); |
| 522 | void loader_implicit_layer_scan(const struct loader_instance *inst, struct loader_layer_list *instance_layers); |
| 523 | VkResult loader_get_icd_loader_instance_extensions(const struct loader_instance *inst, struct loader_icd_tramp_list *icd_tramp_list, |
| 524 | struct loader_extension_list *inst_exts); |
| 525 | struct loader_icd_term *loader_get_icd_and_device(const VkDevice device, struct loader_device **found_dev, uint32_t *icd_index); |
| 526 | void loader_init_dispatch_dev_ext(struct loader_instance *inst, struct loader_device *dev); |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 527 | void *loader_dev_ext_gpa(struct loader_instance *inst, const char *funcName); |
| 528 | void *loader_get_dev_ext_trampoline(uint32_t index); |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 529 | bool loader_phys_dev_ext_gpa(struct loader_instance *inst, const char *funcName, bool perform_checking, void **tramp_addr, |
| 530 | void **term_addr); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 531 | void *loader_get_phys_dev_ext_tramp(uint32_t index); |
| 532 | void *loader_get_phys_dev_ext_termin(uint32_t index); |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 533 | struct loader_instance *loader_get_instance(const VkInstance instance); |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 534 | void loader_deactivate_layers(const struct loader_instance *instance, struct loader_device *device, struct loader_layer_list *list); |
| 535 | struct loader_device *loader_create_logical_device(const struct loader_instance *inst, const VkAllocationCallbacks *pAllocator); |
| 536 | void loader_add_logical_device(const struct loader_instance *inst, struct loader_icd_term *icd_term, |
Piers Daniell | 295fe40 | 2016-03-29 11:51:11 -0600 | [diff] [blame] | 537 | struct loader_device *found_dev); |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 538 | void loader_remove_logical_device(const struct loader_instance *inst, struct loader_icd_term *icd_term, |
| 539 | struct loader_device *found_dev, const VkAllocationCallbacks *pAllocator); |
Mark Young | 0153e0b | 2016-11-03 14:27:13 -0600 | [diff] [blame] | 540 | // NOTE: Outside of loader, this entry-point is only proivided for error |
| 541 | // cleanup. |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 542 | void loader_destroy_logical_device(const struct loader_instance *inst, struct loader_device *dev, |
Mark Young | 0ad8313 | 2016-06-30 13:02:42 -0600 | [diff] [blame] | 543 | const VkAllocationCallbacks *pAllocator); |
| 544 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 545 | VkResult loader_enable_instance_layers(struct loader_instance *inst, const VkInstanceCreateInfo *pCreateInfo, |
| 546 | const struct loader_layer_list *instance_layers); |
Jon Ashburn | dc6fcad | 2015-06-10 10:06:06 -0600 | [diff] [blame] | 547 | void loader_deactivate_instance_layers(struct loader_instance *instance); |
Courtney Goeltzenleuchter | 00150eb | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 548 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 549 | VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, |
| 550 | struct loader_instance *inst, VkInstance *created_instance); |
Courtney Goeltzenleuchter | 00150eb | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 551 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 552 | void loader_activate_instance_layer_extensions(struct loader_instance *inst, VkInstance created_inst); |
| 553 | VkResult loader_enable_device_layers(const struct loader_instance *inst, struct loader_layer_list *activated_layer_list, |
| 554 | const VkDeviceCreateInfo *pCreateInfo, const struct loader_layer_list *device_layers); |
Courtney Goeltzenleuchter | 7f5aafc | 2015-07-05 11:28:29 -0600 | [diff] [blame] | 555 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 556 | VkResult loader_create_device_chain(const struct loader_physical_device_tramp *pd, const VkDeviceCreateInfo *pCreateInfo, |
| 557 | const VkAllocationCallbacks *pAllocator, const struct loader_instance *inst, |
| 558 | struct loader_device *dev); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 559 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 560 | VkResult loader_validate_device_extensions(struct loader_physical_device_tramp *phys_dev, |
| 561 | const struct loader_layer_list *activated_device_layers, |
| 562 | const struct loader_extension_list *icd_exts, const VkDeviceCreateInfo *pCreateInfo); |
Courtney Goeltzenleuchter | 7f5aafc | 2015-07-05 11:28:29 -0600 | [diff] [blame] | 563 | |
Mark Young | 6267ae6 | 2017-01-12 12:27:19 -0700 | [diff] [blame] | 564 | VkResult setupLoaderTrampPhysDevs(VkInstance instance); |
| 565 | VkResult setupLoaderTermPhysDevs(struct loader_instance *inst); |
| 566 | |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 567 | /* instance layer chain termination entrypoint definitions */ |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 568 | VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateInstance(const VkInstanceCreateInfo *pCreateInfo, |
| 569 | const VkAllocationCallbacks *pAllocator, VkInstance *pInstance); |
Jon Ashburn | 87d6aa9 | 2015-08-28 15:19:27 -0600 | [diff] [blame] | 570 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 571 | VKAPI_ATTR void VKAPI_CALL terminator_DestroyInstance(VkInstance instance, const VkAllocationCallbacks *pAllocator); |
Jon Ashburn | 87d6aa9 | 2015-08-28 15:19:27 -0600 | [diff] [blame] | 572 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 573 | VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount, |
| 574 | VkPhysicalDevice *pPhysicalDevices); |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 575 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 576 | VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, |
| 577 | VkPhysicalDeviceFeatures *pFeatures); |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 578 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 579 | VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, |
| 580 | VkFormatProperties *pFormatInfo); |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 581 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 582 | VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, |
| 583 | VkImageType type, VkImageTiling tiling, |
| 584 | VkImageUsageFlags usage, VkImageCreateFlags flags, |
| 585 | VkImageFormatProperties *pImageFormatProperties); |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 586 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 587 | VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, |
| 588 | VkImageType type, VkSampleCountFlagBits samples, |
| 589 | VkImageUsageFlags usage, VkImageTiling tiling, |
| 590 | uint32_t *pNumProperties, |
| 591 | VkSparseImageFormatProperties *pProperties); |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 592 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 593 | VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, |
| 594 | VkPhysicalDeviceProperties *pProperties); |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 595 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 596 | VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, |
| 597 | const char *pLayerName, uint32_t *pCount, |
| 598 | VkExtensionProperties *pProperties); |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 599 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 600 | VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t *pCount, |
| 601 | VkLayerProperties *pProperties); |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 602 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 603 | VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, uint32_t *pCount, |
| 604 | VkQueueFamilyProperties *pProperties); |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 605 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 606 | VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, |
| 607 | VkPhysicalDeviceMemoryProperties *pProperties); |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 608 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 609 | VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDevice(VkPhysicalDevice gpu, const VkDeviceCreateInfo *pCreateInfo, |
| 610 | const VkAllocationCallbacks *pAllocator, VkDevice *pDevice); |
Mark Lobodzinski | e9f09ef | 2016-02-02 18:53:34 -0700 | [diff] [blame] | 611 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 612 | VkStringErrorFlags vk_string_validate(const int max_length, const char *char_array); |
Mark Lobodzinski | e9f09ef | 2016-02-02 18:53:34 -0700 | [diff] [blame] | 613 | |
Chia-I Wu | 1930060 | 2014-08-04 08:03:57 +0800 | [diff] [blame] | 614 | #endif /* LOADER_H */ |