blob: dfd2c0001101f5236370322718107582abba1323 [file] [log] [blame]
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001/*
Jon Ashburn2139a3e2015-05-06 09:02:10 -06002 *
Jon Ashburn44aed662016-02-02 17:47:28 -07003 * Copyright (c) 2015-2016 The Khronos Group Inc.
4 * Copyright (c) 2015-2016 Valve Corporation
5 * Copyright (c) 2015-2016 LunarG, Inc.
Courtney Goeltzenleuchterebbb96d2015-12-02 14:53:22 -07006 * Copyright (C) 2015 Google Inc.
Jon Ashburn2139a3e2015-05-06 09:02:10 -06007 *
Jon Ashburn44aed662016-02-02 17:47:28 -07008 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and/or associated documentation files (the "Materials"), to
10 * deal in the Materials without restriction, including without limitation the
11 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12 * sell copies of the Materials, and to permit persons to whom the Materials are
13 * furnished to do so, subject to the following conditions:
Jon Ashburn2139a3e2015-05-06 09:02:10 -060014 *
Jon Ashburn44aed662016-02-02 17:47:28 -070015 * The above copyright notice(s) and this permission notice shall be included in
16 * all copies or substantial portions of the Materials.
Jon Ashburn2139a3e2015-05-06 09:02:10 -060017 *
Jon Ashburn44aed662016-02-02 17:47:28 -070018 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
Jon Ashburn2139a3e2015-05-06 09:02:10 -060019 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Jon Ashburn44aed662016-02-02 17:47:28 -070020 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
Courtney Goeltzenleuchter96cd7952015-10-30 11:14:30 -060021 *
Jon Ashburn44aed662016-02-02 17:47:28 -070022 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
23 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE
25 * USE OR OTHER DEALINGS IN THE MATERIALS.
26 *
27 * Author: Courtney Goeltzenleuchter <courtney@lunarg.com>
Courtney Goeltzenleuchter96cd7952015-10-30 11:14:30 -060028 * Author: Jon Ashburn <jon@lunarg.com>
29 * Author: Tony Barbour <tony@LunarG.com>
Jon Ashburn44aed662016-02-02 17:47:28 -070030 * Author: Chia-I Wu <olv@lunarg.com>
Jon Ashburn2139a3e2015-05-06 09:02:10 -060031 */
Courtney Goeltzenleuchterb620ace2015-07-05 11:28:29 -060032#define _GNU_SOURCE
Jon Ashburnfce93d92015-05-12 17:26:48 -060033#include <stdlib.h>
34#include <string.h>
Jon Ashburn2139a3e2015-05-06 09:02:10 -060035
Tobin Ehlis7a51d902015-07-03 10:34:49 -060036#include "vk_loader_platform.h"
Jon Ashburn2139a3e2015-05-06 09:02:10 -060037#include "loader.h"
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -060038#include "debug_report.h"
Ian Elliotta81e8ac2015-10-30 15:28:23 -060039#include "wsi.h"
Jon Ashburn2139a3e2015-05-06 09:02:10 -060040
41/* Trampoline entrypoints */
Jon Ashburn44aed662016-02-02 17:47:28 -070042LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
43vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo,
44 const VkAllocationCallbacks *pAllocator,
45 VkInstance *pInstance) {
Jon Ashburnfce93d92015-05-12 17:26:48 -060046 struct loader_instance *ptr_instance = NULL;
Jon Ashburnebbfd5b2016-01-18 12:20:03 -070047 VkInstance created_instance = VK_NULL_HANDLE;
Jon Ashburnfce93d92015-05-12 17:26:48 -060048 VkResult res = VK_ERROR_INITIALIZATION_FAILED;
Courtney Goeltzenleuchteracb13592015-12-09 15:48:16 -070049 VkDebugReportCallbackEXT instance_callback = VK_NULL_HANDLE;
Jon Ashburn44aed662016-02-02 17:47:28 -070050 void *pNext = (void *)pCreateInfo->pNext;
Jon Ashburnfce93d92015-05-12 17:26:48 -060051
Jon Ashburn754f1992015-08-18 18:04:47 -060052 loader_platform_thread_once(&once_init, loader_initialize);
Jon Ashburnfce93d92015-05-12 17:26:48 -060053
Jon Ashburnd13241a2016-01-25 14:51:47 -070054#if 0
55 if (pAllocator) {
Chia-I Wu1f851912015-10-27 18:04:07 +080056 ptr_instance = (struct loader_instance *) pAllocator->pfnAllocation(
Chia-I Wu69f40122015-10-26 21:10:41 +080057 pAllocator->pUserData,
Courtney Goeltzenleuchter1381cd12015-07-06 09:08:37 -060058 sizeof(struct loader_instance),
Jon Ashburn9a3c2b42016-01-07 15:21:14 -070059 sizeof(int *),
Chia-I Wu1f851912015-10-27 18:04:07 +080060 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
Courtney Goeltzenleuchter1381cd12015-07-06 09:08:37 -060061 } else {
Jon Ashburnd13241a2016-01-25 14:51:47 -070062#endif
Jon Ashburn44aed662016-02-02 17:47:28 -070063 ptr_instance =
64 (struct loader_instance *)malloc(sizeof(struct loader_instance));
Jon Ashburnd13241a2016-01-25 14:51:47 -070065 //}
Jon Ashburnfce93d92015-05-12 17:26:48 -060066 if (ptr_instance == NULL) {
67 return VK_ERROR_OUT_OF_HOST_MEMORY;
68 }
Courtney Goeltzenleuchter1381cd12015-07-06 09:08:37 -060069
Jon Ashburn413d6582015-08-28 15:19:27 -060070 tls_instance = ptr_instance;
Courtney Goeltzenleuchter1381cd12015-07-06 09:08:37 -060071 loader_platform_thread_lock_mutex(&loader_lock);
Jon Ashburn182b8302015-08-11 14:49:54 -060072 memset(ptr_instance, 0, sizeof(struct loader_instance));
Jon Ashburnd13241a2016-01-25 14:51:47 -070073#if 0
Chia-I Wu69f40122015-10-26 21:10:41 +080074 if (pAllocator) {
75 ptr_instance->alloc_callbacks = *pAllocator;
Courtney Goeltzenleuchterb620ace2015-07-05 11:28:29 -060076 }
Jon Ashburnd13241a2016-01-25 14:51:47 -070077#endif
Courtney Goeltzenleuchterb620ace2015-07-05 11:28:29 -060078
Courtney Goeltzenleuchter6d8be2d2015-12-03 13:45:51 -070079 /*
80 * Look for a debug report create info structure
81 * and setup a callback if found.
82 */
83 while (pNext) {
Jon Ashburn44aed662016-02-02 17:47:28 -070084 if (((VkInstanceCreateInfo *)pNext)->sType ==
85 VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT) {
86 instance_callback = (VkDebugReportCallbackEXT)ptr_instance;
87 if (util_CreateDebugReportCallback(ptr_instance, pNext, NULL,
88 instance_callback)) {
Courtney Goeltzenleuchter6d8be2d2015-12-03 13:45:51 -070089 loader_heap_free(ptr_instance, ptr_instance);
Courtney Goeltzenleuchter15436c12015-12-02 15:29:33 -070090 loader_platform_thread_unlock_mutex(&loader_lock);
91 return VK_ERROR_OUT_OF_HOST_MEMORY;
92 }
93 }
Jon Ashburn44aed662016-02-02 17:47:28 -070094 pNext = (void *)((VkInstanceCreateInfo *)pNext)->pNext;
Courtney Goeltzenleuchter15436c12015-12-02 15:29:33 -070095 }
96
Jon Ashburne9ca8fa2015-08-20 16:35:30 -060097 /* Due to implicit layers need to get layer list even if
Jon Ashburna4ae48b2016-01-11 13:12:43 -070098 * enabledLayerCount == 0 and VK_INSTANCE_LAYERS is unset. For now always
Jon Ashburne9ca8fa2015-08-20 16:35:30 -060099 * get layer list (both instance and device) via loader_layer_scan(). */
Jon Ashburn44aed662016-02-02 17:47:28 -0700100 memset(&ptr_instance->instance_layer_list, 0,
101 sizeof(ptr_instance->instance_layer_list));
102 memset(&ptr_instance->device_layer_list, 0,
103 sizeof(ptr_instance->device_layer_list));
104 loader_layer_scan(ptr_instance, &ptr_instance->instance_layer_list,
Jon Ashburne58f1a32015-08-28 13:38:21 -0600105 &ptr_instance->device_layer_list);
Jon Ashburne9ca8fa2015-08-20 16:35:30 -0600106
107 /* validate the app requested layers to be enabled */
Jon Ashburna4ae48b2016-01-11 13:12:43 -0700108 if (pCreateInfo->enabledLayerCount > 0) {
Jon Ashburn7ec85cd2016-02-10 20:50:19 -0700109 res =
110 loader_validate_layers(ptr_instance, pCreateInfo->enabledLayerCount,
111 pCreateInfo->ppEnabledLayerNames,
112 &ptr_instance->instance_layer_list);
Jon Ashburne9ca8fa2015-08-20 16:35:30 -0600113 if (res != VK_SUCCESS) {
Jon Ashburn44aed662016-02-02 17:47:28 -0700114 util_DestroyDebugReportCallback(ptr_instance, instance_callback,
115 NULL);
Courtney Goeltzenleuchter6d8be2d2015-12-03 13:45:51 -0700116 loader_heap_free(ptr_instance, ptr_instance);
Jon Ashburn19d11ea2015-10-09 09:40:30 -0600117 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburne9ca8fa2015-08-20 16:35:30 -0600118 return res;
119 }
120 }
121
Jon Ashburn715de582016-02-10 20:59:26 -0700122 /* convert any meta layers to the actual layers makes a copy of layer name*/
123 uint32_t saved_layer_count = pCreateInfo->enabledLayerCount;
Jon Ashburna0eecb22016-02-11 18:59:43 -0700124 char **saved_layer_names;
125 char **saved_layer_ptr;
126 saved_layer_names =
127 loader_stack_alloc(sizeof(char *) * pCreateInfo->enabledLayerCount);
Jon Ashburn715de582016-02-10 20:59:26 -0700128 for (uint32_t i = 0; i < saved_layer_count; i++) {
129 saved_layer_names[i] = (char *)pCreateInfo->ppEnabledLayerNames[i];
130 }
Jon Ashburna0eecb22016-02-11 18:59:43 -0700131 saved_layer_ptr = (char **)pCreateInfo->ppEnabledLayerNames;
Jon Ashburn715de582016-02-10 20:59:26 -0700132
133 loader_expand_layer_names(
134 ptr_instance, std_validation_str,
135 sizeof(std_validation_names) / sizeof(std_validation_names[0]),
136 std_validation_names, (uint32_t *)&pCreateInfo->enabledLayerCount,
137 (char ***)&pCreateInfo->ppEnabledLayerNames);
138
Jon Ashburn754f1992015-08-18 18:04:47 -0600139 /* Scan/discover all ICD libraries */
140 memset(&ptr_instance->icd_libs, 0, sizeof(ptr_instance->icd_libs));
Jon Ashburne58f1a32015-08-28 13:38:21 -0600141 loader_icd_scan(ptr_instance, &ptr_instance->icd_libs);
Jon Ashburn754f1992015-08-18 18:04:47 -0600142
Jon Ashburncfe4e682015-08-14 12:51:47 -0600143 /* get extensions from all ICD's, merge so no duplicates, then validate */
Jon Ashburn44aed662016-02-02 17:47:28 -0700144 loader_get_icd_loader_instance_extensions(
145 ptr_instance, &ptr_instance->icd_libs, &ptr_instance->ext_list);
146 res = loader_validate_instance_extensions(
Jon Ashburn7ec85cd2016-02-10 20:50:19 -0700147 ptr_instance, &ptr_instance->ext_list,
148 &ptr_instance->instance_layer_list, pCreateInfo);
Jon Ashburncfe4e682015-08-14 12:51:47 -0600149 if (res != VK_SUCCESS) {
Jon Ashburna0eecb22016-02-11 18:59:43 -0700150 loader_unexpand_inst_layer_names(ptr_instance, saved_layer_count,
151 saved_layer_names, saved_layer_ptr,
Jon Ashburn715de582016-02-10 20:59:26 -0700152 pCreateInfo);
Jon Ashburne58f1a32015-08-28 13:38:21 -0600153 loader_delete_layer_properties(ptr_instance,
154 &ptr_instance->device_layer_list);
155 loader_delete_layer_properties(ptr_instance,
156 &ptr_instance->instance_layer_list);
157 loader_scanned_icd_clear(ptr_instance, &ptr_instance->icd_libs);
Jon Ashburn44aed662016-02-02 17:47:28 -0700158 loader_destroy_generic_list(
159 ptr_instance,
160 (struct loader_generic_list *)&ptr_instance->ext_list);
Jon Ashburnd13241a2016-01-25 14:51:47 -0700161 util_DestroyDebugReportCallback(ptr_instance, instance_callback, NULL);
Jon Ashburncfe4e682015-08-14 12:51:47 -0600162 loader_platform_thread_unlock_mutex(&loader_lock);
163 loader_heap_free(ptr_instance, ptr_instance);
164 return res;
165 }
166
Jon Ashburn44aed662016-02-02 17:47:28 -0700167 ptr_instance->disp =
168 loader_heap_alloc(ptr_instance, sizeof(VkLayerInstanceDispatchTable),
169 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
Courtney Goeltzenleuchter1381cd12015-07-06 09:08:37 -0600170 if (ptr_instance->disp == NULL) {
Jon Ashburna0eecb22016-02-11 18:59:43 -0700171 loader_unexpand_inst_layer_names(ptr_instance, saved_layer_count,
172 saved_layer_names, saved_layer_ptr,
Jon Ashburn715de582016-02-10 20:59:26 -0700173 pCreateInfo);
Jon Ashburne58f1a32015-08-28 13:38:21 -0600174 loader_delete_layer_properties(ptr_instance,
175 &ptr_instance->device_layer_list);
176 loader_delete_layer_properties(ptr_instance,
177 &ptr_instance->instance_layer_list);
Jon Ashburn44aed662016-02-02 17:47:28 -0700178 loader_scanned_icd_clear(ptr_instance, &ptr_instance->icd_libs);
179 loader_destroy_generic_list(
180 ptr_instance,
181 (struct loader_generic_list *)&ptr_instance->ext_list);
Jon Ashburnd13241a2016-01-25 14:51:47 -0700182 util_DestroyDebugReportCallback(ptr_instance, instance_callback, NULL);
Courtney Goeltzenleuchter1381cd12015-07-06 09:08:37 -0600183 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburncfe4e682015-08-14 12:51:47 -0600184 loader_heap_free(ptr_instance, ptr_instance);
Courtney Goeltzenleuchter1381cd12015-07-06 09:08:37 -0600185 return VK_ERROR_OUT_OF_HOST_MEMORY;
186 }
187 memcpy(ptr_instance->disp, &instance_disp, sizeof(instance_disp));
188 ptr_instance->next = loader.instances;
189 loader.instances = ptr_instance;
190
Jon Ashburn182b8302015-08-11 14:49:54 -0600191 /* activate any layers on instance chain */
Jon Ashburn44aed662016-02-02 17:47:28 -0700192 res = loader_enable_instance_layers(ptr_instance, pCreateInfo,
Jon Ashburne58f1a32015-08-28 13:38:21 -0600193 &ptr_instance->instance_layer_list);
Courtney Goeltzenleuchter1381cd12015-07-06 09:08:37 -0600194 if (res != VK_SUCCESS) {
Jon Ashburna0eecb22016-02-11 18:59:43 -0700195 loader_unexpand_inst_layer_names(ptr_instance, saved_layer_count,
196 saved_layer_names, saved_layer_ptr,
Jon Ashburn715de582016-02-10 20:59:26 -0700197 pCreateInfo);
Jon Ashburne58f1a32015-08-28 13:38:21 -0600198 loader_delete_layer_properties(ptr_instance,
199 &ptr_instance->device_layer_list);
200 loader_delete_layer_properties(ptr_instance,
201 &ptr_instance->instance_layer_list);
Jon Ashburn44aed662016-02-02 17:47:28 -0700202 loader_scanned_icd_clear(ptr_instance, &ptr_instance->icd_libs);
203 loader_destroy_generic_list(
204 ptr_instance,
205 (struct loader_generic_list *)&ptr_instance->ext_list);
Jon Ashburncfe4e682015-08-14 12:51:47 -0600206 loader.instances = ptr_instance->next;
Jon Ashburnd13241a2016-01-25 14:51:47 -0700207 util_DestroyDebugReportCallback(ptr_instance, instance_callback, NULL);
Jon Ashburncfe4e682015-08-14 12:51:47 -0600208 loader_platform_thread_unlock_mutex(&loader_lock);
Courtney Goeltzenleuchter1381cd12015-07-06 09:08:37 -0600209 loader_heap_free(ptr_instance, ptr_instance->disp);
210 loader_heap_free(ptr_instance, ptr_instance);
211 return res;
212 }
Jon Ashburncedc15f2015-05-21 18:13:33 -0600213
Jon Ashburn44aed662016-02-02 17:47:28 -0700214 created_instance = (VkInstance)ptr_instance;
215 res = loader_create_instance_chain(pCreateInfo, pAllocator, ptr_instance,
Jon Ashburna4b34942016-02-03 12:37:30 -0700216 &created_instance);
Jon Ashburna179dcf2015-05-21 17:42:17 -0600217
Jon Ashburn7da19ee2016-01-14 13:51:55 -0700218 if (res == VK_SUCCESS) {
Courtney Goeltzenleuchter2bdf6da2016-01-08 12:18:43 -0700219 wsi_create_instance(ptr_instance, pCreateInfo);
220 debug_report_create_instance(ptr_instance, pCreateInfo);
221
Jon Ashburnebbfd5b2016-01-18 12:20:03 -0700222 *pInstance = created_instance;
Courtney Goeltzenleuchter2bdf6da2016-01-08 12:18:43 -0700223
Jon Ashburn7da19ee2016-01-14 13:51:55 -0700224 /*
225 * Finally have the layers in place and everyone has seen
226 * the CreateInstance command go by. This allows the layer's
227 * GetInstanceProcAddr functions to return valid extension functions
228 * if enabled.
229 */
230 loader_activate_instance_layer_extensions(ptr_instance, *pInstance);
Courtney Goeltzenleuchter2bdf6da2016-01-08 12:18:43 -0700231 } else {
232 // TODO: cleanup here.
Jon Ashburn7da19ee2016-01-14 13:51:55 -0700233 }
Courtney Goeltzenleuchter2bdf6da2016-01-08 12:18:43 -0700234
Courtney Goeltzenleuchter6d8be2d2015-12-03 13:45:51 -0700235 /* Remove temporary debug_report callback */
Jon Ashburnd13241a2016-01-25 14:51:47 -0700236 util_DestroyDebugReportCallback(ptr_instance, instance_callback, NULL);
Jon Ashburna0eecb22016-02-11 18:59:43 -0700237 loader_unexpand_inst_layer_names(ptr_instance, saved_layer_count,
238 saved_layer_names, saved_layer_ptr,
Jon Ashburn715de582016-02-10 20:59:26 -0700239 pCreateInfo);
Jon Ashburnb40f2562015-05-29 13:15:39 -0600240 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburnfce93d92015-05-12 17:26:48 -0600241 return res;
242}
243
Jon Ashburn44aed662016-02-02 17:47:28 -0700244LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
245vkDestroyInstance(VkInstance instance,
246 const VkAllocationCallbacks *pAllocator) {
Jon Ashburnfce93d92015-05-12 17:26:48 -0600247 const VkLayerInstanceDispatchTable *disp;
Jon Ashburn0c5eea22015-09-30 12:56:42 -0600248 struct loader_instance *ptr_instance = NULL;
Jon Ashburnfce93d92015-05-12 17:26:48 -0600249 disp = loader_get_instance_dispatch(instance);
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600250
Jon Ashburnb40f2562015-05-29 13:15:39 -0600251 loader_platform_thread_lock_mutex(&loader_lock);
252
Courtney Goeltzenleuchter6d8be2d2015-12-03 13:45:51 -0700253 /* TODO: Do we need a temporary callback here to catch cleanup issues? */
254
Jon Ashburn0c5eea22015-09-30 12:56:42 -0600255 ptr_instance = loader_get_instance(instance);
Chia-I Wu69f40122015-10-26 21:10:41 +0800256 disp->DestroyInstance(instance, pAllocator);
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600257
Courtney Goeltzenleuchter3d8dc1f2015-06-08 15:09:22 -0600258 loader_deactivate_instance_layers(ptr_instance);
Jon Ashburncfe4e682015-08-14 12:51:47 -0600259 loader_heap_free(ptr_instance, ptr_instance->disp);
260 loader_heap_free(ptr_instance, ptr_instance);
Jon Ashburnb40f2562015-05-29 13:15:39 -0600261 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburnfce93d92015-05-12 17:26:48 -0600262}
Jon Ashburn2666e2f2015-05-15 15:09:35 -0600263
Jon Ashburn44aed662016-02-02 17:47:28 -0700264LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
265vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount,
266 VkPhysicalDevice *pPhysicalDevices) {
Jon Ashburnfce93d92015-05-12 17:26:48 -0600267 const VkLayerInstanceDispatchTable *disp;
Jon Ashburnb40f2562015-05-29 13:15:39 -0600268 VkResult res;
Jon Ashburnfce93d92015-05-12 17:26:48 -0600269 disp = loader_get_instance_dispatch(instance);
Jon Ashburnb40f2562015-05-29 13:15:39 -0600270
271 loader_platform_thread_lock_mutex(&loader_lock);
272 res = disp->EnumeratePhysicalDevices(instance, pPhysicalDeviceCount,
Jon Ashburnfce93d92015-05-12 17:26:48 -0600273 pPhysicalDevices);
Jon Ashburnb40f2562015-05-29 13:15:39 -0600274 loader_platform_thread_unlock_mutex(&loader_lock);
275 return res;
Jon Ashburnfce93d92015-05-12 17:26:48 -0600276}
277
Jon Ashburn44aed662016-02-02 17:47:28 -0700278LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
279vkGetPhysicalDeviceFeatures(VkPhysicalDevice gpu,
280 VkPhysicalDeviceFeatures *pFeatures) {
Jon Ashburn4e189562015-07-23 18:49:07 -0600281 const VkLayerInstanceDispatchTable *disp;
Jon Ashburn4e189562015-07-23 18:49:07 -0600282
283 disp = loader_get_instance_dispatch(gpu);
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -0600284 disp->GetPhysicalDeviceFeatures(gpu, pFeatures);
Jon Ashburn4e189562015-07-23 18:49:07 -0600285}
286
Jon Ashburn44aed662016-02-02 17:47:28 -0700287LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
288vkGetPhysicalDeviceFormatProperties(VkPhysicalDevice gpu, VkFormat format,
289 VkFormatProperties *pFormatInfo) {
Jon Ashburn4e189562015-07-23 18:49:07 -0600290 const VkLayerInstanceDispatchTable *disp;
Jon Ashburn4e189562015-07-23 18:49:07 -0600291
292 disp = loader_get_instance_dispatch(gpu);
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -0600293 disp->GetPhysicalDeviceFormatProperties(gpu, format, pFormatInfo);
Jon Ashburn4e189562015-07-23 18:49:07 -0600294}
295
Jon Ashburn44aed662016-02-02 17:47:28 -0700296LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
297vkGetPhysicalDeviceImageFormatProperties(
298 VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type,
299 VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags,
300 VkImageFormatProperties *pImageFormatProperties) {
Jon Ashburn4e189562015-07-23 18:49:07 -0600301 const VkLayerInstanceDispatchTable *disp;
Jon Ashburn4e189562015-07-23 18:49:07 -0600302
303 disp = loader_get_instance_dispatch(physicalDevice);
Jon Ashburn44aed662016-02-02 17:47:28 -0700304 return disp->GetPhysicalDeviceImageFormatProperties(
305 physicalDevice, format, type, tiling, usage, flags,
306 pImageFormatProperties);
Jon Ashburn4e189562015-07-23 18:49:07 -0600307}
308
Jon Ashburn44aed662016-02-02 17:47:28 -0700309LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
310vkGetPhysicalDeviceProperties(VkPhysicalDevice gpu,
311 VkPhysicalDeviceProperties *pProperties) {
Jon Ashburn2666e2f2015-05-15 15:09:35 -0600312 const VkLayerInstanceDispatchTable *disp;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600313
Jon Ashburn2666e2f2015-05-15 15:09:35 -0600314 disp = loader_get_instance_dispatch(gpu);
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -0600315 disp->GetPhysicalDeviceProperties(gpu, pProperties);
Tony Barbour426b9052015-06-24 16:06:58 -0600316}
317
Jon Ashburn44aed662016-02-02 17:47:28 -0700318LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
319vkGetPhysicalDeviceQueueFamilyProperties(
320 VkPhysicalDevice gpu, uint32_t *pQueueFamilyPropertyCount,
321 VkQueueFamilyProperties *pQueueProperties) {
Tony Barbour426b9052015-06-24 16:06:58 -0600322 const VkLayerInstanceDispatchTable *disp;
Tony Barbour426b9052015-06-24 16:06:58 -0600323
324 disp = loader_get_instance_dispatch(gpu);
Jon Ashburn44aed662016-02-02 17:47:28 -0700325 disp->GetPhysicalDeviceQueueFamilyProperties(gpu, pQueueFamilyPropertyCount,
326 pQueueProperties);
Tony Barbour426b9052015-06-24 16:06:58 -0600327}
328
Chia-I Wuaf9e4fd2015-11-06 06:42:02 +0800329LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties(
Jon Ashburn44aed662016-02-02 17:47:28 -0700330 VkPhysicalDevice gpu, VkPhysicalDeviceMemoryProperties *pMemoryProperties) {
Tony Barbour426b9052015-06-24 16:06:58 -0600331 const VkLayerInstanceDispatchTable *disp;
Tony Barbour426b9052015-06-24 16:06:58 -0600332
333 disp = loader_get_instance_dispatch(gpu);
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -0600334 disp->GetPhysicalDeviceMemoryProperties(gpu, pMemoryProperties);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600335}
336
Jon Ashburn44aed662016-02-02 17:47:28 -0700337LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
338vkCreateDevice(VkPhysicalDevice gpu, const VkDeviceCreateInfo *pCreateInfo,
339 const VkAllocationCallbacks *pAllocator, VkDevice *pDevice) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600340 VkResult res;
341
Jon Ashburnb40f2562015-05-29 13:15:39 -0600342 loader_platform_thread_lock_mutex(&loader_lock);
Courtney Goeltzenleuchterbe637992015-06-25 18:01:43 -0600343
Chia-I Wu69f40122015-10-26 21:10:41 +0800344 res = loader_CreateDevice(gpu, pCreateInfo, pAllocator, pDevice);
Courtney Goeltzenleuchterbe637992015-06-25 18:01:43 -0600345
Jon Ashburnb40f2562015-05-29 13:15:39 -0600346 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600347 return res;
348}
349
Jon Ashburn44aed662016-02-02 17:47:28 -0700350LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
351vkDestroyDevice(VkDevice device, const VkAllocationCallbacks *pAllocator) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600352 const VkLayerDispatchTable *disp;
Jon Ashburne58f1a32015-08-28 13:38:21 -0600353 struct loader_device *dev;
Andrzej Kotlowski4a54a742016-02-03 09:41:53 +0100354
355 loader_platform_thread_lock_mutex(&loader_lock);
356
Jon Ashburne58f1a32015-08-28 13:38:21 -0600357 struct loader_icd *icd = loader_get_icd_and_device(device, &dev);
358 const struct loader_instance *inst = icd->this_instance;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600359 disp = loader_get_dispatch(device);
360
Chia-I Wu69f40122015-10-26 21:10:41 +0800361 disp->DestroyDevice(device, pAllocator);
Jon Ashburndbf8cee2015-11-19 15:43:26 -0700362 dev->device = NULL;
363 loader_remove_logical_device(inst, icd, dev);
364
Jon Ashburnb40f2562015-05-29 13:15:39 -0600365 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburnb40f2562015-05-29 13:15:39 -0600366}
367
Jon Ashburn44aed662016-02-02 17:47:28 -0700368LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
369vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice,
370 const char *pLayerName,
371 uint32_t *pPropertyCount,
372 VkExtensionProperties *pProperties) {
Jon Ashburnb40f2562015-05-29 13:15:39 -0600373 VkResult res;
374
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -0600375 loader_platform_thread_lock_mutex(&loader_lock);
Jon Ashburndb5a5bc2015-11-02 17:40:01 -0700376
377 /* If pLayerName == NULL, then querying ICD extensions, pass this call
378 down the instance chain which will terminate in the ICD. This allows
379 layers to filter the extensions coming back up the chain.
380 If pLayerName != NULL then get layer extensions from manifest file. */
Jon Ashburn44aed662016-02-02 17:47:28 -0700381 if (pLayerName == NULL || strlen(pLayerName) == 0) {
Jon Ashburndb5a5bc2015-11-02 17:40:01 -0700382 const VkLayerInstanceDispatchTable *disp;
383
384 disp = loader_get_instance_dispatch(physicalDevice);
Jon Ashburn44aed662016-02-02 17:47:28 -0700385 res = disp->EnumerateDeviceExtensionProperties(
386 physicalDevice, NULL, pPropertyCount, pProperties);
Jon Ashburndb5a5bc2015-11-02 17:40:01 -0700387 } else {
Jon Ashburn44aed662016-02-02 17:47:28 -0700388 res = loader_EnumerateDeviceExtensionProperties(
389 physicalDevice, pLayerName, pPropertyCount, pProperties);
Jon Ashburndb5a5bc2015-11-02 17:40:01 -0700390 }
391
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -0600392 loader_platform_thread_unlock_mutex(&loader_lock);
Tony Barbour426b9052015-06-24 16:06:58 -0600393 return res;
394}
395
Jon Ashburn44aed662016-02-02 17:47:28 -0700396LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
397vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice,
398 uint32_t *pPropertyCount,
399 VkLayerProperties *pProperties) {
Tony Barbour426b9052015-06-24 16:06:58 -0600400 VkResult res;
401
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -0600402 loader_platform_thread_lock_mutex(&loader_lock);
Jon Ashburndb5a5bc2015-11-02 17:40:01 -0700403
404 /* Don't dispatch this call down the instance chain, want all device layers
405 enumerated and instance chain may not contain all device layers */
Jon Ashburn44aed662016-02-02 17:47:28 -0700406 res = loader_EnumerateDeviceLayerProperties(physicalDevice, pPropertyCount,
407 pProperties);
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -0600408 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburnfce93d92015-05-12 17:26:48 -0600409 return res;
410}
411
Jon Ashburn44aed662016-02-02 17:47:28 -0700412LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
413vkGetDeviceQueue(VkDevice device, uint32_t queueNodeIndex, uint32_t queueIndex,
414 VkQueue *pQueue) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600415 const VkLayerDispatchTable *disp;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600416
417 disp = loader_get_dispatch(device);
418
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -0600419 disp->GetDeviceQueue(device, queueNodeIndex, queueIndex, pQueue);
420 loader_set_dispatch(*pQueue, disp);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600421}
422
Jon Ashburn44aed662016-02-02 17:47:28 -0700423LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
424vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo *pSubmits,
425 VkFence fence) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600426 const VkLayerDispatchTable *disp;
427
428 disp = loader_get_dispatch(queue);
429
Chia-I Wu483e7702015-10-26 17:20:32 +0800430 return disp->QueueSubmit(queue, submitCount, pSubmits, fence);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600431}
432
Jon Ashburn44aed662016-02-02 17:47:28 -0700433LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkQueueWaitIdle(VkQueue queue) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600434 const VkLayerDispatchTable *disp;
435
436 disp = loader_get_dispatch(queue);
437
438 return disp->QueueWaitIdle(queue);
439}
440
Jon Ashburn44aed662016-02-02 17:47:28 -0700441LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkDeviceWaitIdle(VkDevice device) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600442 const VkLayerDispatchTable *disp;
443
444 disp = loader_get_dispatch(device);
445
446 return disp->DeviceWaitIdle(device);
447}
448
Jon Ashburn44aed662016-02-02 17:47:28 -0700449LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
450vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo *pAllocateInfo,
451 const VkAllocationCallbacks *pAllocator,
452 VkDeviceMemory *pMemory) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600453 const VkLayerDispatchTable *disp;
454
455 disp = loader_get_dispatch(device);
456
Chia-I Wu1f851912015-10-27 18:04:07 +0800457 return disp->AllocateMemory(device, pAllocateInfo, pAllocator, pMemory);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600458}
459
Jon Ashburn44aed662016-02-02 17:47:28 -0700460LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
461vkFreeMemory(VkDevice device, VkDeviceMemory mem,
462 const VkAllocationCallbacks *pAllocator) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600463 const VkLayerDispatchTable *disp;
464
465 disp = loader_get_dispatch(device);
466
Chia-I Wu69f40122015-10-26 21:10:41 +0800467 disp->FreeMemory(device, mem, pAllocator);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600468}
469
Jon Ashburn44aed662016-02-02 17:47:28 -0700470LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
471vkMapMemory(VkDevice device, VkDeviceMemory mem, VkDeviceSize offset,
472 VkDeviceSize size, VkFlags flags, void **ppData) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600473 const VkLayerDispatchTable *disp;
474
475 disp = loader_get_dispatch(device);
476
477 return disp->MapMemory(device, mem, offset, size, flags, ppData);
478}
479
Jon Ashburn44aed662016-02-02 17:47:28 -0700480LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
481vkUnmapMemory(VkDevice device, VkDeviceMemory mem) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600482 const VkLayerDispatchTable *disp;
483
484 disp = loader_get_dispatch(device);
485
Mark Lobodzinski67b42b72015-09-07 13:59:43 -0600486 disp->UnmapMemory(device, mem);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600487}
488
Jon Ashburn44aed662016-02-02 17:47:28 -0700489LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
490vkFlushMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount,
491 const VkMappedMemoryRange *pMemoryRanges) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600492 const VkLayerDispatchTable *disp;
493
494 disp = loader_get_dispatch(device);
495
Jon Ashburn44aed662016-02-02 17:47:28 -0700496 return disp->FlushMappedMemoryRanges(device, memoryRangeCount,
497 pMemoryRanges);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600498}
499
Jon Ashburn44aed662016-02-02 17:47:28 -0700500LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
501vkInvalidateMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount,
502 const VkMappedMemoryRange *pMemoryRanges) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600503 const VkLayerDispatchTable *disp;
504
505 disp = loader_get_dispatch(device);
506
Jon Ashburn44aed662016-02-02 17:47:28 -0700507 return disp->InvalidateMappedMemoryRanges(device, memoryRangeCount,
508 pMemoryRanges);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600509}
510
Jon Ashburn44aed662016-02-02 17:47:28 -0700511LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
512vkGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory,
513 VkDeviceSize *pCommittedMemoryInBytes) {
Courtney Goeltzenleuchterd040c5c2015-07-09 21:57:28 -0600514 const VkLayerDispatchTable *disp;
515
516 disp = loader_get_dispatch(device);
517
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -0600518 disp->GetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes);
Courtney Goeltzenleuchterd040c5c2015-07-09 21:57:28 -0600519}
520
Jon Ashburn44aed662016-02-02 17:47:28 -0700521LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
522vkBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory mem,
523 VkDeviceSize offset) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600524 const VkLayerDispatchTable *disp;
525
Mark Lobodzinskifb9f5642015-05-11 17:21:15 -0500526 disp = loader_get_dispatch(device);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600527
Tony Barbourde4124d2015-07-03 10:33:54 -0600528 return disp->BindBufferMemory(device, buffer, mem, offset);
529}
530
Jon Ashburn44aed662016-02-02 17:47:28 -0700531LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
532vkBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory mem,
533 VkDeviceSize offset) {
Tony Barbourde4124d2015-07-03 10:33:54 -0600534 const VkLayerDispatchTable *disp;
535
536 disp = loader_get_dispatch(device);
537
538 return disp->BindImageMemory(device, image, mem, offset);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600539}
540
Jon Ashburn44aed662016-02-02 17:47:28 -0700541LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
542vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer,
543 VkMemoryRequirements *pMemoryRequirements) {
Jon Ashburn4e189562015-07-23 18:49:07 -0600544 const VkLayerDispatchTable *disp;
545
546 disp = loader_get_dispatch(device);
547
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -0600548 disp->GetBufferMemoryRequirements(device, buffer, pMemoryRequirements);
Jon Ashburn4e189562015-07-23 18:49:07 -0600549}
550
Jon Ashburn44aed662016-02-02 17:47:28 -0700551LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
552vkGetImageMemoryRequirements(VkDevice device, VkImage image,
553 VkMemoryRequirements *pMemoryRequirements) {
Jon Ashburn4e189562015-07-23 18:49:07 -0600554 const VkLayerDispatchTable *disp;
555
556 disp = loader_get_dispatch(device);
557
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -0600558 disp->GetImageMemoryRequirements(device, image, pMemoryRequirements);
Jon Ashburn4e189562015-07-23 18:49:07 -0600559}
560
Jon Ashburn44aed662016-02-02 17:47:28 -0700561LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetImageSparseMemoryRequirements(
562 VkDevice device, VkImage image, uint32_t *pSparseMemoryRequirementCount,
563 VkSparseImageMemoryRequirements *pSparseMemoryRequirements) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600564 const VkLayerDispatchTable *disp;
565
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -0600566 disp = loader_get_dispatch(device);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600567
Jon Ashburn44aed662016-02-02 17:47:28 -0700568 disp->GetImageSparseMemoryRequirements(device, image,
569 pSparseMemoryRequirementCount,
570 pSparseMemoryRequirements);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600571}
572
Jon Ashburn44aed662016-02-02 17:47:28 -0700573LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
574vkGetPhysicalDeviceSparseImageFormatProperties(
575 VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type,
576 VkSampleCountFlagBits samples, VkImageUsageFlags usage,
577 VkImageTiling tiling, uint32_t *pPropertyCount,
578 VkSparseImageFormatProperties *pProperties) {
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -0600579 const VkLayerInstanceDispatchTable *disp;
580
581 disp = loader_get_instance_dispatch(physicalDevice);
582
Jon Ashburn44aed662016-02-02 17:47:28 -0700583 disp->GetPhysicalDeviceSparseImageFormatProperties(
584 physicalDevice, format, type, samples, usage, tiling, pPropertyCount,
585 pProperties);
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -0600586}
587
Jon Ashburn44aed662016-02-02 17:47:28 -0700588LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
589vkQueueBindSparse(VkQueue queue, uint32_t bindInfoCount,
590 const VkBindSparseInfo *pBindInfo, VkFence fence) {
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -0600591 const VkLayerDispatchTable *disp;
592
593 disp = loader_get_dispatch(queue);
594
Chia-I Wu06809d52015-10-26 16:55:27 +0800595 return disp->QueueBindSparse(queue, bindInfoCount, pBindInfo, fence);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600596}
597
Jon Ashburn44aed662016-02-02 17:47:28 -0700598LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
599vkCreateFence(VkDevice device, const VkFenceCreateInfo *pCreateInfo,
600 const VkAllocationCallbacks *pAllocator, VkFence *pFence) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600601 const VkLayerDispatchTable *disp;
602
603 disp = loader_get_dispatch(device);
604
Chia-I Wu69f40122015-10-26 21:10:41 +0800605 return disp->CreateFence(device, pCreateInfo, pAllocator, pFence);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600606}
607
Jon Ashburn44aed662016-02-02 17:47:28 -0700608LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
609vkDestroyFence(VkDevice device, VkFence fence,
610 const VkAllocationCallbacks *pAllocator) {
Tony Barbourde4124d2015-07-03 10:33:54 -0600611 const VkLayerDispatchTable *disp;
612
613 disp = loader_get_dispatch(device);
614
Chia-I Wu69f40122015-10-26 21:10:41 +0800615 disp->DestroyFence(device, fence, pAllocator);
Tony Barbourde4124d2015-07-03 10:33:54 -0600616}
617
Jon Ashburn44aed662016-02-02 17:47:28 -0700618LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
619vkResetFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600620 const VkLayerDispatchTable *disp;
621
622 disp = loader_get_dispatch(device);
623
624 return disp->ResetFences(device, fenceCount, pFences);
625}
626
Jon Ashburn44aed662016-02-02 17:47:28 -0700627LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
628vkGetFenceStatus(VkDevice device, VkFence fence) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600629 const VkLayerDispatchTable *disp;
630
631 disp = loader_get_dispatch(device);
632
633 return disp->GetFenceStatus(device, fence);
634}
635
Jon Ashburn44aed662016-02-02 17:47:28 -0700636LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
637vkWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences,
638 VkBool32 waitAll, uint64_t timeout) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600639 const VkLayerDispatchTable *disp;
640
641 disp = loader_get_dispatch(device);
642
643 return disp->WaitForFences(device, fenceCount, pFences, waitAll, timeout);
644}
645
Jon Ashburn44aed662016-02-02 17:47:28 -0700646LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
647vkCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo *pCreateInfo,
648 const VkAllocationCallbacks *pAllocator,
649 VkSemaphore *pSemaphore) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600650 const VkLayerDispatchTable *disp;
651
652 disp = loader_get_dispatch(device);
653
Chia-I Wu69f40122015-10-26 21:10:41 +0800654 return disp->CreateSemaphore(device, pCreateInfo, pAllocator, pSemaphore);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600655}
656
Jon Ashburn44aed662016-02-02 17:47:28 -0700657LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
658vkDestroySemaphore(VkDevice device, VkSemaphore semaphore,
659 const VkAllocationCallbacks *pAllocator) {
Tony Barbourde4124d2015-07-03 10:33:54 -0600660 const VkLayerDispatchTable *disp;
661
662 disp = loader_get_dispatch(device);
663
Chia-I Wu69f40122015-10-26 21:10:41 +0800664 disp->DestroySemaphore(device, semaphore, pAllocator);
Tony Barbourde4124d2015-07-03 10:33:54 -0600665}
666
Jon Ashburn44aed662016-02-02 17:47:28 -0700667LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
668vkCreateEvent(VkDevice device, const VkEventCreateInfo *pCreateInfo,
669 const VkAllocationCallbacks *pAllocator, VkEvent *pEvent) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600670 const VkLayerDispatchTable *disp;
671
672 disp = loader_get_dispatch(device);
673
Chia-I Wu69f40122015-10-26 21:10:41 +0800674 return disp->CreateEvent(device, pCreateInfo, pAllocator, pEvent);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600675}
676
Jon Ashburn44aed662016-02-02 17:47:28 -0700677LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
678vkDestroyEvent(VkDevice device, VkEvent event,
679 const VkAllocationCallbacks *pAllocator) {
Tony Barbourde4124d2015-07-03 10:33:54 -0600680 const VkLayerDispatchTable *disp;
681
682 disp = loader_get_dispatch(device);
683
Chia-I Wu69f40122015-10-26 21:10:41 +0800684 disp->DestroyEvent(device, event, pAllocator);
Tony Barbourde4124d2015-07-03 10:33:54 -0600685}
686
Jon Ashburn44aed662016-02-02 17:47:28 -0700687LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
688vkGetEventStatus(VkDevice device, VkEvent event) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600689 const VkLayerDispatchTable *disp;
690
691 disp = loader_get_dispatch(device);
692
693 return disp->GetEventStatus(device, event);
694}
695
Jon Ashburn44aed662016-02-02 17:47:28 -0700696LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
697vkSetEvent(VkDevice device, VkEvent event) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600698 const VkLayerDispatchTable *disp;
699
700 disp = loader_get_dispatch(device);
701
702 return disp->SetEvent(device, event);
703}
704
Jon Ashburn44aed662016-02-02 17:47:28 -0700705LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
706vkResetEvent(VkDevice device, VkEvent event) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600707 const VkLayerDispatchTable *disp;
708
709 disp = loader_get_dispatch(device);
710
711 return disp->ResetEvent(device, event);
712}
713
Jon Ashburn44aed662016-02-02 17:47:28 -0700714LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
715vkCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo *pCreateInfo,
716 const VkAllocationCallbacks *pAllocator,
717 VkQueryPool *pQueryPool) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600718 const VkLayerDispatchTable *disp;
719
720 disp = loader_get_dispatch(device);
721
Chia-I Wu69f40122015-10-26 21:10:41 +0800722 return disp->CreateQueryPool(device, pCreateInfo, pAllocator, pQueryPool);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600723}
724
Jon Ashburn44aed662016-02-02 17:47:28 -0700725LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
726vkDestroyQueryPool(VkDevice device, VkQueryPool queryPool,
727 const VkAllocationCallbacks *pAllocator) {
Tony Barbourde4124d2015-07-03 10:33:54 -0600728 const VkLayerDispatchTable *disp;
729
730 disp = loader_get_dispatch(device);
731
Chia-I Wu69f40122015-10-26 21:10:41 +0800732 disp->DestroyQueryPool(device, queryPool, pAllocator);
Tony Barbourde4124d2015-07-03 10:33:54 -0600733}
734
Jon Ashburn44aed662016-02-02 17:47:28 -0700735LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
736vkGetQueryPoolResults(VkDevice device, VkQueryPool queryPool,
737 uint32_t firstQuery, uint32_t queryCount, size_t dataSize,
738 void *pData, VkDeviceSize stride,
739 VkQueryResultFlags flags) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600740 const VkLayerDispatchTable *disp;
741
742 disp = loader_get_dispatch(device);
743
Jon Ashburn44aed662016-02-02 17:47:28 -0700744 return disp->GetQueryPoolResults(device, queryPool, firstQuery, queryCount,
745 dataSize, pData, stride, flags);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600746}
747
Jon Ashburn44aed662016-02-02 17:47:28 -0700748LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
749vkCreateBuffer(VkDevice device, const VkBufferCreateInfo *pCreateInfo,
750 const VkAllocationCallbacks *pAllocator, VkBuffer *pBuffer) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600751 const VkLayerDispatchTable *disp;
752
753 disp = loader_get_dispatch(device);
754
Chia-I Wu69f40122015-10-26 21:10:41 +0800755 return disp->CreateBuffer(device, pCreateInfo, pAllocator, pBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600756}
757
Jon Ashburn44aed662016-02-02 17:47:28 -0700758LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
759vkDestroyBuffer(VkDevice device, VkBuffer buffer,
760 const VkAllocationCallbacks *pAllocator) {
Tony Barbourde4124d2015-07-03 10:33:54 -0600761 const VkLayerDispatchTable *disp;
762
763 disp = loader_get_dispatch(device);
764
Chia-I Wu69f40122015-10-26 21:10:41 +0800765 disp->DestroyBuffer(device, buffer, pAllocator);
Tony Barbourde4124d2015-07-03 10:33:54 -0600766}
767
Jon Ashburn44aed662016-02-02 17:47:28 -0700768LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
769vkCreateBufferView(VkDevice device, const VkBufferViewCreateInfo *pCreateInfo,
770 const VkAllocationCallbacks *pAllocator,
771 VkBufferView *pView) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600772 const VkLayerDispatchTable *disp;
773
774 disp = loader_get_dispatch(device);
775
Chia-I Wu69f40122015-10-26 21:10:41 +0800776 return disp->CreateBufferView(device, pCreateInfo, pAllocator, pView);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600777}
778
Jon Ashburn44aed662016-02-02 17:47:28 -0700779LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
780vkDestroyBufferView(VkDevice device, VkBufferView bufferView,
781 const VkAllocationCallbacks *pAllocator) {
Tony Barbourde4124d2015-07-03 10:33:54 -0600782 const VkLayerDispatchTable *disp;
783
784 disp = loader_get_dispatch(device);
785
Chia-I Wu69f40122015-10-26 21:10:41 +0800786 disp->DestroyBufferView(device, bufferView, pAllocator);
Tony Barbourde4124d2015-07-03 10:33:54 -0600787}
788
Jon Ashburn44aed662016-02-02 17:47:28 -0700789LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
790vkCreateImage(VkDevice device, const VkImageCreateInfo *pCreateInfo,
791 const VkAllocationCallbacks *pAllocator, VkImage *pImage) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600792 const VkLayerDispatchTable *disp;
793
794 disp = loader_get_dispatch(device);
795
Chia-I Wu69f40122015-10-26 21:10:41 +0800796 return disp->CreateImage(device, pCreateInfo, pAllocator, pImage);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600797}
798
Jon Ashburn44aed662016-02-02 17:47:28 -0700799LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
800vkDestroyImage(VkDevice device, VkImage image,
801 const VkAllocationCallbacks *pAllocator) {
Tony Barbourde4124d2015-07-03 10:33:54 -0600802 const VkLayerDispatchTable *disp;
803
804 disp = loader_get_dispatch(device);
805
Chia-I Wu69f40122015-10-26 21:10:41 +0800806 disp->DestroyImage(device, image, pAllocator);
Tony Barbourde4124d2015-07-03 10:33:54 -0600807}
808
Jon Ashburn44aed662016-02-02 17:47:28 -0700809LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
810vkGetImageSubresourceLayout(VkDevice device, VkImage image,
811 const VkImageSubresource *pSubresource,
812 VkSubresourceLayout *pLayout) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600813 const VkLayerDispatchTable *disp;
814
815 disp = loader_get_dispatch(device);
816
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -0600817 disp->GetImageSubresourceLayout(device, image, pSubresource, pLayout);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600818}
819
Jon Ashburn44aed662016-02-02 17:47:28 -0700820LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
821vkCreateImageView(VkDevice device, const VkImageViewCreateInfo *pCreateInfo,
822 const VkAllocationCallbacks *pAllocator, VkImageView *pView) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600823 const VkLayerDispatchTable *disp;
824
825 disp = loader_get_dispatch(device);
826
Chia-I Wu69f40122015-10-26 21:10:41 +0800827 return disp->CreateImageView(device, pCreateInfo, pAllocator, pView);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600828}
829
Jon Ashburn44aed662016-02-02 17:47:28 -0700830LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
831vkDestroyImageView(VkDevice device, VkImageView imageView,
832 const VkAllocationCallbacks *pAllocator) {
Tony Barbourde4124d2015-07-03 10:33:54 -0600833 const VkLayerDispatchTable *disp;
834
835 disp = loader_get_dispatch(device);
836
Chia-I Wu69f40122015-10-26 21:10:41 +0800837 disp->DestroyImageView(device, imageView, pAllocator);
Tony Barbourde4124d2015-07-03 10:33:54 -0600838}
839
Jon Ashburn44aed662016-02-02 17:47:28 -0700840LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
841vkCreateShaderModule(VkDevice device,
842 const VkShaderModuleCreateInfo *pCreateInfo,
843 const VkAllocationCallbacks *pAllocator,
844 VkShaderModule *pShader) {
Courtney Goeltzenleuchter0b29b0d2015-06-24 18:24:19 -0600845 const VkLayerDispatchTable *disp;
846
847 disp = loader_get_dispatch(device);
848
Chia-I Wu69f40122015-10-26 21:10:41 +0800849 return disp->CreateShaderModule(device, pCreateInfo, pAllocator, pShader);
Courtney Goeltzenleuchter0b29b0d2015-06-24 18:24:19 -0600850}
851
Jon Ashburn44aed662016-02-02 17:47:28 -0700852LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
853vkDestroyShaderModule(VkDevice device, VkShaderModule shaderModule,
854 const VkAllocationCallbacks *pAllocator) {
Tony Barbourde4124d2015-07-03 10:33:54 -0600855 const VkLayerDispatchTable *disp;
856
857 disp = loader_get_dispatch(device);
858
Chia-I Wu69f40122015-10-26 21:10:41 +0800859 disp->DestroyShaderModule(device, shaderModule, pAllocator);
Tony Barbourde4124d2015-07-03 10:33:54 -0600860}
861
Jon Ashburn44aed662016-02-02 17:47:28 -0700862LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
863vkCreatePipelineCache(VkDevice device,
864 const VkPipelineCacheCreateInfo *pCreateInfo,
865 const VkAllocationCallbacks *pAllocator,
866 VkPipelineCache *pPipelineCache) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600867 const VkLayerDispatchTable *disp;
868
869 disp = loader_get_dispatch(device);
870
Jon Ashburn44aed662016-02-02 17:47:28 -0700871 return disp->CreatePipelineCache(device, pCreateInfo, pAllocator,
872 pPipelineCache);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600873}
874
Jon Ashburn44aed662016-02-02 17:47:28 -0700875LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
876vkDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache,
877 const VkAllocationCallbacks *pAllocator) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600878 const VkLayerDispatchTable *disp;
879
880 disp = loader_get_dispatch(device);
881
Chia-I Wu69f40122015-10-26 21:10:41 +0800882 disp->DestroyPipelineCache(device, pipelineCache, pAllocator);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600883}
884
Jon Ashburn44aed662016-02-02 17:47:28 -0700885LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
886vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache,
887 size_t *pDataSize, void *pData) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600888 const VkLayerDispatchTable *disp;
889
890 disp = loader_get_dispatch(device);
891
Chia-I Wu28c3c432015-10-26 19:17:06 +0800892 return disp->GetPipelineCacheData(device, pipelineCache, pDataSize, pData);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600893}
894
Jon Ashburn44aed662016-02-02 17:47:28 -0700895LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
896vkMergePipelineCaches(VkDevice device, VkPipelineCache dstCache,
897 uint32_t srcCacheCount,
898 const VkPipelineCache *pSrcCaches) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600899 const VkLayerDispatchTable *disp;
900
901 disp = loader_get_dispatch(device);
902
Jon Ashburn44aed662016-02-02 17:47:28 -0700903 return disp->MergePipelineCaches(device, dstCache, srcCacheCount,
904 pSrcCaches);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600905}
906
Jon Ashburn44aed662016-02-02 17:47:28 -0700907LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
908vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache,
909 uint32_t createInfoCount,
910 const VkGraphicsPipelineCreateInfo *pCreateInfos,
911 const VkAllocationCallbacks *pAllocator,
912 VkPipeline *pPipelines) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600913 const VkLayerDispatchTable *disp;
914
915 disp = loader_get_dispatch(device);
916
Jon Ashburn44aed662016-02-02 17:47:28 -0700917 return disp->CreateGraphicsPipelines(device, pipelineCache, createInfoCount,
918 pCreateInfos, pAllocator, pPipelines);
Jon Ashburn0d60d272015-07-09 15:02:25 -0600919}
920
Jon Ashburn44aed662016-02-02 17:47:28 -0700921LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
922vkCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache,
923 uint32_t createInfoCount,
924 const VkComputePipelineCreateInfo *pCreateInfos,
925 const VkAllocationCallbacks *pAllocator,
926 VkPipeline *pPipelines) {
Jon Ashburn0d60d272015-07-09 15:02:25 -0600927 const VkLayerDispatchTable *disp;
928
929 disp = loader_get_dispatch(device);
930
Jon Ashburn44aed662016-02-02 17:47:28 -0700931 return disp->CreateComputePipelines(device, pipelineCache, createInfoCount,
932 pCreateInfos, pAllocator, pPipelines);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600933}
934
Jon Ashburn44aed662016-02-02 17:47:28 -0700935LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
936vkDestroyPipeline(VkDevice device, VkPipeline pipeline,
937 const VkAllocationCallbacks *pAllocator) {
Tony Barbourde4124d2015-07-03 10:33:54 -0600938 const VkLayerDispatchTable *disp;
939
940 disp = loader_get_dispatch(device);
941
Chia-I Wu69f40122015-10-26 21:10:41 +0800942 disp->DestroyPipeline(device, pipeline, pAllocator);
Tony Barbourde4124d2015-07-03 10:33:54 -0600943}
944
Jon Ashburn44aed662016-02-02 17:47:28 -0700945LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
946vkCreatePipelineLayout(VkDevice device,
947 const VkPipelineLayoutCreateInfo *pCreateInfo,
948 const VkAllocationCallbacks *pAllocator,
949 VkPipelineLayout *pPipelineLayout) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600950 const VkLayerDispatchTable *disp;
951
952 disp = loader_get_dispatch(device);
953
Jon Ashburn44aed662016-02-02 17:47:28 -0700954 return disp->CreatePipelineLayout(device, pCreateInfo, pAllocator,
955 pPipelineLayout);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600956}
957
Jon Ashburn44aed662016-02-02 17:47:28 -0700958LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
959vkDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout,
960 const VkAllocationCallbacks *pAllocator) {
Tony Barbourde4124d2015-07-03 10:33:54 -0600961 const VkLayerDispatchTable *disp;
962
963 disp = loader_get_dispatch(device);
964
Chia-I Wu69f40122015-10-26 21:10:41 +0800965 disp->DestroyPipelineLayout(device, pipelineLayout, pAllocator);
Tony Barbourde4124d2015-07-03 10:33:54 -0600966}
967
Jon Ashburn44aed662016-02-02 17:47:28 -0700968LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
969vkCreateSampler(VkDevice device, const VkSamplerCreateInfo *pCreateInfo,
970 const VkAllocationCallbacks *pAllocator, VkSampler *pSampler) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600971 const VkLayerDispatchTable *disp;
972
973 disp = loader_get_dispatch(device);
974
Chia-I Wu69f40122015-10-26 21:10:41 +0800975 return disp->CreateSampler(device, pCreateInfo, pAllocator, pSampler);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600976}
977
Jon Ashburn44aed662016-02-02 17:47:28 -0700978LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
979vkDestroySampler(VkDevice device, VkSampler sampler,
980 const VkAllocationCallbacks *pAllocator) {
Tony Barbourde4124d2015-07-03 10:33:54 -0600981 const VkLayerDispatchTable *disp;
982
983 disp = loader_get_dispatch(device);
984
Chia-I Wu69f40122015-10-26 21:10:41 +0800985 disp->DestroySampler(device, sampler, pAllocator);
Tony Barbourde4124d2015-07-03 10:33:54 -0600986}
987
Jon Ashburn44aed662016-02-02 17:47:28 -0700988LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
989vkCreateDescriptorSetLayout(VkDevice device,
990 const VkDescriptorSetLayoutCreateInfo *pCreateInfo,
991 const VkAllocationCallbacks *pAllocator,
992 VkDescriptorSetLayout *pSetLayout) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600993 const VkLayerDispatchTable *disp;
994
995 disp = loader_get_dispatch(device);
996
Jon Ashburn44aed662016-02-02 17:47:28 -0700997 return disp->CreateDescriptorSetLayout(device, pCreateInfo, pAllocator,
998 pSetLayout);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600999}
1000
Jon Ashburn44aed662016-02-02 17:47:28 -07001001LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1002vkDestroyDescriptorSetLayout(VkDevice device,
1003 VkDescriptorSetLayout descriptorSetLayout,
1004 const VkAllocationCallbacks *pAllocator) {
Tony Barbourde4124d2015-07-03 10:33:54 -06001005 const VkLayerDispatchTable *disp;
1006
1007 disp = loader_get_dispatch(device);
1008
Chia-I Wu69f40122015-10-26 21:10:41 +08001009 disp->DestroyDescriptorSetLayout(device, descriptorSetLayout, pAllocator);
Tony Barbourde4124d2015-07-03 10:33:54 -06001010}
1011
Jon Ashburn44aed662016-02-02 17:47:28 -07001012LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1013vkCreateDescriptorPool(VkDevice device,
1014 const VkDescriptorPoolCreateInfo *pCreateInfo,
1015 const VkAllocationCallbacks *pAllocator,
1016 VkDescriptorPool *pDescriptorPool) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001017 const VkLayerDispatchTable *disp;
1018
1019 disp = loader_get_dispatch(device);
1020
Jon Ashburn44aed662016-02-02 17:47:28 -07001021 return disp->CreateDescriptorPool(device, pCreateInfo, pAllocator,
1022 pDescriptorPool);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001023}
1024
Jon Ashburn44aed662016-02-02 17:47:28 -07001025LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1026vkDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool,
1027 const VkAllocationCallbacks *pAllocator) {
Tony Barbourde4124d2015-07-03 10:33:54 -06001028 const VkLayerDispatchTable *disp;
1029
1030 disp = loader_get_dispatch(device);
1031
Chia-I Wu69f40122015-10-26 21:10:41 +08001032 disp->DestroyDescriptorPool(device, descriptorPool, pAllocator);
Tony Barbourde4124d2015-07-03 10:33:54 -06001033}
1034
Jon Ashburn44aed662016-02-02 17:47:28 -07001035LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1036vkResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool,
1037 VkDescriptorPoolResetFlags flags) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001038 const VkLayerDispatchTable *disp;
1039
1040 disp = loader_get_dispatch(device);
1041
Courtney Goeltzenleuchter831c1832015-10-23 14:21:05 -06001042 return disp->ResetDescriptorPool(device, descriptorPool, flags);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001043}
1044
Jon Ashburn44aed662016-02-02 17:47:28 -07001045LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1046vkAllocateDescriptorSets(VkDevice device,
1047 const VkDescriptorSetAllocateInfo *pAllocateInfo,
1048 VkDescriptorSet *pDescriptorSets) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001049 const VkLayerDispatchTable *disp;
1050
1051 disp = loader_get_dispatch(device);
1052
Chia-I Wu1f851912015-10-27 18:04:07 +08001053 return disp->AllocateDescriptorSets(device, pAllocateInfo, pDescriptorSets);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001054}
1055
Jon Ashburn44aed662016-02-02 17:47:28 -07001056LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1057vkFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool,
1058 uint32_t descriptorSetCount,
1059 const VkDescriptorSet *pDescriptorSets) {
Tony Barbourb857d312015-07-10 10:50:45 -06001060 const VkLayerDispatchTable *disp;
1061
1062 disp = loader_get_dispatch(device);
1063
Jon Ashburn44aed662016-02-02 17:47:28 -07001064 return disp->FreeDescriptorSets(device, descriptorPool, descriptorSetCount,
1065 pDescriptorSets);
Tony Barbourb857d312015-07-10 10:50:45 -06001066}
1067
Jon Ashburn44aed662016-02-02 17:47:28 -07001068LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1069vkUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount,
1070 const VkWriteDescriptorSet *pDescriptorWrites,
1071 uint32_t descriptorCopyCount,
1072 const VkCopyDescriptorSet *pDescriptorCopies) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001073 const VkLayerDispatchTable *disp;
1074
1075 disp = loader_get_dispatch(device);
1076
Jon Ashburn44aed662016-02-02 17:47:28 -07001077 disp->UpdateDescriptorSets(device, descriptorWriteCount, pDescriptorWrites,
1078 descriptorCopyCount, pDescriptorCopies);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001079}
1080
Jon Ashburn44aed662016-02-02 17:47:28 -07001081LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1082vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo *pCreateInfo,
1083 const VkAllocationCallbacks *pAllocator,
1084 VkFramebuffer *pFramebuffer) {
Jon Ashburn4e189562015-07-23 18:49:07 -06001085 const VkLayerDispatchTable *disp;
1086
1087 disp = loader_get_dispatch(device);
1088
Jon Ashburn44aed662016-02-02 17:47:28 -07001089 return disp->CreateFramebuffer(device, pCreateInfo, pAllocator,
1090 pFramebuffer);
Jon Ashburn4e189562015-07-23 18:49:07 -06001091}
1092
Jon Ashburn44aed662016-02-02 17:47:28 -07001093LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1094vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer,
1095 const VkAllocationCallbacks *pAllocator) {
Jon Ashburn4e189562015-07-23 18:49:07 -06001096 const VkLayerDispatchTable *disp;
1097
1098 disp = loader_get_dispatch(device);
1099
Chia-I Wu69f40122015-10-26 21:10:41 +08001100 disp->DestroyFramebuffer(device, framebuffer, pAllocator);
Jon Ashburn4e189562015-07-23 18:49:07 -06001101}
1102
Jon Ashburn44aed662016-02-02 17:47:28 -07001103LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1104vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo,
1105 const VkAllocationCallbacks *pAllocator,
1106 VkRenderPass *pRenderPass) {
Jon Ashburn4e189562015-07-23 18:49:07 -06001107 const VkLayerDispatchTable *disp;
1108
1109 disp = loader_get_dispatch(device);
1110
Chia-I Wu69f40122015-10-26 21:10:41 +08001111 return disp->CreateRenderPass(device, pCreateInfo, pAllocator, pRenderPass);
Jon Ashburn4e189562015-07-23 18:49:07 -06001112}
1113
Jon Ashburn44aed662016-02-02 17:47:28 -07001114LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1115vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass,
1116 const VkAllocationCallbacks *pAllocator) {
Jon Ashburn4e189562015-07-23 18:49:07 -06001117 const VkLayerDispatchTable *disp;
1118
1119 disp = loader_get_dispatch(device);
1120
Chia-I Wu69f40122015-10-26 21:10:41 +08001121 disp->DestroyRenderPass(device, renderPass, pAllocator);
Jon Ashburn4e189562015-07-23 18:49:07 -06001122}
1123
Jon Ashburn44aed662016-02-02 17:47:28 -07001124LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1125vkGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass,
1126 VkExtent2D *pGranularity) {
Jon Ashburn4e189562015-07-23 18:49:07 -06001127 const VkLayerDispatchTable *disp;
1128
1129 disp = loader_get_dispatch(device);
1130
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06001131 disp->GetRenderAreaGranularity(device, renderPass, pGranularity);
Jon Ashburn4e189562015-07-23 18:49:07 -06001132}
1133
Jon Ashburn44aed662016-02-02 17:47:28 -07001134LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1135vkCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo *pCreateInfo,
1136 const VkAllocationCallbacks *pAllocator,
1137 VkCommandPool *pCommandPool) {
Cody Northropf02f9f82015-07-09 18:08:05 -06001138 const VkLayerDispatchTable *disp;
1139
1140 disp = loader_get_dispatch(device);
1141
Jon Ashburn44aed662016-02-02 17:47:28 -07001142 return disp->CreateCommandPool(device, pCreateInfo, pAllocator,
1143 pCommandPool);
Cody Northropf02f9f82015-07-09 18:08:05 -06001144}
1145
Jon Ashburn44aed662016-02-02 17:47:28 -07001146LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1147vkDestroyCommandPool(VkDevice device, VkCommandPool commandPool,
1148 const VkAllocationCallbacks *pAllocator) {
Cody Northropf02f9f82015-07-09 18:08:05 -06001149 const VkLayerDispatchTable *disp;
1150
1151 disp = loader_get_dispatch(device);
1152
Chia-I Wu1f851912015-10-27 18:04:07 +08001153 disp->DestroyCommandPool(device, commandPool, pAllocator);
Cody Northropf02f9f82015-07-09 18:08:05 -06001154}
1155
Jon Ashburn44aed662016-02-02 17:47:28 -07001156LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1157vkResetCommandPool(VkDevice device, VkCommandPool commandPool,
1158 VkCommandPoolResetFlags flags) {
Cody Northropf02f9f82015-07-09 18:08:05 -06001159 const VkLayerDispatchTable *disp;
1160
1161 disp = loader_get_dispatch(device);
1162
Chia-I Wu1f851912015-10-27 18:04:07 +08001163 return disp->ResetCommandPool(device, commandPool, flags);
Cody Northropf02f9f82015-07-09 18:08:05 -06001164}
1165
Jon Ashburn44aed662016-02-02 17:47:28 -07001166LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1167vkAllocateCommandBuffers(VkDevice device,
1168 const VkCommandBufferAllocateInfo *pAllocateInfo,
1169 VkCommandBuffer *pCommandBuffers) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001170 const VkLayerDispatchTable *disp;
1171 VkResult res;
1172
1173 disp = loader_get_dispatch(device);
1174
Chia-I Wu1f851912015-10-27 18:04:07 +08001175 res = disp->AllocateCommandBuffers(device, pAllocateInfo, pCommandBuffers);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001176 if (res == VK_SUCCESS) {
Jon Ashburn44aed662016-02-02 17:47:28 -07001177 for (uint32_t i = 0; i < pAllocateInfo->commandBufferCount; i++) {
Chia-I Wu1f851912015-10-27 18:04:07 +08001178 if (pCommandBuffers[i]) {
1179 loader_init_dispatch(pCommandBuffers[i], disp);
Courtney Goeltzenleuchter831c1832015-10-23 14:21:05 -06001180 }
1181 }
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001182 }
1183
1184 return res;
1185}
1186
Jon Ashburn44aed662016-02-02 17:47:28 -07001187LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1188vkFreeCommandBuffers(VkDevice device, VkCommandPool commandPool,
1189 uint32_t commandBufferCount,
1190 const VkCommandBuffer *pCommandBuffers) {
Tony Barbourde4124d2015-07-03 10:33:54 -06001191 const VkLayerDispatchTable *disp;
1192
1193 disp = loader_get_dispatch(device);
1194
Jon Ashburn44aed662016-02-02 17:47:28 -07001195 disp->FreeCommandBuffers(device, commandPool, commandBufferCount,
1196 pCommandBuffers);
Tony Barbourde4124d2015-07-03 10:33:54 -06001197}
1198
Jon Ashburn44aed662016-02-02 17:47:28 -07001199LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1200vkBeginCommandBuffer(VkCommandBuffer commandBuffer,
1201 const VkCommandBufferBeginInfo *pBeginInfo) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001202 const VkLayerDispatchTable *disp;
1203
Chia-I Wu1f851912015-10-27 18:04:07 +08001204 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001205
Chia-I Wu1f851912015-10-27 18:04:07 +08001206 return disp->BeginCommandBuffer(commandBuffer, pBeginInfo);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001207}
1208
Jon Ashburn44aed662016-02-02 17:47:28 -07001209LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1210vkEndCommandBuffer(VkCommandBuffer commandBuffer) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001211 const VkLayerDispatchTable *disp;
1212
Chia-I Wu1f851912015-10-27 18:04:07 +08001213 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001214
Chia-I Wu1f851912015-10-27 18:04:07 +08001215 return disp->EndCommandBuffer(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001216}
1217
Jon Ashburn44aed662016-02-02 17:47:28 -07001218LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1219vkResetCommandBuffer(VkCommandBuffer commandBuffer,
1220 VkCommandBufferResetFlags flags) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001221 const VkLayerDispatchTable *disp;
1222
Chia-I Wu1f851912015-10-27 18:04:07 +08001223 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001224
Chia-I Wu1f851912015-10-27 18:04:07 +08001225 return disp->ResetCommandBuffer(commandBuffer, flags);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001226}
1227
Jon Ashburn44aed662016-02-02 17:47:28 -07001228LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1229vkCmdBindPipeline(VkCommandBuffer commandBuffer,
1230 VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001231 const VkLayerDispatchTable *disp;
1232
Chia-I Wu1f851912015-10-27 18:04:07 +08001233 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001234
Chia-I Wu1f851912015-10-27 18:04:07 +08001235 disp->CmdBindPipeline(commandBuffer, pipelineBindPoint, pipeline);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001236}
1237
Jon Ashburn44aed662016-02-02 17:47:28 -07001238LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1239vkCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport,
1240 uint32_t viewportCount, const VkViewport *pViewports) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001241 const VkLayerDispatchTable *disp;
1242
Chia-I Wu1f851912015-10-27 18:04:07 +08001243 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001244
Jon Ashburn44aed662016-02-02 17:47:28 -07001245 disp->CmdSetViewport(commandBuffer, firstViewport, viewportCount,
1246 pViewports);
Courtney Goeltzenleuchter932cdb52015-09-21 11:44:06 -06001247}
1248
Jon Ashburn44aed662016-02-02 17:47:28 -07001249LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1250vkCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor,
1251 uint32_t scissorCount, const VkRect2D *pScissors) {
Courtney Goeltzenleuchter932cdb52015-09-21 11:44:06 -06001252 const VkLayerDispatchTable *disp;
1253
Chia-I Wu1f851912015-10-27 18:04:07 +08001254 disp = loader_get_dispatch(commandBuffer);
Courtney Goeltzenleuchter932cdb52015-09-21 11:44:06 -06001255
Jon Ashburnf2516522015-12-30 14:06:55 -07001256 disp->CmdSetScissor(commandBuffer, firstScissor, scissorCount, pScissors);
Tony Barbourde4124d2015-07-03 10:33:54 -06001257}
1258
Jon Ashburn44aed662016-02-02 17:47:28 -07001259LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1260vkCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth) {
Tony Barbourde4124d2015-07-03 10:33:54 -06001261 const VkLayerDispatchTable *disp;
1262
Chia-I Wu1f851912015-10-27 18:04:07 +08001263 disp = loader_get_dispatch(commandBuffer);
Tony Barbourde4124d2015-07-03 10:33:54 -06001264
Chia-I Wu1f851912015-10-27 18:04:07 +08001265 disp->CmdSetLineWidth(commandBuffer, lineWidth);
Cody Northropf5bd2252015-08-17 11:10:49 -06001266}
1267
Jon Ashburn44aed662016-02-02 17:47:28 -07001268LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1269vkCmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor,
1270 float depthBiasClamp, float depthBiasSlopeFactor) {
Cody Northropf5bd2252015-08-17 11:10:49 -06001271 const VkLayerDispatchTable *disp;
1272
Chia-I Wu1f851912015-10-27 18:04:07 +08001273 disp = loader_get_dispatch(commandBuffer);
Cody Northropf5bd2252015-08-17 11:10:49 -06001274
Jon Ashburn44aed662016-02-02 17:47:28 -07001275 disp->CmdSetDepthBias(commandBuffer, depthBiasConstantFactor,
1276 depthBiasClamp, depthBiasSlopeFactor);
Tony Barbourde4124d2015-07-03 10:33:54 -06001277}
1278
Jon Ashburn44aed662016-02-02 17:47:28 -07001279LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1280vkCmdSetBlendConstants(VkCommandBuffer commandBuffer,
1281 const float blendConstants[4]) {
Tony Barbourde4124d2015-07-03 10:33:54 -06001282 const VkLayerDispatchTable *disp;
1283
Chia-I Wu1f851912015-10-27 18:04:07 +08001284 disp = loader_get_dispatch(commandBuffer);
Tony Barbourde4124d2015-07-03 10:33:54 -06001285
Chia-I Wu1f851912015-10-27 18:04:07 +08001286 disp->CmdSetBlendConstants(commandBuffer, blendConstants);
Tony Barbourde4124d2015-07-03 10:33:54 -06001287}
1288
Jon Ashburn44aed662016-02-02 17:47:28 -07001289LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1290vkCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds,
1291 float maxDepthBounds) {
Tony Barbourde4124d2015-07-03 10:33:54 -06001292 const VkLayerDispatchTable *disp;
1293
Chia-I Wu1f851912015-10-27 18:04:07 +08001294 disp = loader_get_dispatch(commandBuffer);
Tony Barbourde4124d2015-07-03 10:33:54 -06001295
Chia-I Wu1f851912015-10-27 18:04:07 +08001296 disp->CmdSetDepthBounds(commandBuffer, minDepthBounds, maxDepthBounds);
Cody Northrop2605cb02015-08-18 15:21:16 -06001297}
1298
Jon Ashburn44aed662016-02-02 17:47:28 -07001299LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1300vkCmdSetStencilCompareMask(VkCommandBuffer commandBuffer,
1301 VkStencilFaceFlags faceMask, uint32_t compareMask) {
Cody Northrop2605cb02015-08-18 15:21:16 -06001302 const VkLayerDispatchTable *disp;
1303
Chia-I Wu1f851912015-10-27 18:04:07 +08001304 disp = loader_get_dispatch(commandBuffer);
Cody Northrop2605cb02015-08-18 15:21:16 -06001305
Chia-I Wuc51b1212015-10-27 19:25:11 +08001306 disp->CmdSetStencilCompareMask(commandBuffer, faceMask, compareMask);
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001307}
1308
Jon Ashburn44aed662016-02-02 17:47:28 -07001309LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1310vkCmdSetStencilWriteMask(VkCommandBuffer commandBuffer,
1311 VkStencilFaceFlags faceMask, uint32_t writeMask) {
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001312 const VkLayerDispatchTable *disp;
1313
Chia-I Wu1f851912015-10-27 18:04:07 +08001314 disp = loader_get_dispatch(commandBuffer);
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001315
Chia-I Wuc51b1212015-10-27 19:25:11 +08001316 disp->CmdSetStencilWriteMask(commandBuffer, faceMask, writeMask);
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001317}
1318
Jon Ashburn44aed662016-02-02 17:47:28 -07001319LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1320vkCmdSetStencilReference(VkCommandBuffer commandBuffer,
1321 VkStencilFaceFlags faceMask, uint32_t reference) {
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001322 const VkLayerDispatchTable *disp;
1323
Chia-I Wu1f851912015-10-27 18:04:07 +08001324 disp = loader_get_dispatch(commandBuffer);
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001325
Chia-I Wuc51b1212015-10-27 19:25:11 +08001326 disp->CmdSetStencilReference(commandBuffer, faceMask, reference);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001327}
1328
Jon Ashburn44aed662016-02-02 17:47:28 -07001329LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBindDescriptorSets(
1330 VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint,
1331 VkPipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount,
1332 const VkDescriptorSet *pDescriptorSets, uint32_t dynamicOffsetCount,
1333 const uint32_t *pDynamicOffsets) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001334 const VkLayerDispatchTable *disp;
1335
Chia-I Wu1f851912015-10-27 18:04:07 +08001336 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001337
Jon Ashburn44aed662016-02-02 17:47:28 -07001338 disp->CmdBindDescriptorSets(commandBuffer, pipelineBindPoint, layout,
1339 firstSet, descriptorSetCount, pDescriptorSets,
1340 dynamicOffsetCount, pDynamicOffsets);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001341}
1342
Jon Ashburn44aed662016-02-02 17:47:28 -07001343LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1344vkCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer,
1345 VkDeviceSize offset, VkIndexType indexType) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001346 const VkLayerDispatchTable *disp;
1347
Chia-I Wu1f851912015-10-27 18:04:07 +08001348 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001349
Chia-I Wu1f851912015-10-27 18:04:07 +08001350 disp->CmdBindIndexBuffer(commandBuffer, buffer, offset, indexType);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001351}
1352
Jon Ashburn44aed662016-02-02 17:47:28 -07001353LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1354vkCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding,
1355 uint32_t bindingCount, const VkBuffer *pBuffers,
1356 const VkDeviceSize *pOffsets) {
Jon Ashburn4e189562015-07-23 18:49:07 -06001357 const VkLayerDispatchTable *disp;
1358
Chia-I Wu1f851912015-10-27 18:04:07 +08001359 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn4e189562015-07-23 18:49:07 -06001360
Jon Ashburn44aed662016-02-02 17:47:28 -07001361 disp->CmdBindVertexBuffers(commandBuffer, firstBinding, bindingCount,
1362 pBuffers, pOffsets);
Jon Ashburn4e189562015-07-23 18:49:07 -06001363}
1364
Jon Ashburn44aed662016-02-02 17:47:28 -07001365LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1366vkCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount,
1367 uint32_t instanceCount, uint32_t firstVertex,
1368 uint32_t firstInstance) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001369 const VkLayerDispatchTable *disp;
1370
Chia-I Wu1f851912015-10-27 18:04:07 +08001371 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001372
Jon Ashburn44aed662016-02-02 17:47:28 -07001373 disp->CmdDraw(commandBuffer, vertexCount, instanceCount, firstVertex,
1374 firstInstance);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001375}
1376
Jon Ashburn44aed662016-02-02 17:47:28 -07001377LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1378vkCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount,
1379 uint32_t instanceCount, uint32_t firstIndex,
1380 int32_t vertexOffset, uint32_t firstInstance) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001381 const VkLayerDispatchTable *disp;
1382
Chia-I Wu1f851912015-10-27 18:04:07 +08001383 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001384
Jon Ashburn44aed662016-02-02 17:47:28 -07001385 disp->CmdDrawIndexed(commandBuffer, indexCount, instanceCount, firstIndex,
1386 vertexOffset, firstInstance);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001387}
1388
Jon Ashburn44aed662016-02-02 17:47:28 -07001389LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1390vkCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer,
1391 VkDeviceSize offset, uint32_t drawCount, uint32_t stride) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001392 const VkLayerDispatchTable *disp;
1393
Chia-I Wu1f851912015-10-27 18:04:07 +08001394 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001395
Chia-I Wu1f851912015-10-27 18:04:07 +08001396 disp->CmdDrawIndirect(commandBuffer, buffer, offset, drawCount, stride);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001397}
1398
Jon Ashburn44aed662016-02-02 17:47:28 -07001399LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1400vkCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer,
1401 VkDeviceSize offset, uint32_t drawCount,
1402 uint32_t stride) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001403 const VkLayerDispatchTable *disp;
1404
Chia-I Wu1f851912015-10-27 18:04:07 +08001405 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001406
Jon Ashburn44aed662016-02-02 17:47:28 -07001407 disp->CmdDrawIndexedIndirect(commandBuffer, buffer, offset, drawCount,
1408 stride);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001409}
1410
Jon Ashburn44aed662016-02-02 17:47:28 -07001411LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1412vkCmdDispatch(VkCommandBuffer commandBuffer, uint32_t x, uint32_t y,
1413 uint32_t z) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001414 const VkLayerDispatchTable *disp;
1415
Chia-I Wu1f851912015-10-27 18:04:07 +08001416 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001417
Chia-I Wu1f851912015-10-27 18:04:07 +08001418 disp->CmdDispatch(commandBuffer, x, y, z);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001419}
1420
Jon Ashburn44aed662016-02-02 17:47:28 -07001421LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1422vkCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer,
1423 VkDeviceSize offset) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001424 const VkLayerDispatchTable *disp;
1425
Chia-I Wu1f851912015-10-27 18:04:07 +08001426 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001427
Chia-I Wu1f851912015-10-27 18:04:07 +08001428 disp->CmdDispatchIndirect(commandBuffer, buffer, offset);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001429}
1430
Jon Ashburn44aed662016-02-02 17:47:28 -07001431LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1432vkCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer,
1433 VkBuffer dstBuffer, uint32_t regionCount,
1434 const VkBufferCopy *pRegions) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001435 const VkLayerDispatchTable *disp;
1436
Chia-I Wu1f851912015-10-27 18:04:07 +08001437 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001438
Jon Ashburn44aed662016-02-02 17:47:28 -07001439 disp->CmdCopyBuffer(commandBuffer, srcBuffer, dstBuffer, regionCount,
1440 pRegions);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001441}
1442
Jon Ashburn44aed662016-02-02 17:47:28 -07001443LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1444vkCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage,
1445 VkImageLayout srcImageLayout, VkImage dstImage,
1446 VkImageLayout dstImageLayout, uint32_t regionCount,
1447 const VkImageCopy *pRegions) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001448 const VkLayerDispatchTable *disp;
1449
Chia-I Wu1f851912015-10-27 18:04:07 +08001450 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001451
Jon Ashburn44aed662016-02-02 17:47:28 -07001452 disp->CmdCopyImage(commandBuffer, srcImage, srcImageLayout, dstImage,
1453 dstImageLayout, regionCount, pRegions);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001454}
1455
Jon Ashburn44aed662016-02-02 17:47:28 -07001456LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1457vkCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage,
1458 VkImageLayout srcImageLayout, VkImage dstImage,
1459 VkImageLayout dstImageLayout, uint32_t regionCount,
1460 const VkImageBlit *pRegions, VkFilter filter) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001461 const VkLayerDispatchTable *disp;
1462
Chia-I Wu1f851912015-10-27 18:04:07 +08001463 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001464
Jon Ashburn44aed662016-02-02 17:47:28 -07001465 disp->CmdBlitImage(commandBuffer, srcImage, srcImageLayout, dstImage,
1466 dstImageLayout, regionCount, pRegions, filter);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001467}
1468
Jon Ashburn44aed662016-02-02 17:47:28 -07001469LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1470vkCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer,
1471 VkImage dstImage, VkImageLayout dstImageLayout,
1472 uint32_t regionCount,
1473 const VkBufferImageCopy *pRegions) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001474 const VkLayerDispatchTable *disp;
1475
Chia-I Wu1f851912015-10-27 18:04:07 +08001476 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001477
Jon Ashburn44aed662016-02-02 17:47:28 -07001478 disp->CmdCopyBufferToImage(commandBuffer, srcBuffer, dstImage,
1479 dstImageLayout, regionCount, pRegions);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001480}
1481
Jon Ashburn44aed662016-02-02 17:47:28 -07001482LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1483vkCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage,
1484 VkImageLayout srcImageLayout, VkBuffer dstBuffer,
1485 uint32_t regionCount,
1486 const VkBufferImageCopy *pRegions) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001487 const VkLayerDispatchTable *disp;
1488
Chia-I Wu1f851912015-10-27 18:04:07 +08001489 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001490
Jon Ashburn44aed662016-02-02 17:47:28 -07001491 disp->CmdCopyImageToBuffer(commandBuffer, srcImage, srcImageLayout,
1492 dstBuffer, regionCount, pRegions);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001493}
1494
Jon Ashburn44aed662016-02-02 17:47:28 -07001495LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1496vkCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer,
1497 VkDeviceSize dstOffset, VkDeviceSize dataSize,
1498 const uint32_t *pData) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001499 const VkLayerDispatchTable *disp;
1500
Chia-I Wu1f851912015-10-27 18:04:07 +08001501 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001502
Chia-I Wu1f851912015-10-27 18:04:07 +08001503 disp->CmdUpdateBuffer(commandBuffer, dstBuffer, dstOffset, dataSize, pData);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001504}
1505
Jon Ashburn44aed662016-02-02 17:47:28 -07001506LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1507vkCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer,
1508 VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001509 const VkLayerDispatchTable *disp;
1510
Chia-I Wu1f851912015-10-27 18:04:07 +08001511 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001512
Chia-I Wu1f851912015-10-27 18:04:07 +08001513 disp->CmdFillBuffer(commandBuffer, dstBuffer, dstOffset, size, data);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001514}
1515
Jon Ashburn44aed662016-02-02 17:47:28 -07001516LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1517vkCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image,
1518 VkImageLayout imageLayout, const VkClearColorValue *pColor,
1519 uint32_t rangeCount,
1520 const VkImageSubresourceRange *pRanges) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001521 const VkLayerDispatchTable *disp;
1522
Chia-I Wu1f851912015-10-27 18:04:07 +08001523 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001524
Jon Ashburn44aed662016-02-02 17:47:28 -07001525 disp->CmdClearColorImage(commandBuffer, image, imageLayout, pColor,
1526 rangeCount, pRanges);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001527}
1528
Jon Ashburn44aed662016-02-02 17:47:28 -07001529LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1530vkCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image,
1531 VkImageLayout imageLayout,
1532 const VkClearDepthStencilValue *pDepthStencil,
1533 uint32_t rangeCount,
1534 const VkImageSubresourceRange *pRanges) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001535 const VkLayerDispatchTable *disp;
1536
Chia-I Wu1f851912015-10-27 18:04:07 +08001537 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001538
Jon Ashburn44aed662016-02-02 17:47:28 -07001539 disp->CmdClearDepthStencilImage(commandBuffer, image, imageLayout,
1540 pDepthStencil, rangeCount, pRanges);
Chris Forbes2951d7d2015-06-22 17:21:59 +12001541}
1542
Jon Ashburn44aed662016-02-02 17:47:28 -07001543LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1544vkCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount,
1545 const VkClearAttachment *pAttachments, uint32_t rectCount,
1546 const VkClearRect *pRects) {
Chris Forbes2951d7d2015-06-22 17:21:59 +12001547 const VkLayerDispatchTable *disp;
1548
Chia-I Wu1f851912015-10-27 18:04:07 +08001549 disp = loader_get_dispatch(commandBuffer);
Chris Forbes2951d7d2015-06-22 17:21:59 +12001550
Jon Ashburn44aed662016-02-02 17:47:28 -07001551 disp->CmdClearAttachments(commandBuffer, attachmentCount, pAttachments,
1552 rectCount, pRects);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001553}
1554
Jon Ashburn44aed662016-02-02 17:47:28 -07001555LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1556vkCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage,
1557 VkImageLayout srcImageLayout, VkImage dstImage,
1558 VkImageLayout dstImageLayout, uint32_t regionCount,
1559 const VkImageResolve *pRegions) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001560 const VkLayerDispatchTable *disp;
1561
Chia-I Wu1f851912015-10-27 18:04:07 +08001562 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001563
Jon Ashburn44aed662016-02-02 17:47:28 -07001564 disp->CmdResolveImage(commandBuffer, srcImage, srcImageLayout, dstImage,
1565 dstImageLayout, regionCount, pRegions);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001566}
1567
Jon Ashburn44aed662016-02-02 17:47:28 -07001568LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1569vkCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event,
1570 VkPipelineStageFlags stageMask) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001571 const VkLayerDispatchTable *disp;
1572
Chia-I Wu1f851912015-10-27 18:04:07 +08001573 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001574
Chia-I Wu1f851912015-10-27 18:04:07 +08001575 disp->CmdSetEvent(commandBuffer, event, stageMask);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001576}
1577
Jon Ashburn44aed662016-02-02 17:47:28 -07001578LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1579vkCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event,
1580 VkPipelineStageFlags stageMask) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001581 const VkLayerDispatchTable *disp;
1582
Chia-I Wu1f851912015-10-27 18:04:07 +08001583 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001584
Chia-I Wu1f851912015-10-27 18:04:07 +08001585 disp->CmdResetEvent(commandBuffer, event, stageMask);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001586}
1587
Jon Ashburn44aed662016-02-02 17:47:28 -07001588LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1589vkCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount,
1590 const VkEvent *pEvents, VkPipelineStageFlags sourceStageMask,
1591 VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount,
1592 const VkMemoryBarrier *pMemoryBarriers,
1593 uint32_t bufferMemoryBarrierCount,
1594 const VkBufferMemoryBarrier *pBufferMemoryBarriers,
1595 uint32_t imageMemoryBarrierCount,
1596 const VkImageMemoryBarrier *pImageMemoryBarriers) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001597 const VkLayerDispatchTable *disp;
1598
Chia-I Wu1f851912015-10-27 18:04:07 +08001599 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001600
Jon Ashburna4ae48b2016-01-11 13:12:43 -07001601 disp->CmdWaitEvents(commandBuffer, eventCount, pEvents, sourceStageMask,
1602 dstStageMask, memoryBarrierCount, pMemoryBarriers,
1603 bufferMemoryBarrierCount, pBufferMemoryBarriers,
1604 imageMemoryBarrierCount, pImageMemoryBarriers);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001605}
1606
Jon Ashburna4ae48b2016-01-11 13:12:43 -07001607LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdPipelineBarrier(
Jon Ashburn44aed662016-02-02 17:47:28 -07001608 VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask,
1609 VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags,
1610 uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers,
1611 uint32_t bufferMemoryBarrierCount,
1612 const VkBufferMemoryBarrier *pBufferMemoryBarriers,
1613 uint32_t imageMemoryBarrierCount,
1614 const VkImageMemoryBarrier *pImageMemoryBarriers) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001615 const VkLayerDispatchTable *disp;
1616
Chia-I Wu1f851912015-10-27 18:04:07 +08001617 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001618
Jon Ashburn44aed662016-02-02 17:47:28 -07001619 disp->CmdPipelineBarrier(
1620 commandBuffer, srcStageMask, dstStageMask, dependencyFlags,
1621 memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount,
1622 pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001623}
1624
Jon Ashburn44aed662016-02-02 17:47:28 -07001625LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1626vkCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool,
1627 uint32_t slot, VkFlags flags) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001628 const VkLayerDispatchTable *disp;
1629
Chia-I Wu1f851912015-10-27 18:04:07 +08001630 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001631
Chia-I Wu1f851912015-10-27 18:04:07 +08001632 disp->CmdBeginQuery(commandBuffer, queryPool, slot, flags);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001633}
1634
Jon Ashburn44aed662016-02-02 17:47:28 -07001635LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1636vkCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool,
1637 uint32_t slot) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001638 const VkLayerDispatchTable *disp;
1639
Chia-I Wu1f851912015-10-27 18:04:07 +08001640 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001641
Chia-I Wu1f851912015-10-27 18:04:07 +08001642 disp->CmdEndQuery(commandBuffer, queryPool, slot);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001643}
1644
Jon Ashburn44aed662016-02-02 17:47:28 -07001645LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1646vkCmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool,
1647 uint32_t firstQuery, uint32_t queryCount) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001648 const VkLayerDispatchTable *disp;
1649
Chia-I Wu1f851912015-10-27 18:04:07 +08001650 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001651
Jon Ashburnf2516522015-12-30 14:06:55 -07001652 disp->CmdResetQueryPool(commandBuffer, queryPool, firstQuery, queryCount);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001653}
1654
Jon Ashburn44aed662016-02-02 17:47:28 -07001655LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1656vkCmdWriteTimestamp(VkCommandBuffer commandBuffer,
1657 VkPipelineStageFlagBits pipelineStage,
1658 VkQueryPool queryPool, uint32_t slot) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001659 const VkLayerDispatchTable *disp;
1660
Chia-I Wu1f851912015-10-27 18:04:07 +08001661 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001662
Chia-I Wu1f851912015-10-27 18:04:07 +08001663 disp->CmdWriteTimestamp(commandBuffer, pipelineStage, queryPool, slot);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001664}
1665
Jon Ashburn44aed662016-02-02 17:47:28 -07001666LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1667vkCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool,
1668 uint32_t firstQuery, uint32_t queryCount,
1669 VkBuffer dstBuffer, VkDeviceSize dstOffset,
1670 VkDeviceSize stride, VkFlags flags) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001671 const VkLayerDispatchTable *disp;
1672
Chia-I Wu1f851912015-10-27 18:04:07 +08001673 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001674
Jon Ashburn44aed662016-02-02 17:47:28 -07001675 disp->CmdCopyQueryPoolResults(commandBuffer, queryPool, firstQuery,
1676 queryCount, dstBuffer, dstOffset, stride,
1677 flags);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001678}
1679
Jon Ashburn44aed662016-02-02 17:47:28 -07001680LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1681vkCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout,
1682 VkShaderStageFlags stageFlags, uint32_t offset,
1683 uint32_t size, const void *pValues) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001684 const VkLayerDispatchTable *disp;
1685
Chia-I Wu1f851912015-10-27 18:04:07 +08001686 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001687
Jon Ashburn44aed662016-02-02 17:47:28 -07001688 disp->CmdPushConstants(commandBuffer, layout, stageFlags, offset, size,
1689 pValues);
Tony Barbourde4124d2015-07-03 10:33:54 -06001690}
1691
Jon Ashburn44aed662016-02-02 17:47:28 -07001692LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1693vkCmdBeginRenderPass(VkCommandBuffer commandBuffer,
1694 const VkRenderPassBeginInfo *pRenderPassBegin,
1695 VkSubpassContents contents) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001696 const VkLayerDispatchTable *disp;
1697
Chia-I Wu1f851912015-10-27 18:04:07 +08001698 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001699
Chia-I Wu1f851912015-10-27 18:04:07 +08001700 disp->CmdBeginRenderPass(commandBuffer, pRenderPassBegin, contents);
Chia-I Wuc278df82015-07-07 11:50:03 +08001701}
1702
Jon Ashburn44aed662016-02-02 17:47:28 -07001703LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1704vkCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents) {
Chia-I Wuc278df82015-07-07 11:50:03 +08001705 const VkLayerDispatchTable *disp;
1706
Chia-I Wu1f851912015-10-27 18:04:07 +08001707 disp = loader_get_dispatch(commandBuffer);
Chia-I Wuc278df82015-07-07 11:50:03 +08001708
Chia-I Wu1f851912015-10-27 18:04:07 +08001709 disp->CmdNextSubpass(commandBuffer, contents);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001710}
1711
Jon Ashburn44aed662016-02-02 17:47:28 -07001712LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1713vkCmdEndRenderPass(VkCommandBuffer commandBuffer) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001714 const VkLayerDispatchTable *disp;
1715
Chia-I Wu1f851912015-10-27 18:04:07 +08001716 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001717
Chia-I Wu1f851912015-10-27 18:04:07 +08001718 disp->CmdEndRenderPass(commandBuffer);
Chia-I Wu88eaa3b2015-06-26 15:34:39 +08001719}
1720
Jon Ashburn44aed662016-02-02 17:47:28 -07001721LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1722vkCmdExecuteCommands(VkCommandBuffer commandBuffer,
1723 uint32_t commandBuffersCount,
1724 const VkCommandBuffer *pCommandBuffers) {
Chia-I Wu88eaa3b2015-06-26 15:34:39 +08001725 const VkLayerDispatchTable *disp;
1726
Chia-I Wu1f851912015-10-27 18:04:07 +08001727 disp = loader_get_dispatch(commandBuffer);
Chia-I Wu88eaa3b2015-06-26 15:34:39 +08001728
Jon Ashburn44aed662016-02-02 17:47:28 -07001729 disp->CmdExecuteCommands(commandBuffer, commandBuffersCount,
1730 pCommandBuffers);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001731}