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