blob: 473daa628568bd6c08f1984bb83ecd5f2907f047 [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;
124 char **saved_layer_names;
125 saved_layer_names = loader_stack_alloc(sizeof(char*) * pCreateInfo->enabledLayerCount);
126 for (uint32_t i = 0; i < saved_layer_count; i++) {
127 saved_layer_names[i] = (char *)pCreateInfo->ppEnabledLayerNames[i];
128 }
129
130 loader_expand_layer_names(
131 ptr_instance, std_validation_str,
132 sizeof(std_validation_names) / sizeof(std_validation_names[0]),
133 std_validation_names, (uint32_t *)&pCreateInfo->enabledLayerCount,
134 (char ***)&pCreateInfo->ppEnabledLayerNames);
135
Jon Ashburn754f1992015-08-18 18:04:47 -0600136 /* Scan/discover all ICD libraries */
137 memset(&ptr_instance->icd_libs, 0, sizeof(ptr_instance->icd_libs));
Jon Ashburne58f1a32015-08-28 13:38:21 -0600138 loader_icd_scan(ptr_instance, &ptr_instance->icd_libs);
Jon Ashburn754f1992015-08-18 18:04:47 -0600139
Jon Ashburncfe4e682015-08-14 12:51:47 -0600140 /* get extensions from all ICD's, merge so no duplicates, then validate */
Jon Ashburn44aed662016-02-02 17:47:28 -0700141 loader_get_icd_loader_instance_extensions(
142 ptr_instance, &ptr_instance->icd_libs, &ptr_instance->ext_list);
143 res = loader_validate_instance_extensions(
Jon Ashburn7ec85cd2016-02-10 20:50:19 -0700144 ptr_instance, &ptr_instance->ext_list,
145 &ptr_instance->instance_layer_list, pCreateInfo);
Jon Ashburncfe4e682015-08-14 12:51:47 -0600146 if (res != VK_SUCCESS) {
Jon Ashburn715de582016-02-10 20:59:26 -0700147 loader_unexpand_inst_layer_names(saved_layer_count, saved_layer_names,
148 pCreateInfo);
Jon Ashburne58f1a32015-08-28 13:38:21 -0600149 loader_delete_layer_properties(ptr_instance,
150 &ptr_instance->device_layer_list);
151 loader_delete_layer_properties(ptr_instance,
152 &ptr_instance->instance_layer_list);
153 loader_scanned_icd_clear(ptr_instance, &ptr_instance->icd_libs);
Jon Ashburn44aed662016-02-02 17:47:28 -0700154 loader_destroy_generic_list(
155 ptr_instance,
156 (struct loader_generic_list *)&ptr_instance->ext_list);
Jon Ashburnd13241a2016-01-25 14:51:47 -0700157 util_DestroyDebugReportCallback(ptr_instance, instance_callback, NULL);
Jon Ashburncfe4e682015-08-14 12:51:47 -0600158 loader_platform_thread_unlock_mutex(&loader_lock);
159 loader_heap_free(ptr_instance, ptr_instance);
160 return res;
161 }
162
Jon Ashburn44aed662016-02-02 17:47:28 -0700163 ptr_instance->disp =
164 loader_heap_alloc(ptr_instance, sizeof(VkLayerInstanceDispatchTable),
165 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
Courtney Goeltzenleuchter1381cd12015-07-06 09:08:37 -0600166 if (ptr_instance->disp == NULL) {
Jon Ashburn715de582016-02-10 20:59:26 -0700167 loader_unexpand_inst_layer_names(saved_layer_count, saved_layer_names,
168 pCreateInfo);
Jon Ashburne58f1a32015-08-28 13:38:21 -0600169 loader_delete_layer_properties(ptr_instance,
170 &ptr_instance->device_layer_list);
171 loader_delete_layer_properties(ptr_instance,
172 &ptr_instance->instance_layer_list);
Jon Ashburn44aed662016-02-02 17:47:28 -0700173 loader_scanned_icd_clear(ptr_instance, &ptr_instance->icd_libs);
174 loader_destroy_generic_list(
175 ptr_instance,
176 (struct loader_generic_list *)&ptr_instance->ext_list);
Jon Ashburnd13241a2016-01-25 14:51:47 -0700177 util_DestroyDebugReportCallback(ptr_instance, instance_callback, NULL);
Courtney Goeltzenleuchter1381cd12015-07-06 09:08:37 -0600178 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburncfe4e682015-08-14 12:51:47 -0600179 loader_heap_free(ptr_instance, ptr_instance);
Courtney Goeltzenleuchter1381cd12015-07-06 09:08:37 -0600180 return VK_ERROR_OUT_OF_HOST_MEMORY;
181 }
182 memcpy(ptr_instance->disp, &instance_disp, sizeof(instance_disp));
183 ptr_instance->next = loader.instances;
184 loader.instances = ptr_instance;
185
Jon Ashburn182b8302015-08-11 14:49:54 -0600186 /* activate any layers on instance chain */
Jon Ashburn44aed662016-02-02 17:47:28 -0700187 res = loader_enable_instance_layers(ptr_instance, pCreateInfo,
Jon Ashburne58f1a32015-08-28 13:38:21 -0600188 &ptr_instance->instance_layer_list);
Courtney Goeltzenleuchter1381cd12015-07-06 09:08:37 -0600189 if (res != VK_SUCCESS) {
Jon Ashburn715de582016-02-10 20:59:26 -0700190 loader_unexpand_inst_layer_names(saved_layer_count, saved_layer_names,
191 pCreateInfo);
Jon Ashburne58f1a32015-08-28 13:38:21 -0600192 loader_delete_layer_properties(ptr_instance,
193 &ptr_instance->device_layer_list);
194 loader_delete_layer_properties(ptr_instance,
195 &ptr_instance->instance_layer_list);
Jon Ashburn44aed662016-02-02 17:47:28 -0700196 loader_scanned_icd_clear(ptr_instance, &ptr_instance->icd_libs);
197 loader_destroy_generic_list(
198 ptr_instance,
199 (struct loader_generic_list *)&ptr_instance->ext_list);
Jon Ashburncfe4e682015-08-14 12:51:47 -0600200 loader.instances = ptr_instance->next;
Jon Ashburnd13241a2016-01-25 14:51:47 -0700201 util_DestroyDebugReportCallback(ptr_instance, instance_callback, NULL);
Jon Ashburncfe4e682015-08-14 12:51:47 -0600202 loader_platform_thread_unlock_mutex(&loader_lock);
Courtney Goeltzenleuchter1381cd12015-07-06 09:08:37 -0600203 loader_heap_free(ptr_instance, ptr_instance->disp);
204 loader_heap_free(ptr_instance, ptr_instance);
205 return res;
206 }
Jon Ashburncedc15f2015-05-21 18:13:33 -0600207
Jon Ashburn44aed662016-02-02 17:47:28 -0700208 created_instance = (VkInstance)ptr_instance;
209 res = loader_create_instance_chain(pCreateInfo, pAllocator, ptr_instance,
Jon Ashburna4b34942016-02-03 12:37:30 -0700210 &created_instance);
Jon Ashburna179dcf2015-05-21 17:42:17 -0600211
Jon Ashburn7da19ee2016-01-14 13:51:55 -0700212 if (res == VK_SUCCESS) {
Courtney Goeltzenleuchter2bdf6da2016-01-08 12:18:43 -0700213 wsi_create_instance(ptr_instance, pCreateInfo);
214 debug_report_create_instance(ptr_instance, pCreateInfo);
215
Jon Ashburnebbfd5b2016-01-18 12:20:03 -0700216 *pInstance = created_instance;
Courtney Goeltzenleuchter2bdf6da2016-01-08 12:18:43 -0700217
Jon Ashburn7da19ee2016-01-14 13:51:55 -0700218 /*
219 * Finally have the layers in place and everyone has seen
220 * the CreateInstance command go by. This allows the layer's
221 * GetInstanceProcAddr functions to return valid extension functions
222 * if enabled.
223 */
224 loader_activate_instance_layer_extensions(ptr_instance, *pInstance);
Courtney Goeltzenleuchter2bdf6da2016-01-08 12:18:43 -0700225 } else {
226 // TODO: cleanup here.
Jon Ashburn7da19ee2016-01-14 13:51:55 -0700227 }
Courtney Goeltzenleuchter2bdf6da2016-01-08 12:18:43 -0700228
Courtney Goeltzenleuchter6d8be2d2015-12-03 13:45:51 -0700229 /* Remove temporary debug_report callback */
Jon Ashburnd13241a2016-01-25 14:51:47 -0700230 util_DestroyDebugReportCallback(ptr_instance, instance_callback, NULL);
Jon Ashburn715de582016-02-10 20:59:26 -0700231 loader_unexpand_inst_layer_names(saved_layer_count, saved_layer_names,
232 pCreateInfo);
Jon Ashburnb40f2562015-05-29 13:15:39 -0600233 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburnfce93d92015-05-12 17:26:48 -0600234 return res;
235}
236
Jon Ashburn44aed662016-02-02 17:47:28 -0700237LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
238vkDestroyInstance(VkInstance instance,
239 const VkAllocationCallbacks *pAllocator) {
Jon Ashburnfce93d92015-05-12 17:26:48 -0600240 const VkLayerInstanceDispatchTable *disp;
Jon Ashburn0c5eea22015-09-30 12:56:42 -0600241 struct loader_instance *ptr_instance = NULL;
Jon Ashburnfce93d92015-05-12 17:26:48 -0600242 disp = loader_get_instance_dispatch(instance);
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600243
Jon Ashburnb40f2562015-05-29 13:15:39 -0600244 loader_platform_thread_lock_mutex(&loader_lock);
245
Courtney Goeltzenleuchter6d8be2d2015-12-03 13:45:51 -0700246 /* TODO: Do we need a temporary callback here to catch cleanup issues? */
247
Jon Ashburn0c5eea22015-09-30 12:56:42 -0600248 ptr_instance = loader_get_instance(instance);
Chia-I Wu69f40122015-10-26 21:10:41 +0800249 disp->DestroyInstance(instance, pAllocator);
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600250
Courtney Goeltzenleuchter3d8dc1f2015-06-08 15:09:22 -0600251 loader_deactivate_instance_layers(ptr_instance);
Jon Ashburncfe4e682015-08-14 12:51:47 -0600252 loader_heap_free(ptr_instance, ptr_instance->disp);
253 loader_heap_free(ptr_instance, ptr_instance);
Jon Ashburnb40f2562015-05-29 13:15:39 -0600254 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburnfce93d92015-05-12 17:26:48 -0600255}
Jon Ashburn2666e2f2015-05-15 15:09:35 -0600256
Jon Ashburn44aed662016-02-02 17:47:28 -0700257LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
258vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount,
259 VkPhysicalDevice *pPhysicalDevices) {
Jon Ashburnfce93d92015-05-12 17:26:48 -0600260 const VkLayerInstanceDispatchTable *disp;
Jon Ashburnb40f2562015-05-29 13:15:39 -0600261 VkResult res;
Jon Ashburnfce93d92015-05-12 17:26:48 -0600262 disp = loader_get_instance_dispatch(instance);
Jon Ashburnb40f2562015-05-29 13:15:39 -0600263
264 loader_platform_thread_lock_mutex(&loader_lock);
265 res = disp->EnumeratePhysicalDevices(instance, pPhysicalDeviceCount,
Jon Ashburnfce93d92015-05-12 17:26:48 -0600266 pPhysicalDevices);
Jon Ashburnb40f2562015-05-29 13:15:39 -0600267 loader_platform_thread_unlock_mutex(&loader_lock);
268 return res;
Jon Ashburnfce93d92015-05-12 17:26:48 -0600269}
270
Jon Ashburn44aed662016-02-02 17:47:28 -0700271LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
272vkGetPhysicalDeviceFeatures(VkPhysicalDevice gpu,
273 VkPhysicalDeviceFeatures *pFeatures) {
Jon Ashburn4e189562015-07-23 18:49:07 -0600274 const VkLayerInstanceDispatchTable *disp;
Jon Ashburn4e189562015-07-23 18:49:07 -0600275
276 disp = loader_get_instance_dispatch(gpu);
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -0600277 disp->GetPhysicalDeviceFeatures(gpu, pFeatures);
Jon Ashburn4e189562015-07-23 18:49:07 -0600278}
279
Jon Ashburn44aed662016-02-02 17:47:28 -0700280LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
281vkGetPhysicalDeviceFormatProperties(VkPhysicalDevice gpu, VkFormat format,
282 VkFormatProperties *pFormatInfo) {
Jon Ashburn4e189562015-07-23 18:49:07 -0600283 const VkLayerInstanceDispatchTable *disp;
Jon Ashburn4e189562015-07-23 18:49:07 -0600284
285 disp = loader_get_instance_dispatch(gpu);
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -0600286 disp->GetPhysicalDeviceFormatProperties(gpu, format, pFormatInfo);
Jon Ashburn4e189562015-07-23 18:49:07 -0600287}
288
Jon Ashburn44aed662016-02-02 17:47:28 -0700289LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
290vkGetPhysicalDeviceImageFormatProperties(
291 VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type,
292 VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags,
293 VkImageFormatProperties *pImageFormatProperties) {
Jon Ashburn4e189562015-07-23 18:49:07 -0600294 const VkLayerInstanceDispatchTable *disp;
Jon Ashburn4e189562015-07-23 18:49:07 -0600295
296 disp = loader_get_instance_dispatch(physicalDevice);
Jon Ashburn44aed662016-02-02 17:47:28 -0700297 return disp->GetPhysicalDeviceImageFormatProperties(
298 physicalDevice, format, type, tiling, usage, flags,
299 pImageFormatProperties);
Jon Ashburn4e189562015-07-23 18:49:07 -0600300}
301
Jon Ashburn44aed662016-02-02 17:47:28 -0700302LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
303vkGetPhysicalDeviceProperties(VkPhysicalDevice gpu,
304 VkPhysicalDeviceProperties *pProperties) {
Jon Ashburn2666e2f2015-05-15 15:09:35 -0600305 const VkLayerInstanceDispatchTable *disp;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600306
Jon Ashburn2666e2f2015-05-15 15:09:35 -0600307 disp = loader_get_instance_dispatch(gpu);
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -0600308 disp->GetPhysicalDeviceProperties(gpu, pProperties);
Tony Barbour426b9052015-06-24 16:06:58 -0600309}
310
Jon Ashburn44aed662016-02-02 17:47:28 -0700311LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
312vkGetPhysicalDeviceQueueFamilyProperties(
313 VkPhysicalDevice gpu, uint32_t *pQueueFamilyPropertyCount,
314 VkQueueFamilyProperties *pQueueProperties) {
Tony Barbour426b9052015-06-24 16:06:58 -0600315 const VkLayerInstanceDispatchTable *disp;
Tony Barbour426b9052015-06-24 16:06:58 -0600316
317 disp = loader_get_instance_dispatch(gpu);
Jon Ashburn44aed662016-02-02 17:47:28 -0700318 disp->GetPhysicalDeviceQueueFamilyProperties(gpu, pQueueFamilyPropertyCount,
319 pQueueProperties);
Tony Barbour426b9052015-06-24 16:06:58 -0600320}
321
Chia-I Wuaf9e4fd2015-11-06 06:42:02 +0800322LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties(
Jon Ashburn44aed662016-02-02 17:47:28 -0700323 VkPhysicalDevice gpu, VkPhysicalDeviceMemoryProperties *pMemoryProperties) {
Tony Barbour426b9052015-06-24 16:06:58 -0600324 const VkLayerInstanceDispatchTable *disp;
Tony Barbour426b9052015-06-24 16:06:58 -0600325
326 disp = loader_get_instance_dispatch(gpu);
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -0600327 disp->GetPhysicalDeviceMemoryProperties(gpu, pMemoryProperties);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600328}
329
Jon Ashburn44aed662016-02-02 17:47:28 -0700330LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
331vkCreateDevice(VkPhysicalDevice gpu, const VkDeviceCreateInfo *pCreateInfo,
332 const VkAllocationCallbacks *pAllocator, VkDevice *pDevice) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600333 VkResult res;
334
Jon Ashburnb40f2562015-05-29 13:15:39 -0600335 loader_platform_thread_lock_mutex(&loader_lock);
Courtney Goeltzenleuchterbe637992015-06-25 18:01:43 -0600336
Chia-I Wu69f40122015-10-26 21:10:41 +0800337 res = loader_CreateDevice(gpu, pCreateInfo, pAllocator, pDevice);
Courtney Goeltzenleuchterbe637992015-06-25 18:01:43 -0600338
Jon Ashburnb40f2562015-05-29 13:15:39 -0600339 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600340 return res;
341}
342
Jon Ashburn44aed662016-02-02 17:47:28 -0700343LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
344vkDestroyDevice(VkDevice device, const VkAllocationCallbacks *pAllocator) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600345 const VkLayerDispatchTable *disp;
Jon Ashburne58f1a32015-08-28 13:38:21 -0600346 struct loader_device *dev;
Andrzej Kotlowski4a54a742016-02-03 09:41:53 +0100347
348 loader_platform_thread_lock_mutex(&loader_lock);
349
Jon Ashburne58f1a32015-08-28 13:38:21 -0600350 struct loader_icd *icd = loader_get_icd_and_device(device, &dev);
351 const struct loader_instance *inst = icd->this_instance;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600352 disp = loader_get_dispatch(device);
353
Chia-I Wu69f40122015-10-26 21:10:41 +0800354 disp->DestroyDevice(device, pAllocator);
Jon Ashburndbf8cee2015-11-19 15:43:26 -0700355 dev->device = NULL;
356 loader_remove_logical_device(inst, icd, dev);
357
Jon Ashburnb40f2562015-05-29 13:15:39 -0600358 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburnb40f2562015-05-29 13:15:39 -0600359}
360
Jon Ashburn44aed662016-02-02 17:47:28 -0700361LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
362vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice,
363 const char *pLayerName,
364 uint32_t *pPropertyCount,
365 VkExtensionProperties *pProperties) {
Jon Ashburnb40f2562015-05-29 13:15:39 -0600366 VkResult res;
367
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -0600368 loader_platform_thread_lock_mutex(&loader_lock);
Jon Ashburndb5a5bc2015-11-02 17:40:01 -0700369
370 /* If pLayerName == NULL, then querying ICD extensions, pass this call
371 down the instance chain which will terminate in the ICD. This allows
372 layers to filter the extensions coming back up the chain.
373 If pLayerName != NULL then get layer extensions from manifest file. */
Jon Ashburn44aed662016-02-02 17:47:28 -0700374 if (pLayerName == NULL || strlen(pLayerName) == 0) {
Jon Ashburndb5a5bc2015-11-02 17:40:01 -0700375 const VkLayerInstanceDispatchTable *disp;
376
377 disp = loader_get_instance_dispatch(physicalDevice);
Jon Ashburn44aed662016-02-02 17:47:28 -0700378 res = disp->EnumerateDeviceExtensionProperties(
379 physicalDevice, NULL, pPropertyCount, pProperties);
Jon Ashburndb5a5bc2015-11-02 17:40:01 -0700380 } else {
Jon Ashburn44aed662016-02-02 17:47:28 -0700381 res = loader_EnumerateDeviceExtensionProperties(
382 physicalDevice, pLayerName, pPropertyCount, pProperties);
Jon Ashburndb5a5bc2015-11-02 17:40:01 -0700383 }
384
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -0600385 loader_platform_thread_unlock_mutex(&loader_lock);
Tony Barbour426b9052015-06-24 16:06:58 -0600386 return res;
387}
388
Jon Ashburn44aed662016-02-02 17:47:28 -0700389LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
390vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice,
391 uint32_t *pPropertyCount,
392 VkLayerProperties *pProperties) {
Tony Barbour426b9052015-06-24 16:06:58 -0600393 VkResult res;
394
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -0600395 loader_platform_thread_lock_mutex(&loader_lock);
Jon Ashburndb5a5bc2015-11-02 17:40:01 -0700396
397 /* Don't dispatch this call down the instance chain, want all device layers
398 enumerated and instance chain may not contain all device layers */
Jon Ashburn44aed662016-02-02 17:47:28 -0700399 res = loader_EnumerateDeviceLayerProperties(physicalDevice, pPropertyCount,
400 pProperties);
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -0600401 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburnfce93d92015-05-12 17:26:48 -0600402 return res;
403}
404
Jon Ashburn44aed662016-02-02 17:47:28 -0700405LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
406vkGetDeviceQueue(VkDevice device, uint32_t queueNodeIndex, uint32_t queueIndex,
407 VkQueue *pQueue) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600408 const VkLayerDispatchTable *disp;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600409
410 disp = loader_get_dispatch(device);
411
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -0600412 disp->GetDeviceQueue(device, queueNodeIndex, queueIndex, pQueue);
413 loader_set_dispatch(*pQueue, disp);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600414}
415
Jon Ashburn44aed662016-02-02 17:47:28 -0700416LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
417vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo *pSubmits,
418 VkFence fence) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600419 const VkLayerDispatchTable *disp;
420
421 disp = loader_get_dispatch(queue);
422
Chia-I Wu483e7702015-10-26 17:20:32 +0800423 return disp->QueueSubmit(queue, submitCount, pSubmits, fence);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600424}
425
Jon Ashburn44aed662016-02-02 17:47:28 -0700426LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkQueueWaitIdle(VkQueue queue) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600427 const VkLayerDispatchTable *disp;
428
429 disp = loader_get_dispatch(queue);
430
431 return disp->QueueWaitIdle(queue);
432}
433
Jon Ashburn44aed662016-02-02 17:47:28 -0700434LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkDeviceWaitIdle(VkDevice device) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600435 const VkLayerDispatchTable *disp;
436
437 disp = loader_get_dispatch(device);
438
439 return disp->DeviceWaitIdle(device);
440}
441
Jon Ashburn44aed662016-02-02 17:47:28 -0700442LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
443vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo *pAllocateInfo,
444 const VkAllocationCallbacks *pAllocator,
445 VkDeviceMemory *pMemory) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600446 const VkLayerDispatchTable *disp;
447
448 disp = loader_get_dispatch(device);
449
Chia-I Wu1f851912015-10-27 18:04:07 +0800450 return disp->AllocateMemory(device, pAllocateInfo, pAllocator, pMemory);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600451}
452
Jon Ashburn44aed662016-02-02 17:47:28 -0700453LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
454vkFreeMemory(VkDevice device, VkDeviceMemory mem,
455 const VkAllocationCallbacks *pAllocator) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600456 const VkLayerDispatchTable *disp;
457
458 disp = loader_get_dispatch(device);
459
Chia-I Wu69f40122015-10-26 21:10:41 +0800460 disp->FreeMemory(device, mem, pAllocator);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600461}
462
Jon Ashburn44aed662016-02-02 17:47:28 -0700463LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
464vkMapMemory(VkDevice device, VkDeviceMemory mem, VkDeviceSize offset,
465 VkDeviceSize size, VkFlags flags, void **ppData) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600466 const VkLayerDispatchTable *disp;
467
468 disp = loader_get_dispatch(device);
469
470 return disp->MapMemory(device, mem, offset, size, flags, ppData);
471}
472
Jon Ashburn44aed662016-02-02 17:47:28 -0700473LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
474vkUnmapMemory(VkDevice device, VkDeviceMemory mem) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600475 const VkLayerDispatchTable *disp;
476
477 disp = loader_get_dispatch(device);
478
Mark Lobodzinski67b42b72015-09-07 13:59:43 -0600479 disp->UnmapMemory(device, mem);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600480}
481
Jon Ashburn44aed662016-02-02 17:47:28 -0700482LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
483vkFlushMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount,
484 const VkMappedMemoryRange *pMemoryRanges) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600485 const VkLayerDispatchTable *disp;
486
487 disp = loader_get_dispatch(device);
488
Jon Ashburn44aed662016-02-02 17:47:28 -0700489 return disp->FlushMappedMemoryRanges(device, memoryRangeCount,
490 pMemoryRanges);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600491}
492
Jon Ashburn44aed662016-02-02 17:47:28 -0700493LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
494vkInvalidateMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount,
495 const VkMappedMemoryRange *pMemoryRanges) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600496 const VkLayerDispatchTable *disp;
497
498 disp = loader_get_dispatch(device);
499
Jon Ashburn44aed662016-02-02 17:47:28 -0700500 return disp->InvalidateMappedMemoryRanges(device, memoryRangeCount,
501 pMemoryRanges);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600502}
503
Jon Ashburn44aed662016-02-02 17:47:28 -0700504LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
505vkGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory,
506 VkDeviceSize *pCommittedMemoryInBytes) {
Courtney Goeltzenleuchterd040c5c2015-07-09 21:57:28 -0600507 const VkLayerDispatchTable *disp;
508
509 disp = loader_get_dispatch(device);
510
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -0600511 disp->GetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes);
Courtney Goeltzenleuchterd040c5c2015-07-09 21:57:28 -0600512}
513
Jon Ashburn44aed662016-02-02 17:47:28 -0700514LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
515vkBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory mem,
516 VkDeviceSize offset) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600517 const VkLayerDispatchTable *disp;
518
Mark Lobodzinskifb9f5642015-05-11 17:21:15 -0500519 disp = loader_get_dispatch(device);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600520
Tony Barbourde4124d2015-07-03 10:33:54 -0600521 return disp->BindBufferMemory(device, buffer, mem, offset);
522}
523
Jon Ashburn44aed662016-02-02 17:47:28 -0700524LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
525vkBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory mem,
526 VkDeviceSize offset) {
Tony Barbourde4124d2015-07-03 10:33:54 -0600527 const VkLayerDispatchTable *disp;
528
529 disp = loader_get_dispatch(device);
530
531 return disp->BindImageMemory(device, image, mem, offset);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600532}
533
Jon Ashburn44aed662016-02-02 17:47:28 -0700534LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
535vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer,
536 VkMemoryRequirements *pMemoryRequirements) {
Jon Ashburn4e189562015-07-23 18:49:07 -0600537 const VkLayerDispatchTable *disp;
538
539 disp = loader_get_dispatch(device);
540
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -0600541 disp->GetBufferMemoryRequirements(device, buffer, pMemoryRequirements);
Jon Ashburn4e189562015-07-23 18:49:07 -0600542}
543
Jon Ashburn44aed662016-02-02 17:47:28 -0700544LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
545vkGetImageMemoryRequirements(VkDevice device, VkImage image,
546 VkMemoryRequirements *pMemoryRequirements) {
Jon Ashburn4e189562015-07-23 18:49:07 -0600547 const VkLayerDispatchTable *disp;
548
549 disp = loader_get_dispatch(device);
550
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -0600551 disp->GetImageMemoryRequirements(device, image, pMemoryRequirements);
Jon Ashburn4e189562015-07-23 18:49:07 -0600552}
553
Jon Ashburn44aed662016-02-02 17:47:28 -0700554LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetImageSparseMemoryRequirements(
555 VkDevice device, VkImage image, uint32_t *pSparseMemoryRequirementCount,
556 VkSparseImageMemoryRequirements *pSparseMemoryRequirements) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600557 const VkLayerDispatchTable *disp;
558
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -0600559 disp = loader_get_dispatch(device);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600560
Jon Ashburn44aed662016-02-02 17:47:28 -0700561 disp->GetImageSparseMemoryRequirements(device, image,
562 pSparseMemoryRequirementCount,
563 pSparseMemoryRequirements);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600564}
565
Jon Ashburn44aed662016-02-02 17:47:28 -0700566LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
567vkGetPhysicalDeviceSparseImageFormatProperties(
568 VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type,
569 VkSampleCountFlagBits samples, VkImageUsageFlags usage,
570 VkImageTiling tiling, uint32_t *pPropertyCount,
571 VkSparseImageFormatProperties *pProperties) {
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -0600572 const VkLayerInstanceDispatchTable *disp;
573
574 disp = loader_get_instance_dispatch(physicalDevice);
575
Jon Ashburn44aed662016-02-02 17:47:28 -0700576 disp->GetPhysicalDeviceSparseImageFormatProperties(
577 physicalDevice, format, type, samples, usage, tiling, pPropertyCount,
578 pProperties);
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -0600579}
580
Jon Ashburn44aed662016-02-02 17:47:28 -0700581LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
582vkQueueBindSparse(VkQueue queue, uint32_t bindInfoCount,
583 const VkBindSparseInfo *pBindInfo, VkFence fence) {
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -0600584 const VkLayerDispatchTable *disp;
585
586 disp = loader_get_dispatch(queue);
587
Chia-I Wu06809d52015-10-26 16:55:27 +0800588 return disp->QueueBindSparse(queue, bindInfoCount, pBindInfo, fence);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600589}
590
Jon Ashburn44aed662016-02-02 17:47:28 -0700591LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
592vkCreateFence(VkDevice device, const VkFenceCreateInfo *pCreateInfo,
593 const VkAllocationCallbacks *pAllocator, VkFence *pFence) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600594 const VkLayerDispatchTable *disp;
595
596 disp = loader_get_dispatch(device);
597
Chia-I Wu69f40122015-10-26 21:10:41 +0800598 return disp->CreateFence(device, pCreateInfo, pAllocator, pFence);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600599}
600
Jon Ashburn44aed662016-02-02 17:47:28 -0700601LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
602vkDestroyFence(VkDevice device, VkFence fence,
603 const VkAllocationCallbacks *pAllocator) {
Tony Barbourde4124d2015-07-03 10:33:54 -0600604 const VkLayerDispatchTable *disp;
605
606 disp = loader_get_dispatch(device);
607
Chia-I Wu69f40122015-10-26 21:10:41 +0800608 disp->DestroyFence(device, fence, pAllocator);
Tony Barbourde4124d2015-07-03 10:33:54 -0600609}
610
Jon Ashburn44aed662016-02-02 17:47:28 -0700611LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
612vkResetFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600613 const VkLayerDispatchTable *disp;
614
615 disp = loader_get_dispatch(device);
616
617 return disp->ResetFences(device, fenceCount, pFences);
618}
619
Jon Ashburn44aed662016-02-02 17:47:28 -0700620LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
621vkGetFenceStatus(VkDevice device, VkFence fence) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600622 const VkLayerDispatchTable *disp;
623
624 disp = loader_get_dispatch(device);
625
626 return disp->GetFenceStatus(device, fence);
627}
628
Jon Ashburn44aed662016-02-02 17:47:28 -0700629LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
630vkWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences,
631 VkBool32 waitAll, uint64_t timeout) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600632 const VkLayerDispatchTable *disp;
633
634 disp = loader_get_dispatch(device);
635
636 return disp->WaitForFences(device, fenceCount, pFences, waitAll, timeout);
637}
638
Jon Ashburn44aed662016-02-02 17:47:28 -0700639LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
640vkCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo *pCreateInfo,
641 const VkAllocationCallbacks *pAllocator,
642 VkSemaphore *pSemaphore) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600643 const VkLayerDispatchTable *disp;
644
645 disp = loader_get_dispatch(device);
646
Chia-I Wu69f40122015-10-26 21:10:41 +0800647 return disp->CreateSemaphore(device, pCreateInfo, pAllocator, pSemaphore);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600648}
649
Jon Ashburn44aed662016-02-02 17:47:28 -0700650LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
651vkDestroySemaphore(VkDevice device, VkSemaphore semaphore,
652 const VkAllocationCallbacks *pAllocator) {
Tony Barbourde4124d2015-07-03 10:33:54 -0600653 const VkLayerDispatchTable *disp;
654
655 disp = loader_get_dispatch(device);
656
Chia-I Wu69f40122015-10-26 21:10:41 +0800657 disp->DestroySemaphore(device, semaphore, pAllocator);
Tony Barbourde4124d2015-07-03 10:33:54 -0600658}
659
Jon Ashburn44aed662016-02-02 17:47:28 -0700660LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
661vkCreateEvent(VkDevice device, const VkEventCreateInfo *pCreateInfo,
662 const VkAllocationCallbacks *pAllocator, VkEvent *pEvent) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600663 const VkLayerDispatchTable *disp;
664
665 disp = loader_get_dispatch(device);
666
Chia-I Wu69f40122015-10-26 21:10:41 +0800667 return disp->CreateEvent(device, pCreateInfo, pAllocator, pEvent);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600668}
669
Jon Ashburn44aed662016-02-02 17:47:28 -0700670LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
671vkDestroyEvent(VkDevice device, VkEvent event,
672 const VkAllocationCallbacks *pAllocator) {
Tony Barbourde4124d2015-07-03 10:33:54 -0600673 const VkLayerDispatchTable *disp;
674
675 disp = loader_get_dispatch(device);
676
Chia-I Wu69f40122015-10-26 21:10:41 +0800677 disp->DestroyEvent(device, event, pAllocator);
Tony Barbourde4124d2015-07-03 10:33:54 -0600678}
679
Jon Ashburn44aed662016-02-02 17:47:28 -0700680LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
681vkGetEventStatus(VkDevice device, VkEvent event) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600682 const VkLayerDispatchTable *disp;
683
684 disp = loader_get_dispatch(device);
685
686 return disp->GetEventStatus(device, event);
687}
688
Jon Ashburn44aed662016-02-02 17:47:28 -0700689LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
690vkSetEvent(VkDevice device, VkEvent event) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600691 const VkLayerDispatchTable *disp;
692
693 disp = loader_get_dispatch(device);
694
695 return disp->SetEvent(device, event);
696}
697
Jon Ashburn44aed662016-02-02 17:47:28 -0700698LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
699vkResetEvent(VkDevice device, VkEvent event) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600700 const VkLayerDispatchTable *disp;
701
702 disp = loader_get_dispatch(device);
703
704 return disp->ResetEvent(device, event);
705}
706
Jon Ashburn44aed662016-02-02 17:47:28 -0700707LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
708vkCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo *pCreateInfo,
709 const VkAllocationCallbacks *pAllocator,
710 VkQueryPool *pQueryPool) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600711 const VkLayerDispatchTable *disp;
712
713 disp = loader_get_dispatch(device);
714
Chia-I Wu69f40122015-10-26 21:10:41 +0800715 return disp->CreateQueryPool(device, pCreateInfo, pAllocator, pQueryPool);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600716}
717
Jon Ashburn44aed662016-02-02 17:47:28 -0700718LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
719vkDestroyQueryPool(VkDevice device, VkQueryPool queryPool,
720 const VkAllocationCallbacks *pAllocator) {
Tony Barbourde4124d2015-07-03 10:33:54 -0600721 const VkLayerDispatchTable *disp;
722
723 disp = loader_get_dispatch(device);
724
Chia-I Wu69f40122015-10-26 21:10:41 +0800725 disp->DestroyQueryPool(device, queryPool, pAllocator);
Tony Barbourde4124d2015-07-03 10:33:54 -0600726}
727
Jon Ashburn44aed662016-02-02 17:47:28 -0700728LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
729vkGetQueryPoolResults(VkDevice device, VkQueryPool queryPool,
730 uint32_t firstQuery, uint32_t queryCount, size_t dataSize,
731 void *pData, VkDeviceSize stride,
732 VkQueryResultFlags flags) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600733 const VkLayerDispatchTable *disp;
734
735 disp = loader_get_dispatch(device);
736
Jon Ashburn44aed662016-02-02 17:47:28 -0700737 return disp->GetQueryPoolResults(device, queryPool, firstQuery, queryCount,
738 dataSize, pData, stride, flags);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600739}
740
Jon Ashburn44aed662016-02-02 17:47:28 -0700741LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
742vkCreateBuffer(VkDevice device, const VkBufferCreateInfo *pCreateInfo,
743 const VkAllocationCallbacks *pAllocator, VkBuffer *pBuffer) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600744 const VkLayerDispatchTable *disp;
745
746 disp = loader_get_dispatch(device);
747
Chia-I Wu69f40122015-10-26 21:10:41 +0800748 return disp->CreateBuffer(device, pCreateInfo, pAllocator, pBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600749}
750
Jon Ashburn44aed662016-02-02 17:47:28 -0700751LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
752vkDestroyBuffer(VkDevice device, VkBuffer buffer,
753 const VkAllocationCallbacks *pAllocator) {
Tony Barbourde4124d2015-07-03 10:33:54 -0600754 const VkLayerDispatchTable *disp;
755
756 disp = loader_get_dispatch(device);
757
Chia-I Wu69f40122015-10-26 21:10:41 +0800758 disp->DestroyBuffer(device, buffer, pAllocator);
Tony Barbourde4124d2015-07-03 10:33:54 -0600759}
760
Jon Ashburn44aed662016-02-02 17:47:28 -0700761LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
762vkCreateBufferView(VkDevice device, const VkBufferViewCreateInfo *pCreateInfo,
763 const VkAllocationCallbacks *pAllocator,
764 VkBufferView *pView) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600765 const VkLayerDispatchTable *disp;
766
767 disp = loader_get_dispatch(device);
768
Chia-I Wu69f40122015-10-26 21:10:41 +0800769 return disp->CreateBufferView(device, pCreateInfo, pAllocator, pView);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600770}
771
Jon Ashburn44aed662016-02-02 17:47:28 -0700772LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
773vkDestroyBufferView(VkDevice device, VkBufferView bufferView,
774 const VkAllocationCallbacks *pAllocator) {
Tony Barbourde4124d2015-07-03 10:33:54 -0600775 const VkLayerDispatchTable *disp;
776
777 disp = loader_get_dispatch(device);
778
Chia-I Wu69f40122015-10-26 21:10:41 +0800779 disp->DestroyBufferView(device, bufferView, pAllocator);
Tony Barbourde4124d2015-07-03 10:33:54 -0600780}
781
Jon Ashburn44aed662016-02-02 17:47:28 -0700782LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
783vkCreateImage(VkDevice device, const VkImageCreateInfo *pCreateInfo,
784 const VkAllocationCallbacks *pAllocator, VkImage *pImage) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600785 const VkLayerDispatchTable *disp;
786
787 disp = loader_get_dispatch(device);
788
Chia-I Wu69f40122015-10-26 21:10:41 +0800789 return disp->CreateImage(device, pCreateInfo, pAllocator, pImage);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600790}
791
Jon Ashburn44aed662016-02-02 17:47:28 -0700792LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
793vkDestroyImage(VkDevice device, VkImage image,
794 const VkAllocationCallbacks *pAllocator) {
Tony Barbourde4124d2015-07-03 10:33:54 -0600795 const VkLayerDispatchTable *disp;
796
797 disp = loader_get_dispatch(device);
798
Chia-I Wu69f40122015-10-26 21:10:41 +0800799 disp->DestroyImage(device, image, pAllocator);
Tony Barbourde4124d2015-07-03 10:33:54 -0600800}
801
Jon Ashburn44aed662016-02-02 17:47:28 -0700802LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
803vkGetImageSubresourceLayout(VkDevice device, VkImage image,
804 const VkImageSubresource *pSubresource,
805 VkSubresourceLayout *pLayout) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600806 const VkLayerDispatchTable *disp;
807
808 disp = loader_get_dispatch(device);
809
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -0600810 disp->GetImageSubresourceLayout(device, image, pSubresource, pLayout);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600811}
812
Jon Ashburn44aed662016-02-02 17:47:28 -0700813LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
814vkCreateImageView(VkDevice device, const VkImageViewCreateInfo *pCreateInfo,
815 const VkAllocationCallbacks *pAllocator, VkImageView *pView) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600816 const VkLayerDispatchTable *disp;
817
818 disp = loader_get_dispatch(device);
819
Chia-I Wu69f40122015-10-26 21:10:41 +0800820 return disp->CreateImageView(device, pCreateInfo, pAllocator, pView);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600821}
822
Jon Ashburn44aed662016-02-02 17:47:28 -0700823LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
824vkDestroyImageView(VkDevice device, VkImageView imageView,
825 const VkAllocationCallbacks *pAllocator) {
Tony Barbourde4124d2015-07-03 10:33:54 -0600826 const VkLayerDispatchTable *disp;
827
828 disp = loader_get_dispatch(device);
829
Chia-I Wu69f40122015-10-26 21:10:41 +0800830 disp->DestroyImageView(device, imageView, pAllocator);
Tony Barbourde4124d2015-07-03 10:33:54 -0600831}
832
Jon Ashburn44aed662016-02-02 17:47:28 -0700833LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
834vkCreateShaderModule(VkDevice device,
835 const VkShaderModuleCreateInfo *pCreateInfo,
836 const VkAllocationCallbacks *pAllocator,
837 VkShaderModule *pShader) {
Courtney Goeltzenleuchter0b29b0d2015-06-24 18:24:19 -0600838 const VkLayerDispatchTable *disp;
839
840 disp = loader_get_dispatch(device);
841
Chia-I Wu69f40122015-10-26 21:10:41 +0800842 return disp->CreateShaderModule(device, pCreateInfo, pAllocator, pShader);
Courtney Goeltzenleuchter0b29b0d2015-06-24 18:24:19 -0600843}
844
Jon Ashburn44aed662016-02-02 17:47:28 -0700845LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
846vkDestroyShaderModule(VkDevice device, VkShaderModule shaderModule,
847 const VkAllocationCallbacks *pAllocator) {
Tony Barbourde4124d2015-07-03 10:33:54 -0600848 const VkLayerDispatchTable *disp;
849
850 disp = loader_get_dispatch(device);
851
Chia-I Wu69f40122015-10-26 21:10:41 +0800852 disp->DestroyShaderModule(device, shaderModule, pAllocator);
Tony Barbourde4124d2015-07-03 10:33:54 -0600853}
854
Jon Ashburn44aed662016-02-02 17:47:28 -0700855LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
856vkCreatePipelineCache(VkDevice device,
857 const VkPipelineCacheCreateInfo *pCreateInfo,
858 const VkAllocationCallbacks *pAllocator,
859 VkPipelineCache *pPipelineCache) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600860 const VkLayerDispatchTable *disp;
861
862 disp = loader_get_dispatch(device);
863
Jon Ashburn44aed662016-02-02 17:47:28 -0700864 return disp->CreatePipelineCache(device, pCreateInfo, pAllocator,
865 pPipelineCache);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600866}
867
Jon Ashburn44aed662016-02-02 17:47:28 -0700868LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
869vkDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache,
870 const VkAllocationCallbacks *pAllocator) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600871 const VkLayerDispatchTable *disp;
872
873 disp = loader_get_dispatch(device);
874
Chia-I Wu69f40122015-10-26 21:10:41 +0800875 disp->DestroyPipelineCache(device, pipelineCache, pAllocator);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600876}
877
Jon Ashburn44aed662016-02-02 17:47:28 -0700878LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
879vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache,
880 size_t *pDataSize, void *pData) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600881 const VkLayerDispatchTable *disp;
882
883 disp = loader_get_dispatch(device);
884
Chia-I Wu28c3c432015-10-26 19:17:06 +0800885 return disp->GetPipelineCacheData(device, pipelineCache, pDataSize, pData);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600886}
887
Jon Ashburn44aed662016-02-02 17:47:28 -0700888LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
889vkMergePipelineCaches(VkDevice device, VkPipelineCache dstCache,
890 uint32_t srcCacheCount,
891 const VkPipelineCache *pSrcCaches) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600892 const VkLayerDispatchTable *disp;
893
894 disp = loader_get_dispatch(device);
895
Jon Ashburn44aed662016-02-02 17:47:28 -0700896 return disp->MergePipelineCaches(device, dstCache, srcCacheCount,
897 pSrcCaches);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600898}
899
Jon Ashburn44aed662016-02-02 17:47:28 -0700900LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
901vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache,
902 uint32_t createInfoCount,
903 const VkGraphicsPipelineCreateInfo *pCreateInfos,
904 const VkAllocationCallbacks *pAllocator,
905 VkPipeline *pPipelines) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600906 const VkLayerDispatchTable *disp;
907
908 disp = loader_get_dispatch(device);
909
Jon Ashburn44aed662016-02-02 17:47:28 -0700910 return disp->CreateGraphicsPipelines(device, pipelineCache, createInfoCount,
911 pCreateInfos, pAllocator, pPipelines);
Jon Ashburn0d60d272015-07-09 15:02:25 -0600912}
913
Jon Ashburn44aed662016-02-02 17:47:28 -0700914LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
915vkCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache,
916 uint32_t createInfoCount,
917 const VkComputePipelineCreateInfo *pCreateInfos,
918 const VkAllocationCallbacks *pAllocator,
919 VkPipeline *pPipelines) {
Jon Ashburn0d60d272015-07-09 15:02:25 -0600920 const VkLayerDispatchTable *disp;
921
922 disp = loader_get_dispatch(device);
923
Jon Ashburn44aed662016-02-02 17:47:28 -0700924 return disp->CreateComputePipelines(device, pipelineCache, createInfoCount,
925 pCreateInfos, pAllocator, pPipelines);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600926}
927
Jon Ashburn44aed662016-02-02 17:47:28 -0700928LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
929vkDestroyPipeline(VkDevice device, VkPipeline pipeline,
930 const VkAllocationCallbacks *pAllocator) {
Tony Barbourde4124d2015-07-03 10:33:54 -0600931 const VkLayerDispatchTable *disp;
932
933 disp = loader_get_dispatch(device);
934
Chia-I Wu69f40122015-10-26 21:10:41 +0800935 disp->DestroyPipeline(device, pipeline, pAllocator);
Tony Barbourde4124d2015-07-03 10:33:54 -0600936}
937
Jon Ashburn44aed662016-02-02 17:47:28 -0700938LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
939vkCreatePipelineLayout(VkDevice device,
940 const VkPipelineLayoutCreateInfo *pCreateInfo,
941 const VkAllocationCallbacks *pAllocator,
942 VkPipelineLayout *pPipelineLayout) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600943 const VkLayerDispatchTable *disp;
944
945 disp = loader_get_dispatch(device);
946
Jon Ashburn44aed662016-02-02 17:47:28 -0700947 return disp->CreatePipelineLayout(device, pCreateInfo, pAllocator,
948 pPipelineLayout);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600949}
950
Jon Ashburn44aed662016-02-02 17:47:28 -0700951LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
952vkDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout,
953 const VkAllocationCallbacks *pAllocator) {
Tony Barbourde4124d2015-07-03 10:33:54 -0600954 const VkLayerDispatchTable *disp;
955
956 disp = loader_get_dispatch(device);
957
Chia-I Wu69f40122015-10-26 21:10:41 +0800958 disp->DestroyPipelineLayout(device, pipelineLayout, pAllocator);
Tony Barbourde4124d2015-07-03 10:33:54 -0600959}
960
Jon Ashburn44aed662016-02-02 17:47:28 -0700961LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
962vkCreateSampler(VkDevice device, const VkSamplerCreateInfo *pCreateInfo,
963 const VkAllocationCallbacks *pAllocator, VkSampler *pSampler) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600964 const VkLayerDispatchTable *disp;
965
966 disp = loader_get_dispatch(device);
967
Chia-I Wu69f40122015-10-26 21:10:41 +0800968 return disp->CreateSampler(device, pCreateInfo, pAllocator, pSampler);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600969}
970
Jon Ashburn44aed662016-02-02 17:47:28 -0700971LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
972vkDestroySampler(VkDevice device, VkSampler sampler,
973 const VkAllocationCallbacks *pAllocator) {
Tony Barbourde4124d2015-07-03 10:33:54 -0600974 const VkLayerDispatchTable *disp;
975
976 disp = loader_get_dispatch(device);
977
Chia-I Wu69f40122015-10-26 21:10:41 +0800978 disp->DestroySampler(device, sampler, pAllocator);
Tony Barbourde4124d2015-07-03 10:33:54 -0600979}
980
Jon Ashburn44aed662016-02-02 17:47:28 -0700981LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
982vkCreateDescriptorSetLayout(VkDevice device,
983 const VkDescriptorSetLayoutCreateInfo *pCreateInfo,
984 const VkAllocationCallbacks *pAllocator,
985 VkDescriptorSetLayout *pSetLayout) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600986 const VkLayerDispatchTable *disp;
987
988 disp = loader_get_dispatch(device);
989
Jon Ashburn44aed662016-02-02 17:47:28 -0700990 return disp->CreateDescriptorSetLayout(device, pCreateInfo, pAllocator,
991 pSetLayout);
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600992}
993
Jon Ashburn44aed662016-02-02 17:47:28 -0700994LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
995vkDestroyDescriptorSetLayout(VkDevice device,
996 VkDescriptorSetLayout descriptorSetLayout,
997 const VkAllocationCallbacks *pAllocator) {
Tony Barbourde4124d2015-07-03 10:33:54 -0600998 const VkLayerDispatchTable *disp;
999
1000 disp = loader_get_dispatch(device);
1001
Chia-I Wu69f40122015-10-26 21:10:41 +08001002 disp->DestroyDescriptorSetLayout(device, descriptorSetLayout, pAllocator);
Tony Barbourde4124d2015-07-03 10:33:54 -06001003}
1004
Jon Ashburn44aed662016-02-02 17:47:28 -07001005LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1006vkCreateDescriptorPool(VkDevice device,
1007 const VkDescriptorPoolCreateInfo *pCreateInfo,
1008 const VkAllocationCallbacks *pAllocator,
1009 VkDescriptorPool *pDescriptorPool) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001010 const VkLayerDispatchTable *disp;
1011
1012 disp = loader_get_dispatch(device);
1013
Jon Ashburn44aed662016-02-02 17:47:28 -07001014 return disp->CreateDescriptorPool(device, pCreateInfo, pAllocator,
1015 pDescriptorPool);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001016}
1017
Jon Ashburn44aed662016-02-02 17:47:28 -07001018LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1019vkDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool,
1020 const VkAllocationCallbacks *pAllocator) {
Tony Barbourde4124d2015-07-03 10:33:54 -06001021 const VkLayerDispatchTable *disp;
1022
1023 disp = loader_get_dispatch(device);
1024
Chia-I Wu69f40122015-10-26 21:10:41 +08001025 disp->DestroyDescriptorPool(device, descriptorPool, pAllocator);
Tony Barbourde4124d2015-07-03 10:33:54 -06001026}
1027
Jon Ashburn44aed662016-02-02 17:47:28 -07001028LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1029vkResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool,
1030 VkDescriptorPoolResetFlags flags) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001031 const VkLayerDispatchTable *disp;
1032
1033 disp = loader_get_dispatch(device);
1034
Courtney Goeltzenleuchter831c1832015-10-23 14:21:05 -06001035 return disp->ResetDescriptorPool(device, descriptorPool, flags);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001036}
1037
Jon Ashburn44aed662016-02-02 17:47:28 -07001038LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1039vkAllocateDescriptorSets(VkDevice device,
1040 const VkDescriptorSetAllocateInfo *pAllocateInfo,
1041 VkDescriptorSet *pDescriptorSets) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001042 const VkLayerDispatchTable *disp;
1043
1044 disp = loader_get_dispatch(device);
1045
Chia-I Wu1f851912015-10-27 18:04:07 +08001046 return disp->AllocateDescriptorSets(device, pAllocateInfo, pDescriptorSets);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001047}
1048
Jon Ashburn44aed662016-02-02 17:47:28 -07001049LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1050vkFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool,
1051 uint32_t descriptorSetCount,
1052 const VkDescriptorSet *pDescriptorSets) {
Tony Barbourb857d312015-07-10 10:50:45 -06001053 const VkLayerDispatchTable *disp;
1054
1055 disp = loader_get_dispatch(device);
1056
Jon Ashburn44aed662016-02-02 17:47:28 -07001057 return disp->FreeDescriptorSets(device, descriptorPool, descriptorSetCount,
1058 pDescriptorSets);
Tony Barbourb857d312015-07-10 10:50:45 -06001059}
1060
Jon Ashburn44aed662016-02-02 17:47:28 -07001061LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1062vkUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount,
1063 const VkWriteDescriptorSet *pDescriptorWrites,
1064 uint32_t descriptorCopyCount,
1065 const VkCopyDescriptorSet *pDescriptorCopies) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001066 const VkLayerDispatchTable *disp;
1067
1068 disp = loader_get_dispatch(device);
1069
Jon Ashburn44aed662016-02-02 17:47:28 -07001070 disp->UpdateDescriptorSets(device, descriptorWriteCount, pDescriptorWrites,
1071 descriptorCopyCount, pDescriptorCopies);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001072}
1073
Jon Ashburn44aed662016-02-02 17:47:28 -07001074LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1075vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo *pCreateInfo,
1076 const VkAllocationCallbacks *pAllocator,
1077 VkFramebuffer *pFramebuffer) {
Jon Ashburn4e189562015-07-23 18:49:07 -06001078 const VkLayerDispatchTable *disp;
1079
1080 disp = loader_get_dispatch(device);
1081
Jon Ashburn44aed662016-02-02 17:47:28 -07001082 return disp->CreateFramebuffer(device, pCreateInfo, pAllocator,
1083 pFramebuffer);
Jon Ashburn4e189562015-07-23 18:49:07 -06001084}
1085
Jon Ashburn44aed662016-02-02 17:47:28 -07001086LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1087vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer,
1088 const VkAllocationCallbacks *pAllocator) {
Jon Ashburn4e189562015-07-23 18:49:07 -06001089 const VkLayerDispatchTable *disp;
1090
1091 disp = loader_get_dispatch(device);
1092
Chia-I Wu69f40122015-10-26 21:10:41 +08001093 disp->DestroyFramebuffer(device, framebuffer, pAllocator);
Jon Ashburn4e189562015-07-23 18:49:07 -06001094}
1095
Jon Ashburn44aed662016-02-02 17:47:28 -07001096LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1097vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo,
1098 const VkAllocationCallbacks *pAllocator,
1099 VkRenderPass *pRenderPass) {
Jon Ashburn4e189562015-07-23 18:49:07 -06001100 const VkLayerDispatchTable *disp;
1101
1102 disp = loader_get_dispatch(device);
1103
Chia-I Wu69f40122015-10-26 21:10:41 +08001104 return disp->CreateRenderPass(device, pCreateInfo, pAllocator, pRenderPass);
Jon Ashburn4e189562015-07-23 18:49:07 -06001105}
1106
Jon Ashburn44aed662016-02-02 17:47:28 -07001107LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1108vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass,
1109 const VkAllocationCallbacks *pAllocator) {
Jon Ashburn4e189562015-07-23 18:49:07 -06001110 const VkLayerDispatchTable *disp;
1111
1112 disp = loader_get_dispatch(device);
1113
Chia-I Wu69f40122015-10-26 21:10:41 +08001114 disp->DestroyRenderPass(device, renderPass, pAllocator);
Jon Ashburn4e189562015-07-23 18:49:07 -06001115}
1116
Jon Ashburn44aed662016-02-02 17:47:28 -07001117LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1118vkGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass,
1119 VkExtent2D *pGranularity) {
Jon Ashburn4e189562015-07-23 18:49:07 -06001120 const VkLayerDispatchTable *disp;
1121
1122 disp = loader_get_dispatch(device);
1123
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06001124 disp->GetRenderAreaGranularity(device, renderPass, pGranularity);
Jon Ashburn4e189562015-07-23 18:49:07 -06001125}
1126
Jon Ashburn44aed662016-02-02 17:47:28 -07001127LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1128vkCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo *pCreateInfo,
1129 const VkAllocationCallbacks *pAllocator,
1130 VkCommandPool *pCommandPool) {
Cody Northropf02f9f82015-07-09 18:08:05 -06001131 const VkLayerDispatchTable *disp;
1132
1133 disp = loader_get_dispatch(device);
1134
Jon Ashburn44aed662016-02-02 17:47:28 -07001135 return disp->CreateCommandPool(device, pCreateInfo, pAllocator,
1136 pCommandPool);
Cody Northropf02f9f82015-07-09 18:08:05 -06001137}
1138
Jon Ashburn44aed662016-02-02 17:47:28 -07001139LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1140vkDestroyCommandPool(VkDevice device, VkCommandPool commandPool,
1141 const VkAllocationCallbacks *pAllocator) {
Cody Northropf02f9f82015-07-09 18:08:05 -06001142 const VkLayerDispatchTable *disp;
1143
1144 disp = loader_get_dispatch(device);
1145
Chia-I Wu1f851912015-10-27 18:04:07 +08001146 disp->DestroyCommandPool(device, commandPool, pAllocator);
Cody Northropf02f9f82015-07-09 18:08:05 -06001147}
1148
Jon Ashburn44aed662016-02-02 17:47:28 -07001149LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1150vkResetCommandPool(VkDevice device, VkCommandPool commandPool,
1151 VkCommandPoolResetFlags flags) {
Cody Northropf02f9f82015-07-09 18:08:05 -06001152 const VkLayerDispatchTable *disp;
1153
1154 disp = loader_get_dispatch(device);
1155
Chia-I Wu1f851912015-10-27 18:04:07 +08001156 return disp->ResetCommandPool(device, commandPool, flags);
Cody Northropf02f9f82015-07-09 18:08:05 -06001157}
1158
Jon Ashburn44aed662016-02-02 17:47:28 -07001159LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1160vkAllocateCommandBuffers(VkDevice device,
1161 const VkCommandBufferAllocateInfo *pAllocateInfo,
1162 VkCommandBuffer *pCommandBuffers) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001163 const VkLayerDispatchTable *disp;
1164 VkResult res;
1165
1166 disp = loader_get_dispatch(device);
1167
Chia-I Wu1f851912015-10-27 18:04:07 +08001168 res = disp->AllocateCommandBuffers(device, pAllocateInfo, pCommandBuffers);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001169 if (res == VK_SUCCESS) {
Jon Ashburn44aed662016-02-02 17:47:28 -07001170 for (uint32_t i = 0; i < pAllocateInfo->commandBufferCount; i++) {
Chia-I Wu1f851912015-10-27 18:04:07 +08001171 if (pCommandBuffers[i]) {
1172 loader_init_dispatch(pCommandBuffers[i], disp);
Courtney Goeltzenleuchter831c1832015-10-23 14:21:05 -06001173 }
1174 }
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001175 }
1176
1177 return res;
1178}
1179
Jon Ashburn44aed662016-02-02 17:47:28 -07001180LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1181vkFreeCommandBuffers(VkDevice device, VkCommandPool commandPool,
1182 uint32_t commandBufferCount,
1183 const VkCommandBuffer *pCommandBuffers) {
Tony Barbourde4124d2015-07-03 10:33:54 -06001184 const VkLayerDispatchTable *disp;
1185
1186 disp = loader_get_dispatch(device);
1187
Jon Ashburn44aed662016-02-02 17:47:28 -07001188 disp->FreeCommandBuffers(device, commandPool, commandBufferCount,
1189 pCommandBuffers);
Tony Barbourde4124d2015-07-03 10:33:54 -06001190}
1191
Jon Ashburn44aed662016-02-02 17:47:28 -07001192LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1193vkBeginCommandBuffer(VkCommandBuffer commandBuffer,
1194 const VkCommandBufferBeginInfo *pBeginInfo) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001195 const VkLayerDispatchTable *disp;
1196
Chia-I Wu1f851912015-10-27 18:04:07 +08001197 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001198
Chia-I Wu1f851912015-10-27 18:04:07 +08001199 return disp->BeginCommandBuffer(commandBuffer, pBeginInfo);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001200}
1201
Jon Ashburn44aed662016-02-02 17:47:28 -07001202LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1203vkEndCommandBuffer(VkCommandBuffer commandBuffer) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001204 const VkLayerDispatchTable *disp;
1205
Chia-I Wu1f851912015-10-27 18:04:07 +08001206 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001207
Chia-I Wu1f851912015-10-27 18:04:07 +08001208 return disp->EndCommandBuffer(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001209}
1210
Jon Ashburn44aed662016-02-02 17:47:28 -07001211LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1212vkResetCommandBuffer(VkCommandBuffer commandBuffer,
1213 VkCommandBufferResetFlags flags) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001214 const VkLayerDispatchTable *disp;
1215
Chia-I Wu1f851912015-10-27 18:04:07 +08001216 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001217
Chia-I Wu1f851912015-10-27 18:04:07 +08001218 return disp->ResetCommandBuffer(commandBuffer, flags);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001219}
1220
Jon Ashburn44aed662016-02-02 17:47:28 -07001221LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1222vkCmdBindPipeline(VkCommandBuffer commandBuffer,
1223 VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001224 const VkLayerDispatchTable *disp;
1225
Chia-I Wu1f851912015-10-27 18:04:07 +08001226 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001227
Chia-I Wu1f851912015-10-27 18:04:07 +08001228 disp->CmdBindPipeline(commandBuffer, pipelineBindPoint, pipeline);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001229}
1230
Jon Ashburn44aed662016-02-02 17:47:28 -07001231LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1232vkCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport,
1233 uint32_t viewportCount, const VkViewport *pViewports) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001234 const VkLayerDispatchTable *disp;
1235
Chia-I Wu1f851912015-10-27 18:04:07 +08001236 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001237
Jon Ashburn44aed662016-02-02 17:47:28 -07001238 disp->CmdSetViewport(commandBuffer, firstViewport, viewportCount,
1239 pViewports);
Courtney Goeltzenleuchter932cdb52015-09-21 11:44:06 -06001240}
1241
Jon Ashburn44aed662016-02-02 17:47:28 -07001242LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1243vkCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor,
1244 uint32_t scissorCount, const VkRect2D *pScissors) {
Courtney Goeltzenleuchter932cdb52015-09-21 11:44:06 -06001245 const VkLayerDispatchTable *disp;
1246
Chia-I Wu1f851912015-10-27 18:04:07 +08001247 disp = loader_get_dispatch(commandBuffer);
Courtney Goeltzenleuchter932cdb52015-09-21 11:44:06 -06001248
Jon Ashburnf2516522015-12-30 14:06:55 -07001249 disp->CmdSetScissor(commandBuffer, firstScissor, scissorCount, pScissors);
Tony Barbourde4124d2015-07-03 10:33:54 -06001250}
1251
Jon Ashburn44aed662016-02-02 17:47:28 -07001252LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1253vkCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth) {
Tony Barbourde4124d2015-07-03 10:33:54 -06001254 const VkLayerDispatchTable *disp;
1255
Chia-I Wu1f851912015-10-27 18:04:07 +08001256 disp = loader_get_dispatch(commandBuffer);
Tony Barbourde4124d2015-07-03 10:33:54 -06001257
Chia-I Wu1f851912015-10-27 18:04:07 +08001258 disp->CmdSetLineWidth(commandBuffer, lineWidth);
Cody Northropf5bd2252015-08-17 11:10:49 -06001259}
1260
Jon Ashburn44aed662016-02-02 17:47:28 -07001261LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1262vkCmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor,
1263 float depthBiasClamp, float depthBiasSlopeFactor) {
Cody Northropf5bd2252015-08-17 11:10:49 -06001264 const VkLayerDispatchTable *disp;
1265
Chia-I Wu1f851912015-10-27 18:04:07 +08001266 disp = loader_get_dispatch(commandBuffer);
Cody Northropf5bd2252015-08-17 11:10:49 -06001267
Jon Ashburn44aed662016-02-02 17:47:28 -07001268 disp->CmdSetDepthBias(commandBuffer, depthBiasConstantFactor,
1269 depthBiasClamp, depthBiasSlopeFactor);
Tony Barbourde4124d2015-07-03 10:33:54 -06001270}
1271
Jon Ashburn44aed662016-02-02 17:47:28 -07001272LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1273vkCmdSetBlendConstants(VkCommandBuffer commandBuffer,
1274 const float blendConstants[4]) {
Tony Barbourde4124d2015-07-03 10:33:54 -06001275 const VkLayerDispatchTable *disp;
1276
Chia-I Wu1f851912015-10-27 18:04:07 +08001277 disp = loader_get_dispatch(commandBuffer);
Tony Barbourde4124d2015-07-03 10:33:54 -06001278
Chia-I Wu1f851912015-10-27 18:04:07 +08001279 disp->CmdSetBlendConstants(commandBuffer, blendConstants);
Tony Barbourde4124d2015-07-03 10:33:54 -06001280}
1281
Jon Ashburn44aed662016-02-02 17:47:28 -07001282LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1283vkCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds,
1284 float maxDepthBounds) {
Tony Barbourde4124d2015-07-03 10:33:54 -06001285 const VkLayerDispatchTable *disp;
1286
Chia-I Wu1f851912015-10-27 18:04:07 +08001287 disp = loader_get_dispatch(commandBuffer);
Tony Barbourde4124d2015-07-03 10:33:54 -06001288
Chia-I Wu1f851912015-10-27 18:04:07 +08001289 disp->CmdSetDepthBounds(commandBuffer, minDepthBounds, maxDepthBounds);
Cody Northrop2605cb02015-08-18 15:21:16 -06001290}
1291
Jon Ashburn44aed662016-02-02 17:47:28 -07001292LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1293vkCmdSetStencilCompareMask(VkCommandBuffer commandBuffer,
1294 VkStencilFaceFlags faceMask, uint32_t compareMask) {
Cody Northrop2605cb02015-08-18 15:21:16 -06001295 const VkLayerDispatchTable *disp;
1296
Chia-I Wu1f851912015-10-27 18:04:07 +08001297 disp = loader_get_dispatch(commandBuffer);
Cody Northrop2605cb02015-08-18 15:21:16 -06001298
Chia-I Wuc51b1212015-10-27 19:25:11 +08001299 disp->CmdSetStencilCompareMask(commandBuffer, faceMask, compareMask);
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001300}
1301
Jon Ashburn44aed662016-02-02 17:47:28 -07001302LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1303vkCmdSetStencilWriteMask(VkCommandBuffer commandBuffer,
1304 VkStencilFaceFlags faceMask, uint32_t writeMask) {
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001305 const VkLayerDispatchTable *disp;
1306
Chia-I Wu1f851912015-10-27 18:04:07 +08001307 disp = loader_get_dispatch(commandBuffer);
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001308
Chia-I Wuc51b1212015-10-27 19:25:11 +08001309 disp->CmdSetStencilWriteMask(commandBuffer, faceMask, writeMask);
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001310}
1311
Jon Ashburn44aed662016-02-02 17:47:28 -07001312LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1313vkCmdSetStencilReference(VkCommandBuffer commandBuffer,
1314 VkStencilFaceFlags faceMask, uint32_t reference) {
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001315 const VkLayerDispatchTable *disp;
1316
Chia-I Wu1f851912015-10-27 18:04:07 +08001317 disp = loader_get_dispatch(commandBuffer);
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001318
Chia-I Wuc51b1212015-10-27 19:25:11 +08001319 disp->CmdSetStencilReference(commandBuffer, faceMask, reference);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001320}
1321
Jon Ashburn44aed662016-02-02 17:47:28 -07001322LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBindDescriptorSets(
1323 VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint,
1324 VkPipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount,
1325 const VkDescriptorSet *pDescriptorSets, uint32_t dynamicOffsetCount,
1326 const uint32_t *pDynamicOffsets) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001327 const VkLayerDispatchTable *disp;
1328
Chia-I Wu1f851912015-10-27 18:04:07 +08001329 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001330
Jon Ashburn44aed662016-02-02 17:47:28 -07001331 disp->CmdBindDescriptorSets(commandBuffer, pipelineBindPoint, layout,
1332 firstSet, descriptorSetCount, pDescriptorSets,
1333 dynamicOffsetCount, pDynamicOffsets);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001334}
1335
Jon Ashburn44aed662016-02-02 17:47:28 -07001336LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1337vkCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer,
1338 VkDeviceSize offset, VkIndexType indexType) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001339 const VkLayerDispatchTable *disp;
1340
Chia-I Wu1f851912015-10-27 18:04:07 +08001341 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001342
Chia-I Wu1f851912015-10-27 18:04:07 +08001343 disp->CmdBindIndexBuffer(commandBuffer, buffer, offset, indexType);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001344}
1345
Jon Ashburn44aed662016-02-02 17:47:28 -07001346LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1347vkCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding,
1348 uint32_t bindingCount, const VkBuffer *pBuffers,
1349 const VkDeviceSize *pOffsets) {
Jon Ashburn4e189562015-07-23 18:49:07 -06001350 const VkLayerDispatchTable *disp;
1351
Chia-I Wu1f851912015-10-27 18:04:07 +08001352 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn4e189562015-07-23 18:49:07 -06001353
Jon Ashburn44aed662016-02-02 17:47:28 -07001354 disp->CmdBindVertexBuffers(commandBuffer, firstBinding, bindingCount,
1355 pBuffers, pOffsets);
Jon Ashburn4e189562015-07-23 18:49:07 -06001356}
1357
Jon Ashburn44aed662016-02-02 17:47:28 -07001358LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1359vkCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount,
1360 uint32_t instanceCount, uint32_t firstVertex,
1361 uint32_t firstInstance) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001362 const VkLayerDispatchTable *disp;
1363
Chia-I Wu1f851912015-10-27 18:04:07 +08001364 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001365
Jon Ashburn44aed662016-02-02 17:47:28 -07001366 disp->CmdDraw(commandBuffer, vertexCount, instanceCount, firstVertex,
1367 firstInstance);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001368}
1369
Jon Ashburn44aed662016-02-02 17:47:28 -07001370LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1371vkCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount,
1372 uint32_t instanceCount, uint32_t firstIndex,
1373 int32_t vertexOffset, uint32_t firstInstance) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001374 const VkLayerDispatchTable *disp;
1375
Chia-I Wu1f851912015-10-27 18:04:07 +08001376 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001377
Jon Ashburn44aed662016-02-02 17:47:28 -07001378 disp->CmdDrawIndexed(commandBuffer, indexCount, instanceCount, firstIndex,
1379 vertexOffset, firstInstance);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001380}
1381
Jon Ashburn44aed662016-02-02 17:47:28 -07001382LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1383vkCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer,
1384 VkDeviceSize offset, uint32_t drawCount, uint32_t stride) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001385 const VkLayerDispatchTable *disp;
1386
Chia-I Wu1f851912015-10-27 18:04:07 +08001387 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001388
Chia-I Wu1f851912015-10-27 18:04:07 +08001389 disp->CmdDrawIndirect(commandBuffer, buffer, offset, drawCount, stride);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001390}
1391
Jon Ashburn44aed662016-02-02 17:47:28 -07001392LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1393vkCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer,
1394 VkDeviceSize offset, uint32_t drawCount,
1395 uint32_t stride) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001396 const VkLayerDispatchTable *disp;
1397
Chia-I Wu1f851912015-10-27 18:04:07 +08001398 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001399
Jon Ashburn44aed662016-02-02 17:47:28 -07001400 disp->CmdDrawIndexedIndirect(commandBuffer, buffer, offset, drawCount,
1401 stride);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001402}
1403
Jon Ashburn44aed662016-02-02 17:47:28 -07001404LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1405vkCmdDispatch(VkCommandBuffer commandBuffer, uint32_t x, uint32_t y,
1406 uint32_t z) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001407 const VkLayerDispatchTable *disp;
1408
Chia-I Wu1f851912015-10-27 18:04:07 +08001409 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001410
Chia-I Wu1f851912015-10-27 18:04:07 +08001411 disp->CmdDispatch(commandBuffer, x, y, z);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001412}
1413
Jon Ashburn44aed662016-02-02 17:47:28 -07001414LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1415vkCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer,
1416 VkDeviceSize offset) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001417 const VkLayerDispatchTable *disp;
1418
Chia-I Wu1f851912015-10-27 18:04:07 +08001419 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001420
Chia-I Wu1f851912015-10-27 18:04:07 +08001421 disp->CmdDispatchIndirect(commandBuffer, buffer, offset);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001422}
1423
Jon Ashburn44aed662016-02-02 17:47:28 -07001424LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1425vkCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer,
1426 VkBuffer dstBuffer, uint32_t regionCount,
1427 const VkBufferCopy *pRegions) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001428 const VkLayerDispatchTable *disp;
1429
Chia-I Wu1f851912015-10-27 18:04:07 +08001430 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001431
Jon Ashburn44aed662016-02-02 17:47:28 -07001432 disp->CmdCopyBuffer(commandBuffer, srcBuffer, dstBuffer, regionCount,
1433 pRegions);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001434}
1435
Jon Ashburn44aed662016-02-02 17:47:28 -07001436LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1437vkCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage,
1438 VkImageLayout srcImageLayout, VkImage dstImage,
1439 VkImageLayout dstImageLayout, uint32_t regionCount,
1440 const VkImageCopy *pRegions) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001441 const VkLayerDispatchTable *disp;
1442
Chia-I Wu1f851912015-10-27 18:04:07 +08001443 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001444
Jon Ashburn44aed662016-02-02 17:47:28 -07001445 disp->CmdCopyImage(commandBuffer, srcImage, srcImageLayout, dstImage,
1446 dstImageLayout, regionCount, pRegions);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001447}
1448
Jon Ashburn44aed662016-02-02 17:47:28 -07001449LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1450vkCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage,
1451 VkImageLayout srcImageLayout, VkImage dstImage,
1452 VkImageLayout dstImageLayout, uint32_t regionCount,
1453 const VkImageBlit *pRegions, VkFilter filter) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001454 const VkLayerDispatchTable *disp;
1455
Chia-I Wu1f851912015-10-27 18:04:07 +08001456 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001457
Jon Ashburn44aed662016-02-02 17:47:28 -07001458 disp->CmdBlitImage(commandBuffer, srcImage, srcImageLayout, dstImage,
1459 dstImageLayout, regionCount, pRegions, filter);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001460}
1461
Jon Ashburn44aed662016-02-02 17:47:28 -07001462LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1463vkCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer,
1464 VkImage dstImage, VkImageLayout dstImageLayout,
1465 uint32_t regionCount,
1466 const VkBufferImageCopy *pRegions) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001467 const VkLayerDispatchTable *disp;
1468
Chia-I Wu1f851912015-10-27 18:04:07 +08001469 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001470
Jon Ashburn44aed662016-02-02 17:47:28 -07001471 disp->CmdCopyBufferToImage(commandBuffer, srcBuffer, dstImage,
1472 dstImageLayout, regionCount, pRegions);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001473}
1474
Jon Ashburn44aed662016-02-02 17:47:28 -07001475LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1476vkCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage,
1477 VkImageLayout srcImageLayout, VkBuffer dstBuffer,
1478 uint32_t regionCount,
1479 const VkBufferImageCopy *pRegions) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001480 const VkLayerDispatchTable *disp;
1481
Chia-I Wu1f851912015-10-27 18:04:07 +08001482 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001483
Jon Ashburn44aed662016-02-02 17:47:28 -07001484 disp->CmdCopyImageToBuffer(commandBuffer, srcImage, srcImageLayout,
1485 dstBuffer, regionCount, pRegions);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001486}
1487
Jon Ashburn44aed662016-02-02 17:47:28 -07001488LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1489vkCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer,
1490 VkDeviceSize dstOffset, VkDeviceSize dataSize,
1491 const uint32_t *pData) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001492 const VkLayerDispatchTable *disp;
1493
Chia-I Wu1f851912015-10-27 18:04:07 +08001494 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001495
Chia-I Wu1f851912015-10-27 18:04:07 +08001496 disp->CmdUpdateBuffer(commandBuffer, dstBuffer, dstOffset, dataSize, pData);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001497}
1498
Jon Ashburn44aed662016-02-02 17:47:28 -07001499LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1500vkCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer,
1501 VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001502 const VkLayerDispatchTable *disp;
1503
Chia-I Wu1f851912015-10-27 18:04:07 +08001504 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001505
Chia-I Wu1f851912015-10-27 18:04:07 +08001506 disp->CmdFillBuffer(commandBuffer, dstBuffer, dstOffset, size, data);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001507}
1508
Jon Ashburn44aed662016-02-02 17:47:28 -07001509LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1510vkCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image,
1511 VkImageLayout imageLayout, const VkClearColorValue *pColor,
1512 uint32_t rangeCount,
1513 const VkImageSubresourceRange *pRanges) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001514 const VkLayerDispatchTable *disp;
1515
Chia-I Wu1f851912015-10-27 18:04:07 +08001516 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001517
Jon Ashburn44aed662016-02-02 17:47:28 -07001518 disp->CmdClearColorImage(commandBuffer, image, imageLayout, pColor,
1519 rangeCount, pRanges);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001520}
1521
Jon Ashburn44aed662016-02-02 17:47:28 -07001522LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1523vkCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image,
1524 VkImageLayout imageLayout,
1525 const VkClearDepthStencilValue *pDepthStencil,
1526 uint32_t rangeCount,
1527 const VkImageSubresourceRange *pRanges) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001528 const VkLayerDispatchTable *disp;
1529
Chia-I Wu1f851912015-10-27 18:04:07 +08001530 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001531
Jon Ashburn44aed662016-02-02 17:47:28 -07001532 disp->CmdClearDepthStencilImage(commandBuffer, image, imageLayout,
1533 pDepthStencil, rangeCount, pRanges);
Chris Forbes2951d7d2015-06-22 17:21:59 +12001534}
1535
Jon Ashburn44aed662016-02-02 17:47:28 -07001536LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1537vkCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount,
1538 const VkClearAttachment *pAttachments, uint32_t rectCount,
1539 const VkClearRect *pRects) {
Chris Forbes2951d7d2015-06-22 17:21:59 +12001540 const VkLayerDispatchTable *disp;
1541
Chia-I Wu1f851912015-10-27 18:04:07 +08001542 disp = loader_get_dispatch(commandBuffer);
Chris Forbes2951d7d2015-06-22 17:21:59 +12001543
Jon Ashburn44aed662016-02-02 17:47:28 -07001544 disp->CmdClearAttachments(commandBuffer, attachmentCount, pAttachments,
1545 rectCount, pRects);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001546}
1547
Jon Ashburn44aed662016-02-02 17:47:28 -07001548LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1549vkCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage,
1550 VkImageLayout srcImageLayout, VkImage dstImage,
1551 VkImageLayout dstImageLayout, uint32_t regionCount,
1552 const VkImageResolve *pRegions) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001553 const VkLayerDispatchTable *disp;
1554
Chia-I Wu1f851912015-10-27 18:04:07 +08001555 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001556
Jon Ashburn44aed662016-02-02 17:47:28 -07001557 disp->CmdResolveImage(commandBuffer, srcImage, srcImageLayout, dstImage,
1558 dstImageLayout, regionCount, pRegions);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001559}
1560
Jon Ashburn44aed662016-02-02 17:47:28 -07001561LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1562vkCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event,
1563 VkPipelineStageFlags stageMask) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001564 const VkLayerDispatchTable *disp;
1565
Chia-I Wu1f851912015-10-27 18:04:07 +08001566 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001567
Chia-I Wu1f851912015-10-27 18:04:07 +08001568 disp->CmdSetEvent(commandBuffer, event, stageMask);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001569}
1570
Jon Ashburn44aed662016-02-02 17:47:28 -07001571LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1572vkCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event,
1573 VkPipelineStageFlags stageMask) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001574 const VkLayerDispatchTable *disp;
1575
Chia-I Wu1f851912015-10-27 18:04:07 +08001576 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001577
Chia-I Wu1f851912015-10-27 18:04:07 +08001578 disp->CmdResetEvent(commandBuffer, event, stageMask);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001579}
1580
Jon Ashburn44aed662016-02-02 17:47:28 -07001581LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1582vkCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount,
1583 const VkEvent *pEvents, VkPipelineStageFlags sourceStageMask,
1584 VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount,
1585 const VkMemoryBarrier *pMemoryBarriers,
1586 uint32_t bufferMemoryBarrierCount,
1587 const VkBufferMemoryBarrier *pBufferMemoryBarriers,
1588 uint32_t imageMemoryBarrierCount,
1589 const VkImageMemoryBarrier *pImageMemoryBarriers) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001590 const VkLayerDispatchTable *disp;
1591
Chia-I Wu1f851912015-10-27 18:04:07 +08001592 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001593
Jon Ashburna4ae48b2016-01-11 13:12:43 -07001594 disp->CmdWaitEvents(commandBuffer, eventCount, pEvents, sourceStageMask,
1595 dstStageMask, memoryBarrierCount, pMemoryBarriers,
1596 bufferMemoryBarrierCount, pBufferMemoryBarriers,
1597 imageMemoryBarrierCount, pImageMemoryBarriers);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001598}
1599
Jon Ashburna4ae48b2016-01-11 13:12:43 -07001600LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdPipelineBarrier(
Jon Ashburn44aed662016-02-02 17:47:28 -07001601 VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask,
1602 VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags,
1603 uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers,
1604 uint32_t bufferMemoryBarrierCount,
1605 const VkBufferMemoryBarrier *pBufferMemoryBarriers,
1606 uint32_t imageMemoryBarrierCount,
1607 const VkImageMemoryBarrier *pImageMemoryBarriers) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001608 const VkLayerDispatchTable *disp;
1609
Chia-I Wu1f851912015-10-27 18:04:07 +08001610 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001611
Jon Ashburn44aed662016-02-02 17:47:28 -07001612 disp->CmdPipelineBarrier(
1613 commandBuffer, srcStageMask, dstStageMask, dependencyFlags,
1614 memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount,
1615 pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001616}
1617
Jon Ashburn44aed662016-02-02 17:47:28 -07001618LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1619vkCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool,
1620 uint32_t slot, VkFlags flags) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001621 const VkLayerDispatchTable *disp;
1622
Chia-I Wu1f851912015-10-27 18:04:07 +08001623 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001624
Chia-I Wu1f851912015-10-27 18:04:07 +08001625 disp->CmdBeginQuery(commandBuffer, queryPool, slot, flags);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001626}
1627
Jon Ashburn44aed662016-02-02 17:47:28 -07001628LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1629vkCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool,
1630 uint32_t slot) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001631 const VkLayerDispatchTable *disp;
1632
Chia-I Wu1f851912015-10-27 18:04:07 +08001633 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001634
Chia-I Wu1f851912015-10-27 18:04:07 +08001635 disp->CmdEndQuery(commandBuffer, queryPool, slot);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001636}
1637
Jon Ashburn44aed662016-02-02 17:47:28 -07001638LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1639vkCmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool,
1640 uint32_t firstQuery, uint32_t queryCount) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001641 const VkLayerDispatchTable *disp;
1642
Chia-I Wu1f851912015-10-27 18:04:07 +08001643 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001644
Jon Ashburnf2516522015-12-30 14:06:55 -07001645 disp->CmdResetQueryPool(commandBuffer, queryPool, firstQuery, queryCount);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001646}
1647
Jon Ashburn44aed662016-02-02 17:47:28 -07001648LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1649vkCmdWriteTimestamp(VkCommandBuffer commandBuffer,
1650 VkPipelineStageFlagBits pipelineStage,
1651 VkQueryPool queryPool, uint32_t slot) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001652 const VkLayerDispatchTable *disp;
1653
Chia-I Wu1f851912015-10-27 18:04:07 +08001654 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001655
Chia-I Wu1f851912015-10-27 18:04:07 +08001656 disp->CmdWriteTimestamp(commandBuffer, pipelineStage, queryPool, slot);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001657}
1658
Jon Ashburn44aed662016-02-02 17:47:28 -07001659LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1660vkCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool,
1661 uint32_t firstQuery, uint32_t queryCount,
1662 VkBuffer dstBuffer, VkDeviceSize dstOffset,
1663 VkDeviceSize stride, VkFlags flags) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001664 const VkLayerDispatchTable *disp;
1665
Chia-I Wu1f851912015-10-27 18:04:07 +08001666 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001667
Jon Ashburn44aed662016-02-02 17:47:28 -07001668 disp->CmdCopyQueryPoolResults(commandBuffer, queryPool, firstQuery,
1669 queryCount, dstBuffer, dstOffset, stride,
1670 flags);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001671}
1672
Jon Ashburn44aed662016-02-02 17:47:28 -07001673LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1674vkCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout,
1675 VkShaderStageFlags stageFlags, uint32_t offset,
1676 uint32_t size, const void *pValues) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001677 const VkLayerDispatchTable *disp;
1678
Chia-I Wu1f851912015-10-27 18:04:07 +08001679 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001680
Jon Ashburn44aed662016-02-02 17:47:28 -07001681 disp->CmdPushConstants(commandBuffer, layout, stageFlags, offset, size,
1682 pValues);
Tony Barbourde4124d2015-07-03 10:33:54 -06001683}
1684
Jon Ashburn44aed662016-02-02 17:47:28 -07001685LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1686vkCmdBeginRenderPass(VkCommandBuffer commandBuffer,
1687 const VkRenderPassBeginInfo *pRenderPassBegin,
1688 VkSubpassContents contents) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001689 const VkLayerDispatchTable *disp;
1690
Chia-I Wu1f851912015-10-27 18:04:07 +08001691 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001692
Chia-I Wu1f851912015-10-27 18:04:07 +08001693 disp->CmdBeginRenderPass(commandBuffer, pRenderPassBegin, contents);
Chia-I Wuc278df82015-07-07 11:50:03 +08001694}
1695
Jon Ashburn44aed662016-02-02 17:47:28 -07001696LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1697vkCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents) {
Chia-I Wuc278df82015-07-07 11:50:03 +08001698 const VkLayerDispatchTable *disp;
1699
Chia-I Wu1f851912015-10-27 18:04:07 +08001700 disp = loader_get_dispatch(commandBuffer);
Chia-I Wuc278df82015-07-07 11:50:03 +08001701
Chia-I Wu1f851912015-10-27 18:04:07 +08001702 disp->CmdNextSubpass(commandBuffer, contents);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001703}
1704
Jon Ashburn44aed662016-02-02 17:47:28 -07001705LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1706vkCmdEndRenderPass(VkCommandBuffer commandBuffer) {
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001707 const VkLayerDispatchTable *disp;
1708
Chia-I Wu1f851912015-10-27 18:04:07 +08001709 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001710
Chia-I Wu1f851912015-10-27 18:04:07 +08001711 disp->CmdEndRenderPass(commandBuffer);
Chia-I Wu88eaa3b2015-06-26 15:34:39 +08001712}
1713
Jon Ashburn44aed662016-02-02 17:47:28 -07001714LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1715vkCmdExecuteCommands(VkCommandBuffer commandBuffer,
1716 uint32_t commandBuffersCount,
1717 const VkCommandBuffer *pCommandBuffers) {
Chia-I Wu88eaa3b2015-06-26 15:34:39 +08001718 const VkLayerDispatchTable *disp;
1719
Chia-I Wu1f851912015-10-27 18:04:07 +08001720 disp = loader_get_dispatch(commandBuffer);
Chia-I Wu88eaa3b2015-06-26 15:34:39 +08001721
Jon Ashburn44aed662016-02-02 17:47:28 -07001722 disp->CmdExecuteCommands(commandBuffer, commandBuffersCount,
1723 pCommandBuffers);
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001724}