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