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