Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1 | /* |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2 | * |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 3 | * Copyright (c) 2015-2016 The Khronos Group Inc. |
| 4 | * Copyright (c) 2015-2016 Valve Corporation |
| 5 | * Copyright (c) 2015-2016 LunarG, Inc. |
Courtney Goeltzenleuchter | f821dad | 2015-12-02 14:53:22 -0700 | [diff] [blame] | 6 | * Copyright (C) 2015 Google Inc. |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 7 | * |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 8 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 9 | * of this software and/or associated documentation files (the "Materials"), to |
| 10 | * deal in the Materials without restriction, including without limitation the |
| 11 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 12 | * sell copies of the Materials, and to permit persons to whom the Materials are |
| 13 | * furnished to do so, subject to the following conditions: |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 14 | * |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 15 | * The above copyright notice(s) and this permission notice shall be included in |
| 16 | * all copies or substantial portions of the Materials. |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 17 | * |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 18 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 20 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
Courtney Goeltzenleuchter | 0555952 | 2015-10-30 11:14:30 -0600 | [diff] [blame] | 21 | * |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 22 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
| 23 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
| 24 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE |
| 25 | * USE OR OTHER DEALINGS IN THE MATERIALS. |
| 26 | * |
| 27 | * Author: Courtney Goeltzenleuchter <courtney@lunarg.com> |
Courtney Goeltzenleuchter | 0555952 | 2015-10-30 11:14:30 -0600 | [diff] [blame] | 28 | * Author: Jon Ashburn <jon@lunarg.com> |
| 29 | * Author: Tony Barbour <tony@LunarG.com> |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 30 | * Author: Chia-I Wu <olv@lunarg.com> |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 31 | */ |
Courtney Goeltzenleuchter | 7f5aafc | 2015-07-05 11:28:29 -0600 | [diff] [blame] | 32 | #define _GNU_SOURCE |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 33 | #include <stdlib.h> |
| 34 | #include <string.h> |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 35 | |
Tobin Ehlis | b835d1b | 2015-07-03 10:34:49 -0600 | [diff] [blame] | 36 | #include "vk_loader_platform.h" |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 37 | #include "loader.h" |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 38 | #include "debug_report.h" |
Ian Elliott | 954fa34 | 2015-10-30 15:28:23 -0600 | [diff] [blame] | 39 | #include "wsi.h" |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 40 | #include "gpa_helper.h" |
| 41 | #include "table_ops.h" |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 42 | |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 43 | /* Trampoline entrypoints are in this file for core Vulkan commands */ |
| 44 | /** |
| 45 | * Get an instance level or global level entry point address. |
| 46 | * @param instance |
| 47 | * @param pName |
| 48 | * @return |
| 49 | * If instance == NULL returns a global level functions only |
| 50 | * If instance is valid returns a trampoline entry point for all dispatchable |
| 51 | * Vulkan |
| 52 | * functions both core and extensions. |
| 53 | */ |
| 54 | LOADER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL |
| 55 | vkGetInstanceProcAddr(VkInstance instance, const char *pName) { |
| 56 | |
| 57 | void *addr; |
| 58 | |
| 59 | addr = globalGetProcAddr(pName); |
| 60 | if (instance == VK_NULL_HANDLE) { |
| 61 | // get entrypoint addresses that are global (no dispatchable object) |
| 62 | |
| 63 | return addr; |
| 64 | } else { |
| 65 | // if a global entrypoint return NULL |
| 66 | if (addr) |
| 67 | return NULL; |
| 68 | } |
| 69 | |
| 70 | struct loader_instance *ptr_instance = loader_get_instance(instance); |
| 71 | if (ptr_instance == NULL) |
| 72 | return NULL; |
| 73 | // Return trampoline code for non-global entrypoints including any |
| 74 | // extensions. |
| 75 | // Device extensions are returned if a layer or ICD supports the extension. |
| 76 | // Instance extensions are returned if the extension is enabled and the |
| 77 | // loader |
| 78 | // or someone else supports the extension |
| 79 | return trampolineGetProcAddr(ptr_instance, pName); |
| 80 | } |
| 81 | |
| 82 | /** |
| 83 | * Get a device level or global level entry point address. |
| 84 | * @param device |
| 85 | * @param pName |
| 86 | * @return |
| 87 | * If device is valid, returns a device relative entry point for device level |
| 88 | * entry points both core and extensions. |
| 89 | * Device relative means call down the device chain. |
| 90 | */ |
| 91 | LOADER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL |
| 92 | vkGetDeviceProcAddr(VkDevice device, const char *pName) { |
| 93 | void *addr; |
| 94 | |
| 95 | /* for entrypoints that loader must handle (ie non-dispatchable or create |
| 96 | object) |
| 97 | make sure the loader entrypoint is returned */ |
| 98 | addr = loader_non_passthrough_gdpa(pName); |
| 99 | if (addr) { |
| 100 | return addr; |
| 101 | } |
| 102 | |
| 103 | /* Although CreateDevice is on device chain it's dispatchable object isn't |
| 104 | * a VkDevice or child of VkDevice so return NULL. |
| 105 | */ |
| 106 | if (!strcmp(pName, "CreateDevice")) |
| 107 | return NULL; |
| 108 | |
| 109 | /* return the dispatch table entrypoint for the fastest case */ |
| 110 | const VkLayerDispatchTable *disp_table = *(VkLayerDispatchTable **)device; |
| 111 | if (disp_table == NULL) |
| 112 | return NULL; |
| 113 | |
| 114 | addr = loader_lookup_device_dispatch_table(disp_table, pName); |
| 115 | if (addr) |
| 116 | return addr; |
| 117 | |
| 118 | if (disp_table->GetDeviceProcAddr == NULL) |
| 119 | return NULL; |
| 120 | return disp_table->GetDeviceProcAddr(device, pName); |
| 121 | } |
| 122 | |
| 123 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 124 | vkEnumerateInstanceExtensionProperties(const char *pLayerName, |
| 125 | uint32_t *pPropertyCount, |
| 126 | VkExtensionProperties *pProperties) { |
| 127 | struct loader_extension_list *global_ext_list = NULL; |
| 128 | struct loader_layer_list instance_layers; |
Jon Ashburn | b872696 | 2016-04-08 15:03:35 -0600 | [diff] [blame] | 129 | struct loader_extension_list local_ext_list; |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 130 | struct loader_icd_libs icd_libs; |
| 131 | uint32_t copy_size; |
| 132 | |
| 133 | tls_instance = NULL; |
Jon Ashburn | b872696 | 2016-04-08 15:03:35 -0600 | [diff] [blame] | 134 | memset(&local_ext_list, 0, sizeof(local_ext_list)); |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 135 | memset(&instance_layers, 0, sizeof(instance_layers)); |
| 136 | loader_platform_thread_once(&once_init, loader_initialize); |
| 137 | |
| 138 | /* get layer libraries if needed */ |
| 139 | if (pLayerName && strlen(pLayerName) != 0) { |
Jeremy Hayes | 3e2bd5a | 2016-04-01 11:40:26 -0600 | [diff] [blame] | 140 | if (vk_string_validate(MaxLoaderStringLength, pLayerName) != |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 141 | VK_STRING_ERROR_NONE) { |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 142 | assert(VK_FALSE && "vkEnumerateInstanceExtensionProperties: " |
| 143 | "pLayerName is too long or is badly formed"); |
| 144 | return VK_ERROR_EXTENSION_NOT_PRESENT; |
| 145 | } |
Jeremy Hayes | 3e2bd5a | 2016-04-01 11:40:26 -0600 | [diff] [blame] | 146 | |
| 147 | loader_layer_scan(NULL, &instance_layers, NULL); |
Jon Ashburn | b872696 | 2016-04-08 15:03:35 -0600 | [diff] [blame] | 148 | if (strcmp(pLayerName, std_validation_str) == 0) { |
| 149 | struct loader_layer_list local_list; |
| 150 | memset(&local_list, 0, sizeof(local_list)); |
| 151 | for (uint32_t i = 0; i < sizeof(std_validation_names) / |
| 152 | sizeof(std_validation_names[0]); |
| 153 | i++) { |
| 154 | loader_find_layer_name_add_list(NULL, std_validation_names[i], |
| 155 | VK_LAYER_TYPE_INSTANCE_EXPLICIT, |
| 156 | &instance_layers, &local_list); |
| 157 | } |
| 158 | for (uint32_t i = 0; i < local_list.count; i++) { |
| 159 | struct loader_extension_list *ext_list = |
| 160 | &local_list.list[i].instance_extension_list; |
| 161 | loader_add_to_ext_list(NULL, &local_ext_list, ext_list->count, |
| 162 | ext_list->list); |
| 163 | } |
| 164 | loader_destroy_layer_list(NULL, &local_list); |
| 165 | global_ext_list = &local_ext_list; |
| 166 | |
| 167 | } else { |
| 168 | for (uint32_t i = 0; i < instance_layers.count; i++) { |
| 169 | struct loader_layer_properties *props = |
| 170 | &instance_layers.list[i]; |
| 171 | if (strcmp(props->info.layerName, pLayerName) == 0) { |
| 172 | global_ext_list = &props->instance_extension_list; |
| 173 | break; |
| 174 | } |
Jeremy Hayes | 3e2bd5a | 2016-04-01 11:40:26 -0600 | [diff] [blame] | 175 | } |
| 176 | } |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 177 | } else { |
| 178 | /* Scan/discover all ICD libraries */ |
| 179 | memset(&icd_libs, 0, sizeof(struct loader_icd_libs)); |
| 180 | loader_icd_scan(NULL, &icd_libs); |
| 181 | /* get extensions from all ICD's, merge so no duplicates */ |
| 182 | loader_get_icd_loader_instance_extensions(NULL, &icd_libs, |
Jon Ashburn | b872696 | 2016-04-08 15:03:35 -0600 | [diff] [blame] | 183 | &local_ext_list); |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 184 | loader_scanned_icd_clear(NULL, &icd_libs); |
Jeremy Hayes | 3e2bd5a | 2016-04-01 11:40:26 -0600 | [diff] [blame] | 185 | |
| 186 | // Append implicit layers. |
| 187 | loader_implicit_layer_scan(NULL, &instance_layers, NULL); |
| 188 | for (uint32_t i = 0; i < instance_layers.count; i++) { |
| 189 | struct loader_extension_list *ext_list = &instance_layers.list[i].instance_extension_list; |
Jon Ashburn | b872696 | 2016-04-08 15:03:35 -0600 | [diff] [blame] | 190 | loader_add_to_ext_list(NULL, &local_ext_list, ext_list->count, ext_list->list); |
Jeremy Hayes | 3e2bd5a | 2016-04-01 11:40:26 -0600 | [diff] [blame] | 191 | } |
| 192 | |
Jon Ashburn | b872696 | 2016-04-08 15:03:35 -0600 | [diff] [blame] | 193 | global_ext_list = &local_ext_list; |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 194 | } |
| 195 | |
| 196 | if (global_ext_list == NULL) { |
| 197 | loader_destroy_layer_list(NULL, &instance_layers); |
| 198 | return VK_ERROR_LAYER_NOT_PRESENT; |
| 199 | } |
| 200 | |
| 201 | if (pProperties == NULL) { |
| 202 | *pPropertyCount = global_ext_list->count; |
| 203 | loader_destroy_layer_list(NULL, &instance_layers); |
| 204 | loader_destroy_generic_list( |
Jon Ashburn | b872696 | 2016-04-08 15:03:35 -0600 | [diff] [blame] | 205 | NULL, (struct loader_generic_list *)&local_ext_list); |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 206 | return VK_SUCCESS; |
| 207 | } |
| 208 | |
| 209 | copy_size = *pPropertyCount < global_ext_list->count |
| 210 | ? *pPropertyCount |
| 211 | : global_ext_list->count; |
| 212 | for (uint32_t i = 0; i < copy_size; i++) { |
| 213 | memcpy(&pProperties[i], &global_ext_list->list[i], |
| 214 | sizeof(VkExtensionProperties)); |
| 215 | } |
| 216 | *pPropertyCount = copy_size; |
| 217 | loader_destroy_generic_list(NULL, |
Jon Ashburn | b872696 | 2016-04-08 15:03:35 -0600 | [diff] [blame] | 218 | (struct loader_generic_list *)&local_ext_list); |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 219 | |
| 220 | if (copy_size < global_ext_list->count) { |
| 221 | loader_destroy_layer_list(NULL, &instance_layers); |
| 222 | return VK_INCOMPLETE; |
| 223 | } |
| 224 | |
| 225 | loader_destroy_layer_list(NULL, &instance_layers); |
| 226 | return VK_SUCCESS; |
| 227 | } |
| 228 | |
| 229 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 230 | vkEnumerateInstanceLayerProperties(uint32_t *pPropertyCount, |
| 231 | VkLayerProperties *pProperties) { |
| 232 | |
| 233 | struct loader_layer_list instance_layer_list; |
| 234 | tls_instance = NULL; |
| 235 | |
| 236 | loader_platform_thread_once(&once_init, loader_initialize); |
| 237 | |
| 238 | uint32_t copy_size; |
| 239 | |
| 240 | /* get layer libraries */ |
| 241 | memset(&instance_layer_list, 0, sizeof(instance_layer_list)); |
| 242 | loader_layer_scan(NULL, &instance_layer_list, NULL); |
| 243 | |
| 244 | if (pProperties == NULL) { |
| 245 | *pPropertyCount = instance_layer_list.count; |
| 246 | loader_destroy_layer_list(NULL, &instance_layer_list); |
| 247 | return VK_SUCCESS; |
| 248 | } |
| 249 | |
| 250 | copy_size = (*pPropertyCount < instance_layer_list.count) |
| 251 | ? *pPropertyCount |
| 252 | : instance_layer_list.count; |
| 253 | for (uint32_t i = 0; i < copy_size; i++) { |
| 254 | memcpy(&pProperties[i], &instance_layer_list.list[i].info, |
| 255 | sizeof(VkLayerProperties)); |
| 256 | } |
| 257 | |
| 258 | *pPropertyCount = copy_size; |
| 259 | loader_destroy_layer_list(NULL, &instance_layer_list); |
| 260 | |
| 261 | if (copy_size < instance_layer_list.count) { |
| 262 | return VK_INCOMPLETE; |
| 263 | } |
| 264 | |
| 265 | return VK_SUCCESS; |
| 266 | } |
| 267 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 268 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 269 | vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo, |
| 270 | const VkAllocationCallbacks *pAllocator, |
| 271 | VkInstance *pInstance) { |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 272 | struct loader_instance *ptr_instance = NULL; |
Jon Ashburn | e5b9bba | 2016-01-18 12:20:03 -0700 | [diff] [blame] | 273 | VkInstance created_instance = VK_NULL_HANDLE; |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 274 | VkResult res = VK_ERROR_INITIALIZATION_FAILED; |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 275 | |
Jon Ashburn | 8810c5f | 2015-08-18 18:04:47 -0600 | [diff] [blame] | 276 | loader_platform_thread_once(&once_init, loader_initialize); |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 277 | |
Jon Ashburn | f9af1d3 | 2016-01-25 14:51:47 -0700 | [diff] [blame] | 278 | #if 0 |
| 279 | if (pAllocator) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 280 | ptr_instance = (struct loader_instance *) pAllocator->pfnAllocation( |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 281 | pAllocator->pUserData, |
Courtney Goeltzenleuchter | 8109510 | 2015-07-06 09:08:37 -0600 | [diff] [blame] | 282 | sizeof(struct loader_instance), |
Jon Ashburn | 6a118ae | 2016-01-07 15:21:14 -0700 | [diff] [blame] | 283 | sizeof(int *), |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 284 | VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); |
Courtney Goeltzenleuchter | 8109510 | 2015-07-06 09:08:37 -0600 | [diff] [blame] | 285 | } else { |
Jon Ashburn | f9af1d3 | 2016-01-25 14:51:47 -0700 | [diff] [blame] | 286 | #endif |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 287 | ptr_instance = |
| 288 | (struct loader_instance *)malloc(sizeof(struct loader_instance)); |
Jon Ashburn | f9af1d3 | 2016-01-25 14:51:47 -0700 | [diff] [blame] | 289 | //} |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 290 | if (ptr_instance == NULL) { |
| 291 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 292 | } |
Courtney Goeltzenleuchter | 8109510 | 2015-07-06 09:08:37 -0600 | [diff] [blame] | 293 | |
Jon Ashburn | 87d6aa9 | 2015-08-28 15:19:27 -0600 | [diff] [blame] | 294 | tls_instance = ptr_instance; |
Courtney Goeltzenleuchter | 8109510 | 2015-07-06 09:08:37 -0600 | [diff] [blame] | 295 | loader_platform_thread_lock_mutex(&loader_lock); |
Jon Ashburn | b82c185 | 2015-08-11 14:49:54 -0600 | [diff] [blame] | 296 | memset(ptr_instance, 0, sizeof(struct loader_instance)); |
Jon Ashburn | f9af1d3 | 2016-01-25 14:51:47 -0700 | [diff] [blame] | 297 | #if 0 |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 298 | if (pAllocator) { |
| 299 | ptr_instance->alloc_callbacks = *pAllocator; |
Courtney Goeltzenleuchter | 7f5aafc | 2015-07-05 11:28:29 -0600 | [diff] [blame] | 300 | } |
Jon Ashburn | f9af1d3 | 2016-01-25 14:51:47 -0700 | [diff] [blame] | 301 | #endif |
Courtney Goeltzenleuchter | 7f5aafc | 2015-07-05 11:28:29 -0600 | [diff] [blame] | 302 | |
Courtney Goeltzenleuchter | 45cde5d | 2015-12-03 13:45:51 -0700 | [diff] [blame] | 303 | /* |
Ian Elliott | ad6300f | 2016-03-31 10:48:19 -0600 | [diff] [blame] | 304 | * Look for one or more debug report create info structures |
| 305 | * and setup a callback(s) for each one found. |
Courtney Goeltzenleuchter | 45cde5d | 2015-12-03 13:45:51 -0700 | [diff] [blame] | 306 | */ |
Ian Elliott | ad6300f | 2016-03-31 10:48:19 -0600 | [diff] [blame] | 307 | ptr_instance->num_tmp_callbacks = 0; |
| 308 | ptr_instance->tmp_dbg_create_infos = NULL; |
| 309 | ptr_instance->tmp_callbacks = NULL; |
| 310 | if (util_CopyDebugReportCreateInfos(pCreateInfo->pNext, |
| 311 | pAllocator, |
| 312 | &ptr_instance->num_tmp_callbacks, |
| 313 | &ptr_instance->tmp_dbg_create_infos, |
| 314 | &ptr_instance->tmp_callbacks)) { |
| 315 | // One or more were found, but allocation failed. Therefore, clean up |
| 316 | // and fail this function: |
| 317 | loader_heap_free(ptr_instance, ptr_instance); |
| 318 | loader_platform_thread_unlock_mutex(&loader_lock); |
| 319 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 320 | } else if (ptr_instance->num_tmp_callbacks > 0) { |
| 321 | // Setup the temporary callback(s) here to catch early issues: |
| 322 | if (util_CreateDebugReportCallbacks(ptr_instance, |
| 323 | pAllocator, |
| 324 | ptr_instance->num_tmp_callbacks, |
| 325 | ptr_instance->tmp_dbg_create_infos, |
| 326 | ptr_instance->tmp_callbacks)) { |
| 327 | // Failure of setting up one or more of the callback. Therefore, |
| 328 | // clean up and fail this function: |
| 329 | util_FreeDebugReportCreateInfos(pAllocator, |
| 330 | ptr_instance->tmp_dbg_create_infos, |
| 331 | ptr_instance->tmp_callbacks); |
| 332 | loader_heap_free(ptr_instance, ptr_instance); |
| 333 | loader_platform_thread_unlock_mutex(&loader_lock); |
| 334 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
Courtney Goeltzenleuchter | 8288727 | 2015-12-02 15:29:33 -0700 | [diff] [blame] | 335 | } |
| 336 | } |
| 337 | |
Jon Ashburn | 3d00233 | 2015-08-20 16:35:30 -0600 | [diff] [blame] | 338 | /* Due to implicit layers need to get layer list even if |
Jon Ashburn | f19916e | 2016-01-11 13:12:43 -0700 | [diff] [blame] | 339 | * enabledLayerCount == 0 and VK_INSTANCE_LAYERS is unset. For now always |
Jon Ashburn | 3d00233 | 2015-08-20 16:35:30 -0600 | [diff] [blame] | 340 | * get layer list (both instance and device) via loader_layer_scan(). */ |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 341 | memset(&ptr_instance->instance_layer_list, 0, |
| 342 | sizeof(ptr_instance->instance_layer_list)); |
| 343 | memset(&ptr_instance->device_layer_list, 0, |
| 344 | sizeof(ptr_instance->device_layer_list)); |
| 345 | loader_layer_scan(ptr_instance, &ptr_instance->instance_layer_list, |
Jon Ashburn | e39a4f8 | 2015-08-28 13:38:21 -0600 | [diff] [blame] | 346 | &ptr_instance->device_layer_list); |
Jon Ashburn | 3d00233 | 2015-08-20 16:35:30 -0600 | [diff] [blame] | 347 | |
| 348 | /* validate the app requested layers to be enabled */ |
Jon Ashburn | f19916e | 2016-01-11 13:12:43 -0700 | [diff] [blame] | 349 | if (pCreateInfo->enabledLayerCount > 0) { |
Jon Ashburn | f2b4e38 | 2016-02-10 20:50:19 -0700 | [diff] [blame] | 350 | res = |
| 351 | loader_validate_layers(ptr_instance, pCreateInfo->enabledLayerCount, |
| 352 | pCreateInfo->ppEnabledLayerNames, |
| 353 | &ptr_instance->instance_layer_list); |
Jon Ashburn | 3d00233 | 2015-08-20 16:35:30 -0600 | [diff] [blame] | 354 | if (res != VK_SUCCESS) { |
Ian Elliott | ad6300f | 2016-03-31 10:48:19 -0600 | [diff] [blame] | 355 | util_DestroyDebugReportCallbacks(ptr_instance, |
| 356 | pAllocator, |
| 357 | ptr_instance->num_tmp_callbacks, |
| 358 | ptr_instance->tmp_callbacks); |
| 359 | util_FreeDebugReportCreateInfos(pAllocator, |
| 360 | ptr_instance->tmp_dbg_create_infos, |
| 361 | ptr_instance->tmp_callbacks); |
Courtney Goeltzenleuchter | 45cde5d | 2015-12-03 13:45:51 -0700 | [diff] [blame] | 362 | loader_heap_free(ptr_instance, ptr_instance); |
Jon Ashburn | 1ff1759 | 2015-10-09 09:40:30 -0600 | [diff] [blame] | 363 | loader_platform_thread_unlock_mutex(&loader_lock); |
Jon Ashburn | 3d00233 | 2015-08-20 16:35:30 -0600 | [diff] [blame] | 364 | return res; |
| 365 | } |
| 366 | } |
| 367 | |
Jon Ashburn | 86a527a | 2016-02-10 20:59:26 -0700 | [diff] [blame] | 368 | /* convert any meta layers to the actual layers makes a copy of layer name*/ |
Chris Forbes | bd9de05 | 2016-04-06 20:49:02 +1200 | [diff] [blame] | 369 | VkInstanceCreateInfo ici = *pCreateInfo; |
Jon Ashburn | 86a527a | 2016-02-10 20:59:26 -0700 | [diff] [blame] | 370 | loader_expand_layer_names( |
| 371 | ptr_instance, std_validation_str, |
| 372 | sizeof(std_validation_names) / sizeof(std_validation_names[0]), |
Chris Forbes | bd9de05 | 2016-04-06 20:49:02 +1200 | [diff] [blame] | 373 | std_validation_names, &ici.enabledLayerCount, |
| 374 | &ici.ppEnabledLayerNames); |
Jon Ashburn | 86a527a | 2016-02-10 20:59:26 -0700 | [diff] [blame] | 375 | |
Jon Ashburn | 8810c5f | 2015-08-18 18:04:47 -0600 | [diff] [blame] | 376 | /* Scan/discover all ICD libraries */ |
| 377 | memset(&ptr_instance->icd_libs, 0, sizeof(ptr_instance->icd_libs)); |
Jon Ashburn | e39a4f8 | 2015-08-28 13:38:21 -0600 | [diff] [blame] | 378 | loader_icd_scan(ptr_instance, &ptr_instance->icd_libs); |
Jon Ashburn | 8810c5f | 2015-08-18 18:04:47 -0600 | [diff] [blame] | 379 | |
Jon Ashburn | eacfa3a | 2015-08-14 12:51:47 -0600 | [diff] [blame] | 380 | /* get extensions from all ICD's, merge so no duplicates, then validate */ |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 381 | loader_get_icd_loader_instance_extensions( |
| 382 | ptr_instance, &ptr_instance->icd_libs, &ptr_instance->ext_list); |
| 383 | res = loader_validate_instance_extensions( |
Jon Ashburn | f2b4e38 | 2016-02-10 20:50:19 -0700 | [diff] [blame] | 384 | ptr_instance, &ptr_instance->ext_list, |
Chris Forbes | bd9de05 | 2016-04-06 20:49:02 +1200 | [diff] [blame] | 385 | &ptr_instance->instance_layer_list, &ici); |
Jon Ashburn | eacfa3a | 2015-08-14 12:51:47 -0600 | [diff] [blame] | 386 | if (res != VK_SUCCESS) { |
Chris Forbes | bd9de05 | 2016-04-06 20:49:02 +1200 | [diff] [blame] | 387 | loader_delete_shadow_inst_layer_names(ptr_instance, pCreateInfo, &ici); |
Jon Ashburn | e39a4f8 | 2015-08-28 13:38:21 -0600 | [diff] [blame] | 388 | loader_delete_layer_properties(ptr_instance, |
| 389 | &ptr_instance->device_layer_list); |
| 390 | loader_delete_layer_properties(ptr_instance, |
| 391 | &ptr_instance->instance_layer_list); |
| 392 | loader_scanned_icd_clear(ptr_instance, &ptr_instance->icd_libs); |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 393 | loader_destroy_generic_list( |
| 394 | ptr_instance, |
| 395 | (struct loader_generic_list *)&ptr_instance->ext_list); |
Ian Elliott | ad6300f | 2016-03-31 10:48:19 -0600 | [diff] [blame] | 396 | util_DestroyDebugReportCallbacks(ptr_instance, |
| 397 | pAllocator, |
| 398 | ptr_instance->num_tmp_callbacks, |
| 399 | ptr_instance->tmp_callbacks); |
| 400 | util_FreeDebugReportCreateInfos(pAllocator, |
| 401 | ptr_instance->tmp_dbg_create_infos, |
| 402 | ptr_instance->tmp_callbacks); |
Jon Ashburn | eacfa3a | 2015-08-14 12:51:47 -0600 | [diff] [blame] | 403 | loader_platform_thread_unlock_mutex(&loader_lock); |
| 404 | loader_heap_free(ptr_instance, ptr_instance); |
| 405 | return res; |
| 406 | } |
| 407 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 408 | ptr_instance->disp = |
| 409 | loader_heap_alloc(ptr_instance, sizeof(VkLayerInstanceDispatchTable), |
| 410 | VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); |
Courtney Goeltzenleuchter | 8109510 | 2015-07-06 09:08:37 -0600 | [diff] [blame] | 411 | if (ptr_instance->disp == NULL) { |
Chris Forbes | bd9de05 | 2016-04-06 20:49:02 +1200 | [diff] [blame] | 412 | loader_delete_shadow_inst_layer_names(ptr_instance, pCreateInfo, &ici); |
Jon Ashburn | e39a4f8 | 2015-08-28 13:38:21 -0600 | [diff] [blame] | 413 | loader_delete_layer_properties(ptr_instance, |
| 414 | &ptr_instance->device_layer_list); |
| 415 | loader_delete_layer_properties(ptr_instance, |
| 416 | &ptr_instance->instance_layer_list); |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 417 | loader_scanned_icd_clear(ptr_instance, &ptr_instance->icd_libs); |
| 418 | loader_destroy_generic_list( |
| 419 | ptr_instance, |
| 420 | (struct loader_generic_list *)&ptr_instance->ext_list); |
Ian Elliott | ad6300f | 2016-03-31 10:48:19 -0600 | [diff] [blame] | 421 | util_DestroyDebugReportCallbacks(ptr_instance, |
| 422 | pAllocator, |
| 423 | ptr_instance->num_tmp_callbacks, |
| 424 | ptr_instance->tmp_callbacks); |
| 425 | util_FreeDebugReportCreateInfos(pAllocator, |
| 426 | ptr_instance->tmp_dbg_create_infos, |
| 427 | ptr_instance->tmp_callbacks); |
Courtney Goeltzenleuchter | 8109510 | 2015-07-06 09:08:37 -0600 | [diff] [blame] | 428 | loader_platform_thread_unlock_mutex(&loader_lock); |
Jon Ashburn | eacfa3a | 2015-08-14 12:51:47 -0600 | [diff] [blame] | 429 | loader_heap_free(ptr_instance, ptr_instance); |
Courtney Goeltzenleuchter | 8109510 | 2015-07-06 09:08:37 -0600 | [diff] [blame] | 430 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 431 | } |
| 432 | memcpy(ptr_instance->disp, &instance_disp, sizeof(instance_disp)); |
| 433 | ptr_instance->next = loader.instances; |
| 434 | loader.instances = ptr_instance; |
| 435 | |
Jon Ashburn | b82c185 | 2015-08-11 14:49:54 -0600 | [diff] [blame] | 436 | /* activate any layers on instance chain */ |
Chris Forbes | bd9de05 | 2016-04-06 20:49:02 +1200 | [diff] [blame] | 437 | res = loader_enable_instance_layers(ptr_instance, &ici, |
Jon Ashburn | e39a4f8 | 2015-08-28 13:38:21 -0600 | [diff] [blame] | 438 | &ptr_instance->instance_layer_list); |
Courtney Goeltzenleuchter | 8109510 | 2015-07-06 09:08:37 -0600 | [diff] [blame] | 439 | if (res != VK_SUCCESS) { |
Chris Forbes | bd9de05 | 2016-04-06 20:49:02 +1200 | [diff] [blame] | 440 | loader_delete_shadow_inst_layer_names(ptr_instance, pCreateInfo, &ici); |
Jon Ashburn | e39a4f8 | 2015-08-28 13:38:21 -0600 | [diff] [blame] | 441 | loader_delete_layer_properties(ptr_instance, |
| 442 | &ptr_instance->device_layer_list); |
| 443 | loader_delete_layer_properties(ptr_instance, |
| 444 | &ptr_instance->instance_layer_list); |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 445 | loader_scanned_icd_clear(ptr_instance, &ptr_instance->icd_libs); |
| 446 | loader_destroy_generic_list( |
| 447 | ptr_instance, |
| 448 | (struct loader_generic_list *)&ptr_instance->ext_list); |
Jon Ashburn | eacfa3a | 2015-08-14 12:51:47 -0600 | [diff] [blame] | 449 | loader.instances = ptr_instance->next; |
Ian Elliott | ad6300f | 2016-03-31 10:48:19 -0600 | [diff] [blame] | 450 | util_DestroyDebugReportCallbacks(ptr_instance, |
| 451 | pAllocator, |
| 452 | ptr_instance->num_tmp_callbacks, |
| 453 | ptr_instance->tmp_callbacks); |
| 454 | util_FreeDebugReportCreateInfos(pAllocator, |
| 455 | ptr_instance->tmp_dbg_create_infos, |
| 456 | ptr_instance->tmp_callbacks); |
Jon Ashburn | eacfa3a | 2015-08-14 12:51:47 -0600 | [diff] [blame] | 457 | loader_platform_thread_unlock_mutex(&loader_lock); |
Courtney Goeltzenleuchter | 8109510 | 2015-07-06 09:08:37 -0600 | [diff] [blame] | 458 | loader_heap_free(ptr_instance, ptr_instance->disp); |
| 459 | loader_heap_free(ptr_instance, ptr_instance); |
| 460 | return res; |
| 461 | } |
Jon Ashburn | 07daee7 | 2015-05-21 18:13:33 -0600 | [diff] [blame] | 462 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 463 | created_instance = (VkInstance)ptr_instance; |
Chris Forbes | bd9de05 | 2016-04-06 20:49:02 +1200 | [diff] [blame] | 464 | res = loader_create_instance_chain(&ici, pAllocator, ptr_instance, |
Jon Ashburn | 6e0a213 | 2016-02-03 12:37:30 -0700 | [diff] [blame] | 465 | &created_instance); |
Jon Ashburn | eed0c00 | 2015-05-21 17:42:17 -0600 | [diff] [blame] | 466 | |
Jon Ashburn | e46cf7c | 2016-01-14 13:51:55 -0700 | [diff] [blame] | 467 | if (res == VK_SUCCESS) { |
Chris Forbes | bd9de05 | 2016-04-06 20:49:02 +1200 | [diff] [blame] | 468 | wsi_create_instance(ptr_instance, &ici); |
| 469 | debug_report_create_instance(ptr_instance, &ici); |
Courtney Goeltzenleuchter | 00150eb | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 470 | |
Jon Ashburn | e5b9bba | 2016-01-18 12:20:03 -0700 | [diff] [blame] | 471 | *pInstance = created_instance; |
Courtney Goeltzenleuchter | 00150eb | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 472 | |
Jon Ashburn | e46cf7c | 2016-01-14 13:51:55 -0700 | [diff] [blame] | 473 | /* |
| 474 | * Finally have the layers in place and everyone has seen |
| 475 | * the CreateInstance command go by. This allows the layer's |
| 476 | * GetInstanceProcAddr functions to return valid extension functions |
| 477 | * if enabled. |
| 478 | */ |
| 479 | loader_activate_instance_layer_extensions(ptr_instance, *pInstance); |
Courtney Goeltzenleuchter | 00150eb | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 480 | } else { |
| 481 | // TODO: cleanup here. |
Jon Ashburn | e46cf7c | 2016-01-14 13:51:55 -0700 | [diff] [blame] | 482 | } |
Courtney Goeltzenleuchter | 00150eb | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 483 | |
Courtney Goeltzenleuchter | 45cde5d | 2015-12-03 13:45:51 -0700 | [diff] [blame] | 484 | /* Remove temporary debug_report callback */ |
Ian Elliott | ad6300f | 2016-03-31 10:48:19 -0600 | [diff] [blame] | 485 | util_DestroyDebugReportCallbacks(ptr_instance, |
| 486 | pAllocator, |
| 487 | ptr_instance->num_tmp_callbacks, |
| 488 | ptr_instance->tmp_callbacks); |
Chris Forbes | bd9de05 | 2016-04-06 20:49:02 +1200 | [diff] [blame] | 489 | loader_delete_shadow_inst_layer_names(ptr_instance, pCreateInfo, &ici); |
Jon Ashburn | 6301a0f | 2015-05-29 13:15:39 -0600 | [diff] [blame] | 490 | loader_platform_thread_unlock_mutex(&loader_lock); |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 491 | return res; |
| 492 | } |
| 493 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 494 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 495 | vkDestroyInstance(VkInstance instance, |
| 496 | const VkAllocationCallbacks *pAllocator) { |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 497 | const VkLayerInstanceDispatchTable *disp; |
Jon Ashburn | e0e6457 | 2015-09-30 12:56:42 -0600 | [diff] [blame] | 498 | struct loader_instance *ptr_instance = NULL; |
Ian Elliott | 3b354cf | 2016-03-25 08:43:01 -0600 | [diff] [blame] | 499 | bool callback_setup = false; |
| 500 | |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 501 | disp = loader_get_instance_dispatch(instance); |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 502 | |
Jon Ashburn | 6301a0f | 2015-05-29 13:15:39 -0600 | [diff] [blame] | 503 | loader_platform_thread_lock_mutex(&loader_lock); |
| 504 | |
Jon Ashburn | e0e6457 | 2015-09-30 12:56:42 -0600 | [diff] [blame] | 505 | ptr_instance = loader_get_instance(instance); |
Ian Elliott | 3b354cf | 2016-03-25 08:43:01 -0600 | [diff] [blame] | 506 | |
Ian Elliott | ad6300f | 2016-03-31 10:48:19 -0600 | [diff] [blame] | 507 | if (ptr_instance->num_tmp_callbacks > 0) { |
| 508 | // Setup the temporary callback(s) here to catch cleanup issues: |
| 509 | if (!util_CreateDebugReportCallbacks(ptr_instance, |
| 510 | pAllocator, |
| 511 | ptr_instance->num_tmp_callbacks, |
| 512 | ptr_instance->tmp_dbg_create_infos, |
| 513 | ptr_instance->tmp_callbacks)) { |
Ian Elliott | 3b354cf | 2016-03-25 08:43:01 -0600 | [diff] [blame] | 514 | callback_setup = true; |
| 515 | } |
| 516 | } |
| 517 | |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 518 | disp->DestroyInstance(instance, pAllocator); |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 519 | |
Courtney Goeltzenleuchter | 7d0023c | 2015-06-08 15:09:22 -0600 | [diff] [blame] | 520 | loader_deactivate_instance_layers(ptr_instance); |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 521 | if (ptr_instance->phys_devs) |
| 522 | loader_heap_free(ptr_instance, ptr_instance->phys_devs); |
Ian Elliott | 3b354cf | 2016-03-25 08:43:01 -0600 | [diff] [blame] | 523 | if (callback_setup) { |
Ian Elliott | ad6300f | 2016-03-31 10:48:19 -0600 | [diff] [blame] | 524 | util_DestroyDebugReportCallbacks(ptr_instance, |
| 525 | pAllocator, |
| 526 | ptr_instance->num_tmp_callbacks, |
| 527 | ptr_instance->tmp_callbacks); |
| 528 | util_FreeDebugReportCreateInfos(pAllocator, |
| 529 | ptr_instance->tmp_dbg_create_infos, |
| 530 | ptr_instance->tmp_callbacks); |
Ian Elliott | 3b354cf | 2016-03-25 08:43:01 -0600 | [diff] [blame] | 531 | } |
Jon Ashburn | eacfa3a | 2015-08-14 12:51:47 -0600 | [diff] [blame] | 532 | loader_heap_free(ptr_instance, ptr_instance->disp); |
| 533 | loader_heap_free(ptr_instance, ptr_instance); |
Jon Ashburn | 6301a0f | 2015-05-29 13:15:39 -0600 | [diff] [blame] | 534 | loader_platform_thread_unlock_mutex(&loader_lock); |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 535 | } |
Jon Ashburn | 95a77ba | 2015-05-15 15:09:35 -0600 | [diff] [blame] | 536 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 537 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 538 | vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount, |
| 539 | VkPhysicalDevice *pPhysicalDevices) { |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 540 | const VkLayerInstanceDispatchTable *disp; |
Jon Ashburn | 6301a0f | 2015-05-29 13:15:39 -0600 | [diff] [blame] | 541 | VkResult res; |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 542 | uint32_t count, i; |
| 543 | struct loader_instance *inst; |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 544 | disp = loader_get_instance_dispatch(instance); |
Jon Ashburn | 6301a0f | 2015-05-29 13:15:39 -0600 | [diff] [blame] | 545 | |
| 546 | loader_platform_thread_lock_mutex(&loader_lock); |
| 547 | res = disp->EnumeratePhysicalDevices(instance, pPhysicalDeviceCount, |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 548 | pPhysicalDevices); |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 549 | |
| 550 | if (res != VK_SUCCESS && res != VK_INCOMPLETE) { |
| 551 | loader_platform_thread_unlock_mutex(&loader_lock); |
| 552 | return res; |
| 553 | } |
| 554 | |
| 555 | if (!pPhysicalDevices) { |
| 556 | loader_platform_thread_unlock_mutex(&loader_lock); |
| 557 | return res; |
| 558 | } |
| 559 | |
| 560 | // wrap the PhysDev object for loader usage, return wrapped objects |
| 561 | inst = loader_get_instance(instance); |
| 562 | if (!inst) { |
| 563 | loader_platform_thread_unlock_mutex(&loader_lock); |
| 564 | return VK_ERROR_INITIALIZATION_FAILED; |
| 565 | } |
Piers Daniell | 295fe40 | 2016-03-29 11:51:11 -0600 | [diff] [blame] | 566 | count = (inst->total_gpu_count < *pPhysicalDeviceCount) ? |
| 567 | inst->total_gpu_count : *pPhysicalDeviceCount; |
| 568 | *pPhysicalDeviceCount = count; |
Jeannot Breton | 32ad8d8 | 2016-04-12 15:46:20 -0500 | [diff] [blame^] | 569 | if (!inst->phys_devs) { |
| 570 | inst->phys_devs = (struct loader_physical_device_tramp *)loader_heap_alloc( |
| 571 | inst, inst->total_gpu_count * sizeof(struct loader_physical_device_tramp), |
| 572 | VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); |
| 573 | } |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 574 | if (!inst->phys_devs) { |
| 575 | loader_platform_thread_unlock_mutex(&loader_lock); |
| 576 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 577 | } |
| 578 | |
| 579 | for (i = 0; i < count; i++) { |
| 580 | |
| 581 | // initialize the loader's physicalDevice object |
| 582 | loader_set_dispatch((void *)&inst->phys_devs[i], inst->disp); |
Piers Daniell | 295fe40 | 2016-03-29 11:51:11 -0600 | [diff] [blame] | 583 | inst->phys_devs[i].this_instance = inst; |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 584 | inst->phys_devs[i].phys_dev = pPhysicalDevices[i]; |
| 585 | |
| 586 | // copy wrapped object into Application provided array |
| 587 | pPhysicalDevices[i] = (VkPhysicalDevice)&inst->phys_devs[i]; |
| 588 | } |
Jon Ashburn | 6301a0f | 2015-05-29 13:15:39 -0600 | [diff] [blame] | 589 | loader_platform_thread_unlock_mutex(&loader_lock); |
| 590 | return res; |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 591 | } |
| 592 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 593 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 594 | vkGetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 595 | VkPhysicalDeviceFeatures *pFeatures) { |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 596 | const VkLayerInstanceDispatchTable *disp; |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 597 | VkPhysicalDevice unwrapped_phys_dev = |
| 598 | loader_unwrap_physical_device(physicalDevice); |
| 599 | disp = loader_get_instance_dispatch(physicalDevice); |
| 600 | disp->GetPhysicalDeviceFeatures(unwrapped_phys_dev, pFeatures); |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 601 | } |
| 602 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 603 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 604 | vkGetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, |
| 605 | VkFormat format, |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 606 | VkFormatProperties *pFormatInfo) { |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 607 | const VkLayerInstanceDispatchTable *disp; |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 608 | VkPhysicalDevice unwrapped_pd = |
| 609 | loader_unwrap_physical_device(physicalDevice); |
| 610 | disp = loader_get_instance_dispatch(physicalDevice); |
| 611 | disp->GetPhysicalDeviceFormatProperties(unwrapped_pd, format, pFormatInfo); |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 612 | } |
| 613 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 614 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 615 | vkGetPhysicalDeviceImageFormatProperties( |
| 616 | VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, |
| 617 | VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, |
| 618 | VkImageFormatProperties *pImageFormatProperties) { |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 619 | const VkLayerInstanceDispatchTable *disp; |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 620 | VkPhysicalDevice unwrapped_phys_dev = |
| 621 | loader_unwrap_physical_device(physicalDevice); |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 622 | disp = loader_get_instance_dispatch(physicalDevice); |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 623 | return disp->GetPhysicalDeviceImageFormatProperties( |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 624 | unwrapped_phys_dev, format, type, tiling, usage, flags, |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 625 | pImageFormatProperties); |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 626 | } |
| 627 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 628 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 629 | vkGetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 630 | VkPhysicalDeviceProperties *pProperties) { |
Jon Ashburn | 95a77ba | 2015-05-15 15:09:35 -0600 | [diff] [blame] | 631 | const VkLayerInstanceDispatchTable *disp; |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 632 | VkPhysicalDevice unwrapped_phys_dev = |
| 633 | loader_unwrap_physical_device(physicalDevice); |
| 634 | disp = loader_get_instance_dispatch(physicalDevice); |
| 635 | disp->GetPhysicalDeviceProperties(unwrapped_phys_dev, pProperties); |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 636 | } |
| 637 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 638 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 639 | vkGetPhysicalDeviceQueueFamilyProperties( |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 640 | VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 641 | VkQueueFamilyProperties *pQueueProperties) { |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 642 | const VkLayerInstanceDispatchTable *disp; |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 643 | VkPhysicalDevice unwrapped_phys_dev = |
| 644 | loader_unwrap_physical_device(physicalDevice); |
| 645 | disp = loader_get_instance_dispatch(physicalDevice); |
| 646 | disp->GetPhysicalDeviceQueueFamilyProperties( |
| 647 | unwrapped_phys_dev, pQueueFamilyPropertyCount, pQueueProperties); |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 648 | } |
| 649 | |
Chia-I Wu | 9ab6150 | 2015-11-06 06:42:02 +0800 | [diff] [blame] | 650 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties( |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 651 | VkPhysicalDevice physicalDevice, |
| 652 | VkPhysicalDeviceMemoryProperties *pMemoryProperties) { |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 653 | const VkLayerInstanceDispatchTable *disp; |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 654 | VkPhysicalDevice unwrapped_phys_dev = |
| 655 | loader_unwrap_physical_device(physicalDevice); |
| 656 | disp = loader_get_instance_dispatch(physicalDevice); |
| 657 | disp->GetPhysicalDeviceMemoryProperties(unwrapped_phys_dev, |
| 658 | pMemoryProperties); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 659 | } |
| 660 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 661 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 662 | vkCreateDevice(VkPhysicalDevice physicalDevice, |
| 663 | const VkDeviceCreateInfo *pCreateInfo, |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 664 | const VkAllocationCallbacks *pAllocator, VkDevice *pDevice) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 665 | VkResult res; |
Jon Ashburn | 787eb25 | 2016-03-24 15:49:57 -0600 | [diff] [blame] | 666 | struct loader_physical_device_tramp *phys_dev; |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 667 | struct loader_device *dev; |
| 668 | struct loader_instance *inst; |
| 669 | struct loader_layer_list activated_layer_list = {0}; |
| 670 | |
| 671 | assert(pCreateInfo->queueCreateInfoCount >= 1); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 672 | |
Jon Ashburn | 6301a0f | 2015-05-29 13:15:39 -0600 | [diff] [blame] | 673 | loader_platform_thread_lock_mutex(&loader_lock); |
Courtney Goeltzenleuchter | ca173b8 | 2015-06-25 18:01:43 -0600 | [diff] [blame] | 674 | |
Jon Ashburn | 787eb25 | 2016-03-24 15:49:57 -0600 | [diff] [blame] | 675 | phys_dev = (struct loader_physical_device_tramp *)physicalDevice; |
Piers Daniell | 295fe40 | 2016-03-29 11:51:11 -0600 | [diff] [blame] | 676 | inst = (struct loader_instance *)phys_dev->this_instance; |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 677 | |
| 678 | /* validate any app enabled layers are available */ |
| 679 | if (pCreateInfo->enabledLayerCount > 0) { |
| 680 | res = loader_validate_layers(inst, pCreateInfo->enabledLayerCount, |
| 681 | pCreateInfo->ppEnabledLayerNames, |
| 682 | &inst->device_layer_list); |
| 683 | if (res != VK_SUCCESS) { |
| 684 | loader_platform_thread_unlock_mutex(&loader_lock); |
| 685 | return res; |
| 686 | } |
| 687 | } |
| 688 | |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 689 | /* Get the physical device (ICD) extensions */ |
| 690 | struct loader_extension_list icd_exts; |
| 691 | if (!loader_init_generic_list(inst, (struct loader_generic_list *)&icd_exts, |
| 692 | sizeof(VkExtensionProperties))) { |
| 693 | loader_platform_thread_unlock_mutex(&loader_lock); |
| 694 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 695 | } |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 696 | |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 697 | res = loader_add_device_extensions( |
Piers Daniell | 295fe40 | 2016-03-29 11:51:11 -0600 | [diff] [blame] | 698 | inst, inst->disp->EnumerateDeviceExtensionProperties, phys_dev->phys_dev, |
| 699 | "Unknown", &icd_exts); |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 700 | if (res != VK_SUCCESS) { |
| 701 | loader_platform_thread_unlock_mutex(&loader_lock); |
| 702 | return res; |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 703 | } |
| 704 | |
| 705 | /* convert any meta layers to the actual layers makes a copy of layer name*/ |
Chris Forbes | bd9de05 | 2016-04-06 20:49:02 +1200 | [diff] [blame] | 706 | VkDeviceCreateInfo dci = *pCreateInfo; |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 707 | loader_expand_layer_names( |
| 708 | inst, std_validation_str, |
| 709 | sizeof(std_validation_names) / sizeof(std_validation_names[0]), |
Chris Forbes | bd9de05 | 2016-04-06 20:49:02 +1200 | [diff] [blame] | 710 | std_validation_names, &dci.enabledLayerCount, |
| 711 | &dci.ppEnabledLayerNames); |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 712 | |
| 713 | /* fetch a list of all layers activated, explicit and implicit */ |
Piers Daniell | 295fe40 | 2016-03-29 11:51:11 -0600 | [diff] [blame] | 714 | res = loader_enable_device_layers(inst, &activated_layer_list, |
Chris Forbes | bd9de05 | 2016-04-06 20:49:02 +1200 | [diff] [blame] | 715 | &dci, &inst->device_layer_list); |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 716 | if (res != VK_SUCCESS) { |
Chris Forbes | bd9de05 | 2016-04-06 20:49:02 +1200 | [diff] [blame] | 717 | loader_delete_shadow_dev_layer_names(inst, pCreateInfo, &dci); |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 718 | loader_platform_thread_unlock_mutex(&loader_lock); |
| 719 | return res; |
| 720 | } |
| 721 | |
| 722 | /* make sure requested extensions to be enabled are supported */ |
| 723 | res = loader_validate_device_extensions(phys_dev, &activated_layer_list, |
Chris Forbes | bd9de05 | 2016-04-06 20:49:02 +1200 | [diff] [blame] | 724 | &icd_exts, &dci); |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 725 | if (res != VK_SUCCESS) { |
Chris Forbes | bd9de05 | 2016-04-06 20:49:02 +1200 | [diff] [blame] | 726 | loader_delete_shadow_dev_layer_names(inst, pCreateInfo, &dci); |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 727 | loader_destroy_generic_list( |
| 728 | inst, (struct loader_generic_list *)&activated_layer_list); |
| 729 | loader_platform_thread_unlock_mutex(&loader_lock); |
| 730 | return res; |
| 731 | } |
| 732 | |
Piers Daniell | 295fe40 | 2016-03-29 11:51:11 -0600 | [diff] [blame] | 733 | dev = loader_create_logical_device(inst); |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 734 | if (dev == NULL) { |
Chris Forbes | bd9de05 | 2016-04-06 20:49:02 +1200 | [diff] [blame] | 735 | loader_delete_shadow_dev_layer_names(inst, pCreateInfo, &dci); |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 736 | loader_destroy_generic_list( |
| 737 | inst, (struct loader_generic_list *)&activated_layer_list); |
| 738 | loader_platform_thread_unlock_mutex(&loader_lock); |
| 739 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 740 | } |
| 741 | |
| 742 | /* move the locally filled layer list into the device, and pass ownership of |
| 743 | * the memory */ |
| 744 | dev->activated_layer_list.capacity = activated_layer_list.capacity; |
| 745 | dev->activated_layer_list.count = activated_layer_list.count; |
| 746 | dev->activated_layer_list.list = activated_layer_list.list; |
| 747 | memset(&activated_layer_list, 0, sizeof(activated_layer_list)); |
| 748 | |
| 749 | /* activate any layers on device chain which terminates with device*/ |
Piers Daniell | 295fe40 | 2016-03-29 11:51:11 -0600 | [diff] [blame] | 750 | res = loader_enable_device_layers(inst, &dev->activated_layer_list, |
Chris Forbes | bd9de05 | 2016-04-06 20:49:02 +1200 | [diff] [blame] | 751 | &dci, &inst->device_layer_list); |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 752 | if (res != VK_SUCCESS) { |
Chris Forbes | bd9de05 | 2016-04-06 20:49:02 +1200 | [diff] [blame] | 753 | loader_delete_shadow_dev_layer_names(inst, pCreateInfo, &dci); |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 754 | loader_platform_thread_unlock_mutex(&loader_lock); |
| 755 | return res; |
| 756 | } |
| 757 | |
Chris Forbes | bd9de05 | 2016-04-06 20:49:02 +1200 | [diff] [blame] | 758 | res = loader_create_device_chain(phys_dev, &dci, pAllocator, inst, |
Piers Daniell | 295fe40 | 2016-03-29 11:51:11 -0600 | [diff] [blame] | 759 | dev); |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 760 | if (res != VK_SUCCESS) { |
Chris Forbes | bd9de05 | 2016-04-06 20:49:02 +1200 | [diff] [blame] | 761 | loader_delete_shadow_dev_layer_names(inst, pCreateInfo, &dci); |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 762 | loader_platform_thread_unlock_mutex(&loader_lock); |
| 763 | return res; |
| 764 | } |
| 765 | |
| 766 | *pDevice = dev->device; |
| 767 | |
| 768 | /* initialize any device extension dispatch entry's from the instance list*/ |
| 769 | loader_init_dispatch_dev_ext(inst, dev); |
| 770 | |
| 771 | /* initialize WSI device extensions as part of core dispatch since loader |
| 772 | * has |
| 773 | * dedicated trampoline code for these*/ |
| 774 | loader_init_device_extension_dispatch_table( |
| 775 | &dev->loader_dispatch, |
| 776 | dev->loader_dispatch.core_dispatch.GetDeviceProcAddr, *pDevice); |
| 777 | |
Chris Forbes | bd9de05 | 2016-04-06 20:49:02 +1200 | [diff] [blame] | 778 | loader_delete_shadow_dev_layer_names(inst, pCreateInfo, &dci); |
Courtney Goeltzenleuchter | ca173b8 | 2015-06-25 18:01:43 -0600 | [diff] [blame] | 779 | |
Jon Ashburn | 6301a0f | 2015-05-29 13:15:39 -0600 | [diff] [blame] | 780 | loader_platform_thread_unlock_mutex(&loader_lock); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 781 | return res; |
| 782 | } |
| 783 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 784 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 785 | vkDestroyDevice(VkDevice device, const VkAllocationCallbacks *pAllocator) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 786 | const VkLayerDispatchTable *disp; |
Jon Ashburn | e39a4f8 | 2015-08-28 13:38:21 -0600 | [diff] [blame] | 787 | struct loader_device *dev; |
Andrzej Kotlowski | b168b1a | 2016-02-03 09:41:53 +0100 | [diff] [blame] | 788 | |
| 789 | loader_platform_thread_lock_mutex(&loader_lock); |
| 790 | |
Jon Ashburn | e39a4f8 | 2015-08-28 13:38:21 -0600 | [diff] [blame] | 791 | struct loader_icd *icd = loader_get_icd_and_device(device, &dev); |
| 792 | const struct loader_instance *inst = icd->this_instance; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 793 | disp = loader_get_dispatch(device); |
| 794 | |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 795 | disp->DestroyDevice(device, pAllocator); |
Jon Ashburn | 781a7ae | 2015-11-19 15:43:26 -0700 | [diff] [blame] | 796 | dev->device = NULL; |
| 797 | loader_remove_logical_device(inst, icd, dev); |
| 798 | |
Jon Ashburn | 6301a0f | 2015-05-29 13:15:39 -0600 | [diff] [blame] | 799 | loader_platform_thread_unlock_mutex(&loader_lock); |
Jon Ashburn | 6301a0f | 2015-05-29 13:15:39 -0600 | [diff] [blame] | 800 | } |
| 801 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 802 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 803 | vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, |
| 804 | const char *pLayerName, |
| 805 | uint32_t *pPropertyCount, |
| 806 | VkExtensionProperties *pProperties) { |
Jon Ashburn | dc5d920 | 2016-02-29 13:00:51 -0700 | [diff] [blame] | 807 | VkResult res = VK_SUCCESS; |
Jon Ashburn | 787eb25 | 2016-03-24 15:49:57 -0600 | [diff] [blame] | 808 | struct loader_physical_device_tramp *phys_dev; |
| 809 | phys_dev = (struct loader_physical_device_tramp *)physicalDevice; |
Jon Ashburn | 6301a0f | 2015-05-29 13:15:39 -0600 | [diff] [blame] | 810 | |
Courtney Goeltzenleuchter | 110fdf9 | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 811 | loader_platform_thread_lock_mutex(&loader_lock); |
Jon Ashburn | 00eb6c0 | 2015-11-02 17:40:01 -0700 | [diff] [blame] | 812 | |
| 813 | /* If pLayerName == NULL, then querying ICD extensions, pass this call |
| 814 | down the instance chain which will terminate in the ICD. This allows |
| 815 | layers to filter the extensions coming back up the chain. |
| 816 | If pLayerName != NULL then get layer extensions from manifest file. */ |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 817 | if (pLayerName == NULL || strlen(pLayerName) == 0) { |
Jon Ashburn | 00eb6c0 | 2015-11-02 17:40:01 -0700 | [diff] [blame] | 818 | const VkLayerInstanceDispatchTable *disp; |
| 819 | |
| 820 | disp = loader_get_instance_dispatch(physicalDevice); |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 821 | res = disp->EnumerateDeviceExtensionProperties( |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 822 | phys_dev->phys_dev, NULL, pPropertyCount, pProperties); |
Jon Ashburn | 00eb6c0 | 2015-11-02 17:40:01 -0700 | [diff] [blame] | 823 | } else { |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 824 | |
Jon Ashburn | dc5d920 | 2016-02-29 13:00:51 -0700 | [diff] [blame] | 825 | uint32_t count; |
| 826 | uint32_t copy_size; |
Piers Daniell | 295fe40 | 2016-03-29 11:51:11 -0600 | [diff] [blame] | 827 | const struct loader_instance *inst = phys_dev->this_instance; |
Jon Ashburn | b872696 | 2016-04-08 15:03:35 -0600 | [diff] [blame] | 828 | struct loader_device_extension_list *dev_ext_list = NULL; |
| 829 | struct loader_device_extension_list local_ext_list; |
| 830 | memset(&local_ext_list, 0, sizeof(local_ext_list)); |
Jon Ashburn | dc5d920 | 2016-02-29 13:00:51 -0700 | [diff] [blame] | 831 | if (vk_string_validate(MaxLoaderStringLength, pLayerName) == |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 832 | VK_STRING_ERROR_NONE) { |
Jon Ashburn | b872696 | 2016-04-08 15:03:35 -0600 | [diff] [blame] | 833 | if (strcmp(pLayerName, std_validation_str) == 0) { |
| 834 | struct loader_layer_list local_list; |
| 835 | memset(&local_list, 0, sizeof(local_list)); |
| 836 | for (uint32_t i = 0; i < sizeof(std_validation_names) / |
| 837 | sizeof(std_validation_names[0]); |
| 838 | i++) { |
| 839 | loader_find_layer_name_add_list(NULL, std_validation_names[i], |
| 840 | VK_LAYER_TYPE_DEVICE_EXPLICIT, |
| 841 | &inst->device_layer_list, &local_list); |
| 842 | } |
| 843 | for (uint32_t i = 0; i < local_list.count; i++) { |
| 844 | struct loader_device_extension_list *ext_list = |
| 845 | &local_list.list[i].device_extension_list; |
| 846 | for (uint32_t j = 0; j < ext_list->count; j++) { |
| 847 | loader_add_to_dev_ext_list(NULL, &local_ext_list, |
| 848 | &ext_list->list[j].props, 0, |
| 849 | NULL); |
| 850 | } |
| 851 | } |
| 852 | dev_ext_list = &local_ext_list; |
Jon Ashburn | dc5d920 | 2016-02-29 13:00:51 -0700 | [diff] [blame] | 853 | |
Jon Ashburn | b872696 | 2016-04-08 15:03:35 -0600 | [diff] [blame] | 854 | } else { |
| 855 | for (uint32_t i = 0; i < inst->device_layer_list.count; i++) { |
| 856 | struct loader_layer_properties *props = |
| 857 | &inst->device_layer_list.list[i]; |
| 858 | if (strcmp(props->info.layerName, pLayerName) == 0) { |
| 859 | dev_ext_list = &props->device_extension_list; |
| 860 | } |
Jon Ashburn | dc5d920 | 2016-02-29 13:00:51 -0700 | [diff] [blame] | 861 | } |
| 862 | } |
Jon Ashburn | b872696 | 2016-04-08 15:03:35 -0600 | [diff] [blame] | 863 | |
Jon Ashburn | dc5d920 | 2016-02-29 13:00:51 -0700 | [diff] [blame] | 864 | count = (dev_ext_list == NULL) ? 0 : dev_ext_list->count; |
| 865 | if (pProperties == NULL) { |
| 866 | *pPropertyCount = count; |
Jon Ashburn | b872696 | 2016-04-08 15:03:35 -0600 | [diff] [blame] | 867 | loader_destroy_generic_list(inst, |
| 868 | (struct loader_generic_list *) &local_ext_list); |
Jon Ashburn | dc5d920 | 2016-02-29 13:00:51 -0700 | [diff] [blame] | 869 | loader_platform_thread_unlock_mutex(&loader_lock); |
| 870 | return VK_SUCCESS; |
| 871 | } |
| 872 | |
| 873 | copy_size = *pPropertyCount < count ? *pPropertyCount : count; |
| 874 | for (uint32_t i = 0; i < copy_size; i++) { |
| 875 | memcpy(&pProperties[i], &dev_ext_list->list[i].props, |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 876 | sizeof(VkExtensionProperties)); |
Jon Ashburn | dc5d920 | 2016-02-29 13:00:51 -0700 | [diff] [blame] | 877 | } |
| 878 | *pPropertyCount = copy_size; |
| 879 | |
Jon Ashburn | b872696 | 2016-04-08 15:03:35 -0600 | [diff] [blame] | 880 | loader_destroy_generic_list(inst, |
| 881 | (struct loader_generic_list *) &local_ext_list); |
Jon Ashburn | dc5d920 | 2016-02-29 13:00:51 -0700 | [diff] [blame] | 882 | if (copy_size < count) { |
| 883 | loader_platform_thread_unlock_mutex(&loader_lock); |
| 884 | return VK_INCOMPLETE; |
| 885 | } |
| 886 | } else { |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 887 | loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, |
| 888 | "vkEnumerateDeviceExtensionProperties: pLayerName " |
| 889 | "is too long or is badly formed"); |
| 890 | loader_platform_thread_unlock_mutex(&loader_lock); |
Jon Ashburn | dc5d920 | 2016-02-29 13:00:51 -0700 | [diff] [blame] | 891 | return VK_ERROR_EXTENSION_NOT_PRESENT; |
| 892 | } |
Jon Ashburn | 00eb6c0 | 2015-11-02 17:40:01 -0700 | [diff] [blame] | 893 | } |
| 894 | |
Courtney Goeltzenleuchter | 110fdf9 | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 895 | loader_platform_thread_unlock_mutex(&loader_lock); |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 896 | return res; |
| 897 | } |
| 898 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 899 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 900 | vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, |
| 901 | uint32_t *pPropertyCount, |
| 902 | VkLayerProperties *pProperties) { |
Jon Ashburn | dc5d920 | 2016-02-29 13:00:51 -0700 | [diff] [blame] | 903 | uint32_t copy_size; |
Jon Ashburn | 787eb25 | 2016-03-24 15:49:57 -0600 | [diff] [blame] | 904 | struct loader_physical_device_tramp *phys_dev; |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 905 | |
Courtney Goeltzenleuchter | 110fdf9 | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 906 | loader_platform_thread_lock_mutex(&loader_lock); |
Jon Ashburn | 00eb6c0 | 2015-11-02 17:40:01 -0700 | [diff] [blame] | 907 | |
| 908 | /* Don't dispatch this call down the instance chain, want all device layers |
| 909 | enumerated and instance chain may not contain all device layers */ |
Jon Ashburn | dc5d920 | 2016-02-29 13:00:51 -0700 | [diff] [blame] | 910 | |
Jon Ashburn | 787eb25 | 2016-03-24 15:49:57 -0600 | [diff] [blame] | 911 | phys_dev = (struct loader_physical_device_tramp *)physicalDevice; |
Piers Daniell | 295fe40 | 2016-03-29 11:51:11 -0600 | [diff] [blame] | 912 | const struct loader_instance *inst = phys_dev->this_instance; |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 913 | uint32_t count = inst->device_layer_list.count; |
Jon Ashburn | dc5d920 | 2016-02-29 13:00:51 -0700 | [diff] [blame] | 914 | |
| 915 | if (pProperties == NULL) { |
| 916 | *pPropertyCount = count; |
| 917 | loader_platform_thread_unlock_mutex(&loader_lock); |
| 918 | return VK_SUCCESS; |
| 919 | } |
| 920 | |
| 921 | copy_size = (*pPropertyCount < count) ? *pPropertyCount : count; |
| 922 | for (uint32_t i = 0; i < copy_size; i++) { |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 923 | memcpy(&pProperties[i], &(inst->device_layer_list.list[i].info), |
Jon Ashburn | dc5d920 | 2016-02-29 13:00:51 -0700 | [diff] [blame] | 924 | sizeof(VkLayerProperties)); |
| 925 | } |
| 926 | *pPropertyCount = copy_size; |
| 927 | |
| 928 | if (copy_size < count) { |
| 929 | loader_platform_thread_unlock_mutex(&loader_lock); |
| 930 | return VK_INCOMPLETE; |
| 931 | } |
| 932 | |
Courtney Goeltzenleuchter | 110fdf9 | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 933 | loader_platform_thread_unlock_mutex(&loader_lock); |
Jon Ashburn | dc5d920 | 2016-02-29 13:00:51 -0700 | [diff] [blame] | 934 | return VK_SUCCESS; |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 935 | } |
| 936 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 937 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 938 | vkGetDeviceQueue(VkDevice device, uint32_t queueNodeIndex, uint32_t queueIndex, |
| 939 | VkQueue *pQueue) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 940 | const VkLayerDispatchTable *disp; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 941 | |
| 942 | disp = loader_get_dispatch(device); |
| 943 | |
Courtney Goeltzenleuchter | 06d8947 | 2015-10-20 16:40:38 -0600 | [diff] [blame] | 944 | disp->GetDeviceQueue(device, queueNodeIndex, queueIndex, pQueue); |
| 945 | loader_set_dispatch(*pQueue, disp); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 946 | } |
| 947 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 948 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 949 | vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo *pSubmits, |
| 950 | VkFence fence) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 951 | const VkLayerDispatchTable *disp; |
| 952 | |
| 953 | disp = loader_get_dispatch(queue); |
| 954 | |
Chia-I Wu | 40cf0ae | 2015-10-26 17:20:32 +0800 | [diff] [blame] | 955 | return disp->QueueSubmit(queue, submitCount, pSubmits, fence); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 956 | } |
| 957 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 958 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkQueueWaitIdle(VkQueue queue) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 959 | const VkLayerDispatchTable *disp; |
| 960 | |
| 961 | disp = loader_get_dispatch(queue); |
| 962 | |
| 963 | return disp->QueueWaitIdle(queue); |
| 964 | } |
| 965 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 966 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkDeviceWaitIdle(VkDevice device) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 967 | const VkLayerDispatchTable *disp; |
| 968 | |
| 969 | disp = loader_get_dispatch(device); |
| 970 | |
| 971 | return disp->DeviceWaitIdle(device); |
| 972 | } |
| 973 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 974 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 975 | vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo *pAllocateInfo, |
| 976 | const VkAllocationCallbacks *pAllocator, |
| 977 | VkDeviceMemory *pMemory) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 978 | const VkLayerDispatchTable *disp; |
| 979 | |
| 980 | disp = loader_get_dispatch(device); |
| 981 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 982 | return disp->AllocateMemory(device, pAllocateInfo, pAllocator, pMemory); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 983 | } |
| 984 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 985 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 986 | vkFreeMemory(VkDevice device, VkDeviceMemory mem, |
| 987 | const VkAllocationCallbacks *pAllocator) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 988 | const VkLayerDispatchTable *disp; |
| 989 | |
| 990 | disp = loader_get_dispatch(device); |
| 991 | |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 992 | disp->FreeMemory(device, mem, pAllocator); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 993 | } |
| 994 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 995 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 996 | vkMapMemory(VkDevice device, VkDeviceMemory mem, VkDeviceSize offset, |
| 997 | VkDeviceSize size, VkFlags flags, void **ppData) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 998 | const VkLayerDispatchTable *disp; |
| 999 | |
| 1000 | disp = loader_get_dispatch(device); |
| 1001 | |
| 1002 | return disp->MapMemory(device, mem, offset, size, flags, ppData); |
| 1003 | } |
| 1004 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1005 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1006 | vkUnmapMemory(VkDevice device, VkDeviceMemory mem) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1007 | const VkLayerDispatchTable *disp; |
| 1008 | |
| 1009 | disp = loader_get_dispatch(device); |
| 1010 | |
Mark Lobodzinski | 2141f65 | 2015-09-07 13:59:43 -0600 | [diff] [blame] | 1011 | disp->UnmapMemory(device, mem); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1012 | } |
| 1013 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1014 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1015 | vkFlushMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, |
| 1016 | const VkMappedMemoryRange *pMemoryRanges) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1017 | const VkLayerDispatchTable *disp; |
| 1018 | |
| 1019 | disp = loader_get_dispatch(device); |
| 1020 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1021 | return disp->FlushMappedMemoryRanges(device, memoryRangeCount, |
| 1022 | pMemoryRanges); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1023 | } |
| 1024 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1025 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1026 | vkInvalidateMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, |
| 1027 | const VkMappedMemoryRange *pMemoryRanges) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1028 | const VkLayerDispatchTable *disp; |
| 1029 | |
| 1030 | disp = loader_get_dispatch(device); |
| 1031 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1032 | return disp->InvalidateMappedMemoryRanges(device, memoryRangeCount, |
| 1033 | pMemoryRanges); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1034 | } |
| 1035 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1036 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1037 | vkGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, |
| 1038 | VkDeviceSize *pCommittedMemoryInBytes) { |
Courtney Goeltzenleuchter | fb71f22 | 2015-07-09 21:57:28 -0600 | [diff] [blame] | 1039 | const VkLayerDispatchTable *disp; |
| 1040 | |
| 1041 | disp = loader_get_dispatch(device); |
| 1042 | |
Courtney Goeltzenleuchter | 06d8947 | 2015-10-20 16:40:38 -0600 | [diff] [blame] | 1043 | disp->GetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes); |
Courtney Goeltzenleuchter | fb71f22 | 2015-07-09 21:57:28 -0600 | [diff] [blame] | 1044 | } |
| 1045 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1046 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1047 | vkBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory mem, |
| 1048 | VkDeviceSize offset) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1049 | const VkLayerDispatchTable *disp; |
| 1050 | |
Mark Lobodzinski | 942b172 | 2015-05-11 17:21:15 -0500 | [diff] [blame] | 1051 | disp = loader_get_dispatch(device); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1052 | |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1053 | return disp->BindBufferMemory(device, buffer, mem, offset); |
| 1054 | } |
| 1055 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1056 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1057 | vkBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory mem, |
| 1058 | VkDeviceSize offset) { |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1059 | const VkLayerDispatchTable *disp; |
| 1060 | |
| 1061 | disp = loader_get_dispatch(device); |
| 1062 | |
| 1063 | return disp->BindImageMemory(device, image, mem, offset); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1064 | } |
| 1065 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1066 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1067 | vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, |
| 1068 | VkMemoryRequirements *pMemoryRequirements) { |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 1069 | const VkLayerDispatchTable *disp; |
| 1070 | |
| 1071 | disp = loader_get_dispatch(device); |
| 1072 | |
Courtney Goeltzenleuchter | 06d8947 | 2015-10-20 16:40:38 -0600 | [diff] [blame] | 1073 | disp->GetBufferMemoryRequirements(device, buffer, pMemoryRequirements); |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 1074 | } |
| 1075 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1076 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1077 | vkGetImageMemoryRequirements(VkDevice device, VkImage image, |
| 1078 | VkMemoryRequirements *pMemoryRequirements) { |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 1079 | const VkLayerDispatchTable *disp; |
| 1080 | |
| 1081 | disp = loader_get_dispatch(device); |
| 1082 | |
Courtney Goeltzenleuchter | 06d8947 | 2015-10-20 16:40:38 -0600 | [diff] [blame] | 1083 | disp->GetImageMemoryRequirements(device, image, pMemoryRequirements); |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 1084 | } |
| 1085 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1086 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetImageSparseMemoryRequirements( |
| 1087 | VkDevice device, VkImage image, uint32_t *pSparseMemoryRequirementCount, |
| 1088 | VkSparseImageMemoryRequirements *pSparseMemoryRequirements) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1089 | const VkLayerDispatchTable *disp; |
| 1090 | |
Mark Lobodzinski | 16e8bef | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 1091 | disp = loader_get_dispatch(device); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1092 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1093 | disp->GetImageSparseMemoryRequirements(device, image, |
| 1094 | pSparseMemoryRequirementCount, |
| 1095 | pSparseMemoryRequirements); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1096 | } |
| 1097 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1098 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1099 | vkGetPhysicalDeviceSparseImageFormatProperties( |
| 1100 | VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, |
| 1101 | VkSampleCountFlagBits samples, VkImageUsageFlags usage, |
| 1102 | VkImageTiling tiling, uint32_t *pPropertyCount, |
| 1103 | VkSparseImageFormatProperties *pProperties) { |
Mark Lobodzinski | 16e8bef | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 1104 | const VkLayerInstanceDispatchTable *disp; |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 1105 | VkPhysicalDevice unwrapped_phys_dev = |
| 1106 | loader_unwrap_physical_device(physicalDevice); |
Mark Lobodzinski | 16e8bef | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 1107 | disp = loader_get_instance_dispatch(physicalDevice); |
| 1108 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1109 | disp->GetPhysicalDeviceSparseImageFormatProperties( |
Jon Ashburn | 014438f | 2016-03-01 19:51:07 -0700 | [diff] [blame] | 1110 | unwrapped_phys_dev, format, type, samples, usage, tiling, |
| 1111 | pPropertyCount, pProperties); |
Mark Lobodzinski | 16e8bef | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 1112 | } |
| 1113 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1114 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1115 | vkQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, |
| 1116 | const VkBindSparseInfo *pBindInfo, VkFence fence) { |
Mark Lobodzinski | 16e8bef | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 1117 | const VkLayerDispatchTable *disp; |
| 1118 | |
| 1119 | disp = loader_get_dispatch(queue); |
| 1120 | |
Chia-I Wu | 1ff4c3d | 2015-10-26 16:55:27 +0800 | [diff] [blame] | 1121 | return disp->QueueBindSparse(queue, bindInfoCount, pBindInfo, fence); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1122 | } |
| 1123 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1124 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1125 | vkCreateFence(VkDevice device, const VkFenceCreateInfo *pCreateInfo, |
| 1126 | const VkAllocationCallbacks *pAllocator, VkFence *pFence) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1127 | const VkLayerDispatchTable *disp; |
| 1128 | |
| 1129 | disp = loader_get_dispatch(device); |
| 1130 | |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 1131 | return disp->CreateFence(device, pCreateInfo, pAllocator, pFence); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1132 | } |
| 1133 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1134 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1135 | vkDestroyFence(VkDevice device, VkFence fence, |
| 1136 | const VkAllocationCallbacks *pAllocator) { |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1137 | const VkLayerDispatchTable *disp; |
| 1138 | |
| 1139 | disp = loader_get_dispatch(device); |
| 1140 | |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 1141 | disp->DestroyFence(device, fence, pAllocator); |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1142 | } |
| 1143 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1144 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1145 | vkResetFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1146 | const VkLayerDispatchTable *disp; |
| 1147 | |
| 1148 | disp = loader_get_dispatch(device); |
| 1149 | |
| 1150 | return disp->ResetFences(device, fenceCount, pFences); |
| 1151 | } |
| 1152 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1153 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1154 | vkGetFenceStatus(VkDevice device, VkFence fence) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1155 | const VkLayerDispatchTable *disp; |
| 1156 | |
| 1157 | disp = loader_get_dispatch(device); |
| 1158 | |
| 1159 | return disp->GetFenceStatus(device, fence); |
| 1160 | } |
| 1161 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1162 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1163 | vkWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences, |
| 1164 | VkBool32 waitAll, uint64_t timeout) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1165 | const VkLayerDispatchTable *disp; |
| 1166 | |
| 1167 | disp = loader_get_dispatch(device); |
| 1168 | |
| 1169 | return disp->WaitForFences(device, fenceCount, pFences, waitAll, timeout); |
| 1170 | } |
| 1171 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1172 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1173 | vkCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo *pCreateInfo, |
| 1174 | const VkAllocationCallbacks *pAllocator, |
| 1175 | VkSemaphore *pSemaphore) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1176 | const VkLayerDispatchTable *disp; |
| 1177 | |
| 1178 | disp = loader_get_dispatch(device); |
| 1179 | |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 1180 | return disp->CreateSemaphore(device, pCreateInfo, pAllocator, pSemaphore); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1181 | } |
| 1182 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1183 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1184 | vkDestroySemaphore(VkDevice device, VkSemaphore semaphore, |
| 1185 | const VkAllocationCallbacks *pAllocator) { |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1186 | const VkLayerDispatchTable *disp; |
| 1187 | |
| 1188 | disp = loader_get_dispatch(device); |
| 1189 | |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 1190 | disp->DestroySemaphore(device, semaphore, pAllocator); |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1191 | } |
| 1192 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1193 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1194 | vkCreateEvent(VkDevice device, const VkEventCreateInfo *pCreateInfo, |
| 1195 | const VkAllocationCallbacks *pAllocator, VkEvent *pEvent) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1196 | const VkLayerDispatchTable *disp; |
| 1197 | |
| 1198 | disp = loader_get_dispatch(device); |
| 1199 | |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 1200 | return disp->CreateEvent(device, pCreateInfo, pAllocator, pEvent); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1201 | } |
| 1202 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1203 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1204 | vkDestroyEvent(VkDevice device, VkEvent event, |
| 1205 | const VkAllocationCallbacks *pAllocator) { |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1206 | const VkLayerDispatchTable *disp; |
| 1207 | |
| 1208 | disp = loader_get_dispatch(device); |
| 1209 | |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 1210 | disp->DestroyEvent(device, event, pAllocator); |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1211 | } |
| 1212 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1213 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1214 | vkGetEventStatus(VkDevice device, VkEvent event) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1215 | const VkLayerDispatchTable *disp; |
| 1216 | |
| 1217 | disp = loader_get_dispatch(device); |
| 1218 | |
| 1219 | return disp->GetEventStatus(device, event); |
| 1220 | } |
| 1221 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1222 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1223 | vkSetEvent(VkDevice device, VkEvent event) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1224 | const VkLayerDispatchTable *disp; |
| 1225 | |
| 1226 | disp = loader_get_dispatch(device); |
| 1227 | |
| 1228 | return disp->SetEvent(device, event); |
| 1229 | } |
| 1230 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1231 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1232 | vkResetEvent(VkDevice device, VkEvent event) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1233 | const VkLayerDispatchTable *disp; |
| 1234 | |
| 1235 | disp = loader_get_dispatch(device); |
| 1236 | |
| 1237 | return disp->ResetEvent(device, event); |
| 1238 | } |
| 1239 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1240 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1241 | vkCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo *pCreateInfo, |
| 1242 | const VkAllocationCallbacks *pAllocator, |
| 1243 | VkQueryPool *pQueryPool) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1244 | const VkLayerDispatchTable *disp; |
| 1245 | |
| 1246 | disp = loader_get_dispatch(device); |
| 1247 | |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 1248 | return disp->CreateQueryPool(device, pCreateInfo, pAllocator, pQueryPool); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1249 | } |
| 1250 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1251 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1252 | vkDestroyQueryPool(VkDevice device, VkQueryPool queryPool, |
| 1253 | const VkAllocationCallbacks *pAllocator) { |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1254 | const VkLayerDispatchTable *disp; |
| 1255 | |
| 1256 | disp = loader_get_dispatch(device); |
| 1257 | |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 1258 | disp->DestroyQueryPool(device, queryPool, pAllocator); |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1259 | } |
| 1260 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1261 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1262 | vkGetQueryPoolResults(VkDevice device, VkQueryPool queryPool, |
| 1263 | uint32_t firstQuery, uint32_t queryCount, size_t dataSize, |
| 1264 | void *pData, VkDeviceSize stride, |
| 1265 | VkQueryResultFlags flags) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1266 | const VkLayerDispatchTable *disp; |
| 1267 | |
| 1268 | disp = loader_get_dispatch(device); |
| 1269 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1270 | return disp->GetQueryPoolResults(device, queryPool, firstQuery, queryCount, |
| 1271 | dataSize, pData, stride, flags); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1272 | } |
| 1273 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1274 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1275 | vkCreateBuffer(VkDevice device, const VkBufferCreateInfo *pCreateInfo, |
| 1276 | const VkAllocationCallbacks *pAllocator, VkBuffer *pBuffer) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1277 | const VkLayerDispatchTable *disp; |
| 1278 | |
| 1279 | disp = loader_get_dispatch(device); |
| 1280 | |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 1281 | return disp->CreateBuffer(device, pCreateInfo, pAllocator, pBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1282 | } |
| 1283 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1284 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1285 | vkDestroyBuffer(VkDevice device, VkBuffer buffer, |
| 1286 | const VkAllocationCallbacks *pAllocator) { |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1287 | const VkLayerDispatchTable *disp; |
| 1288 | |
| 1289 | disp = loader_get_dispatch(device); |
| 1290 | |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 1291 | disp->DestroyBuffer(device, buffer, pAllocator); |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1292 | } |
| 1293 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1294 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1295 | vkCreateBufferView(VkDevice device, const VkBufferViewCreateInfo *pCreateInfo, |
| 1296 | const VkAllocationCallbacks *pAllocator, |
| 1297 | VkBufferView *pView) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1298 | const VkLayerDispatchTable *disp; |
| 1299 | |
| 1300 | disp = loader_get_dispatch(device); |
| 1301 | |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 1302 | return disp->CreateBufferView(device, pCreateInfo, pAllocator, pView); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1303 | } |
| 1304 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1305 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1306 | vkDestroyBufferView(VkDevice device, VkBufferView bufferView, |
| 1307 | const VkAllocationCallbacks *pAllocator) { |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1308 | const VkLayerDispatchTable *disp; |
| 1309 | |
| 1310 | disp = loader_get_dispatch(device); |
| 1311 | |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 1312 | disp->DestroyBufferView(device, bufferView, pAllocator); |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1313 | } |
| 1314 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1315 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1316 | vkCreateImage(VkDevice device, const VkImageCreateInfo *pCreateInfo, |
| 1317 | const VkAllocationCallbacks *pAllocator, VkImage *pImage) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1318 | const VkLayerDispatchTable *disp; |
| 1319 | |
| 1320 | disp = loader_get_dispatch(device); |
| 1321 | |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 1322 | return disp->CreateImage(device, pCreateInfo, pAllocator, pImage); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1323 | } |
| 1324 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1325 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1326 | vkDestroyImage(VkDevice device, VkImage image, |
| 1327 | const VkAllocationCallbacks *pAllocator) { |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1328 | const VkLayerDispatchTable *disp; |
| 1329 | |
| 1330 | disp = loader_get_dispatch(device); |
| 1331 | |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 1332 | disp->DestroyImage(device, image, pAllocator); |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1333 | } |
| 1334 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1335 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1336 | vkGetImageSubresourceLayout(VkDevice device, VkImage image, |
| 1337 | const VkImageSubresource *pSubresource, |
| 1338 | VkSubresourceLayout *pLayout) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1339 | const VkLayerDispatchTable *disp; |
| 1340 | |
| 1341 | disp = loader_get_dispatch(device); |
| 1342 | |
Courtney Goeltzenleuchter | 06d8947 | 2015-10-20 16:40:38 -0600 | [diff] [blame] | 1343 | disp->GetImageSubresourceLayout(device, image, pSubresource, pLayout); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1344 | } |
| 1345 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1346 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1347 | vkCreateImageView(VkDevice device, const VkImageViewCreateInfo *pCreateInfo, |
| 1348 | const VkAllocationCallbacks *pAllocator, VkImageView *pView) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1349 | const VkLayerDispatchTable *disp; |
| 1350 | |
| 1351 | disp = loader_get_dispatch(device); |
| 1352 | |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 1353 | return disp->CreateImageView(device, pCreateInfo, pAllocator, pView); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1354 | } |
| 1355 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1356 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1357 | vkDestroyImageView(VkDevice device, VkImageView imageView, |
| 1358 | const VkAllocationCallbacks *pAllocator) { |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1359 | const VkLayerDispatchTable *disp; |
| 1360 | |
| 1361 | disp = loader_get_dispatch(device); |
| 1362 | |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 1363 | disp->DestroyImageView(device, imageView, pAllocator); |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1364 | } |
| 1365 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1366 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1367 | vkCreateShaderModule(VkDevice device, |
| 1368 | const VkShaderModuleCreateInfo *pCreateInfo, |
| 1369 | const VkAllocationCallbacks *pAllocator, |
| 1370 | VkShaderModule *pShader) { |
Courtney Goeltzenleuchter | 2d2cb68 | 2015-06-24 18:24:19 -0600 | [diff] [blame] | 1371 | const VkLayerDispatchTable *disp; |
| 1372 | |
| 1373 | disp = loader_get_dispatch(device); |
| 1374 | |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 1375 | return disp->CreateShaderModule(device, pCreateInfo, pAllocator, pShader); |
Courtney Goeltzenleuchter | 2d2cb68 | 2015-06-24 18:24:19 -0600 | [diff] [blame] | 1376 | } |
| 1377 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1378 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1379 | vkDestroyShaderModule(VkDevice device, VkShaderModule shaderModule, |
| 1380 | const VkAllocationCallbacks *pAllocator) { |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1381 | const VkLayerDispatchTable *disp; |
| 1382 | |
| 1383 | disp = loader_get_dispatch(device); |
| 1384 | |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 1385 | disp->DestroyShaderModule(device, shaderModule, pAllocator); |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1386 | } |
| 1387 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1388 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1389 | vkCreatePipelineCache(VkDevice device, |
| 1390 | const VkPipelineCacheCreateInfo *pCreateInfo, |
| 1391 | const VkAllocationCallbacks *pAllocator, |
| 1392 | VkPipelineCache *pPipelineCache) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1393 | const VkLayerDispatchTable *disp; |
| 1394 | |
| 1395 | disp = loader_get_dispatch(device); |
| 1396 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1397 | return disp->CreatePipelineCache(device, pCreateInfo, pAllocator, |
| 1398 | pPipelineCache); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1399 | } |
| 1400 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1401 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1402 | vkDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, |
| 1403 | const VkAllocationCallbacks *pAllocator) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1404 | const VkLayerDispatchTable *disp; |
| 1405 | |
| 1406 | disp = loader_get_dispatch(device); |
| 1407 | |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 1408 | disp->DestroyPipelineCache(device, pipelineCache, pAllocator); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1409 | } |
| 1410 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1411 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1412 | vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, |
| 1413 | size_t *pDataSize, void *pData) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1414 | const VkLayerDispatchTable *disp; |
| 1415 | |
| 1416 | disp = loader_get_dispatch(device); |
| 1417 | |
Chia-I Wu | b16facd | 2015-10-26 19:17:06 +0800 | [diff] [blame] | 1418 | return disp->GetPipelineCacheData(device, pipelineCache, pDataSize, pData); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1419 | } |
| 1420 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1421 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1422 | vkMergePipelineCaches(VkDevice device, VkPipelineCache dstCache, |
| 1423 | uint32_t srcCacheCount, |
| 1424 | const VkPipelineCache *pSrcCaches) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1425 | const VkLayerDispatchTable *disp; |
| 1426 | |
| 1427 | disp = loader_get_dispatch(device); |
| 1428 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1429 | return disp->MergePipelineCaches(device, dstCache, srcCacheCount, |
| 1430 | pSrcCaches); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1431 | } |
| 1432 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1433 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1434 | vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, |
| 1435 | uint32_t createInfoCount, |
| 1436 | const VkGraphicsPipelineCreateInfo *pCreateInfos, |
| 1437 | const VkAllocationCallbacks *pAllocator, |
| 1438 | VkPipeline *pPipelines) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1439 | const VkLayerDispatchTable *disp; |
| 1440 | |
| 1441 | disp = loader_get_dispatch(device); |
| 1442 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1443 | return disp->CreateGraphicsPipelines(device, pipelineCache, createInfoCount, |
| 1444 | pCreateInfos, pAllocator, pPipelines); |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 1445 | } |
| 1446 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1447 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1448 | vkCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, |
| 1449 | uint32_t createInfoCount, |
| 1450 | const VkComputePipelineCreateInfo *pCreateInfos, |
| 1451 | const VkAllocationCallbacks *pAllocator, |
| 1452 | VkPipeline *pPipelines) { |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 1453 | const VkLayerDispatchTable *disp; |
| 1454 | |
| 1455 | disp = loader_get_dispatch(device); |
| 1456 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1457 | return disp->CreateComputePipelines(device, pipelineCache, createInfoCount, |
| 1458 | pCreateInfos, pAllocator, pPipelines); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1459 | } |
| 1460 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1461 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1462 | vkDestroyPipeline(VkDevice device, VkPipeline pipeline, |
| 1463 | const VkAllocationCallbacks *pAllocator) { |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1464 | const VkLayerDispatchTable *disp; |
| 1465 | |
| 1466 | disp = loader_get_dispatch(device); |
| 1467 | |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 1468 | disp->DestroyPipeline(device, pipeline, pAllocator); |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1469 | } |
| 1470 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1471 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1472 | vkCreatePipelineLayout(VkDevice device, |
| 1473 | const VkPipelineLayoutCreateInfo *pCreateInfo, |
| 1474 | const VkAllocationCallbacks *pAllocator, |
| 1475 | VkPipelineLayout *pPipelineLayout) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1476 | const VkLayerDispatchTable *disp; |
| 1477 | |
| 1478 | disp = loader_get_dispatch(device); |
| 1479 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1480 | return disp->CreatePipelineLayout(device, pCreateInfo, pAllocator, |
| 1481 | pPipelineLayout); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1482 | } |
| 1483 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1484 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1485 | vkDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout, |
| 1486 | const VkAllocationCallbacks *pAllocator) { |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1487 | const VkLayerDispatchTable *disp; |
| 1488 | |
| 1489 | disp = loader_get_dispatch(device); |
| 1490 | |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 1491 | disp->DestroyPipelineLayout(device, pipelineLayout, pAllocator); |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1492 | } |
| 1493 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1494 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1495 | vkCreateSampler(VkDevice device, const VkSamplerCreateInfo *pCreateInfo, |
| 1496 | const VkAllocationCallbacks *pAllocator, VkSampler *pSampler) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1497 | const VkLayerDispatchTable *disp; |
| 1498 | |
| 1499 | disp = loader_get_dispatch(device); |
| 1500 | |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 1501 | return disp->CreateSampler(device, pCreateInfo, pAllocator, pSampler); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1502 | } |
| 1503 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1504 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1505 | vkDestroySampler(VkDevice device, VkSampler sampler, |
| 1506 | const VkAllocationCallbacks *pAllocator) { |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1507 | const VkLayerDispatchTable *disp; |
| 1508 | |
| 1509 | disp = loader_get_dispatch(device); |
| 1510 | |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 1511 | disp->DestroySampler(device, sampler, pAllocator); |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1512 | } |
| 1513 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1514 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1515 | vkCreateDescriptorSetLayout(VkDevice device, |
| 1516 | const VkDescriptorSetLayoutCreateInfo *pCreateInfo, |
| 1517 | const VkAllocationCallbacks *pAllocator, |
| 1518 | VkDescriptorSetLayout *pSetLayout) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1519 | const VkLayerDispatchTable *disp; |
| 1520 | |
| 1521 | disp = loader_get_dispatch(device); |
| 1522 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1523 | return disp->CreateDescriptorSetLayout(device, pCreateInfo, pAllocator, |
| 1524 | pSetLayout); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1525 | } |
| 1526 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1527 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1528 | vkDestroyDescriptorSetLayout(VkDevice device, |
| 1529 | VkDescriptorSetLayout descriptorSetLayout, |
| 1530 | const VkAllocationCallbacks *pAllocator) { |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1531 | const VkLayerDispatchTable *disp; |
| 1532 | |
| 1533 | disp = loader_get_dispatch(device); |
| 1534 | |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 1535 | disp->DestroyDescriptorSetLayout(device, descriptorSetLayout, pAllocator); |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1536 | } |
| 1537 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1538 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1539 | vkCreateDescriptorPool(VkDevice device, |
| 1540 | const VkDescriptorPoolCreateInfo *pCreateInfo, |
| 1541 | const VkAllocationCallbacks *pAllocator, |
| 1542 | VkDescriptorPool *pDescriptorPool) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1543 | const VkLayerDispatchTable *disp; |
| 1544 | |
| 1545 | disp = loader_get_dispatch(device); |
| 1546 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1547 | return disp->CreateDescriptorPool(device, pCreateInfo, pAllocator, |
| 1548 | pDescriptorPool); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1549 | } |
| 1550 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1551 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1552 | vkDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, |
| 1553 | const VkAllocationCallbacks *pAllocator) { |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1554 | const VkLayerDispatchTable *disp; |
| 1555 | |
| 1556 | disp = loader_get_dispatch(device); |
| 1557 | |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 1558 | disp->DestroyDescriptorPool(device, descriptorPool, pAllocator); |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1559 | } |
| 1560 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1561 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1562 | vkResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, |
| 1563 | VkDescriptorPoolResetFlags flags) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1564 | const VkLayerDispatchTable *disp; |
| 1565 | |
| 1566 | disp = loader_get_dispatch(device); |
| 1567 | |
Courtney Goeltzenleuchter | bee18a9 | 2015-10-23 14:21:05 -0600 | [diff] [blame] | 1568 | return disp->ResetDescriptorPool(device, descriptorPool, flags); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1569 | } |
| 1570 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1571 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1572 | vkAllocateDescriptorSets(VkDevice device, |
| 1573 | const VkDescriptorSetAllocateInfo *pAllocateInfo, |
| 1574 | VkDescriptorSet *pDescriptorSets) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1575 | const VkLayerDispatchTable *disp; |
| 1576 | |
| 1577 | disp = loader_get_dispatch(device); |
| 1578 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1579 | return disp->AllocateDescriptorSets(device, pAllocateInfo, pDescriptorSets); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1580 | } |
| 1581 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1582 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1583 | vkFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, |
| 1584 | uint32_t descriptorSetCount, |
| 1585 | const VkDescriptorSet *pDescriptorSets) { |
Tony Barbour | 34ec692 | 2015-07-10 10:50:45 -0600 | [diff] [blame] | 1586 | const VkLayerDispatchTable *disp; |
| 1587 | |
| 1588 | disp = loader_get_dispatch(device); |
| 1589 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1590 | return disp->FreeDescriptorSets(device, descriptorPool, descriptorSetCount, |
| 1591 | pDescriptorSets); |
Tony Barbour | 34ec692 | 2015-07-10 10:50:45 -0600 | [diff] [blame] | 1592 | } |
| 1593 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1594 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1595 | vkUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount, |
| 1596 | const VkWriteDescriptorSet *pDescriptorWrites, |
| 1597 | uint32_t descriptorCopyCount, |
| 1598 | const VkCopyDescriptorSet *pDescriptorCopies) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1599 | const VkLayerDispatchTable *disp; |
| 1600 | |
| 1601 | disp = loader_get_dispatch(device); |
| 1602 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1603 | disp->UpdateDescriptorSets(device, descriptorWriteCount, pDescriptorWrites, |
| 1604 | descriptorCopyCount, pDescriptorCopies); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1605 | } |
| 1606 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1607 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1608 | vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo *pCreateInfo, |
| 1609 | const VkAllocationCallbacks *pAllocator, |
| 1610 | VkFramebuffer *pFramebuffer) { |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 1611 | const VkLayerDispatchTable *disp; |
| 1612 | |
| 1613 | disp = loader_get_dispatch(device); |
| 1614 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1615 | return disp->CreateFramebuffer(device, pCreateInfo, pAllocator, |
| 1616 | pFramebuffer); |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 1617 | } |
| 1618 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1619 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1620 | vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, |
| 1621 | const VkAllocationCallbacks *pAllocator) { |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 1622 | const VkLayerDispatchTable *disp; |
| 1623 | |
| 1624 | disp = loader_get_dispatch(device); |
| 1625 | |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 1626 | disp->DestroyFramebuffer(device, framebuffer, pAllocator); |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 1627 | } |
| 1628 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1629 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1630 | vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo, |
| 1631 | const VkAllocationCallbacks *pAllocator, |
| 1632 | VkRenderPass *pRenderPass) { |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 1633 | const VkLayerDispatchTable *disp; |
| 1634 | |
| 1635 | disp = loader_get_dispatch(device); |
| 1636 | |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 1637 | return disp->CreateRenderPass(device, pCreateInfo, pAllocator, pRenderPass); |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 1638 | } |
| 1639 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1640 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1641 | vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass, |
| 1642 | const VkAllocationCallbacks *pAllocator) { |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 1643 | const VkLayerDispatchTable *disp; |
| 1644 | |
| 1645 | disp = loader_get_dispatch(device); |
| 1646 | |
Chia-I Wu | f7458c5 | 2015-10-26 21:10:41 +0800 | [diff] [blame] | 1647 | disp->DestroyRenderPass(device, renderPass, pAllocator); |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 1648 | } |
| 1649 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1650 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1651 | vkGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, |
| 1652 | VkExtent2D *pGranularity) { |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 1653 | const VkLayerDispatchTable *disp; |
| 1654 | |
| 1655 | disp = loader_get_dispatch(device); |
| 1656 | |
Courtney Goeltzenleuchter | 06d8947 | 2015-10-20 16:40:38 -0600 | [diff] [blame] | 1657 | disp->GetRenderAreaGranularity(device, renderPass, pGranularity); |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 1658 | } |
| 1659 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1660 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1661 | vkCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo *pCreateInfo, |
| 1662 | const VkAllocationCallbacks *pAllocator, |
| 1663 | VkCommandPool *pCommandPool) { |
Cody Northrop | e62183e | 2015-07-09 18:08:05 -0600 | [diff] [blame] | 1664 | const VkLayerDispatchTable *disp; |
| 1665 | |
| 1666 | disp = loader_get_dispatch(device); |
| 1667 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1668 | return disp->CreateCommandPool(device, pCreateInfo, pAllocator, |
| 1669 | pCommandPool); |
Cody Northrop | e62183e | 2015-07-09 18:08:05 -0600 | [diff] [blame] | 1670 | } |
| 1671 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1672 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1673 | vkDestroyCommandPool(VkDevice device, VkCommandPool commandPool, |
| 1674 | const VkAllocationCallbacks *pAllocator) { |
Cody Northrop | e62183e | 2015-07-09 18:08:05 -0600 | [diff] [blame] | 1675 | const VkLayerDispatchTable *disp; |
| 1676 | |
| 1677 | disp = loader_get_dispatch(device); |
| 1678 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1679 | disp->DestroyCommandPool(device, commandPool, pAllocator); |
Cody Northrop | e62183e | 2015-07-09 18:08:05 -0600 | [diff] [blame] | 1680 | } |
| 1681 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1682 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1683 | vkResetCommandPool(VkDevice device, VkCommandPool commandPool, |
| 1684 | VkCommandPoolResetFlags flags) { |
Cody Northrop | e62183e | 2015-07-09 18:08:05 -0600 | [diff] [blame] | 1685 | const VkLayerDispatchTable *disp; |
| 1686 | |
| 1687 | disp = loader_get_dispatch(device); |
| 1688 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1689 | return disp->ResetCommandPool(device, commandPool, flags); |
Cody Northrop | e62183e | 2015-07-09 18:08:05 -0600 | [diff] [blame] | 1690 | } |
| 1691 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1692 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1693 | vkAllocateCommandBuffers(VkDevice device, |
| 1694 | const VkCommandBufferAllocateInfo *pAllocateInfo, |
| 1695 | VkCommandBuffer *pCommandBuffers) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1696 | const VkLayerDispatchTable *disp; |
| 1697 | VkResult res; |
| 1698 | |
| 1699 | disp = loader_get_dispatch(device); |
| 1700 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1701 | res = disp->AllocateCommandBuffers(device, pAllocateInfo, pCommandBuffers); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1702 | if (res == VK_SUCCESS) { |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1703 | for (uint32_t i = 0; i < pAllocateInfo->commandBufferCount; i++) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1704 | if (pCommandBuffers[i]) { |
| 1705 | loader_init_dispatch(pCommandBuffers[i], disp); |
Courtney Goeltzenleuchter | bee18a9 | 2015-10-23 14:21:05 -0600 | [diff] [blame] | 1706 | } |
| 1707 | } |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1708 | } |
| 1709 | |
| 1710 | return res; |
| 1711 | } |
| 1712 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1713 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1714 | vkFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, |
| 1715 | uint32_t commandBufferCount, |
| 1716 | const VkCommandBuffer *pCommandBuffers) { |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1717 | const VkLayerDispatchTable *disp; |
| 1718 | |
| 1719 | disp = loader_get_dispatch(device); |
| 1720 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1721 | disp->FreeCommandBuffers(device, commandPool, commandBufferCount, |
| 1722 | pCommandBuffers); |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1723 | } |
| 1724 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1725 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1726 | vkBeginCommandBuffer(VkCommandBuffer commandBuffer, |
| 1727 | const VkCommandBufferBeginInfo *pBeginInfo) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1728 | const VkLayerDispatchTable *disp; |
| 1729 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1730 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1731 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1732 | return disp->BeginCommandBuffer(commandBuffer, pBeginInfo); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1733 | } |
| 1734 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1735 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1736 | vkEndCommandBuffer(VkCommandBuffer commandBuffer) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1737 | const VkLayerDispatchTable *disp; |
| 1738 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1739 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1740 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1741 | return disp->EndCommandBuffer(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1742 | } |
| 1743 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1744 | LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1745 | vkResetCommandBuffer(VkCommandBuffer commandBuffer, |
| 1746 | VkCommandBufferResetFlags flags) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1747 | const VkLayerDispatchTable *disp; |
| 1748 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1749 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1750 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1751 | return disp->ResetCommandBuffer(commandBuffer, flags); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1752 | } |
| 1753 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1754 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1755 | vkCmdBindPipeline(VkCommandBuffer commandBuffer, |
| 1756 | VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1757 | const VkLayerDispatchTable *disp; |
| 1758 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1759 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1760 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1761 | disp->CmdBindPipeline(commandBuffer, pipelineBindPoint, pipeline); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1762 | } |
| 1763 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1764 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1765 | vkCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, |
| 1766 | uint32_t viewportCount, const VkViewport *pViewports) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1767 | const VkLayerDispatchTable *disp; |
| 1768 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1769 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1770 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1771 | disp->CmdSetViewport(commandBuffer, firstViewport, viewportCount, |
| 1772 | pViewports); |
Courtney Goeltzenleuchter | 078f817 | 2015-09-21 11:44:06 -0600 | [diff] [blame] | 1773 | } |
| 1774 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1775 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1776 | vkCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, |
| 1777 | uint32_t scissorCount, const VkRect2D *pScissors) { |
Courtney Goeltzenleuchter | 078f817 | 2015-09-21 11:44:06 -0600 | [diff] [blame] | 1778 | const VkLayerDispatchTable *disp; |
| 1779 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1780 | disp = loader_get_dispatch(commandBuffer); |
Courtney Goeltzenleuchter | 078f817 | 2015-09-21 11:44:06 -0600 | [diff] [blame] | 1781 | |
Jon Ashburn | 19d3bf1 | 2015-12-30 14:06:55 -0700 | [diff] [blame] | 1782 | disp->CmdSetScissor(commandBuffer, firstScissor, scissorCount, pScissors); |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1783 | } |
| 1784 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1785 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1786 | vkCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth) { |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1787 | const VkLayerDispatchTable *disp; |
| 1788 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1789 | disp = loader_get_dispatch(commandBuffer); |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1790 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1791 | disp->CmdSetLineWidth(commandBuffer, lineWidth); |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 1792 | } |
| 1793 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1794 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1795 | vkCmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, |
| 1796 | float depthBiasClamp, float depthBiasSlopeFactor) { |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 1797 | const VkLayerDispatchTable *disp; |
| 1798 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1799 | disp = loader_get_dispatch(commandBuffer); |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 1800 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1801 | disp->CmdSetDepthBias(commandBuffer, depthBiasConstantFactor, |
| 1802 | depthBiasClamp, depthBiasSlopeFactor); |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1803 | } |
| 1804 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1805 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1806 | vkCmdSetBlendConstants(VkCommandBuffer commandBuffer, |
| 1807 | const float blendConstants[4]) { |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1808 | const VkLayerDispatchTable *disp; |
| 1809 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1810 | disp = loader_get_dispatch(commandBuffer); |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1811 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1812 | disp->CmdSetBlendConstants(commandBuffer, blendConstants); |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1813 | } |
| 1814 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1815 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1816 | vkCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds, |
| 1817 | float maxDepthBounds) { |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1818 | const VkLayerDispatchTable *disp; |
| 1819 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1820 | disp = loader_get_dispatch(commandBuffer); |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1821 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1822 | disp->CmdSetDepthBounds(commandBuffer, minDepthBounds, maxDepthBounds); |
Cody Northrop | 82485a8 | 2015-08-18 15:21:16 -0600 | [diff] [blame] | 1823 | } |
| 1824 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1825 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1826 | vkCmdSetStencilCompareMask(VkCommandBuffer commandBuffer, |
| 1827 | VkStencilFaceFlags faceMask, uint32_t compareMask) { |
Cody Northrop | 82485a8 | 2015-08-18 15:21:16 -0600 | [diff] [blame] | 1828 | const VkLayerDispatchTable *disp; |
| 1829 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1830 | disp = loader_get_dispatch(commandBuffer); |
Cody Northrop | 82485a8 | 2015-08-18 15:21:16 -0600 | [diff] [blame] | 1831 | |
Chia-I Wu | 1b99bb2 | 2015-10-27 19:25:11 +0800 | [diff] [blame] | 1832 | disp->CmdSetStencilCompareMask(commandBuffer, faceMask, compareMask); |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 1833 | } |
| 1834 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1835 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1836 | vkCmdSetStencilWriteMask(VkCommandBuffer commandBuffer, |
| 1837 | VkStencilFaceFlags faceMask, uint32_t writeMask) { |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 1838 | const VkLayerDispatchTable *disp; |
| 1839 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1840 | disp = loader_get_dispatch(commandBuffer); |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 1841 | |
Chia-I Wu | 1b99bb2 | 2015-10-27 19:25:11 +0800 | [diff] [blame] | 1842 | disp->CmdSetStencilWriteMask(commandBuffer, faceMask, writeMask); |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 1843 | } |
| 1844 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1845 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1846 | vkCmdSetStencilReference(VkCommandBuffer commandBuffer, |
| 1847 | VkStencilFaceFlags faceMask, uint32_t reference) { |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 1848 | const VkLayerDispatchTable *disp; |
| 1849 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1850 | disp = loader_get_dispatch(commandBuffer); |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 1851 | |
Chia-I Wu | 1b99bb2 | 2015-10-27 19:25:11 +0800 | [diff] [blame] | 1852 | disp->CmdSetStencilReference(commandBuffer, faceMask, reference); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1853 | } |
| 1854 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1855 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBindDescriptorSets( |
| 1856 | VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, |
| 1857 | VkPipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, |
| 1858 | const VkDescriptorSet *pDescriptorSets, uint32_t dynamicOffsetCount, |
| 1859 | const uint32_t *pDynamicOffsets) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1860 | const VkLayerDispatchTable *disp; |
| 1861 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1862 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1863 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1864 | disp->CmdBindDescriptorSets(commandBuffer, pipelineBindPoint, layout, |
| 1865 | firstSet, descriptorSetCount, pDescriptorSets, |
| 1866 | dynamicOffsetCount, pDynamicOffsets); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1867 | } |
| 1868 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1869 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1870 | vkCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, |
| 1871 | VkDeviceSize offset, VkIndexType indexType) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1872 | const VkLayerDispatchTable *disp; |
| 1873 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1874 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1875 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1876 | disp->CmdBindIndexBuffer(commandBuffer, buffer, offset, indexType); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1877 | } |
| 1878 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1879 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1880 | vkCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding, |
| 1881 | uint32_t bindingCount, const VkBuffer *pBuffers, |
| 1882 | const VkDeviceSize *pOffsets) { |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 1883 | const VkLayerDispatchTable *disp; |
| 1884 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1885 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 1886 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1887 | disp->CmdBindVertexBuffers(commandBuffer, firstBinding, bindingCount, |
| 1888 | pBuffers, pOffsets); |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 1889 | } |
| 1890 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1891 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1892 | vkCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, |
| 1893 | uint32_t instanceCount, uint32_t firstVertex, |
| 1894 | uint32_t firstInstance) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1895 | const VkLayerDispatchTable *disp; |
| 1896 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1897 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1898 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1899 | disp->CmdDraw(commandBuffer, vertexCount, instanceCount, firstVertex, |
| 1900 | firstInstance); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1901 | } |
| 1902 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1903 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1904 | vkCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount, |
| 1905 | uint32_t instanceCount, uint32_t firstIndex, |
| 1906 | int32_t vertexOffset, uint32_t firstInstance) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1907 | const VkLayerDispatchTable *disp; |
| 1908 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1909 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1910 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1911 | disp->CmdDrawIndexed(commandBuffer, indexCount, instanceCount, firstIndex, |
| 1912 | vertexOffset, firstInstance); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1913 | } |
| 1914 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1915 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1916 | vkCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, |
| 1917 | VkDeviceSize offset, uint32_t drawCount, uint32_t stride) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1918 | const VkLayerDispatchTable *disp; |
| 1919 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1920 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1921 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1922 | disp->CmdDrawIndirect(commandBuffer, buffer, offset, drawCount, stride); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1923 | } |
| 1924 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1925 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1926 | vkCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, |
| 1927 | VkDeviceSize offset, uint32_t drawCount, |
| 1928 | uint32_t stride) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1929 | const VkLayerDispatchTable *disp; |
| 1930 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1931 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1932 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1933 | disp->CmdDrawIndexedIndirect(commandBuffer, buffer, offset, drawCount, |
| 1934 | stride); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1935 | } |
| 1936 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1937 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1938 | vkCmdDispatch(VkCommandBuffer commandBuffer, uint32_t x, uint32_t y, |
| 1939 | uint32_t z) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1940 | const VkLayerDispatchTable *disp; |
| 1941 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1942 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1943 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1944 | disp->CmdDispatch(commandBuffer, x, y, z); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1945 | } |
| 1946 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1947 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1948 | vkCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, |
| 1949 | VkDeviceSize offset) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1950 | const VkLayerDispatchTable *disp; |
| 1951 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1952 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1953 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1954 | disp->CmdDispatchIndirect(commandBuffer, buffer, offset); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1955 | } |
| 1956 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1957 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1958 | vkCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, |
| 1959 | VkBuffer dstBuffer, uint32_t regionCount, |
| 1960 | const VkBufferCopy *pRegions) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1961 | const VkLayerDispatchTable *disp; |
| 1962 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1963 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1964 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1965 | disp->CmdCopyBuffer(commandBuffer, srcBuffer, dstBuffer, regionCount, |
| 1966 | pRegions); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1967 | } |
| 1968 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1969 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1970 | vkCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, |
| 1971 | VkImageLayout srcImageLayout, VkImage dstImage, |
| 1972 | VkImageLayout dstImageLayout, uint32_t regionCount, |
| 1973 | const VkImageCopy *pRegions) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1974 | const VkLayerDispatchTable *disp; |
| 1975 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1976 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1977 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1978 | disp->CmdCopyImage(commandBuffer, srcImage, srcImageLayout, dstImage, |
| 1979 | dstImageLayout, regionCount, pRegions); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1980 | } |
| 1981 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1982 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1983 | vkCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, |
| 1984 | VkImageLayout srcImageLayout, VkImage dstImage, |
| 1985 | VkImageLayout dstImageLayout, uint32_t regionCount, |
| 1986 | const VkImageBlit *pRegions, VkFilter filter) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1987 | const VkLayerDispatchTable *disp; |
| 1988 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1989 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1990 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1991 | disp->CmdBlitImage(commandBuffer, srcImage, srcImageLayout, dstImage, |
| 1992 | dstImageLayout, regionCount, pRegions, filter); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1993 | } |
| 1994 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 1995 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1996 | vkCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, |
| 1997 | VkImage dstImage, VkImageLayout dstImageLayout, |
| 1998 | uint32_t regionCount, |
| 1999 | const VkBufferImageCopy *pRegions) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2000 | const VkLayerDispatchTable *disp; |
| 2001 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 2002 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2003 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2004 | disp->CmdCopyBufferToImage(commandBuffer, srcBuffer, dstImage, |
| 2005 | dstImageLayout, regionCount, pRegions); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2006 | } |
| 2007 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2008 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 2009 | vkCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, |
| 2010 | VkImageLayout srcImageLayout, VkBuffer dstBuffer, |
| 2011 | uint32_t regionCount, |
| 2012 | const VkBufferImageCopy *pRegions) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2013 | const VkLayerDispatchTable *disp; |
| 2014 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 2015 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2016 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2017 | disp->CmdCopyImageToBuffer(commandBuffer, srcImage, srcImageLayout, |
| 2018 | dstBuffer, regionCount, pRegions); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2019 | } |
| 2020 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2021 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 2022 | vkCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, |
| 2023 | VkDeviceSize dstOffset, VkDeviceSize dataSize, |
| 2024 | const uint32_t *pData) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2025 | const VkLayerDispatchTable *disp; |
| 2026 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 2027 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2028 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 2029 | disp->CmdUpdateBuffer(commandBuffer, dstBuffer, dstOffset, dataSize, pData); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2030 | } |
| 2031 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2032 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 2033 | vkCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, |
| 2034 | VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2035 | const VkLayerDispatchTable *disp; |
| 2036 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 2037 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2038 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 2039 | disp->CmdFillBuffer(commandBuffer, dstBuffer, dstOffset, size, data); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2040 | } |
| 2041 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2042 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 2043 | vkCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, |
| 2044 | VkImageLayout imageLayout, const VkClearColorValue *pColor, |
| 2045 | uint32_t rangeCount, |
| 2046 | const VkImageSubresourceRange *pRanges) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2047 | const VkLayerDispatchTable *disp; |
| 2048 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 2049 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2050 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2051 | disp->CmdClearColorImage(commandBuffer, image, imageLayout, pColor, |
| 2052 | rangeCount, pRanges); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2053 | } |
| 2054 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2055 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 2056 | vkCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image, |
| 2057 | VkImageLayout imageLayout, |
| 2058 | const VkClearDepthStencilValue *pDepthStencil, |
| 2059 | uint32_t rangeCount, |
| 2060 | const VkImageSubresourceRange *pRanges) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2061 | const VkLayerDispatchTable *disp; |
| 2062 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 2063 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2064 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2065 | disp->CmdClearDepthStencilImage(commandBuffer, image, imageLayout, |
| 2066 | pDepthStencil, rangeCount, pRanges); |
Chris Forbes | d9be82b | 2015-06-22 17:21:59 +1200 | [diff] [blame] | 2067 | } |
| 2068 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2069 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 2070 | vkCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount, |
| 2071 | const VkClearAttachment *pAttachments, uint32_t rectCount, |
| 2072 | const VkClearRect *pRects) { |
Chris Forbes | d9be82b | 2015-06-22 17:21:59 +1200 | [diff] [blame] | 2073 | const VkLayerDispatchTable *disp; |
| 2074 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 2075 | disp = loader_get_dispatch(commandBuffer); |
Chris Forbes | d9be82b | 2015-06-22 17:21:59 +1200 | [diff] [blame] | 2076 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2077 | disp->CmdClearAttachments(commandBuffer, attachmentCount, pAttachments, |
| 2078 | rectCount, pRects); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2079 | } |
| 2080 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2081 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 2082 | vkCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage, |
| 2083 | VkImageLayout srcImageLayout, VkImage dstImage, |
| 2084 | VkImageLayout dstImageLayout, uint32_t regionCount, |
| 2085 | const VkImageResolve *pRegions) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2086 | const VkLayerDispatchTable *disp; |
| 2087 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 2088 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2089 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2090 | disp->CmdResolveImage(commandBuffer, srcImage, srcImageLayout, dstImage, |
| 2091 | dstImageLayout, regionCount, pRegions); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2092 | } |
| 2093 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2094 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 2095 | vkCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, |
| 2096 | VkPipelineStageFlags stageMask) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2097 | const VkLayerDispatchTable *disp; |
| 2098 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 2099 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2100 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 2101 | disp->CmdSetEvent(commandBuffer, event, stageMask); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2102 | } |
| 2103 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2104 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 2105 | vkCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, |
| 2106 | VkPipelineStageFlags stageMask) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2107 | const VkLayerDispatchTable *disp; |
| 2108 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 2109 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2110 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 2111 | disp->CmdResetEvent(commandBuffer, event, stageMask); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2112 | } |
| 2113 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2114 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 2115 | vkCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, |
| 2116 | const VkEvent *pEvents, VkPipelineStageFlags sourceStageMask, |
| 2117 | VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, |
| 2118 | const VkMemoryBarrier *pMemoryBarriers, |
| 2119 | uint32_t bufferMemoryBarrierCount, |
| 2120 | const VkBufferMemoryBarrier *pBufferMemoryBarriers, |
| 2121 | uint32_t imageMemoryBarrierCount, |
| 2122 | const VkImageMemoryBarrier *pImageMemoryBarriers) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2123 | const VkLayerDispatchTable *disp; |
| 2124 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 2125 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2126 | |
Jon Ashburn | f19916e | 2016-01-11 13:12:43 -0700 | [diff] [blame] | 2127 | disp->CmdWaitEvents(commandBuffer, eventCount, pEvents, sourceStageMask, |
| 2128 | dstStageMask, memoryBarrierCount, pMemoryBarriers, |
| 2129 | bufferMemoryBarrierCount, pBufferMemoryBarriers, |
| 2130 | imageMemoryBarrierCount, pImageMemoryBarriers); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2131 | } |
| 2132 | |
Jon Ashburn | f19916e | 2016-01-11 13:12:43 -0700 | [diff] [blame] | 2133 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdPipelineBarrier( |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2134 | VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, |
| 2135 | VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, |
| 2136 | uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers, |
| 2137 | uint32_t bufferMemoryBarrierCount, |
| 2138 | const VkBufferMemoryBarrier *pBufferMemoryBarriers, |
| 2139 | uint32_t imageMemoryBarrierCount, |
| 2140 | const VkImageMemoryBarrier *pImageMemoryBarriers) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2141 | const VkLayerDispatchTable *disp; |
| 2142 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 2143 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2144 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2145 | disp->CmdPipelineBarrier( |
| 2146 | commandBuffer, srcStageMask, dstStageMask, dependencyFlags, |
| 2147 | memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount, |
| 2148 | pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2149 | } |
| 2150 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2151 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 2152 | vkCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, |
| 2153 | uint32_t slot, VkFlags flags) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2154 | const VkLayerDispatchTable *disp; |
| 2155 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 2156 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2157 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 2158 | disp->CmdBeginQuery(commandBuffer, queryPool, slot, flags); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2159 | } |
| 2160 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2161 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 2162 | vkCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, |
| 2163 | uint32_t slot) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2164 | const VkLayerDispatchTable *disp; |
| 2165 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 2166 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2167 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 2168 | disp->CmdEndQuery(commandBuffer, queryPool, slot); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2169 | } |
| 2170 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2171 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 2172 | vkCmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool, |
| 2173 | uint32_t firstQuery, uint32_t queryCount) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2174 | const VkLayerDispatchTable *disp; |
| 2175 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 2176 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2177 | |
Jon Ashburn | 19d3bf1 | 2015-12-30 14:06:55 -0700 | [diff] [blame] | 2178 | disp->CmdResetQueryPool(commandBuffer, queryPool, firstQuery, queryCount); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2179 | } |
| 2180 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2181 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 2182 | vkCmdWriteTimestamp(VkCommandBuffer commandBuffer, |
| 2183 | VkPipelineStageFlagBits pipelineStage, |
| 2184 | VkQueryPool queryPool, uint32_t slot) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2185 | const VkLayerDispatchTable *disp; |
| 2186 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 2187 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2188 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 2189 | disp->CmdWriteTimestamp(commandBuffer, pipelineStage, queryPool, slot); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2190 | } |
| 2191 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2192 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 2193 | vkCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool, |
| 2194 | uint32_t firstQuery, uint32_t queryCount, |
| 2195 | VkBuffer dstBuffer, VkDeviceSize dstOffset, |
| 2196 | VkDeviceSize stride, VkFlags flags) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2197 | const VkLayerDispatchTable *disp; |
| 2198 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 2199 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2200 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2201 | disp->CmdCopyQueryPoolResults(commandBuffer, queryPool, firstQuery, |
| 2202 | queryCount, dstBuffer, dstOffset, stride, |
| 2203 | flags); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2204 | } |
| 2205 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2206 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 2207 | vkCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout, |
| 2208 | VkShaderStageFlags stageFlags, uint32_t offset, |
| 2209 | uint32_t size, const void *pValues) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2210 | const VkLayerDispatchTable *disp; |
| 2211 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 2212 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2213 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2214 | disp->CmdPushConstants(commandBuffer, layout, stageFlags, offset, size, |
| 2215 | pValues); |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 2216 | } |
| 2217 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2218 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 2219 | vkCmdBeginRenderPass(VkCommandBuffer commandBuffer, |
| 2220 | const VkRenderPassBeginInfo *pRenderPassBegin, |
| 2221 | VkSubpassContents contents) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2222 | const VkLayerDispatchTable *disp; |
| 2223 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 2224 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2225 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 2226 | disp->CmdBeginRenderPass(commandBuffer, pRenderPassBegin, contents); |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 2227 | } |
| 2228 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2229 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 2230 | vkCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents) { |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 2231 | const VkLayerDispatchTable *disp; |
| 2232 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 2233 | disp = loader_get_dispatch(commandBuffer); |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 2234 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 2235 | disp->CmdNextSubpass(commandBuffer, contents); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2236 | } |
| 2237 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2238 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 2239 | vkCmdEndRenderPass(VkCommandBuffer commandBuffer) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2240 | const VkLayerDispatchTable *disp; |
| 2241 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 2242 | disp = loader_get_dispatch(commandBuffer); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2243 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 2244 | disp->CmdEndRenderPass(commandBuffer); |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 2245 | } |
| 2246 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2247 | LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 2248 | vkCmdExecuteCommands(VkCommandBuffer commandBuffer, |
| 2249 | uint32_t commandBuffersCount, |
| 2250 | const VkCommandBuffer *pCommandBuffers) { |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 2251 | const VkLayerDispatchTable *disp; |
| 2252 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 2253 | disp = loader_get_dispatch(commandBuffer); |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 2254 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2255 | disp->CmdExecuteCommands(commandBuffer, commandBuffersCount, |
| 2256 | pCommandBuffers); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2257 | } |