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