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