blob: b35f1d82a44cb11d2606922554d3a969df065965 [file] [log] [blame]
Jon Ashburnd55a3942015-05-06 09:02:10 -06001/*
Jon Ashburnd55a3942015-05-06 09:02:10 -06002 *
Jon Ashburn23d36b12016-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 Goeltzenleuchterf821dad2015-12-02 14:53:22 -07006 * Copyright (C) 2015 Google Inc.
Jon Ashburnd55a3942015-05-06 09:02:10 -06007 *
Jon Ashburn23d36b12016-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 Ashburnd55a3942015-05-06 09:02:10 -060014 *
Jon Ashburn23d36b12016-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 Ashburnd55a3942015-05-06 09:02:10 -060017 *
Jon Ashburn23d36b12016-02-02 17:47:28 -070018 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
Jon Ashburnd55a3942015-05-06 09:02:10 -060019 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Jon Ashburn23d36b12016-02-02 17:47:28 -070020 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
Courtney Goeltzenleuchter05559522015-10-30 11:14:30 -060021 *
Jon Ashburn23d36b12016-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 Goeltzenleuchter05559522015-10-30 11:14:30 -060028 * Author: Jon Ashburn <jon@lunarg.com>
29 * Author: Tony Barbour <tony@LunarG.com>
Jon Ashburn23d36b12016-02-02 17:47:28 -070030 * Author: Chia-I Wu <olv@lunarg.com>
Jon Ashburnd55a3942015-05-06 09:02:10 -060031 */
Courtney Goeltzenleuchter7f5aafc2015-07-05 11:28:29 -060032#define _GNU_SOURCE
Jon Ashburn27cd5842015-05-12 17:26:48 -060033#include <stdlib.h>
34#include <string.h>
Jon Ashburnd55a3942015-05-06 09:02:10 -060035
Tobin Ehlisb835d1b2015-07-03 10:34:49 -060036#include "vk_loader_platform.h"
Jon Ashburnd55a3942015-05-06 09:02:10 -060037#include "loader.h"
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -060038#include "debug_report.h"
Ian Elliott954fa342015-10-30 15:28:23 -060039#include "wsi.h"
Jon Ashburnd55a3942015-05-06 09:02:10 -060040
41/* Trampoline entrypoints */
Jon Ashburn23d36b12016-02-02 17:47:28 -070042LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
43vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo,
44 const VkAllocationCallbacks *pAllocator,
45 VkInstance *pInstance) {
Jon Ashburn27cd5842015-05-12 17:26:48 -060046 struct loader_instance *ptr_instance = NULL;
Jon Ashburne5b9bba2016-01-18 12:20:03 -070047 VkInstance created_instance = VK_NULL_HANDLE;
Jon Ashburn27cd5842015-05-12 17:26:48 -060048 VkResult res = VK_ERROR_INITIALIZATION_FAILED;
Courtney Goeltzenleuchter7415d5a2015-12-09 15:48:16 -070049 VkDebugReportCallbackEXT instance_callback = VK_NULL_HANDLE;
Jon Ashburn23d36b12016-02-02 17:47:28 -070050 void *pNext = (void *)pCreateInfo->pNext;
Jon Ashburn27cd5842015-05-12 17:26:48 -060051
Jon Ashburn8810c5f2015-08-18 18:04:47 -060052 loader_platform_thread_once(&once_init, loader_initialize);
Jon Ashburn27cd5842015-05-12 17:26:48 -060053
Jon Ashburnf9af1d32016-01-25 14:51:47 -070054#if 0
55 if (pAllocator) {
Chia-I Wu3432a0c2015-10-27 18:04:07 +080056 ptr_instance = (struct loader_instance *) pAllocator->pfnAllocation(
Chia-I Wuf7458c52015-10-26 21:10:41 +080057 pAllocator->pUserData,
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -060058 sizeof(struct loader_instance),
Jon Ashburn6a118ae2016-01-07 15:21:14 -070059 sizeof(int *),
Chia-I Wu3432a0c2015-10-27 18:04:07 +080060 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -060061 } else {
Jon Ashburnf9af1d32016-01-25 14:51:47 -070062#endif
Jon Ashburn23d36b12016-02-02 17:47:28 -070063 ptr_instance =
64 (struct loader_instance *)malloc(sizeof(struct loader_instance));
Jon Ashburnf9af1d32016-01-25 14:51:47 -070065 //}
Jon Ashburn27cd5842015-05-12 17:26:48 -060066 if (ptr_instance == NULL) {
67 return VK_ERROR_OUT_OF_HOST_MEMORY;
68 }
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -060069
Jon Ashburn87d6aa92015-08-28 15:19:27 -060070 tls_instance = ptr_instance;
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -060071 loader_platform_thread_lock_mutex(&loader_lock);
Jon Ashburnb82c1852015-08-11 14:49:54 -060072 memset(ptr_instance, 0, sizeof(struct loader_instance));
Jon Ashburnf9af1d32016-01-25 14:51:47 -070073#if 0
Chia-I Wuf7458c52015-10-26 21:10:41 +080074 if (pAllocator) {
75 ptr_instance->alloc_callbacks = *pAllocator;
Courtney Goeltzenleuchter7f5aafc2015-07-05 11:28:29 -060076 }
Jon Ashburnf9af1d32016-01-25 14:51:47 -070077#endif
Courtney Goeltzenleuchter7f5aafc2015-07-05 11:28:29 -060078
Courtney Goeltzenleuchter45cde5d2015-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 Ashburn23d36b12016-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 Goeltzenleuchter45cde5d2015-12-03 13:45:51 -070089 loader_heap_free(ptr_instance, ptr_instance);
Courtney Goeltzenleuchter82887272015-12-02 15:29:33 -070090 loader_platform_thread_unlock_mutex(&loader_lock);
91 return VK_ERROR_OUT_OF_HOST_MEMORY;
92 }
93 }
Jon Ashburn23d36b12016-02-02 17:47:28 -070094 pNext = (void *)((VkInstanceCreateInfo *)pNext)->pNext;
Courtney Goeltzenleuchter82887272015-12-02 15:29:33 -070095 }
96
Jon Ashburn3d002332015-08-20 16:35:30 -060097 /* Due to implicit layers need to get layer list even if
Jon Ashburnf19916e2016-01-11 13:12:43 -070098 * enabledLayerCount == 0 and VK_INSTANCE_LAYERS is unset. For now always
Jon Ashburn3d002332015-08-20 16:35:30 -060099 * get layer list (both instance and device) via loader_layer_scan(). */
Jon Ashburn23d36b12016-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 Ashburne39a4f82015-08-28 13:38:21 -0600105 &ptr_instance->device_layer_list);
Jon Ashburn3d002332015-08-20 16:35:30 -0600106
107 /* validate the app requested layers to be enabled */
Jon Ashburnf19916e2016-01-11 13:12:43 -0700108 if (pCreateInfo->enabledLayerCount > 0) {
Mark Lobodzinskie9f09ef2016-02-02 18:53:34 -0700109 res = loader_validate_layers(ptr_instance,
110 pCreateInfo->enabledLayerCount,
Jon Ashburn3d002332015-08-20 16:35:30 -0600111 pCreateInfo->ppEnabledLayerNames,
112 &ptr_instance->instance_layer_list);
113 if (res != VK_SUCCESS) {
Jon Ashburn23d36b12016-02-02 17:47:28 -0700114 util_DestroyDebugReportCallback(ptr_instance, instance_callback,
115 NULL);
Courtney Goeltzenleuchter45cde5d2015-12-03 13:45:51 -0700116 loader_heap_free(ptr_instance, ptr_instance);
Jon Ashburn1ff17592015-10-09 09:40:30 -0600117 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburn3d002332015-08-20 16:35:30 -0600118 return res;
119 }
120 }
121
Jon Ashburn8810c5f2015-08-18 18:04:47 -0600122 /* Scan/discover all ICD libraries */
123 memset(&ptr_instance->icd_libs, 0, sizeof(ptr_instance->icd_libs));
Jon Ashburne39a4f82015-08-28 13:38:21 -0600124 loader_icd_scan(ptr_instance, &ptr_instance->icd_libs);
Jon Ashburn8810c5f2015-08-18 18:04:47 -0600125
Jon Ashburneacfa3a2015-08-14 12:51:47 -0600126 /* get extensions from all ICD's, merge so no duplicates, then validate */
Jon Ashburn23d36b12016-02-02 17:47:28 -0700127 loader_get_icd_loader_instance_extensions(
128 ptr_instance, &ptr_instance->icd_libs, &ptr_instance->ext_list);
129 res = loader_validate_instance_extensions(
Mark Lobodzinskie9f09ef2016-02-02 18:53:34 -0700130 ptr_instance, &ptr_instance->ext_list, &ptr_instance->instance_layer_list,
Jon Ashburn23d36b12016-02-02 17:47:28 -0700131 pCreateInfo);
Jon Ashburneacfa3a2015-08-14 12:51:47 -0600132 if (res != VK_SUCCESS) {
Jon Ashburne39a4f82015-08-28 13:38:21 -0600133 loader_delete_layer_properties(ptr_instance,
134 &ptr_instance->device_layer_list);
135 loader_delete_layer_properties(ptr_instance,
136 &ptr_instance->instance_layer_list);
137 loader_scanned_icd_clear(ptr_instance, &ptr_instance->icd_libs);
Jon Ashburn23d36b12016-02-02 17:47:28 -0700138 loader_destroy_generic_list(
139 ptr_instance,
140 (struct loader_generic_list *)&ptr_instance->ext_list);
Jon Ashburnf9af1d32016-01-25 14:51:47 -0700141 util_DestroyDebugReportCallback(ptr_instance, instance_callback, NULL);
Jon Ashburneacfa3a2015-08-14 12:51:47 -0600142 loader_platform_thread_unlock_mutex(&loader_lock);
143 loader_heap_free(ptr_instance, ptr_instance);
144 return res;
145 }
146
Jon Ashburn23d36b12016-02-02 17:47:28 -0700147 ptr_instance->disp =
148 loader_heap_alloc(ptr_instance, sizeof(VkLayerInstanceDispatchTable),
149 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -0600150 if (ptr_instance->disp == NULL) {
Jon Ashburne39a4f82015-08-28 13:38:21 -0600151 loader_delete_layer_properties(ptr_instance,
152 &ptr_instance->device_layer_list);
153 loader_delete_layer_properties(ptr_instance,
154 &ptr_instance->instance_layer_list);
Jon Ashburn23d36b12016-02-02 17:47:28 -0700155 loader_scanned_icd_clear(ptr_instance, &ptr_instance->icd_libs);
156 loader_destroy_generic_list(
157 ptr_instance,
158 (struct loader_generic_list *)&ptr_instance->ext_list);
Jon Ashburnf9af1d32016-01-25 14:51:47 -0700159 util_DestroyDebugReportCallback(ptr_instance, instance_callback, NULL);
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -0600160 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburneacfa3a2015-08-14 12:51:47 -0600161 loader_heap_free(ptr_instance, ptr_instance);
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -0600162 return VK_ERROR_OUT_OF_HOST_MEMORY;
163 }
164 memcpy(ptr_instance->disp, &instance_disp, sizeof(instance_disp));
165 ptr_instance->next = loader.instances;
166 loader.instances = ptr_instance;
167
Jon Ashburnb82c1852015-08-11 14:49:54 -0600168 /* activate any layers on instance chain */
Jon Ashburn23d36b12016-02-02 17:47:28 -0700169 res = loader_enable_instance_layers(ptr_instance, pCreateInfo,
Jon Ashburne39a4f82015-08-28 13:38:21 -0600170 &ptr_instance->instance_layer_list);
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -0600171 if (res != VK_SUCCESS) {
Jon Ashburne39a4f82015-08-28 13:38:21 -0600172 loader_delete_layer_properties(ptr_instance,
173 &ptr_instance->device_layer_list);
174 loader_delete_layer_properties(ptr_instance,
175 &ptr_instance->instance_layer_list);
Jon Ashburn23d36b12016-02-02 17:47:28 -0700176 loader_scanned_icd_clear(ptr_instance, &ptr_instance->icd_libs);
177 loader_destroy_generic_list(
178 ptr_instance,
179 (struct loader_generic_list *)&ptr_instance->ext_list);
Jon Ashburneacfa3a2015-08-14 12:51:47 -0600180 loader.instances = ptr_instance->next;
Jon Ashburnf9af1d32016-01-25 14:51:47 -0700181 util_DestroyDebugReportCallback(ptr_instance, instance_callback, NULL);
Jon Ashburneacfa3a2015-08-14 12:51:47 -0600182 loader_platform_thread_unlock_mutex(&loader_lock);
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -0600183 loader_heap_free(ptr_instance, ptr_instance->disp);
184 loader_heap_free(ptr_instance, ptr_instance);
185 return res;
186 }
Jon Ashburn07daee72015-05-21 18:13:33 -0600187
Jon Ashburn23d36b12016-02-02 17:47:28 -0700188 created_instance = (VkInstance)ptr_instance;
189 res = loader_create_instance_chain(pCreateInfo, pAllocator, ptr_instance,
Jon Ashburn6e0a2132016-02-03 12:37:30 -0700190 &created_instance);
Jon Ashburneed0c002015-05-21 17:42:17 -0600191
Jon Ashburne46cf7c2016-01-14 13:51:55 -0700192 if (res == VK_SUCCESS) {
Courtney Goeltzenleuchter00150eb2016-01-08 12:18:43 -0700193 wsi_create_instance(ptr_instance, pCreateInfo);
194 debug_report_create_instance(ptr_instance, pCreateInfo);
195
Jon Ashburne5b9bba2016-01-18 12:20:03 -0700196 *pInstance = created_instance;
Courtney Goeltzenleuchter00150eb2016-01-08 12:18:43 -0700197
Jon Ashburne46cf7c2016-01-14 13:51:55 -0700198 /*
199 * Finally have the layers in place and everyone has seen
200 * the CreateInstance command go by. This allows the layer's
201 * GetInstanceProcAddr functions to return valid extension functions
202 * if enabled.
203 */
204 loader_activate_instance_layer_extensions(ptr_instance, *pInstance);
Courtney Goeltzenleuchter00150eb2016-01-08 12:18:43 -0700205 } else {
206 // TODO: cleanup here.
Jon Ashburne46cf7c2016-01-14 13:51:55 -0700207 }
Courtney Goeltzenleuchter00150eb2016-01-08 12:18:43 -0700208
Courtney Goeltzenleuchter45cde5d2015-12-03 13:45:51 -0700209 /* Remove temporary debug_report callback */
Jon Ashburnf9af1d32016-01-25 14:51:47 -0700210 util_DestroyDebugReportCallback(ptr_instance, instance_callback, NULL);
Courtney Goeltzenleuchter45cde5d2015-12-03 13:45:51 -0700211
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600212 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburn27cd5842015-05-12 17:26:48 -0600213 return res;
214}
215
Jon Ashburn23d36b12016-02-02 17:47:28 -0700216LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
217vkDestroyInstance(VkInstance instance,
218 const VkAllocationCallbacks *pAllocator) {
Jon Ashburn27cd5842015-05-12 17:26:48 -0600219 const VkLayerInstanceDispatchTable *disp;
Jon Ashburne0e64572015-09-30 12:56:42 -0600220 struct loader_instance *ptr_instance = NULL;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600221 disp = loader_get_instance_dispatch(instance);
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -0600222
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600223 loader_platform_thread_lock_mutex(&loader_lock);
224
Courtney Goeltzenleuchter45cde5d2015-12-03 13:45:51 -0700225 /* TODO: Do we need a temporary callback here to catch cleanup issues? */
226
Jon Ashburne0e64572015-09-30 12:56:42 -0600227 ptr_instance = loader_get_instance(instance);
Chia-I Wuf7458c52015-10-26 21:10:41 +0800228 disp->DestroyInstance(instance, pAllocator);
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -0600229
Courtney Goeltzenleuchter7d0023c2015-06-08 15:09:22 -0600230 loader_deactivate_instance_layers(ptr_instance);
Jon Ashburneacfa3a2015-08-14 12:51:47 -0600231 loader_heap_free(ptr_instance, ptr_instance->disp);
232 loader_heap_free(ptr_instance, ptr_instance);
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600233 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburn27cd5842015-05-12 17:26:48 -0600234}
Jon Ashburn95a77ba2015-05-15 15:09:35 -0600235
Jon Ashburn23d36b12016-02-02 17:47:28 -0700236LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
237vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount,
238 VkPhysicalDevice *pPhysicalDevices) {
Jon Ashburn27cd5842015-05-12 17:26:48 -0600239 const VkLayerInstanceDispatchTable *disp;
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600240 VkResult res;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600241 disp = loader_get_instance_dispatch(instance);
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600242
243 loader_platform_thread_lock_mutex(&loader_lock);
244 res = disp->EnumeratePhysicalDevices(instance, pPhysicalDeviceCount,
Jon Ashburn27cd5842015-05-12 17:26:48 -0600245 pPhysicalDevices);
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600246 loader_platform_thread_unlock_mutex(&loader_lock);
247 return res;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600248}
249
Jon Ashburn23d36b12016-02-02 17:47:28 -0700250LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
251vkGetPhysicalDeviceFeatures(VkPhysicalDevice gpu,
252 VkPhysicalDeviceFeatures *pFeatures) {
Jon Ashburn754864f2015-07-23 18:49:07 -0600253 const VkLayerInstanceDispatchTable *disp;
Jon Ashburn754864f2015-07-23 18:49:07 -0600254
255 disp = loader_get_instance_dispatch(gpu);
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600256 disp->GetPhysicalDeviceFeatures(gpu, pFeatures);
Jon Ashburn754864f2015-07-23 18:49:07 -0600257}
258
Jon Ashburn23d36b12016-02-02 17:47:28 -0700259LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
260vkGetPhysicalDeviceFormatProperties(VkPhysicalDevice gpu, VkFormat format,
261 VkFormatProperties *pFormatInfo) {
Jon Ashburn754864f2015-07-23 18:49:07 -0600262 const VkLayerInstanceDispatchTable *disp;
Jon Ashburn754864f2015-07-23 18:49:07 -0600263
264 disp = loader_get_instance_dispatch(gpu);
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600265 disp->GetPhysicalDeviceFormatProperties(gpu, format, pFormatInfo);
Jon Ashburn754864f2015-07-23 18:49:07 -0600266}
267
Jon Ashburn23d36b12016-02-02 17:47:28 -0700268LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
269vkGetPhysicalDeviceImageFormatProperties(
270 VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type,
271 VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags,
272 VkImageFormatProperties *pImageFormatProperties) {
Jon Ashburn754864f2015-07-23 18:49:07 -0600273 const VkLayerInstanceDispatchTable *disp;
Jon Ashburn754864f2015-07-23 18:49:07 -0600274
275 disp = loader_get_instance_dispatch(physicalDevice);
Jon Ashburn23d36b12016-02-02 17:47:28 -0700276 return disp->GetPhysicalDeviceImageFormatProperties(
277 physicalDevice, format, type, tiling, usage, flags,
278 pImageFormatProperties);
Jon Ashburn754864f2015-07-23 18:49:07 -0600279}
280
Jon Ashburn23d36b12016-02-02 17:47:28 -0700281LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
282vkGetPhysicalDeviceProperties(VkPhysicalDevice gpu,
283 VkPhysicalDeviceProperties *pProperties) {
Jon Ashburn95a77ba2015-05-15 15:09:35 -0600284 const VkLayerInstanceDispatchTable *disp;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600285
Jon Ashburn95a77ba2015-05-15 15:09:35 -0600286 disp = loader_get_instance_dispatch(gpu);
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600287 disp->GetPhysicalDeviceProperties(gpu, pProperties);
Tony Barbour59a47322015-06-24 16:06:58 -0600288}
289
Jon Ashburn23d36b12016-02-02 17:47:28 -0700290LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
291vkGetPhysicalDeviceQueueFamilyProperties(
292 VkPhysicalDevice gpu, uint32_t *pQueueFamilyPropertyCount,
293 VkQueueFamilyProperties *pQueueProperties) {
Tony Barbour59a47322015-06-24 16:06:58 -0600294 const VkLayerInstanceDispatchTable *disp;
Tony Barbour59a47322015-06-24 16:06:58 -0600295
296 disp = loader_get_instance_dispatch(gpu);
Jon Ashburn23d36b12016-02-02 17:47:28 -0700297 disp->GetPhysicalDeviceQueueFamilyProperties(gpu, pQueueFamilyPropertyCount,
298 pQueueProperties);
Tony Barbour59a47322015-06-24 16:06:58 -0600299}
300
Chia-I Wu9ab61502015-11-06 06:42:02 +0800301LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties(
Jon Ashburn23d36b12016-02-02 17:47:28 -0700302 VkPhysicalDevice gpu, VkPhysicalDeviceMemoryProperties *pMemoryProperties) {
Tony Barbour59a47322015-06-24 16:06:58 -0600303 const VkLayerInstanceDispatchTable *disp;
Tony Barbour59a47322015-06-24 16:06:58 -0600304
305 disp = loader_get_instance_dispatch(gpu);
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600306 disp->GetPhysicalDeviceMemoryProperties(gpu, pMemoryProperties);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600307}
308
Jon Ashburn23d36b12016-02-02 17:47:28 -0700309LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
310vkCreateDevice(VkPhysicalDevice gpu, const VkDeviceCreateInfo *pCreateInfo,
311 const VkAllocationCallbacks *pAllocator, VkDevice *pDevice) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600312 VkResult res;
313
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600314 loader_platform_thread_lock_mutex(&loader_lock);
Courtney Goeltzenleuchterca173b82015-06-25 18:01:43 -0600315
Chia-I Wuf7458c52015-10-26 21:10:41 +0800316 res = loader_CreateDevice(gpu, pCreateInfo, pAllocator, pDevice);
Courtney Goeltzenleuchterca173b82015-06-25 18:01:43 -0600317
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600318 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600319 return res;
320}
321
Jon Ashburn23d36b12016-02-02 17:47:28 -0700322LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
323vkDestroyDevice(VkDevice device, const VkAllocationCallbacks *pAllocator) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600324 const VkLayerDispatchTable *disp;
Jon Ashburne39a4f82015-08-28 13:38:21 -0600325 struct loader_device *dev;
Andrzej Kotlowskib168b1a2016-02-03 09:41:53 +0100326
327 loader_platform_thread_lock_mutex(&loader_lock);
328
Jon Ashburne39a4f82015-08-28 13:38:21 -0600329 struct loader_icd *icd = loader_get_icd_and_device(device, &dev);
330 const struct loader_instance *inst = icd->this_instance;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600331 disp = loader_get_dispatch(device);
332
Chia-I Wuf7458c52015-10-26 21:10:41 +0800333 disp->DestroyDevice(device, pAllocator);
Jon Ashburn781a7ae2015-11-19 15:43:26 -0700334 dev->device = NULL;
335 loader_remove_logical_device(inst, icd, dev);
336
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600337 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600338}
339
Jon Ashburn23d36b12016-02-02 17:47:28 -0700340LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
341vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice,
342 const char *pLayerName,
343 uint32_t *pPropertyCount,
344 VkExtensionProperties *pProperties) {
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600345 VkResult res;
346
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600347 loader_platform_thread_lock_mutex(&loader_lock);
Jon Ashburn00eb6c02015-11-02 17:40:01 -0700348
349 /* If pLayerName == NULL, then querying ICD extensions, pass this call
350 down the instance chain which will terminate in the ICD. This allows
351 layers to filter the extensions coming back up the chain.
352 If pLayerName != NULL then get layer extensions from manifest file. */
Jon Ashburn23d36b12016-02-02 17:47:28 -0700353 if (pLayerName == NULL || strlen(pLayerName) == 0) {
Jon Ashburn00eb6c02015-11-02 17:40:01 -0700354 const VkLayerInstanceDispatchTable *disp;
355
356 disp = loader_get_instance_dispatch(physicalDevice);
Jon Ashburn23d36b12016-02-02 17:47:28 -0700357 res = disp->EnumerateDeviceExtensionProperties(
358 physicalDevice, NULL, pPropertyCount, pProperties);
Jon Ashburn00eb6c02015-11-02 17:40:01 -0700359 } else {
Jon Ashburn23d36b12016-02-02 17:47:28 -0700360 res = loader_EnumerateDeviceExtensionProperties(
361 physicalDevice, pLayerName, pPropertyCount, pProperties);
Jon Ashburn00eb6c02015-11-02 17:40:01 -0700362 }
363
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600364 loader_platform_thread_unlock_mutex(&loader_lock);
Tony Barbour59a47322015-06-24 16:06:58 -0600365 return res;
366}
367
Jon Ashburn23d36b12016-02-02 17:47:28 -0700368LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
369vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice,
370 uint32_t *pPropertyCount,
371 VkLayerProperties *pProperties) {
Tony Barbour59a47322015-06-24 16:06:58 -0600372 VkResult res;
373
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600374 loader_platform_thread_lock_mutex(&loader_lock);
Jon Ashburn00eb6c02015-11-02 17:40:01 -0700375
376 /* Don't dispatch this call down the instance chain, want all device layers
377 enumerated and instance chain may not contain all device layers */
Jon Ashburn23d36b12016-02-02 17:47:28 -0700378 res = loader_EnumerateDeviceLayerProperties(physicalDevice, pPropertyCount,
379 pProperties);
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600380 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburn27cd5842015-05-12 17:26:48 -0600381 return res;
382}
383
Jon Ashburn23d36b12016-02-02 17:47:28 -0700384LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
385vkGetDeviceQueue(VkDevice device, uint32_t queueNodeIndex, uint32_t queueIndex,
386 VkQueue *pQueue) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600387 const VkLayerDispatchTable *disp;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600388
389 disp = loader_get_dispatch(device);
390
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600391 disp->GetDeviceQueue(device, queueNodeIndex, queueIndex, pQueue);
392 loader_set_dispatch(*pQueue, disp);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600393}
394
Jon Ashburn23d36b12016-02-02 17:47:28 -0700395LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
396vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo *pSubmits,
397 VkFence fence) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600398 const VkLayerDispatchTable *disp;
399
400 disp = loader_get_dispatch(queue);
401
Chia-I Wu40cf0ae2015-10-26 17:20:32 +0800402 return disp->QueueSubmit(queue, submitCount, pSubmits, fence);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600403}
404
Jon Ashburn23d36b12016-02-02 17:47:28 -0700405LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkQueueWaitIdle(VkQueue queue) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600406 const VkLayerDispatchTable *disp;
407
408 disp = loader_get_dispatch(queue);
409
410 return disp->QueueWaitIdle(queue);
411}
412
Jon Ashburn23d36b12016-02-02 17:47:28 -0700413LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkDeviceWaitIdle(VkDevice device) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600414 const VkLayerDispatchTable *disp;
415
416 disp = loader_get_dispatch(device);
417
418 return disp->DeviceWaitIdle(device);
419}
420
Jon Ashburn23d36b12016-02-02 17:47:28 -0700421LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
422vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo *pAllocateInfo,
423 const VkAllocationCallbacks *pAllocator,
424 VkDeviceMemory *pMemory) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600425 const VkLayerDispatchTable *disp;
426
427 disp = loader_get_dispatch(device);
428
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800429 return disp->AllocateMemory(device, pAllocateInfo, pAllocator, pMemory);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600430}
431
Jon Ashburn23d36b12016-02-02 17:47:28 -0700432LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
433vkFreeMemory(VkDevice device, VkDeviceMemory mem,
434 const VkAllocationCallbacks *pAllocator) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600435 const VkLayerDispatchTable *disp;
436
437 disp = loader_get_dispatch(device);
438
Chia-I Wuf7458c52015-10-26 21:10:41 +0800439 disp->FreeMemory(device, mem, pAllocator);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600440}
441
Jon Ashburn23d36b12016-02-02 17:47:28 -0700442LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
443vkMapMemory(VkDevice device, VkDeviceMemory mem, VkDeviceSize offset,
444 VkDeviceSize size, VkFlags flags, void **ppData) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600445 const VkLayerDispatchTable *disp;
446
447 disp = loader_get_dispatch(device);
448
449 return disp->MapMemory(device, mem, offset, size, flags, ppData);
450}
451
Jon Ashburn23d36b12016-02-02 17:47:28 -0700452LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
453vkUnmapMemory(VkDevice device, VkDeviceMemory mem) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600454 const VkLayerDispatchTable *disp;
455
456 disp = loader_get_dispatch(device);
457
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600458 disp->UnmapMemory(device, mem);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600459}
460
Jon Ashburn23d36b12016-02-02 17:47:28 -0700461LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
462vkFlushMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount,
463 const VkMappedMemoryRange *pMemoryRanges) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600464 const VkLayerDispatchTable *disp;
465
466 disp = loader_get_dispatch(device);
467
Jon Ashburn23d36b12016-02-02 17:47:28 -0700468 return disp->FlushMappedMemoryRanges(device, memoryRangeCount,
469 pMemoryRanges);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600470}
471
Jon Ashburn23d36b12016-02-02 17:47:28 -0700472LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
473vkInvalidateMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount,
474 const VkMappedMemoryRange *pMemoryRanges) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600475 const VkLayerDispatchTable *disp;
476
477 disp = loader_get_dispatch(device);
478
Jon Ashburn23d36b12016-02-02 17:47:28 -0700479 return disp->InvalidateMappedMemoryRanges(device, memoryRangeCount,
480 pMemoryRanges);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600481}
482
Jon Ashburn23d36b12016-02-02 17:47:28 -0700483LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
484vkGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory,
485 VkDeviceSize *pCommittedMemoryInBytes) {
Courtney Goeltzenleuchterfb71f222015-07-09 21:57:28 -0600486 const VkLayerDispatchTable *disp;
487
488 disp = loader_get_dispatch(device);
489
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600490 disp->GetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes);
Courtney Goeltzenleuchterfb71f222015-07-09 21:57:28 -0600491}
492
Jon Ashburn23d36b12016-02-02 17:47:28 -0700493LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
494vkBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory mem,
495 VkDeviceSize offset) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600496 const VkLayerDispatchTable *disp;
497
Mark Lobodzinski942b1722015-05-11 17:21:15 -0500498 disp = loader_get_dispatch(device);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600499
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600500 return disp->BindBufferMemory(device, buffer, mem, offset);
501}
502
Jon Ashburn23d36b12016-02-02 17:47:28 -0700503LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
504vkBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory mem,
505 VkDeviceSize offset) {
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600506 const VkLayerDispatchTable *disp;
507
508 disp = loader_get_dispatch(device);
509
510 return disp->BindImageMemory(device, image, mem, offset);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600511}
512
Jon Ashburn23d36b12016-02-02 17:47:28 -0700513LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
514vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer,
515 VkMemoryRequirements *pMemoryRequirements) {
Jon Ashburn754864f2015-07-23 18:49:07 -0600516 const VkLayerDispatchTable *disp;
517
518 disp = loader_get_dispatch(device);
519
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600520 disp->GetBufferMemoryRequirements(device, buffer, pMemoryRequirements);
Jon Ashburn754864f2015-07-23 18:49:07 -0600521}
522
Jon Ashburn23d36b12016-02-02 17:47:28 -0700523LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
524vkGetImageMemoryRequirements(VkDevice device, VkImage image,
525 VkMemoryRequirements *pMemoryRequirements) {
Jon Ashburn754864f2015-07-23 18:49:07 -0600526 const VkLayerDispatchTable *disp;
527
528 disp = loader_get_dispatch(device);
529
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600530 disp->GetImageMemoryRequirements(device, image, pMemoryRequirements);
Jon Ashburn754864f2015-07-23 18:49:07 -0600531}
532
Jon Ashburn23d36b12016-02-02 17:47:28 -0700533LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetImageSparseMemoryRequirements(
534 VkDevice device, VkImage image, uint32_t *pSparseMemoryRequirementCount,
535 VkSparseImageMemoryRequirements *pSparseMemoryRequirements) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600536 const VkLayerDispatchTable *disp;
537
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600538 disp = loader_get_dispatch(device);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600539
Jon Ashburn23d36b12016-02-02 17:47:28 -0700540 disp->GetImageSparseMemoryRequirements(device, image,
541 pSparseMemoryRequirementCount,
542 pSparseMemoryRequirements);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600543}
544
Jon Ashburn23d36b12016-02-02 17:47:28 -0700545LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
546vkGetPhysicalDeviceSparseImageFormatProperties(
547 VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type,
548 VkSampleCountFlagBits samples, VkImageUsageFlags usage,
549 VkImageTiling tiling, uint32_t *pPropertyCount,
550 VkSparseImageFormatProperties *pProperties) {
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600551 const VkLayerInstanceDispatchTable *disp;
552
553 disp = loader_get_instance_dispatch(physicalDevice);
554
Jon Ashburn23d36b12016-02-02 17:47:28 -0700555 disp->GetPhysicalDeviceSparseImageFormatProperties(
556 physicalDevice, format, type, samples, usage, tiling, pPropertyCount,
557 pProperties);
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600558}
559
Jon Ashburn23d36b12016-02-02 17:47:28 -0700560LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
561vkQueueBindSparse(VkQueue queue, uint32_t bindInfoCount,
562 const VkBindSparseInfo *pBindInfo, VkFence fence) {
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600563 const VkLayerDispatchTable *disp;
564
565 disp = loader_get_dispatch(queue);
566
Chia-I Wu1ff4c3d2015-10-26 16:55:27 +0800567 return disp->QueueBindSparse(queue, bindInfoCount, pBindInfo, fence);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600568}
569
Jon Ashburn23d36b12016-02-02 17:47:28 -0700570LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
571vkCreateFence(VkDevice device, const VkFenceCreateInfo *pCreateInfo,
572 const VkAllocationCallbacks *pAllocator, VkFence *pFence) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600573 const VkLayerDispatchTable *disp;
574
575 disp = loader_get_dispatch(device);
576
Chia-I Wuf7458c52015-10-26 21:10:41 +0800577 return disp->CreateFence(device, pCreateInfo, pAllocator, pFence);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600578}
579
Jon Ashburn23d36b12016-02-02 17:47:28 -0700580LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
581vkDestroyFence(VkDevice device, VkFence fence,
582 const VkAllocationCallbacks *pAllocator) {
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600583 const VkLayerDispatchTable *disp;
584
585 disp = loader_get_dispatch(device);
586
Chia-I Wuf7458c52015-10-26 21:10:41 +0800587 disp->DestroyFence(device, fence, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600588}
589
Jon Ashburn23d36b12016-02-02 17:47:28 -0700590LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
591vkResetFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600592 const VkLayerDispatchTable *disp;
593
594 disp = loader_get_dispatch(device);
595
596 return disp->ResetFences(device, fenceCount, pFences);
597}
598
Jon Ashburn23d36b12016-02-02 17:47:28 -0700599LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
600vkGetFenceStatus(VkDevice device, VkFence fence) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600601 const VkLayerDispatchTable *disp;
602
603 disp = loader_get_dispatch(device);
604
605 return disp->GetFenceStatus(device, fence);
606}
607
Jon Ashburn23d36b12016-02-02 17:47:28 -0700608LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
609vkWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences,
610 VkBool32 waitAll, uint64_t timeout) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600611 const VkLayerDispatchTable *disp;
612
613 disp = loader_get_dispatch(device);
614
615 return disp->WaitForFences(device, fenceCount, pFences, waitAll, timeout);
616}
617
Jon Ashburn23d36b12016-02-02 17:47:28 -0700618LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
619vkCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo *pCreateInfo,
620 const VkAllocationCallbacks *pAllocator,
621 VkSemaphore *pSemaphore) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600622 const VkLayerDispatchTable *disp;
623
624 disp = loader_get_dispatch(device);
625
Chia-I Wuf7458c52015-10-26 21:10:41 +0800626 return disp->CreateSemaphore(device, pCreateInfo, pAllocator, pSemaphore);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600627}
628
Jon Ashburn23d36b12016-02-02 17:47:28 -0700629LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
630vkDestroySemaphore(VkDevice device, VkSemaphore semaphore,
631 const VkAllocationCallbacks *pAllocator) {
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600632 const VkLayerDispatchTable *disp;
633
634 disp = loader_get_dispatch(device);
635
Chia-I Wuf7458c52015-10-26 21:10:41 +0800636 disp->DestroySemaphore(device, semaphore, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600637}
638
Jon Ashburn23d36b12016-02-02 17:47:28 -0700639LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
640vkCreateEvent(VkDevice device, const VkEventCreateInfo *pCreateInfo,
641 const VkAllocationCallbacks *pAllocator, VkEvent *pEvent) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600642 const VkLayerDispatchTable *disp;
643
644 disp = loader_get_dispatch(device);
645
Chia-I Wuf7458c52015-10-26 21:10:41 +0800646 return disp->CreateEvent(device, pCreateInfo, pAllocator, pEvent);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600647}
648
Jon Ashburn23d36b12016-02-02 17:47:28 -0700649LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
650vkDestroyEvent(VkDevice device, VkEvent event,
651 const VkAllocationCallbacks *pAllocator) {
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600652 const VkLayerDispatchTable *disp;
653
654 disp = loader_get_dispatch(device);
655
Chia-I Wuf7458c52015-10-26 21:10:41 +0800656 disp->DestroyEvent(device, event, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600657}
658
Jon Ashburn23d36b12016-02-02 17:47:28 -0700659LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
660vkGetEventStatus(VkDevice device, VkEvent event) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600661 const VkLayerDispatchTable *disp;
662
663 disp = loader_get_dispatch(device);
664
665 return disp->GetEventStatus(device, event);
666}
667
Jon Ashburn23d36b12016-02-02 17:47:28 -0700668LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
669vkSetEvent(VkDevice device, VkEvent event) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600670 const VkLayerDispatchTable *disp;
671
672 disp = loader_get_dispatch(device);
673
674 return disp->SetEvent(device, event);
675}
676
Jon Ashburn23d36b12016-02-02 17:47:28 -0700677LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
678vkResetEvent(VkDevice device, VkEvent event) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600679 const VkLayerDispatchTable *disp;
680
681 disp = loader_get_dispatch(device);
682
683 return disp->ResetEvent(device, event);
684}
685
Jon Ashburn23d36b12016-02-02 17:47:28 -0700686LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
687vkCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo *pCreateInfo,
688 const VkAllocationCallbacks *pAllocator,
689 VkQueryPool *pQueryPool) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600690 const VkLayerDispatchTable *disp;
691
692 disp = loader_get_dispatch(device);
693
Chia-I Wuf7458c52015-10-26 21:10:41 +0800694 return disp->CreateQueryPool(device, pCreateInfo, pAllocator, pQueryPool);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600695}
696
Jon Ashburn23d36b12016-02-02 17:47:28 -0700697LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
698vkDestroyQueryPool(VkDevice device, VkQueryPool queryPool,
699 const VkAllocationCallbacks *pAllocator) {
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600700 const VkLayerDispatchTable *disp;
701
702 disp = loader_get_dispatch(device);
703
Chia-I Wuf7458c52015-10-26 21:10:41 +0800704 disp->DestroyQueryPool(device, queryPool, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600705}
706
Jon Ashburn23d36b12016-02-02 17:47:28 -0700707LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
708vkGetQueryPoolResults(VkDevice device, VkQueryPool queryPool,
709 uint32_t firstQuery, uint32_t queryCount, size_t dataSize,
710 void *pData, VkDeviceSize stride,
711 VkQueryResultFlags flags) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600712 const VkLayerDispatchTable *disp;
713
714 disp = loader_get_dispatch(device);
715
Jon Ashburn23d36b12016-02-02 17:47:28 -0700716 return disp->GetQueryPoolResults(device, queryPool, firstQuery, queryCount,
717 dataSize, pData, stride, flags);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600718}
719
Jon Ashburn23d36b12016-02-02 17:47:28 -0700720LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
721vkCreateBuffer(VkDevice device, const VkBufferCreateInfo *pCreateInfo,
722 const VkAllocationCallbacks *pAllocator, VkBuffer *pBuffer) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600723 const VkLayerDispatchTable *disp;
724
725 disp = loader_get_dispatch(device);
726
Chia-I Wuf7458c52015-10-26 21:10:41 +0800727 return disp->CreateBuffer(device, pCreateInfo, pAllocator, pBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600728}
729
Jon Ashburn23d36b12016-02-02 17:47:28 -0700730LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
731vkDestroyBuffer(VkDevice device, VkBuffer buffer,
732 const VkAllocationCallbacks *pAllocator) {
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600733 const VkLayerDispatchTable *disp;
734
735 disp = loader_get_dispatch(device);
736
Chia-I Wuf7458c52015-10-26 21:10:41 +0800737 disp->DestroyBuffer(device, buffer, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600738}
739
Jon Ashburn23d36b12016-02-02 17:47:28 -0700740LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
741vkCreateBufferView(VkDevice device, const VkBufferViewCreateInfo *pCreateInfo,
742 const VkAllocationCallbacks *pAllocator,
743 VkBufferView *pView) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600744 const VkLayerDispatchTable *disp;
745
746 disp = loader_get_dispatch(device);
747
Chia-I Wuf7458c52015-10-26 21:10:41 +0800748 return disp->CreateBufferView(device, pCreateInfo, pAllocator, pView);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600749}
750
Jon Ashburn23d36b12016-02-02 17:47:28 -0700751LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
752vkDestroyBufferView(VkDevice device, VkBufferView bufferView,
753 const VkAllocationCallbacks *pAllocator) {
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600754 const VkLayerDispatchTable *disp;
755
756 disp = loader_get_dispatch(device);
757
Chia-I Wuf7458c52015-10-26 21:10:41 +0800758 disp->DestroyBufferView(device, bufferView, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600759}
760
Jon Ashburn23d36b12016-02-02 17:47:28 -0700761LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
762vkCreateImage(VkDevice device, const VkImageCreateInfo *pCreateInfo,
763 const VkAllocationCallbacks *pAllocator, VkImage *pImage) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600764 const VkLayerDispatchTable *disp;
765
766 disp = loader_get_dispatch(device);
767
Chia-I Wuf7458c52015-10-26 21:10:41 +0800768 return disp->CreateImage(device, pCreateInfo, pAllocator, pImage);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600769}
770
Jon Ashburn23d36b12016-02-02 17:47:28 -0700771LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
772vkDestroyImage(VkDevice device, VkImage image,
773 const VkAllocationCallbacks *pAllocator) {
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600774 const VkLayerDispatchTable *disp;
775
776 disp = loader_get_dispatch(device);
777
Chia-I Wuf7458c52015-10-26 21:10:41 +0800778 disp->DestroyImage(device, image, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600779}
780
Jon Ashburn23d36b12016-02-02 17:47:28 -0700781LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
782vkGetImageSubresourceLayout(VkDevice device, VkImage image,
783 const VkImageSubresource *pSubresource,
784 VkSubresourceLayout *pLayout) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600785 const VkLayerDispatchTable *disp;
786
787 disp = loader_get_dispatch(device);
788
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600789 disp->GetImageSubresourceLayout(device, image, pSubresource, pLayout);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600790}
791
Jon Ashburn23d36b12016-02-02 17:47:28 -0700792LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
793vkCreateImageView(VkDevice device, const VkImageViewCreateInfo *pCreateInfo,
794 const VkAllocationCallbacks *pAllocator, VkImageView *pView) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600795 const VkLayerDispatchTable *disp;
796
797 disp = loader_get_dispatch(device);
798
Chia-I Wuf7458c52015-10-26 21:10:41 +0800799 return disp->CreateImageView(device, pCreateInfo, pAllocator, pView);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600800}
801
Jon Ashburn23d36b12016-02-02 17:47:28 -0700802LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
803vkDestroyImageView(VkDevice device, VkImageView imageView,
804 const VkAllocationCallbacks *pAllocator) {
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600805 const VkLayerDispatchTable *disp;
806
807 disp = loader_get_dispatch(device);
808
Chia-I Wuf7458c52015-10-26 21:10:41 +0800809 disp->DestroyImageView(device, imageView, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600810}
811
Jon Ashburn23d36b12016-02-02 17:47:28 -0700812LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
813vkCreateShaderModule(VkDevice device,
814 const VkShaderModuleCreateInfo *pCreateInfo,
815 const VkAllocationCallbacks *pAllocator,
816 VkShaderModule *pShader) {
Courtney Goeltzenleuchter2d2cb682015-06-24 18:24:19 -0600817 const VkLayerDispatchTable *disp;
818
819 disp = loader_get_dispatch(device);
820
Chia-I Wuf7458c52015-10-26 21:10:41 +0800821 return disp->CreateShaderModule(device, pCreateInfo, pAllocator, pShader);
Courtney Goeltzenleuchter2d2cb682015-06-24 18:24:19 -0600822}
823
Jon Ashburn23d36b12016-02-02 17:47:28 -0700824LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
825vkDestroyShaderModule(VkDevice device, VkShaderModule shaderModule,
826 const VkAllocationCallbacks *pAllocator) {
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600827 const VkLayerDispatchTable *disp;
828
829 disp = loader_get_dispatch(device);
830
Chia-I Wuf7458c52015-10-26 21:10:41 +0800831 disp->DestroyShaderModule(device, shaderModule, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600832}
833
Jon Ashburn23d36b12016-02-02 17:47:28 -0700834LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
835vkCreatePipelineCache(VkDevice device,
836 const VkPipelineCacheCreateInfo *pCreateInfo,
837 const VkAllocationCallbacks *pAllocator,
838 VkPipelineCache *pPipelineCache) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600839 const VkLayerDispatchTable *disp;
840
841 disp = loader_get_dispatch(device);
842
Jon Ashburn23d36b12016-02-02 17:47:28 -0700843 return disp->CreatePipelineCache(device, pCreateInfo, pAllocator,
844 pPipelineCache);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600845}
846
Jon Ashburn23d36b12016-02-02 17:47:28 -0700847LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
848vkDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache,
849 const VkAllocationCallbacks *pAllocator) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600850 const VkLayerDispatchTable *disp;
851
852 disp = loader_get_dispatch(device);
853
Chia-I Wuf7458c52015-10-26 21:10:41 +0800854 disp->DestroyPipelineCache(device, pipelineCache, pAllocator);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600855}
856
Jon Ashburn23d36b12016-02-02 17:47:28 -0700857LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
858vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache,
859 size_t *pDataSize, void *pData) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600860 const VkLayerDispatchTable *disp;
861
862 disp = loader_get_dispatch(device);
863
Chia-I Wub16facd2015-10-26 19:17:06 +0800864 return disp->GetPipelineCacheData(device, pipelineCache, pDataSize, pData);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600865}
866
Jon Ashburn23d36b12016-02-02 17:47:28 -0700867LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
868vkMergePipelineCaches(VkDevice device, VkPipelineCache dstCache,
869 uint32_t srcCacheCount,
870 const VkPipelineCache *pSrcCaches) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600871 const VkLayerDispatchTable *disp;
872
873 disp = loader_get_dispatch(device);
874
Jon Ashburn23d36b12016-02-02 17:47:28 -0700875 return disp->MergePipelineCaches(device, dstCache, srcCacheCount,
876 pSrcCaches);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600877}
878
Jon Ashburn23d36b12016-02-02 17:47:28 -0700879LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
880vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache,
881 uint32_t createInfoCount,
882 const VkGraphicsPipelineCreateInfo *pCreateInfos,
883 const VkAllocationCallbacks *pAllocator,
884 VkPipeline *pPipelines) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600885 const VkLayerDispatchTable *disp;
886
887 disp = loader_get_dispatch(device);
888
Jon Ashburn23d36b12016-02-02 17:47:28 -0700889 return disp->CreateGraphicsPipelines(device, pipelineCache, createInfoCount,
890 pCreateInfos, pAllocator, pPipelines);
Jon Ashburnc669cc62015-07-09 15:02:25 -0600891}
892
Jon Ashburn23d36b12016-02-02 17:47:28 -0700893LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
894vkCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache,
895 uint32_t createInfoCount,
896 const VkComputePipelineCreateInfo *pCreateInfos,
897 const VkAllocationCallbacks *pAllocator,
898 VkPipeline *pPipelines) {
Jon Ashburnc669cc62015-07-09 15:02:25 -0600899 const VkLayerDispatchTable *disp;
900
901 disp = loader_get_dispatch(device);
902
Jon Ashburn23d36b12016-02-02 17:47:28 -0700903 return disp->CreateComputePipelines(device, pipelineCache, createInfoCount,
904 pCreateInfos, pAllocator, pPipelines);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600905}
906
Jon Ashburn23d36b12016-02-02 17:47:28 -0700907LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
908vkDestroyPipeline(VkDevice device, VkPipeline pipeline,
909 const VkAllocationCallbacks *pAllocator) {
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600910 const VkLayerDispatchTable *disp;
911
912 disp = loader_get_dispatch(device);
913
Chia-I Wuf7458c52015-10-26 21:10:41 +0800914 disp->DestroyPipeline(device, pipeline, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600915}
916
Jon Ashburn23d36b12016-02-02 17:47:28 -0700917LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
918vkCreatePipelineLayout(VkDevice device,
919 const VkPipelineLayoutCreateInfo *pCreateInfo,
920 const VkAllocationCallbacks *pAllocator,
921 VkPipelineLayout *pPipelineLayout) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600922 const VkLayerDispatchTable *disp;
923
924 disp = loader_get_dispatch(device);
925
Jon Ashburn23d36b12016-02-02 17:47:28 -0700926 return disp->CreatePipelineLayout(device, pCreateInfo, pAllocator,
927 pPipelineLayout);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600928}
929
Jon Ashburn23d36b12016-02-02 17:47:28 -0700930LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
931vkDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout,
932 const VkAllocationCallbacks *pAllocator) {
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600933 const VkLayerDispatchTable *disp;
934
935 disp = loader_get_dispatch(device);
936
Chia-I Wuf7458c52015-10-26 21:10:41 +0800937 disp->DestroyPipelineLayout(device, pipelineLayout, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600938}
939
Jon Ashburn23d36b12016-02-02 17:47:28 -0700940LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
941vkCreateSampler(VkDevice device, const VkSamplerCreateInfo *pCreateInfo,
942 const VkAllocationCallbacks *pAllocator, VkSampler *pSampler) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600943 const VkLayerDispatchTable *disp;
944
945 disp = loader_get_dispatch(device);
946
Chia-I Wuf7458c52015-10-26 21:10:41 +0800947 return disp->CreateSampler(device, pCreateInfo, pAllocator, pSampler);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600948}
949
Jon Ashburn23d36b12016-02-02 17:47:28 -0700950LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
951vkDestroySampler(VkDevice device, VkSampler sampler,
952 const VkAllocationCallbacks *pAllocator) {
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600953 const VkLayerDispatchTable *disp;
954
955 disp = loader_get_dispatch(device);
956
Chia-I Wuf7458c52015-10-26 21:10:41 +0800957 disp->DestroySampler(device, sampler, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600958}
959
Jon Ashburn23d36b12016-02-02 17:47:28 -0700960LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
961vkCreateDescriptorSetLayout(VkDevice device,
962 const VkDescriptorSetLayoutCreateInfo *pCreateInfo,
963 const VkAllocationCallbacks *pAllocator,
964 VkDescriptorSetLayout *pSetLayout) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600965 const VkLayerDispatchTable *disp;
966
967 disp = loader_get_dispatch(device);
968
Jon Ashburn23d36b12016-02-02 17:47:28 -0700969 return disp->CreateDescriptorSetLayout(device, pCreateInfo, pAllocator,
970 pSetLayout);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600971}
972
Jon Ashburn23d36b12016-02-02 17:47:28 -0700973LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
974vkDestroyDescriptorSetLayout(VkDevice device,
975 VkDescriptorSetLayout descriptorSetLayout,
976 const VkAllocationCallbacks *pAllocator) {
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600977 const VkLayerDispatchTable *disp;
978
979 disp = loader_get_dispatch(device);
980
Chia-I Wuf7458c52015-10-26 21:10:41 +0800981 disp->DestroyDescriptorSetLayout(device, descriptorSetLayout, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600982}
983
Jon Ashburn23d36b12016-02-02 17:47:28 -0700984LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
985vkCreateDescriptorPool(VkDevice device,
986 const VkDescriptorPoolCreateInfo *pCreateInfo,
987 const VkAllocationCallbacks *pAllocator,
988 VkDescriptorPool *pDescriptorPool) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600989 const VkLayerDispatchTable *disp;
990
991 disp = loader_get_dispatch(device);
992
Jon Ashburn23d36b12016-02-02 17:47:28 -0700993 return disp->CreateDescriptorPool(device, pCreateInfo, pAllocator,
994 pDescriptorPool);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600995}
996
Jon Ashburn23d36b12016-02-02 17:47:28 -0700997LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
998vkDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool,
999 const VkAllocationCallbacks *pAllocator) {
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001000 const VkLayerDispatchTable *disp;
1001
1002 disp = loader_get_dispatch(device);
1003
Chia-I Wuf7458c52015-10-26 21:10:41 +08001004 disp->DestroyDescriptorPool(device, descriptorPool, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001005}
1006
Jon Ashburn23d36b12016-02-02 17:47:28 -07001007LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1008vkResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool,
1009 VkDescriptorPoolResetFlags flags) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001010 const VkLayerDispatchTable *disp;
1011
1012 disp = loader_get_dispatch(device);
1013
Courtney Goeltzenleuchterbee18a92015-10-23 14:21:05 -06001014 return disp->ResetDescriptorPool(device, descriptorPool, flags);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001015}
1016
Jon Ashburn23d36b12016-02-02 17:47:28 -07001017LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1018vkAllocateDescriptorSets(VkDevice device,
1019 const VkDescriptorSetAllocateInfo *pAllocateInfo,
1020 VkDescriptorSet *pDescriptorSets) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001021 const VkLayerDispatchTable *disp;
1022
1023 disp = loader_get_dispatch(device);
1024
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001025 return disp->AllocateDescriptorSets(device, pAllocateInfo, pDescriptorSets);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001026}
1027
Jon Ashburn23d36b12016-02-02 17:47:28 -07001028LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1029vkFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool,
1030 uint32_t descriptorSetCount,
1031 const VkDescriptorSet *pDescriptorSets) {
Tony Barbour34ec6922015-07-10 10:50:45 -06001032 const VkLayerDispatchTable *disp;
1033
1034 disp = loader_get_dispatch(device);
1035
Jon Ashburn23d36b12016-02-02 17:47:28 -07001036 return disp->FreeDescriptorSets(device, descriptorPool, descriptorSetCount,
1037 pDescriptorSets);
Tony Barbour34ec6922015-07-10 10:50:45 -06001038}
1039
Jon Ashburn23d36b12016-02-02 17:47:28 -07001040LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1041vkUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount,
1042 const VkWriteDescriptorSet *pDescriptorWrites,
1043 uint32_t descriptorCopyCount,
1044 const VkCopyDescriptorSet *pDescriptorCopies) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001045 const VkLayerDispatchTable *disp;
1046
1047 disp = loader_get_dispatch(device);
1048
Jon Ashburn23d36b12016-02-02 17:47:28 -07001049 disp->UpdateDescriptorSets(device, descriptorWriteCount, pDescriptorWrites,
1050 descriptorCopyCount, pDescriptorCopies);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001051}
1052
Jon Ashburn23d36b12016-02-02 17:47:28 -07001053LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1054vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo *pCreateInfo,
1055 const VkAllocationCallbacks *pAllocator,
1056 VkFramebuffer *pFramebuffer) {
Jon Ashburn754864f2015-07-23 18:49:07 -06001057 const VkLayerDispatchTable *disp;
1058
1059 disp = loader_get_dispatch(device);
1060
Jon Ashburn23d36b12016-02-02 17:47:28 -07001061 return disp->CreateFramebuffer(device, pCreateInfo, pAllocator,
1062 pFramebuffer);
Jon Ashburn754864f2015-07-23 18:49:07 -06001063}
1064
Jon Ashburn23d36b12016-02-02 17:47:28 -07001065LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1066vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer,
1067 const VkAllocationCallbacks *pAllocator) {
Jon Ashburn754864f2015-07-23 18:49:07 -06001068 const VkLayerDispatchTable *disp;
1069
1070 disp = loader_get_dispatch(device);
1071
Chia-I Wuf7458c52015-10-26 21:10:41 +08001072 disp->DestroyFramebuffer(device, framebuffer, pAllocator);
Jon Ashburn754864f2015-07-23 18:49:07 -06001073}
1074
Jon Ashburn23d36b12016-02-02 17:47:28 -07001075LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1076vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo,
1077 const VkAllocationCallbacks *pAllocator,
1078 VkRenderPass *pRenderPass) {
Jon Ashburn754864f2015-07-23 18:49:07 -06001079 const VkLayerDispatchTable *disp;
1080
1081 disp = loader_get_dispatch(device);
1082
Chia-I Wuf7458c52015-10-26 21:10:41 +08001083 return disp->CreateRenderPass(device, pCreateInfo, pAllocator, pRenderPass);
Jon Ashburn754864f2015-07-23 18:49:07 -06001084}
1085
Jon Ashburn23d36b12016-02-02 17:47:28 -07001086LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1087vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass,
1088 const VkAllocationCallbacks *pAllocator) {
Jon Ashburn754864f2015-07-23 18:49:07 -06001089 const VkLayerDispatchTable *disp;
1090
1091 disp = loader_get_dispatch(device);
1092
Chia-I Wuf7458c52015-10-26 21:10:41 +08001093 disp->DestroyRenderPass(device, renderPass, pAllocator);
Jon Ashburn754864f2015-07-23 18:49:07 -06001094}
1095
Jon Ashburn23d36b12016-02-02 17:47:28 -07001096LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1097vkGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass,
1098 VkExtent2D *pGranularity) {
Jon Ashburn754864f2015-07-23 18:49:07 -06001099 const VkLayerDispatchTable *disp;
1100
1101 disp = loader_get_dispatch(device);
1102
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -06001103 disp->GetRenderAreaGranularity(device, renderPass, pGranularity);
Jon Ashburn754864f2015-07-23 18:49:07 -06001104}
1105
Jon Ashburn23d36b12016-02-02 17:47:28 -07001106LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1107vkCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo *pCreateInfo,
1108 const VkAllocationCallbacks *pAllocator,
1109 VkCommandPool *pCommandPool) {
Cody Northrope62183e2015-07-09 18:08:05 -06001110 const VkLayerDispatchTable *disp;
1111
1112 disp = loader_get_dispatch(device);
1113
Jon Ashburn23d36b12016-02-02 17:47:28 -07001114 return disp->CreateCommandPool(device, pCreateInfo, pAllocator,
1115 pCommandPool);
Cody Northrope62183e2015-07-09 18:08:05 -06001116}
1117
Jon Ashburn23d36b12016-02-02 17:47:28 -07001118LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1119vkDestroyCommandPool(VkDevice device, VkCommandPool commandPool,
1120 const VkAllocationCallbacks *pAllocator) {
Cody Northrope62183e2015-07-09 18:08:05 -06001121 const VkLayerDispatchTable *disp;
1122
1123 disp = loader_get_dispatch(device);
1124
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001125 disp->DestroyCommandPool(device, commandPool, pAllocator);
Cody Northrope62183e2015-07-09 18:08:05 -06001126}
1127
Jon Ashburn23d36b12016-02-02 17:47:28 -07001128LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1129vkResetCommandPool(VkDevice device, VkCommandPool commandPool,
1130 VkCommandPoolResetFlags flags) {
Cody Northrope62183e2015-07-09 18:08:05 -06001131 const VkLayerDispatchTable *disp;
1132
1133 disp = loader_get_dispatch(device);
1134
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001135 return disp->ResetCommandPool(device, commandPool, flags);
Cody Northrope62183e2015-07-09 18:08:05 -06001136}
1137
Jon Ashburn23d36b12016-02-02 17:47:28 -07001138LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1139vkAllocateCommandBuffers(VkDevice device,
1140 const VkCommandBufferAllocateInfo *pAllocateInfo,
1141 VkCommandBuffer *pCommandBuffers) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001142 const VkLayerDispatchTable *disp;
1143 VkResult res;
1144
1145 disp = loader_get_dispatch(device);
1146
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001147 res = disp->AllocateCommandBuffers(device, pAllocateInfo, pCommandBuffers);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001148 if (res == VK_SUCCESS) {
Jon Ashburn23d36b12016-02-02 17:47:28 -07001149 for (uint32_t i = 0; i < pAllocateInfo->commandBufferCount; i++) {
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001150 if (pCommandBuffers[i]) {
1151 loader_init_dispatch(pCommandBuffers[i], disp);
Courtney Goeltzenleuchterbee18a92015-10-23 14:21:05 -06001152 }
1153 }
Jon Ashburnd55a3942015-05-06 09:02:10 -06001154 }
1155
1156 return res;
1157}
1158
Jon Ashburn23d36b12016-02-02 17:47:28 -07001159LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1160vkFreeCommandBuffers(VkDevice device, VkCommandPool commandPool,
1161 uint32_t commandBufferCount,
1162 const VkCommandBuffer *pCommandBuffers) {
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001163 const VkLayerDispatchTable *disp;
1164
1165 disp = loader_get_dispatch(device);
1166
Jon Ashburn23d36b12016-02-02 17:47:28 -07001167 disp->FreeCommandBuffers(device, commandPool, commandBufferCount,
1168 pCommandBuffers);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001169}
1170
Jon Ashburn23d36b12016-02-02 17:47:28 -07001171LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1172vkBeginCommandBuffer(VkCommandBuffer commandBuffer,
1173 const VkCommandBufferBeginInfo *pBeginInfo) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001174 const VkLayerDispatchTable *disp;
1175
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001176 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001177
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001178 return disp->BeginCommandBuffer(commandBuffer, pBeginInfo);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001179}
1180
Jon Ashburn23d36b12016-02-02 17:47:28 -07001181LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1182vkEndCommandBuffer(VkCommandBuffer commandBuffer) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001183 const VkLayerDispatchTable *disp;
1184
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001185 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001186
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001187 return disp->EndCommandBuffer(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001188}
1189
Jon Ashburn23d36b12016-02-02 17:47:28 -07001190LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1191vkResetCommandBuffer(VkCommandBuffer commandBuffer,
1192 VkCommandBufferResetFlags flags) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001193 const VkLayerDispatchTable *disp;
1194
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001195 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001196
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001197 return disp->ResetCommandBuffer(commandBuffer, flags);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001198}
1199
Jon Ashburn23d36b12016-02-02 17:47:28 -07001200LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1201vkCmdBindPipeline(VkCommandBuffer commandBuffer,
1202 VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001203 const VkLayerDispatchTable *disp;
1204
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001205 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001206
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001207 disp->CmdBindPipeline(commandBuffer, pipelineBindPoint, pipeline);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001208}
1209
Jon Ashburn23d36b12016-02-02 17:47:28 -07001210LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1211vkCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport,
1212 uint32_t viewportCount, const VkViewport *pViewports) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001213 const VkLayerDispatchTable *disp;
1214
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001215 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001216
Jon Ashburn23d36b12016-02-02 17:47:28 -07001217 disp->CmdSetViewport(commandBuffer, firstViewport, viewportCount,
1218 pViewports);
Courtney Goeltzenleuchter078f8172015-09-21 11:44:06 -06001219}
1220
Jon Ashburn23d36b12016-02-02 17:47:28 -07001221LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1222vkCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor,
1223 uint32_t scissorCount, const VkRect2D *pScissors) {
Courtney Goeltzenleuchter078f8172015-09-21 11:44:06 -06001224 const VkLayerDispatchTable *disp;
1225
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001226 disp = loader_get_dispatch(commandBuffer);
Courtney Goeltzenleuchter078f8172015-09-21 11:44:06 -06001227
Jon Ashburn19d3bf12015-12-30 14:06:55 -07001228 disp->CmdSetScissor(commandBuffer, firstScissor, scissorCount, pScissors);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001229}
1230
Jon Ashburn23d36b12016-02-02 17:47:28 -07001231LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1232vkCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth) {
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001233 const VkLayerDispatchTable *disp;
1234
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001235 disp = loader_get_dispatch(commandBuffer);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001236
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001237 disp->CmdSetLineWidth(commandBuffer, lineWidth);
Cody Northrop12365112015-08-17 11:10:49 -06001238}
1239
Jon Ashburn23d36b12016-02-02 17:47:28 -07001240LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1241vkCmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor,
1242 float depthBiasClamp, float depthBiasSlopeFactor) {
Cody Northrop12365112015-08-17 11:10:49 -06001243 const VkLayerDispatchTable *disp;
1244
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001245 disp = loader_get_dispatch(commandBuffer);
Cody Northrop12365112015-08-17 11:10:49 -06001246
Jon Ashburn23d36b12016-02-02 17:47:28 -07001247 disp->CmdSetDepthBias(commandBuffer, depthBiasConstantFactor,
1248 depthBiasClamp, depthBiasSlopeFactor);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001249}
1250
Jon Ashburn23d36b12016-02-02 17:47:28 -07001251LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1252vkCmdSetBlendConstants(VkCommandBuffer commandBuffer,
1253 const float blendConstants[4]) {
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001254 const VkLayerDispatchTable *disp;
1255
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001256 disp = loader_get_dispatch(commandBuffer);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001257
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001258 disp->CmdSetBlendConstants(commandBuffer, blendConstants);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001259}
1260
Jon Ashburn23d36b12016-02-02 17:47:28 -07001261LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1262vkCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds,
1263 float maxDepthBounds) {
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001264 const VkLayerDispatchTable *disp;
1265
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001266 disp = loader_get_dispatch(commandBuffer);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001267
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001268 disp->CmdSetDepthBounds(commandBuffer, minDepthBounds, maxDepthBounds);
Cody Northrop82485a82015-08-18 15:21:16 -06001269}
1270
Jon Ashburn23d36b12016-02-02 17:47:28 -07001271LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1272vkCmdSetStencilCompareMask(VkCommandBuffer commandBuffer,
1273 VkStencilFaceFlags faceMask, uint32_t compareMask) {
Cody Northrop82485a82015-08-18 15:21:16 -06001274 const VkLayerDispatchTable *disp;
1275
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001276 disp = loader_get_dispatch(commandBuffer);
Cody Northrop82485a82015-08-18 15:21:16 -06001277
Chia-I Wu1b99bb22015-10-27 19:25:11 +08001278 disp->CmdSetStencilCompareMask(commandBuffer, faceMask, compareMask);
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001279}
1280
Jon Ashburn23d36b12016-02-02 17:47:28 -07001281LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1282vkCmdSetStencilWriteMask(VkCommandBuffer commandBuffer,
1283 VkStencilFaceFlags faceMask, uint32_t writeMask) {
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001284 const VkLayerDispatchTable *disp;
1285
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001286 disp = loader_get_dispatch(commandBuffer);
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001287
Chia-I Wu1b99bb22015-10-27 19:25:11 +08001288 disp->CmdSetStencilWriteMask(commandBuffer, faceMask, writeMask);
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001289}
1290
Jon Ashburn23d36b12016-02-02 17:47:28 -07001291LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1292vkCmdSetStencilReference(VkCommandBuffer commandBuffer,
1293 VkStencilFaceFlags faceMask, uint32_t reference) {
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001294 const VkLayerDispatchTable *disp;
1295
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001296 disp = loader_get_dispatch(commandBuffer);
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001297
Chia-I Wu1b99bb22015-10-27 19:25:11 +08001298 disp->CmdSetStencilReference(commandBuffer, faceMask, reference);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001299}
1300
Jon Ashburn23d36b12016-02-02 17:47:28 -07001301LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBindDescriptorSets(
1302 VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint,
1303 VkPipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount,
1304 const VkDescriptorSet *pDescriptorSets, uint32_t dynamicOffsetCount,
1305 const uint32_t *pDynamicOffsets) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001306 const VkLayerDispatchTable *disp;
1307
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001308 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001309
Jon Ashburn23d36b12016-02-02 17:47:28 -07001310 disp->CmdBindDescriptorSets(commandBuffer, pipelineBindPoint, layout,
1311 firstSet, descriptorSetCount, pDescriptorSets,
1312 dynamicOffsetCount, pDynamicOffsets);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001313}
1314
Jon Ashburn23d36b12016-02-02 17:47:28 -07001315LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1316vkCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer,
1317 VkDeviceSize offset, VkIndexType indexType) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001318 const VkLayerDispatchTable *disp;
1319
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001320 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001321
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001322 disp->CmdBindIndexBuffer(commandBuffer, buffer, offset, indexType);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001323}
1324
Jon Ashburn23d36b12016-02-02 17:47:28 -07001325LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1326vkCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding,
1327 uint32_t bindingCount, const VkBuffer *pBuffers,
1328 const VkDeviceSize *pOffsets) {
Jon Ashburn754864f2015-07-23 18:49:07 -06001329 const VkLayerDispatchTable *disp;
1330
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001331 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn754864f2015-07-23 18:49:07 -06001332
Jon Ashburn23d36b12016-02-02 17:47:28 -07001333 disp->CmdBindVertexBuffers(commandBuffer, firstBinding, bindingCount,
1334 pBuffers, pOffsets);
Jon Ashburn754864f2015-07-23 18:49:07 -06001335}
1336
Jon Ashburn23d36b12016-02-02 17:47:28 -07001337LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1338vkCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount,
1339 uint32_t instanceCount, uint32_t firstVertex,
1340 uint32_t firstInstance) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001341 const VkLayerDispatchTable *disp;
1342
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001343 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001344
Jon Ashburn23d36b12016-02-02 17:47:28 -07001345 disp->CmdDraw(commandBuffer, vertexCount, instanceCount, firstVertex,
1346 firstInstance);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001347}
1348
Jon Ashburn23d36b12016-02-02 17:47:28 -07001349LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1350vkCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount,
1351 uint32_t instanceCount, uint32_t firstIndex,
1352 int32_t vertexOffset, uint32_t firstInstance) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001353 const VkLayerDispatchTable *disp;
1354
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001355 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001356
Jon Ashburn23d36b12016-02-02 17:47:28 -07001357 disp->CmdDrawIndexed(commandBuffer, indexCount, instanceCount, firstIndex,
1358 vertexOffset, firstInstance);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001359}
1360
Jon Ashburn23d36b12016-02-02 17:47:28 -07001361LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1362vkCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer,
1363 VkDeviceSize offset, uint32_t drawCount, uint32_t stride) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001364 const VkLayerDispatchTable *disp;
1365
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001366 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001367
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001368 disp->CmdDrawIndirect(commandBuffer, buffer, offset, drawCount, stride);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001369}
1370
Jon Ashburn23d36b12016-02-02 17:47:28 -07001371LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1372vkCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer,
1373 VkDeviceSize offset, uint32_t drawCount,
1374 uint32_t stride) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001375 const VkLayerDispatchTable *disp;
1376
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001377 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001378
Jon Ashburn23d36b12016-02-02 17:47:28 -07001379 disp->CmdDrawIndexedIndirect(commandBuffer, buffer, offset, drawCount,
1380 stride);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001381}
1382
Jon Ashburn23d36b12016-02-02 17:47:28 -07001383LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1384vkCmdDispatch(VkCommandBuffer commandBuffer, uint32_t x, uint32_t y,
1385 uint32_t z) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001386 const VkLayerDispatchTable *disp;
1387
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001388 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001389
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001390 disp->CmdDispatch(commandBuffer, x, y, z);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001391}
1392
Jon Ashburn23d36b12016-02-02 17:47:28 -07001393LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1394vkCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer,
1395 VkDeviceSize offset) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001396 const VkLayerDispatchTable *disp;
1397
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001398 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001399
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001400 disp->CmdDispatchIndirect(commandBuffer, buffer, offset);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001401}
1402
Jon Ashburn23d36b12016-02-02 17:47:28 -07001403LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1404vkCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer,
1405 VkBuffer dstBuffer, uint32_t regionCount,
1406 const VkBufferCopy *pRegions) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001407 const VkLayerDispatchTable *disp;
1408
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001409 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001410
Jon Ashburn23d36b12016-02-02 17:47:28 -07001411 disp->CmdCopyBuffer(commandBuffer, srcBuffer, dstBuffer, regionCount,
1412 pRegions);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001413}
1414
Jon Ashburn23d36b12016-02-02 17:47:28 -07001415LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1416vkCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage,
1417 VkImageLayout srcImageLayout, VkImage dstImage,
1418 VkImageLayout dstImageLayout, uint32_t regionCount,
1419 const VkImageCopy *pRegions) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001420 const VkLayerDispatchTable *disp;
1421
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001422 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001423
Jon Ashburn23d36b12016-02-02 17:47:28 -07001424 disp->CmdCopyImage(commandBuffer, srcImage, srcImageLayout, dstImage,
1425 dstImageLayout, regionCount, pRegions);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001426}
1427
Jon Ashburn23d36b12016-02-02 17:47:28 -07001428LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1429vkCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage,
1430 VkImageLayout srcImageLayout, VkImage dstImage,
1431 VkImageLayout dstImageLayout, uint32_t regionCount,
1432 const VkImageBlit *pRegions, VkFilter filter) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001433 const VkLayerDispatchTable *disp;
1434
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001435 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001436
Jon Ashburn23d36b12016-02-02 17:47:28 -07001437 disp->CmdBlitImage(commandBuffer, srcImage, srcImageLayout, dstImage,
1438 dstImageLayout, regionCount, pRegions, filter);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001439}
1440
Jon Ashburn23d36b12016-02-02 17:47:28 -07001441LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1442vkCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer,
1443 VkImage dstImage, VkImageLayout dstImageLayout,
1444 uint32_t regionCount,
1445 const VkBufferImageCopy *pRegions) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001446 const VkLayerDispatchTable *disp;
1447
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001448 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001449
Jon Ashburn23d36b12016-02-02 17:47:28 -07001450 disp->CmdCopyBufferToImage(commandBuffer, srcBuffer, dstImage,
1451 dstImageLayout, regionCount, pRegions);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001452}
1453
Jon Ashburn23d36b12016-02-02 17:47:28 -07001454LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1455vkCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage,
1456 VkImageLayout srcImageLayout, VkBuffer dstBuffer,
1457 uint32_t regionCount,
1458 const VkBufferImageCopy *pRegions) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001459 const VkLayerDispatchTable *disp;
1460
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001461 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001462
Jon Ashburn23d36b12016-02-02 17:47:28 -07001463 disp->CmdCopyImageToBuffer(commandBuffer, srcImage, srcImageLayout,
1464 dstBuffer, regionCount, pRegions);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001465}
1466
Jon Ashburn23d36b12016-02-02 17:47:28 -07001467LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1468vkCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer,
1469 VkDeviceSize dstOffset, VkDeviceSize dataSize,
1470 const uint32_t *pData) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001471 const VkLayerDispatchTable *disp;
1472
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001473 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001474
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001475 disp->CmdUpdateBuffer(commandBuffer, dstBuffer, dstOffset, dataSize, pData);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001476}
1477
Jon Ashburn23d36b12016-02-02 17:47:28 -07001478LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1479vkCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer,
1480 VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001481 const VkLayerDispatchTable *disp;
1482
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001483 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001484
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001485 disp->CmdFillBuffer(commandBuffer, dstBuffer, dstOffset, size, data);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001486}
1487
Jon Ashburn23d36b12016-02-02 17:47:28 -07001488LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1489vkCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image,
1490 VkImageLayout imageLayout, const VkClearColorValue *pColor,
1491 uint32_t rangeCount,
1492 const VkImageSubresourceRange *pRanges) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001493 const VkLayerDispatchTable *disp;
1494
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001495 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001496
Jon Ashburn23d36b12016-02-02 17:47:28 -07001497 disp->CmdClearColorImage(commandBuffer, image, imageLayout, pColor,
1498 rangeCount, pRanges);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001499}
1500
Jon Ashburn23d36b12016-02-02 17:47:28 -07001501LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1502vkCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image,
1503 VkImageLayout imageLayout,
1504 const VkClearDepthStencilValue *pDepthStencil,
1505 uint32_t rangeCount,
1506 const VkImageSubresourceRange *pRanges) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001507 const VkLayerDispatchTable *disp;
1508
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001509 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001510
Jon Ashburn23d36b12016-02-02 17:47:28 -07001511 disp->CmdClearDepthStencilImage(commandBuffer, image, imageLayout,
1512 pDepthStencil, rangeCount, pRanges);
Chris Forbesd9be82b2015-06-22 17:21:59 +12001513}
1514
Jon Ashburn23d36b12016-02-02 17:47:28 -07001515LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1516vkCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount,
1517 const VkClearAttachment *pAttachments, uint32_t rectCount,
1518 const VkClearRect *pRects) {
Chris Forbesd9be82b2015-06-22 17:21:59 +12001519 const VkLayerDispatchTable *disp;
1520
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001521 disp = loader_get_dispatch(commandBuffer);
Chris Forbesd9be82b2015-06-22 17:21:59 +12001522
Jon Ashburn23d36b12016-02-02 17:47:28 -07001523 disp->CmdClearAttachments(commandBuffer, attachmentCount, pAttachments,
1524 rectCount, pRects);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001525}
1526
Jon Ashburn23d36b12016-02-02 17:47:28 -07001527LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1528vkCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage,
1529 VkImageLayout srcImageLayout, VkImage dstImage,
1530 VkImageLayout dstImageLayout, uint32_t regionCount,
1531 const VkImageResolve *pRegions) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001532 const VkLayerDispatchTable *disp;
1533
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001534 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001535
Jon Ashburn23d36b12016-02-02 17:47:28 -07001536 disp->CmdResolveImage(commandBuffer, srcImage, srcImageLayout, dstImage,
1537 dstImageLayout, regionCount, pRegions);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001538}
1539
Jon Ashburn23d36b12016-02-02 17:47:28 -07001540LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1541vkCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event,
1542 VkPipelineStageFlags stageMask) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001543 const VkLayerDispatchTable *disp;
1544
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001545 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001546
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001547 disp->CmdSetEvent(commandBuffer, event, stageMask);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001548}
1549
Jon Ashburn23d36b12016-02-02 17:47:28 -07001550LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1551vkCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event,
1552 VkPipelineStageFlags stageMask) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001553 const VkLayerDispatchTable *disp;
1554
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001555 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001556
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001557 disp->CmdResetEvent(commandBuffer, event, stageMask);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001558}
1559
Jon Ashburn23d36b12016-02-02 17:47:28 -07001560LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1561vkCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount,
1562 const VkEvent *pEvents, VkPipelineStageFlags sourceStageMask,
1563 VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount,
1564 const VkMemoryBarrier *pMemoryBarriers,
1565 uint32_t bufferMemoryBarrierCount,
1566 const VkBufferMemoryBarrier *pBufferMemoryBarriers,
1567 uint32_t imageMemoryBarrierCount,
1568 const VkImageMemoryBarrier *pImageMemoryBarriers) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001569 const VkLayerDispatchTable *disp;
1570
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001571 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001572
Jon Ashburnf19916e2016-01-11 13:12:43 -07001573 disp->CmdWaitEvents(commandBuffer, eventCount, pEvents, sourceStageMask,
1574 dstStageMask, memoryBarrierCount, pMemoryBarriers,
1575 bufferMemoryBarrierCount, pBufferMemoryBarriers,
1576 imageMemoryBarrierCount, pImageMemoryBarriers);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001577}
1578
Jon Ashburnf19916e2016-01-11 13:12:43 -07001579LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdPipelineBarrier(
Jon Ashburn23d36b12016-02-02 17:47:28 -07001580 VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask,
1581 VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags,
1582 uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers,
1583 uint32_t bufferMemoryBarrierCount,
1584 const VkBufferMemoryBarrier *pBufferMemoryBarriers,
1585 uint32_t imageMemoryBarrierCount,
1586 const VkImageMemoryBarrier *pImageMemoryBarriers) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001587 const VkLayerDispatchTable *disp;
1588
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001589 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001590
Jon Ashburn23d36b12016-02-02 17:47:28 -07001591 disp->CmdPipelineBarrier(
1592 commandBuffer, srcStageMask, dstStageMask, dependencyFlags,
1593 memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount,
1594 pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001595}
1596
Jon Ashburn23d36b12016-02-02 17:47:28 -07001597LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1598vkCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool,
1599 uint32_t slot, VkFlags flags) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001600 const VkLayerDispatchTable *disp;
1601
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001602 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001603
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001604 disp->CmdBeginQuery(commandBuffer, queryPool, slot, flags);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001605}
1606
Jon Ashburn23d36b12016-02-02 17:47:28 -07001607LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1608vkCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool,
1609 uint32_t slot) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001610 const VkLayerDispatchTable *disp;
1611
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001612 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001613
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001614 disp->CmdEndQuery(commandBuffer, queryPool, slot);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001615}
1616
Jon Ashburn23d36b12016-02-02 17:47:28 -07001617LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1618vkCmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool,
1619 uint32_t firstQuery, uint32_t queryCount) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001620 const VkLayerDispatchTable *disp;
1621
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001622 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001623
Jon Ashburn19d3bf12015-12-30 14:06:55 -07001624 disp->CmdResetQueryPool(commandBuffer, queryPool, firstQuery, queryCount);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001625}
1626
Jon Ashburn23d36b12016-02-02 17:47:28 -07001627LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1628vkCmdWriteTimestamp(VkCommandBuffer commandBuffer,
1629 VkPipelineStageFlagBits pipelineStage,
1630 VkQueryPool queryPool, uint32_t slot) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001631 const VkLayerDispatchTable *disp;
1632
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001633 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001634
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001635 disp->CmdWriteTimestamp(commandBuffer, pipelineStage, queryPool, slot);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001636}
1637
Jon Ashburn23d36b12016-02-02 17:47:28 -07001638LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1639vkCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool,
1640 uint32_t firstQuery, uint32_t queryCount,
1641 VkBuffer dstBuffer, VkDeviceSize dstOffset,
1642 VkDeviceSize stride, VkFlags flags) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001643 const VkLayerDispatchTable *disp;
1644
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001645 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001646
Jon Ashburn23d36b12016-02-02 17:47:28 -07001647 disp->CmdCopyQueryPoolResults(commandBuffer, queryPool, firstQuery,
1648 queryCount, dstBuffer, dstOffset, stride,
1649 flags);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001650}
1651
Jon Ashburn23d36b12016-02-02 17:47:28 -07001652LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1653vkCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout,
1654 VkShaderStageFlags stageFlags, uint32_t offset,
1655 uint32_t size, const void *pValues) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001656 const VkLayerDispatchTable *disp;
1657
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001658 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001659
Jon Ashburn23d36b12016-02-02 17:47:28 -07001660 disp->CmdPushConstants(commandBuffer, layout, stageFlags, offset, size,
1661 pValues);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001662}
1663
Jon Ashburn23d36b12016-02-02 17:47:28 -07001664LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1665vkCmdBeginRenderPass(VkCommandBuffer commandBuffer,
1666 const VkRenderPassBeginInfo *pRenderPassBegin,
1667 VkSubpassContents contents) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001668 const VkLayerDispatchTable *disp;
1669
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001670 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001671
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001672 disp->CmdBeginRenderPass(commandBuffer, pRenderPassBegin, contents);
Chia-I Wu08accc62015-07-07 11:50:03 +08001673}
1674
Jon Ashburn23d36b12016-02-02 17:47:28 -07001675LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1676vkCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents) {
Chia-I Wu08accc62015-07-07 11:50:03 +08001677 const VkLayerDispatchTable *disp;
1678
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001679 disp = loader_get_dispatch(commandBuffer);
Chia-I Wu08accc62015-07-07 11:50:03 +08001680
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001681 disp->CmdNextSubpass(commandBuffer, contents);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001682}
1683
Jon Ashburn23d36b12016-02-02 17:47:28 -07001684LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1685vkCmdEndRenderPass(VkCommandBuffer commandBuffer) {
Jon Ashburnd55a3942015-05-06 09:02:10 -06001686 const VkLayerDispatchTable *disp;
1687
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001688 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001689
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001690 disp->CmdEndRenderPass(commandBuffer);
Chia-I Wu0b50a1c2015-06-26 15:34:39 +08001691}
1692
Jon Ashburn23d36b12016-02-02 17:47:28 -07001693LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
1694vkCmdExecuteCommands(VkCommandBuffer commandBuffer,
1695 uint32_t commandBuffersCount,
1696 const VkCommandBuffer *pCommandBuffers) {
Chia-I Wu0b50a1c2015-06-26 15:34:39 +08001697 const VkLayerDispatchTable *disp;
1698
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001699 disp = loader_get_dispatch(commandBuffer);
Chia-I Wu0b50a1c2015-06-26 15:34:39 +08001700
Jon Ashburn23d36b12016-02-02 17:47:28 -07001701 disp->CmdExecuteCommands(commandBuffer, commandBuffersCount,
1702 pCommandBuffers);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001703}