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