blob: 6d68166efd81c9ddfb2348af422885e180cab4ee [file] [log] [blame]
Jon Ashburnd55a3942015-05-06 09:02:10 -06001/*
Jon Ashburnd55a3942015-05-06 09:02:10 -06002 *
Courtney Goeltzenleuchterfcbe16f2015-10-29 13:50:34 -06003 * Copyright (C) 2015 Valve Corporation
Courtney Goeltzenleuchterf821dad2015-12-02 14:53:22 -07004 * Copyright (C) 2015 Google Inc.
Jon Ashburnd55a3942015-05-06 09:02:10 -06005 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
Courtney Goeltzenleuchter05559522015-10-30 11:14:30 -060023 *
24 * Author: Chris Forbes <chrisf@ijw.co.nz>
25 * Author: Cody Northrop <cody@lunarg.com>
26 * Author: Jon Ashburn <jon@lunarg.com>
27 * Author: Tony Barbour <tony@LunarG.com>
Jon Ashburnd55a3942015-05-06 09:02:10 -060028 */
Courtney Goeltzenleuchter7f5aafc2015-07-05 11:28:29 -060029#define _GNU_SOURCE
Jon Ashburn27cd5842015-05-12 17:26:48 -060030#include <stdlib.h>
31#include <string.h>
Jon Ashburnd55a3942015-05-06 09:02:10 -060032
Tobin Ehlisb835d1b2015-07-03 10:34:49 -060033#include "vk_loader_platform.h"
Jon Ashburnd55a3942015-05-06 09:02:10 -060034#include "loader.h"
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -060035#include "debug_report.h"
Ian Elliott954fa342015-10-30 15:28:23 -060036#include "wsi.h"
Jon Ashburnd55a3942015-05-06 09:02:10 -060037
Tobin Ehlisf37926f2015-05-13 11:57:18 -060038
Jon Ashburnd55a3942015-05-06 09:02:10 -060039/* Trampoline entrypoints */
Chia-I Wu9ab61502015-11-06 06:42:02 +080040LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(
Courtney Goeltzenleuchter57fb1572015-06-08 15:13:50 -060041 const VkInstanceCreateInfo* pCreateInfo,
Chia-I Wu3432a0c2015-10-27 18:04:07 +080042 const VkAllocationCallbacks* pAllocator,
Courtney Goeltzenleuchter57fb1572015-06-08 15:13:50 -060043 VkInstance* pInstance)
Jon Ashburn27cd5842015-05-12 17:26:48 -060044{
45 struct loader_instance *ptr_instance = NULL;
Jon Ashburn27cd5842015-05-12 17:26:48 -060046 VkResult res = VK_ERROR_INITIALIZATION_FAILED;
Courtney Goeltzenleuchter7415d5a2015-12-09 15:48:16 -070047 VkDebugReportCallbackEXT instance_callback = VK_NULL_HANDLE;
Courtney Goeltzenleuchter82887272015-12-02 15:29:33 -070048 void *pNext = (void *) pCreateInfo->pNext;
Jon Ashburn27cd5842015-05-12 17:26:48 -060049
Jon Ashburn8810c5f2015-08-18 18:04:47 -060050 loader_platform_thread_once(&once_init, loader_initialize);
Jon Ashburn27cd5842015-05-12 17:26:48 -060051
Chia-I Wuf7458c52015-10-26 21:10:41 +080052 if (pAllocator) {
Chia-I Wu3432a0c2015-10-27 18:04:07 +080053 ptr_instance = (struct loader_instance *) pAllocator->pfnAllocation(
Chia-I Wuf7458c52015-10-26 21:10:41 +080054 pAllocator->pUserData,
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -060055 sizeof(struct loader_instance),
56 sizeof(VkInstance),
Chia-I Wu3432a0c2015-10-27 18:04:07 +080057 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -060058 } else {
59 ptr_instance = (struct loader_instance *) malloc(sizeof(struct loader_instance));
60 }
Jon Ashburn27cd5842015-05-12 17:26:48 -060061 if (ptr_instance == NULL) {
62 return VK_ERROR_OUT_OF_HOST_MEMORY;
63 }
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -060064
Jon Ashburn87d6aa92015-08-28 15:19:27 -060065 tls_instance = ptr_instance;
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -060066 loader_platform_thread_lock_mutex(&loader_lock);
Jon Ashburnb82c1852015-08-11 14:49:54 -060067 memset(ptr_instance, 0, sizeof(struct loader_instance));
Jon Ashburn07daee72015-05-21 18:13:33 -060068
Chia-I Wuf7458c52015-10-26 21:10:41 +080069 if (pAllocator) {
70 ptr_instance->alloc_callbacks = *pAllocator;
Courtney Goeltzenleuchter7f5aafc2015-07-05 11:28:29 -060071 }
72
Courtney Goeltzenleuchter45cde5d2015-12-03 13:45:51 -070073 /*
74 * Look for a debug report create info structure
75 * and setup a callback if found.
76 */
77 while (pNext) {
Courtney Goeltzenleuchter7415d5a2015-12-09 15:48:16 -070078 if (((VkInstanceCreateInfo *)pNext)->sType == VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT) {
79 instance_callback = (VkDebugReportCallbackEXT) ptr_instance;
Courtney Goeltzenleuchter82887272015-12-02 15:29:33 -070080 if (util_CreateDebugReportCallback(ptr_instance, pNext, pAllocator, instance_callback)) {
Courtney Goeltzenleuchter45cde5d2015-12-03 13:45:51 -070081 loader_heap_free(ptr_instance, ptr_instance);
Courtney Goeltzenleuchter82887272015-12-02 15:29:33 -070082 loader_platform_thread_unlock_mutex(&loader_lock);
83 return VK_ERROR_OUT_OF_HOST_MEMORY;
84 }
85 }
Courtney Goeltzenleuchter45cde5d2015-12-03 13:45:51 -070086 pNext = (void *) ((VkInstanceCreateInfo *)pNext)->pNext;
Courtney Goeltzenleuchter82887272015-12-02 15:29:33 -070087 }
88
Jon Ashburn3d002332015-08-20 16:35:30 -060089 /* Due to implicit layers need to get layer list even if
Chia-I Wud50a7d72015-10-26 20:48:51 +080090 * enabledLayerNameCount == 0 and VK_INSTANCE_LAYERS is unset. For now always
Jon Ashburn3d002332015-08-20 16:35:30 -060091 * get layer list (both instance and device) via loader_layer_scan(). */
92 memset(&ptr_instance->instance_layer_list, 0, sizeof(ptr_instance->instance_layer_list));
93 memset(&ptr_instance->device_layer_list, 0, sizeof(ptr_instance->device_layer_list));
Jon Ashburne39a4f82015-08-28 13:38:21 -060094 loader_layer_scan(ptr_instance,
Jon Ashburne39a4f82015-08-28 13:38:21 -060095 &ptr_instance->instance_layer_list,
96 &ptr_instance->device_layer_list);
Jon Ashburn3d002332015-08-20 16:35:30 -060097
98 /* validate the app requested layers to be enabled */
Chia-I Wud50a7d72015-10-26 20:48:51 +080099 if (pCreateInfo->enabledLayerNameCount > 0) {
100 res = loader_validate_layers(pCreateInfo->enabledLayerNameCount,
Jon Ashburn3d002332015-08-20 16:35:30 -0600101 pCreateInfo->ppEnabledLayerNames,
102 &ptr_instance->instance_layer_list);
103 if (res != VK_SUCCESS) {
Courtney Goeltzenleuchter45cde5d2015-12-03 13:45:51 -0700104 util_DestroyDebugReportCallback(ptr_instance, instance_callback, pAllocator);
105 loader_heap_free(ptr_instance, ptr_instance);
Jon Ashburn1ff17592015-10-09 09:40:30 -0600106 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburn3d002332015-08-20 16:35:30 -0600107 return res;
108 }
109 }
110
Jon Ashburn8810c5f2015-08-18 18:04:47 -0600111 /* Scan/discover all ICD libraries */
112 memset(&ptr_instance->icd_libs, 0, sizeof(ptr_instance->icd_libs));
Jon Ashburne39a4f82015-08-28 13:38:21 -0600113 loader_icd_scan(ptr_instance, &ptr_instance->icd_libs);
Jon Ashburn8810c5f2015-08-18 18:04:47 -0600114
Jon Ashburneacfa3a2015-08-14 12:51:47 -0600115 /* get extensions from all ICD's, merge so no duplicates, then validate */
Jon Ashburne39a4f82015-08-28 13:38:21 -0600116 loader_get_icd_loader_instance_extensions(ptr_instance,
117 &ptr_instance->icd_libs,
118 &ptr_instance->ext_list);
119 res = loader_validate_instance_extensions(&ptr_instance->ext_list,
120 &ptr_instance->instance_layer_list,
121 pCreateInfo);
Jon Ashburneacfa3a2015-08-14 12:51:47 -0600122 if (res != VK_SUCCESS) {
Jon Ashburne39a4f82015-08-28 13:38:21 -0600123 loader_delete_layer_properties(ptr_instance,
124 &ptr_instance->device_layer_list);
125 loader_delete_layer_properties(ptr_instance,
126 &ptr_instance->instance_layer_list);
127 loader_scanned_icd_clear(ptr_instance, &ptr_instance->icd_libs);
Jon Ashburn6e6a2162015-12-10 08:51:10 -0700128 loader_destroy_generic_list(ptr_instance, (struct loader_generic_list *)
129 &ptr_instance->ext_list);
Courtney Goeltzenleuchter45cde5d2015-12-03 13:45:51 -0700130 util_DestroyDebugReportCallback(ptr_instance, instance_callback, pAllocator);
Jon Ashburneacfa3a2015-08-14 12:51:47 -0600131 loader_platform_thread_unlock_mutex(&loader_lock);
132 loader_heap_free(ptr_instance, ptr_instance);
133 return res;
134 }
135
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -0600136 ptr_instance->disp = loader_heap_alloc(
137 ptr_instance,
138 sizeof(VkLayerInstanceDispatchTable),
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800139 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -0600140 if (ptr_instance->disp == NULL) {
Jon Ashburne39a4f82015-08-28 13:38:21 -0600141 loader_delete_layer_properties(ptr_instance,
142 &ptr_instance->device_layer_list);
143 loader_delete_layer_properties(ptr_instance,
144 &ptr_instance->instance_layer_list);
145 loader_scanned_icd_clear(ptr_instance,
146 &ptr_instance->icd_libs);
Jon Ashburn6e6a2162015-12-10 08:51:10 -0700147 loader_destroy_generic_list(ptr_instance, (struct loader_generic_list *)
Jon Ashburne39a4f82015-08-28 13:38:21 -0600148 &ptr_instance->ext_list);
Courtney Goeltzenleuchter45cde5d2015-12-03 13:45:51 -0700149 util_DestroyDebugReportCallback(ptr_instance, instance_callback, pAllocator);
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -0600150 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburneacfa3a2015-08-14 12:51:47 -0600151 loader_heap_free(ptr_instance, ptr_instance);
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -0600152 return VK_ERROR_OUT_OF_HOST_MEMORY;
153 }
154 memcpy(ptr_instance->disp, &instance_disp, sizeof(instance_disp));
155 ptr_instance->next = loader.instances;
156 loader.instances = ptr_instance;
157
Jon Ashburnb82c1852015-08-11 14:49:54 -0600158 /* activate any layers on instance chain */
Jon Ashburne39a4f82015-08-28 13:38:21 -0600159 res = loader_enable_instance_layers(ptr_instance,
160 pCreateInfo,
161 &ptr_instance->instance_layer_list);
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -0600162 if (res != VK_SUCCESS) {
Jon Ashburne39a4f82015-08-28 13:38:21 -0600163 loader_delete_layer_properties(ptr_instance,
164 &ptr_instance->device_layer_list);
165 loader_delete_layer_properties(ptr_instance,
166 &ptr_instance->instance_layer_list);
167 loader_scanned_icd_clear(ptr_instance,
168 &ptr_instance->icd_libs);
Jon Ashburn6e6a2162015-12-10 08:51:10 -0700169 loader_destroy_generic_list(ptr_instance, (struct loader_generic_list *)
Jon Ashburne39a4f82015-08-28 13:38:21 -0600170 &ptr_instance->ext_list);
Jon Ashburneacfa3a2015-08-14 12:51:47 -0600171 loader.instances = ptr_instance->next;
Courtney Goeltzenleuchter45cde5d2015-12-03 13:45:51 -0700172 util_DestroyDebugReportCallback(ptr_instance, instance_callback, pAllocator);
Jon Ashburneacfa3a2015-08-14 12:51:47 -0600173 loader_platform_thread_unlock_mutex(&loader_lock);
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -0600174 loader_heap_free(ptr_instance, ptr_instance->disp);
175 loader_heap_free(ptr_instance, ptr_instance);
176 return res;
177 }
Jon Ashburnb82c1852015-08-11 14:49:54 -0600178 loader_activate_instance_layers(ptr_instance);
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -0600179
Ian Elliott954fa342015-10-30 15:28:23 -0600180 wsi_create_instance(ptr_instance, pCreateInfo);
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600181 debug_report_create_instance(ptr_instance, pCreateInfo);
Jon Ashburn07daee72015-05-21 18:13:33 -0600182
Jon Ashburn27cd5842015-05-12 17:26:48 -0600183
Jon Ashburn27cd5842015-05-12 17:26:48 -0600184 *pInstance = (VkInstance) ptr_instance;
Jon Ashburneed0c002015-05-21 17:42:17 -0600185
Chia-I Wuf7458c52015-10-26 21:10:41 +0800186 res = ptr_instance->disp->CreateInstance(pCreateInfo, pAllocator, pInstance);
Jon Ashburneed0c002015-05-21 17:42:17 -0600187
Courtney Goeltzenleuchterd971b612015-06-17 20:51:59 -0600188 /*
189 * Finally have the layers in place and everyone has seen
190 * the CreateInstance command go by. This allows the layer's
191 * GetInstanceProcAddr functions to return valid extension functions
192 * if enabled.
193 */
194 loader_activate_instance_layer_extensions(ptr_instance);
195
Courtney Goeltzenleuchter45cde5d2015-12-03 13:45:51 -0700196 /* Remove temporary debug_report callback */
197 util_DestroyDebugReportCallback(ptr_instance, instance_callback, pAllocator);
198
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600199 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburn27cd5842015-05-12 17:26:48 -0600200 return res;
201}
202
Chia-I Wu9ab61502015-11-06 06:42:02 +0800203LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyInstance(
Chia-I Wuf7458c52015-10-26 21:10:41 +0800204 VkInstance instance,
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800205 const VkAllocationCallbacks* pAllocator)
Jon Ashburn27cd5842015-05-12 17:26:48 -0600206{
207 const VkLayerInstanceDispatchTable *disp;
Jon Ashburne0e64572015-09-30 12:56:42 -0600208 struct loader_instance *ptr_instance = NULL;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600209 disp = loader_get_instance_dispatch(instance);
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -0600210
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600211 loader_platform_thread_lock_mutex(&loader_lock);
212
Courtney Goeltzenleuchter45cde5d2015-12-03 13:45:51 -0700213 /* TODO: Do we need a temporary callback here to catch cleanup issues? */
214
Jon Ashburne0e64572015-09-30 12:56:42 -0600215 ptr_instance = loader_get_instance(instance);
Chia-I Wuf7458c52015-10-26 21:10:41 +0800216 disp->DestroyInstance(instance, pAllocator);
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -0600217
Courtney Goeltzenleuchter7d0023c2015-06-08 15:09:22 -0600218 loader_deactivate_instance_layers(ptr_instance);
Jon Ashburneacfa3a2015-08-14 12:51:47 -0600219 loader_heap_free(ptr_instance, ptr_instance->disp);
220 loader_heap_free(ptr_instance, ptr_instance);
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600221 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburn27cd5842015-05-12 17:26:48 -0600222}
Jon Ashburn95a77ba2015-05-15 15:09:35 -0600223
Chia-I Wu9ab61502015-11-06 06:42:02 +0800224LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDevices(
Jon Ashburn27cd5842015-05-12 17:26:48 -0600225 VkInstance instance,
226 uint32_t* pPhysicalDeviceCount,
227 VkPhysicalDevice* pPhysicalDevices)
228{
229 const VkLayerInstanceDispatchTable *disp;
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600230 VkResult res;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600231 disp = loader_get_instance_dispatch(instance);
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600232
233 loader_platform_thread_lock_mutex(&loader_lock);
234 res = disp->EnumeratePhysicalDevices(instance, pPhysicalDeviceCount,
Jon Ashburn27cd5842015-05-12 17:26:48 -0600235 pPhysicalDevices);
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600236 loader_platform_thread_unlock_mutex(&loader_lock);
237 return res;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600238}
239
Chia-I Wu9ab61502015-11-06 06:42:02 +0800240LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFeatures(
Jon Ashburn754864f2015-07-23 18:49:07 -0600241 VkPhysicalDevice gpu,
242 VkPhysicalDeviceFeatures *pFeatures)
243{
244 const VkLayerInstanceDispatchTable *disp;
Jon Ashburn754864f2015-07-23 18:49:07 -0600245
246 disp = loader_get_instance_dispatch(gpu);
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600247 disp->GetPhysicalDeviceFeatures(gpu, pFeatures);
Jon Ashburn754864f2015-07-23 18:49:07 -0600248}
249
Chia-I Wu9ab61502015-11-06 06:42:02 +0800250LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFormatProperties(
Jon Ashburn754864f2015-07-23 18:49:07 -0600251 VkPhysicalDevice gpu,
252 VkFormat format,
253 VkFormatProperties *pFormatInfo)
254{
255 const VkLayerInstanceDispatchTable *disp;
Jon Ashburn754864f2015-07-23 18:49:07 -0600256
257 disp = loader_get_instance_dispatch(gpu);
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600258 disp->GetPhysicalDeviceFormatProperties(gpu, format, pFormatInfo);
Jon Ashburn754864f2015-07-23 18:49:07 -0600259}
260
Chia-I Wu9ab61502015-11-06 06:42:02 +0800261LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties)
Jon Ashburn754864f2015-07-23 18:49:07 -0600262{
263 const VkLayerInstanceDispatchTable *disp;
Jon Ashburn754864f2015-07-23 18:49:07 -0600264
265 disp = loader_get_instance_dispatch(physicalDevice);
Chia-I Wu17241042015-10-31 00:31:16 +0800266 return disp->GetPhysicalDeviceImageFormatProperties(physicalDevice, format, type, tiling, usage, flags, pImageFormatProperties);
Jon Ashburn754864f2015-07-23 18:49:07 -0600267}
268
Chia-I Wu9ab61502015-11-06 06:42:02 +0800269LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceProperties(
Jon Ashburn27cd5842015-05-12 17:26:48 -0600270 VkPhysicalDevice gpu,
Tony Barbour59a47322015-06-24 16:06:58 -0600271 VkPhysicalDeviceProperties* pProperties)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600272{
Jon Ashburn95a77ba2015-05-15 15:09:35 -0600273 const VkLayerInstanceDispatchTable *disp;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600274
Jon Ashburn95a77ba2015-05-15 15:09:35 -0600275 disp = loader_get_instance_dispatch(gpu);
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600276 disp->GetPhysicalDeviceProperties(gpu, pProperties);
Tony Barbour59a47322015-06-24 16:06:58 -0600277}
278
Chia-I Wu9ab61502015-11-06 06:42:02 +0800279LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties(
Tony Barbour59a47322015-06-24 16:06:58 -0600280 VkPhysicalDevice gpu,
Chia-I Wud50a7d72015-10-26 20:48:51 +0800281 uint32_t* pQueueFamilyPropertyCount,
Cody Northropd0802882015-08-03 17:04:53 -0600282 VkQueueFamilyProperties* pQueueProperties)
Tony Barbour59a47322015-06-24 16:06:58 -0600283{
284 const VkLayerInstanceDispatchTable *disp;
Tony Barbour59a47322015-06-24 16:06:58 -0600285
286 disp = loader_get_instance_dispatch(gpu);
Chia-I Wud50a7d72015-10-26 20:48:51 +0800287 disp->GetPhysicalDeviceQueueFamilyProperties(gpu, pQueueFamilyPropertyCount, pQueueProperties);
Tony Barbour59a47322015-06-24 16:06:58 -0600288}
289
Chia-I Wu9ab61502015-11-06 06:42:02 +0800290LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties(
Tony Barbour59a47322015-06-24 16:06:58 -0600291 VkPhysicalDevice gpu,
292 VkPhysicalDeviceMemoryProperties* pMemoryProperties)
293{
294 const VkLayerInstanceDispatchTable *disp;
Tony Barbour59a47322015-06-24 16:06:58 -0600295
296 disp = loader_get_instance_dispatch(gpu);
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600297 disp->GetPhysicalDeviceMemoryProperties(gpu, pMemoryProperties);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600298}
299
Chia-I Wu9ab61502015-11-06 06:42:02 +0800300LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(
Courtney Goeltzenleuchterca173b82015-06-25 18:01:43 -0600301 VkPhysicalDevice gpu,
302 const VkDeviceCreateInfo* pCreateInfo,
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800303 const VkAllocationCallbacks* pAllocator,
Courtney Goeltzenleuchterca173b82015-06-25 18:01:43 -0600304 VkDevice* pDevice)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600305{
Jon Ashburnd55a3942015-05-06 09:02:10 -0600306 VkResult res;
307
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600308 loader_platform_thread_lock_mutex(&loader_lock);
Courtney Goeltzenleuchterca173b82015-06-25 18:01:43 -0600309
Chia-I Wuf7458c52015-10-26 21:10:41 +0800310 res = loader_CreateDevice(gpu, pCreateInfo, pAllocator, pDevice);
Courtney Goeltzenleuchterca173b82015-06-25 18:01:43 -0600311
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600312 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600313 return res;
314}
315
Chia-I Wu9ab61502015-11-06 06:42:02 +0800316LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyDevice(VkDevice device, const VkAllocationCallbacks* pAllocator)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600317{
318 const VkLayerDispatchTable *disp;
Jon Ashburne39a4f82015-08-28 13:38:21 -0600319 struct loader_device *dev;
320 struct loader_icd *icd = loader_get_icd_and_device(device, &dev);
321 const struct loader_instance *inst = icd->this_instance;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600322 disp = loader_get_dispatch(device);
323
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600324 loader_platform_thread_lock_mutex(&loader_lock);
Chia-I Wuf7458c52015-10-26 21:10:41 +0800325 disp->DestroyDevice(device, pAllocator);
Jon Ashburn781a7ae2015-11-19 15:43:26 -0700326 dev->device = NULL;
327 loader_remove_logical_device(inst, icd, dev);
328
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600329 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600330}
331
Chia-I Wu9ab61502015-11-06 06:42:02 +0800332LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceExtensionProperties(
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600333 VkPhysicalDevice physicalDevice,
334 const char* pLayerName,
Chia-I Wud50a7d72015-10-26 20:48:51 +0800335 uint32_t* pPropertyCount,
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600336 VkExtensionProperties* pProperties)
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600337{
338 VkResult res;
339
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600340 loader_platform_thread_lock_mutex(&loader_lock);
Jon Ashburn00eb6c02015-11-02 17:40:01 -0700341
342 /* If pLayerName == NULL, then querying ICD extensions, pass this call
343 down the instance chain which will terminate in the ICD. This allows
344 layers to filter the extensions coming back up the chain.
345 If pLayerName != NULL then get layer extensions from manifest file. */
346 if (pLayerName == NULL || strlen(pLayerName) == 0) {
347 const VkLayerInstanceDispatchTable *disp;
348
349 disp = loader_get_instance_dispatch(physicalDevice);
350 res = disp->EnumerateDeviceExtensionProperties(physicalDevice, NULL, pPropertyCount, pProperties);
351 } else {
352 res = loader_EnumerateDeviceExtensionProperties(physicalDevice, pLayerName, pPropertyCount, pProperties);
353 }
354
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600355 loader_platform_thread_unlock_mutex(&loader_lock);
Tony Barbour59a47322015-06-24 16:06:58 -0600356 return res;
357}
358
Chia-I Wu9ab61502015-11-06 06:42:02 +0800359LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceLayerProperties(
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600360 VkPhysicalDevice physicalDevice,
Chia-I Wud50a7d72015-10-26 20:48:51 +0800361 uint32_t* pPropertyCount,
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600362 VkLayerProperties* pProperties)
Tony Barbour59a47322015-06-24 16:06:58 -0600363{
364 VkResult res;
365
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600366 loader_platform_thread_lock_mutex(&loader_lock);
Jon Ashburn00eb6c02015-11-02 17:40:01 -0700367
368 /* Don't dispatch this call down the instance chain, want all device layers
369 enumerated and instance chain may not contain all device layers */
Chia-I Wud50a7d72015-10-26 20:48:51 +0800370 res = loader_EnumerateDeviceLayerProperties(physicalDevice, pPropertyCount, pProperties);
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600371 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburn27cd5842015-05-12 17:26:48 -0600372 return res;
373}
374
Chia-I Wu9ab61502015-11-06 06:42:02 +0800375LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetDeviceQueue(VkDevice device, uint32_t queueNodeIndex, uint32_t queueIndex, VkQueue* pQueue)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600376{
377 const VkLayerDispatchTable *disp;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600378
379 disp = loader_get_dispatch(device);
380
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600381 disp->GetDeviceQueue(device, queueNodeIndex, queueIndex, pQueue);
382 loader_set_dispatch(*pQueue, disp);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600383}
384
Chia-I Wu9ab61502015-11-06 06:42:02 +0800385LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600386{
387 const VkLayerDispatchTable *disp;
388
389 disp = loader_get_dispatch(queue);
390
Chia-I Wu40cf0ae2015-10-26 17:20:32 +0800391 return disp->QueueSubmit(queue, submitCount, pSubmits, fence);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600392}
393
Chia-I Wu9ab61502015-11-06 06:42:02 +0800394LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkQueueWaitIdle(VkQueue queue)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600395{
396 const VkLayerDispatchTable *disp;
397
398 disp = loader_get_dispatch(queue);
399
400 return disp->QueueWaitIdle(queue);
401}
402
Chia-I Wu9ab61502015-11-06 06:42:02 +0800403LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkDeviceWaitIdle(VkDevice device)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600404{
405 const VkLayerDispatchTable *disp;
406
407 disp = loader_get_dispatch(device);
408
409 return disp->DeviceWaitIdle(device);
410}
411
Chia-I Wu9ab61502015-11-06 06:42:02 +0800412LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo, const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600413{
414 const VkLayerDispatchTable *disp;
415
416 disp = loader_get_dispatch(device);
417
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800418 return disp->AllocateMemory(device, pAllocateInfo, pAllocator, pMemory);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600419}
420
Chia-I Wu9ab61502015-11-06 06:42:02 +0800421LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkFreeMemory(VkDevice device, VkDeviceMemory mem, const VkAllocationCallbacks* pAllocator)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600422{
423 const VkLayerDispatchTable *disp;
424
425 disp = loader_get_dispatch(device);
426
Chia-I Wuf7458c52015-10-26 21:10:41 +0800427 disp->FreeMemory(device, mem, pAllocator);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600428}
429
Chia-I Wu9ab61502015-11-06 06:42:02 +0800430LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkMapMemory(VkDevice device, VkDeviceMemory mem, VkDeviceSize offset, VkDeviceSize size, VkFlags flags, void** ppData)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600431{
432 const VkLayerDispatchTable *disp;
433
434 disp = loader_get_dispatch(device);
435
436 return disp->MapMemory(device, mem, offset, size, flags, ppData);
437}
438
Chia-I Wu9ab61502015-11-06 06:42:02 +0800439LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkUnmapMemory(VkDevice device, VkDeviceMemory mem)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600440{
441 const VkLayerDispatchTable *disp;
442
443 disp = loader_get_dispatch(device);
444
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600445 disp->UnmapMemory(device, mem);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600446}
447
Chia-I Wu9ab61502015-11-06 06:42:02 +0800448LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkFlushMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600449{
450 const VkLayerDispatchTable *disp;
451
452 disp = loader_get_dispatch(device);
453
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800454 return disp->FlushMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600455}
456
Chia-I Wu9ab61502015-11-06 06:42:02 +0800457LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkInvalidateMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600458{
459 const VkLayerDispatchTable *disp;
460
461 disp = loader_get_dispatch(device);
462
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800463 return disp->InvalidateMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600464}
465
Chia-I Wu9ab61502015-11-06 06:42:02 +0800466LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes)
Courtney Goeltzenleuchterfb71f222015-07-09 21:57:28 -0600467{
468 const VkLayerDispatchTable *disp;
469
470 disp = loader_get_dispatch(device);
471
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600472 disp->GetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes);
Courtney Goeltzenleuchterfb71f222015-07-09 21:57:28 -0600473}
474
Chia-I Wu9ab61502015-11-06 06:42:02 +0800475LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory mem, VkDeviceSize offset)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600476{
477 const VkLayerDispatchTable *disp;
478
Mark Lobodzinski942b1722015-05-11 17:21:15 -0500479 disp = loader_get_dispatch(device);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600480
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600481 return disp->BindBufferMemory(device, buffer, mem, offset);
482}
483
Chia-I Wu9ab61502015-11-06 06:42:02 +0800484LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory mem, VkDeviceSize offset)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600485{
486 const VkLayerDispatchTable *disp;
487
488 disp = loader_get_dispatch(device);
489
490 return disp->BindImageMemory(device, image, mem, offset);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600491}
492
Chia-I Wu9ab61502015-11-06 06:42:02 +0800493LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements)
Jon Ashburn754864f2015-07-23 18:49:07 -0600494{
495 const VkLayerDispatchTable *disp;
496
497 disp = loader_get_dispatch(device);
498
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600499 disp->GetBufferMemoryRequirements(device, buffer, pMemoryRequirements);
Jon Ashburn754864f2015-07-23 18:49:07 -0600500}
501
Chia-I Wu9ab61502015-11-06 06:42:02 +0800502LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements)
Jon Ashburn754864f2015-07-23 18:49:07 -0600503{
504 const VkLayerDispatchTable *disp;
505
506 disp = loader_get_dispatch(device);
507
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600508 disp->GetImageMemoryRequirements(device, image, pMemoryRequirements);
Jon Ashburn754864f2015-07-23 18:49:07 -0600509}
510
Chia-I Wu9ab61502015-11-06 06:42:02 +0800511LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements* pSparseMemoryRequirements)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600512{
513 const VkLayerDispatchTable *disp;
514
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600515 disp = loader_get_dispatch(device);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600516
Chia-I Wud50a7d72015-10-26 20:48:51 +0800517 disp->GetImageSparseMemoryRequirements(device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600518}
519
Chia-I Wu9ab61502015-11-06 06:42:02 +0800520LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t* pPropertyCount, VkSparseImageFormatProperties* pProperties)
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600521{
522 const VkLayerInstanceDispatchTable *disp;
523
524 disp = loader_get_instance_dispatch(physicalDevice);
525
Chia-I Wud50a7d72015-10-26 20:48:51 +0800526 disp->GetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, pPropertyCount, pProperties);
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600527}
528
Chia-I Wu9ab61502015-11-06 06:42:02 +0800529LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence)
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600530{
531 const VkLayerDispatchTable *disp;
532
533 disp = loader_get_dispatch(queue);
534
Chia-I Wu1ff4c3d2015-10-26 16:55:27 +0800535 return disp->QueueBindSparse(queue, bindInfoCount, pBindInfo, fence);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600536}
537
Chia-I Wu9ab61502015-11-06 06:42:02 +0800538LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateFence(VkDevice device, const VkFenceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600539{
540 const VkLayerDispatchTable *disp;
541
542 disp = loader_get_dispatch(device);
543
Chia-I Wuf7458c52015-10-26 21:10:41 +0800544 return disp->CreateFence(device, pCreateInfo, pAllocator, pFence);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600545}
546
Chia-I Wu9ab61502015-11-06 06:42:02 +0800547LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600548{
549 const VkLayerDispatchTable *disp;
550
551 disp = loader_get_dispatch(device);
552
Chia-I Wuf7458c52015-10-26 21:10:41 +0800553 disp->DestroyFence(device, fence, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600554}
555
Chia-I Wu9ab61502015-11-06 06:42:02 +0800556LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600557{
558 const VkLayerDispatchTable *disp;
559
560 disp = loader_get_dispatch(device);
561
562 return disp->ResetFences(device, fenceCount, pFences);
563}
564
Chia-I Wu9ab61502015-11-06 06:42:02 +0800565LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceStatus(VkDevice device, VkFence fence)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600566{
567 const VkLayerDispatchTable *disp;
568
569 disp = loader_get_dispatch(device);
570
571 return disp->GetFenceStatus(device, fence);
572}
573
Chia-I Wu9ab61502015-11-06 06:42:02 +0800574LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600575{
576 const VkLayerDispatchTable *disp;
577
578 disp = loader_get_dispatch(device);
579
580 return disp->WaitForFences(device, fenceCount, pFences, waitAll, timeout);
581}
582
Chia-I Wu9ab61502015-11-06 06:42:02 +0800583LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSemaphore* pSemaphore)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600584{
585 const VkLayerDispatchTable *disp;
586
587 disp = loader_get_dispatch(device);
588
Chia-I Wuf7458c52015-10-26 21:10:41 +0800589 return disp->CreateSemaphore(device, pCreateInfo, pAllocator, pSemaphore);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600590}
591
Chia-I Wu9ab61502015-11-06 06:42:02 +0800592LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroySemaphore(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600593{
594 const VkLayerDispatchTable *disp;
595
596 disp = loader_get_dispatch(device);
597
Chia-I Wuf7458c52015-10-26 21:10:41 +0800598 disp->DestroySemaphore(device, semaphore, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600599}
600
Chia-I Wu9ab61502015-11-06 06:42:02 +0800601LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateEvent(VkDevice device, const VkEventCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkEvent* pEvent)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600602{
603 const VkLayerDispatchTable *disp;
604
605 disp = loader_get_dispatch(device);
606
Chia-I Wuf7458c52015-10-26 21:10:41 +0800607 return disp->CreateEvent(device, pCreateInfo, pAllocator, pEvent);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600608}
609
Chia-I Wu9ab61502015-11-06 06:42:02 +0800610LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600611{
612 const VkLayerDispatchTable *disp;
613
614 disp = loader_get_dispatch(device);
615
Chia-I Wuf7458c52015-10-26 21:10:41 +0800616 disp->DestroyEvent(device, event, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600617}
618
Chia-I Wu9ab61502015-11-06 06:42:02 +0800619LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetEventStatus(VkDevice device, VkEvent event)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600620{
621 const VkLayerDispatchTable *disp;
622
623 disp = loader_get_dispatch(device);
624
625 return disp->GetEventStatus(device, event);
626}
627
Chia-I Wu9ab61502015-11-06 06:42:02 +0800628LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkSetEvent(VkDevice device, VkEvent event)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600629{
630 const VkLayerDispatchTable *disp;
631
632 disp = loader_get_dispatch(device);
633
634 return disp->SetEvent(device, event);
635}
636
Chia-I Wu9ab61502015-11-06 06:42:02 +0800637LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkResetEvent(VkDevice device, VkEvent event)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600638{
639 const VkLayerDispatchTable *disp;
640
641 disp = loader_get_dispatch(device);
642
643 return disp->ResetEvent(device, event);
644}
645
Chia-I Wu9ab61502015-11-06 06:42:02 +0800646LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkQueryPool* pQueryPool)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600647{
648 const VkLayerDispatchTable *disp;
649
650 disp = loader_get_dispatch(device);
651
Chia-I Wuf7458c52015-10-26 21:10:41 +0800652 return disp->CreateQueryPool(device, pCreateInfo, pAllocator, pQueryPool);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600653}
654
Chia-I Wu9ab61502015-11-06 06:42:02 +0800655LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyQueryPool(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600656{
657 const VkLayerDispatchTable *disp;
658
659 disp = loader_get_dispatch(device);
660
Chia-I Wuf7458c52015-10-26 21:10:41 +0800661 disp->DestroyQueryPool(device, queryPool, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600662}
663
Jon Ashburn19d3bf12015-12-30 14:06:55 -0700664LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void* pData, VkDeviceSize stride, VkQueryResultFlags flags)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600665{
666 const VkLayerDispatchTable *disp;
667
668 disp = loader_get_dispatch(device);
669
Jon Ashburn19d3bf12015-12-30 14:06:55 -0700670 return disp->GetQueryPoolResults(device, queryPool, firstQuery, queryCount, dataSize, pData, stride, flags);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600671}
672
Chia-I Wu9ab61502015-11-06 06:42:02 +0800673LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600674{
675 const VkLayerDispatchTable *disp;
676
677 disp = loader_get_dispatch(device);
678
Chia-I Wuf7458c52015-10-26 21:10:41 +0800679 return disp->CreateBuffer(device, pCreateInfo, pAllocator, pBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600680}
681
Chia-I Wu9ab61502015-11-06 06:42:02 +0800682LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600683{
684 const VkLayerDispatchTable *disp;
685
686 disp = loader_get_dispatch(device);
687
Chia-I Wuf7458c52015-10-26 21:10:41 +0800688 disp->DestroyBuffer(device, buffer, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600689}
690
Chia-I Wu9ab61502015-11-06 06:42:02 +0800691LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateBufferView(VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBufferView* pView)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600692{
693 const VkLayerDispatchTable *disp;
694
695 disp = loader_get_dispatch(device);
696
Chia-I Wuf7458c52015-10-26 21:10:41 +0800697 return disp->CreateBufferView(device, pCreateInfo, pAllocator, pView);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600698}
699
Chia-I Wu9ab61502015-11-06 06:42:02 +0800700LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyBufferView(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600701{
702 const VkLayerDispatchTable *disp;
703
704 disp = loader_get_dispatch(device);
705
Chia-I Wuf7458c52015-10-26 21:10:41 +0800706 disp->DestroyBufferView(device, bufferView, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600707}
708
Chia-I Wu9ab61502015-11-06 06:42:02 +0800709LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImage* pImage)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600710{
711 const VkLayerDispatchTable *disp;
712
713 disp = loader_get_dispatch(device);
714
Chia-I Wuf7458c52015-10-26 21:10:41 +0800715 return disp->CreateImage(device, pCreateInfo, pAllocator, pImage);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600716}
717
Chia-I Wu9ab61502015-11-06 06:42:02 +0800718LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600719{
720 const VkLayerDispatchTable *disp;
721
722 disp = loader_get_dispatch(device);
723
Chia-I Wuf7458c52015-10-26 21:10:41 +0800724 disp->DestroyImage(device, image, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600725}
726
Chia-I Wu9ab61502015-11-06 06:42:02 +0800727LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600728{
729 const VkLayerDispatchTable *disp;
730
731 disp = loader_get_dispatch(device);
732
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600733 disp->GetImageSubresourceLayout(device, image, pSubresource, pLayout);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600734}
735
Chia-I Wu9ab61502015-11-06 06:42:02 +0800736LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateImageView(VkDevice device, const VkImageViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImageView* pView)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600737{
738 const VkLayerDispatchTable *disp;
739
740 disp = loader_get_dispatch(device);
741
Chia-I Wuf7458c52015-10-26 21:10:41 +0800742 return disp->CreateImageView(device, pCreateInfo, pAllocator, pView);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600743}
744
Chia-I Wu9ab61502015-11-06 06:42:02 +0800745LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600746{
747 const VkLayerDispatchTable *disp;
748
749 disp = loader_get_dispatch(device);
750
Chia-I Wuf7458c52015-10-26 21:10:41 +0800751 disp->DestroyImageView(device, imageView, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600752}
753
Chia-I Wu9ab61502015-11-06 06:42:02 +0800754LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkShaderModule* pShader)
Courtney Goeltzenleuchter2d2cb682015-06-24 18:24:19 -0600755{
756 const VkLayerDispatchTable *disp;
757
758 disp = loader_get_dispatch(device);
759
Chia-I Wuf7458c52015-10-26 21:10:41 +0800760 return disp->CreateShaderModule(device, pCreateInfo, pAllocator, pShader);
Courtney Goeltzenleuchter2d2cb682015-06-24 18:24:19 -0600761}
762
Chia-I Wu9ab61502015-11-06 06:42:02 +0800763LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyShaderModule(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600764{
765 const VkLayerDispatchTable *disp;
766
767 disp = loader_get_dispatch(device);
768
Chia-I Wuf7458c52015-10-26 21:10:41 +0800769 disp->DestroyShaderModule(device, shaderModule, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600770}
771
Chia-I Wu9ab61502015-11-06 06:42:02 +0800772LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineCache* pPipelineCache)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600773{
774 const VkLayerDispatchTable *disp;
775
776 disp = loader_get_dispatch(device);
777
Chia-I Wuf7458c52015-10-26 21:10:41 +0800778 return disp->CreatePipelineCache(device, pCreateInfo, pAllocator, pPipelineCache);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600779}
780
Chia-I Wu9ab61502015-11-06 06:42:02 +0800781LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks* pAllocator)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600782{
783 const VkLayerDispatchTable *disp;
784
785 disp = loader_get_dispatch(device);
786
Chia-I Wuf7458c52015-10-26 21:10:41 +0800787 disp->DestroyPipelineCache(device, pipelineCache, pAllocator);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600788}
789
Chia-I Wu9ab61502015-11-06 06:42:02 +0800790LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600791{
792 const VkLayerDispatchTable *disp;
793
794 disp = loader_get_dispatch(device);
795
Chia-I Wub16facd2015-10-26 19:17:06 +0800796 return disp->GetPipelineCacheData(device, pipelineCache, pDataSize, pData);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600797}
798
Chia-I Wu9ab61502015-11-06 06:42:02 +0800799LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkMergePipelineCaches(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600800{
801 const VkLayerDispatchTable *disp;
802
803 disp = loader_get_dispatch(device);
804
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800805 return disp->MergePipelineCaches(device, dstCache, srcCacheCount, pSrcCaches);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600806}
807
Chia-I Wu9ab61502015-11-06 06:42:02 +0800808LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600809{
810 const VkLayerDispatchTable *disp;
811
812 disp = loader_get_dispatch(device);
813
Chia-I Wuf7458c52015-10-26 21:10:41 +0800814 return disp->CreateGraphicsPipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines);
Jon Ashburnc669cc62015-07-09 15:02:25 -0600815}
816
Chia-I Wu9ab61502015-11-06 06:42:02 +0800817LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines)
Jon Ashburnc669cc62015-07-09 15:02:25 -0600818{
819 const VkLayerDispatchTable *disp;
820
821 disp = loader_get_dispatch(device);
822
Chia-I Wuf7458c52015-10-26 21:10:41 +0800823 return disp->CreateComputePipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600824}
825
Chia-I Wu9ab61502015-11-06 06:42:02 +0800826LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600827{
828 const VkLayerDispatchTable *disp;
829
830 disp = loader_get_dispatch(device);
831
Chia-I Wuf7458c52015-10-26 21:10:41 +0800832 disp->DestroyPipeline(device, pipeline, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600833}
834
Chia-I Wu9ab61502015-11-06 06:42:02 +0800835LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineLayout* pPipelineLayout)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600836{
837 const VkLayerDispatchTable *disp;
838
839 disp = loader_get_dispatch(device);
840
Chia-I Wuf7458c52015-10-26 21:10:41 +0800841 return disp->CreatePipelineLayout(device, pCreateInfo, pAllocator, pPipelineLayout);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600842}
843
Chia-I Wu9ab61502015-11-06 06:42:02 +0800844LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600845{
846 const VkLayerDispatchTable *disp;
847
848 disp = loader_get_dispatch(device);
849
Chia-I Wuf7458c52015-10-26 21:10:41 +0800850 disp->DestroyPipelineLayout(device, pipelineLayout, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600851}
852
Chia-I Wu9ab61502015-11-06 06:42:02 +0800853LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateSampler(VkDevice device, const VkSamplerCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSampler* pSampler)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600854{
855 const VkLayerDispatchTable *disp;
856
857 disp = loader_get_dispatch(device);
858
Chia-I Wuf7458c52015-10-26 21:10:41 +0800859 return disp->CreateSampler(device, pCreateInfo, pAllocator, pSampler);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600860}
861
Chia-I Wu9ab61502015-11-06 06:42:02 +0800862LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600863{
864 const VkLayerDispatchTable *disp;
865
866 disp = loader_get_dispatch(device);
867
Chia-I Wuf7458c52015-10-26 21:10:41 +0800868 disp->DestroySampler(device, sampler, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600869}
870
871
Chia-I Wu9ab61502015-11-06 06:42:02 +0800872LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorSetLayout* pSetLayout)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600873{
874 const VkLayerDispatchTable *disp;
875
876 disp = loader_get_dispatch(device);
877
Chia-I Wuf7458c52015-10-26 21:10:41 +0800878 return disp->CreateDescriptorSetLayout(device, pCreateInfo, pAllocator, pSetLayout);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600879}
880
Chia-I Wu9ab61502015-11-06 06:42:02 +0800881LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600882{
883 const VkLayerDispatchTable *disp;
884
885 disp = loader_get_dispatch(device);
886
Chia-I Wuf7458c52015-10-26 21:10:41 +0800887 disp->DestroyDescriptorSetLayout(device, descriptorSetLayout, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600888}
889
Chia-I Wu9ab61502015-11-06 06:42:02 +0800890LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorPool* pDescriptorPool)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600891{
892 const VkLayerDispatchTable *disp;
893
894 disp = loader_get_dispatch(device);
895
Chia-I Wuf7458c52015-10-26 21:10:41 +0800896 return disp->CreateDescriptorPool(device, pCreateInfo, pAllocator, pDescriptorPool);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600897}
898
Chia-I Wu9ab61502015-11-06 06:42:02 +0800899LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600900{
901 const VkLayerDispatchTable *disp;
902
903 disp = loader_get_dispatch(device);
904
Chia-I Wuf7458c52015-10-26 21:10:41 +0800905 disp->DestroyDescriptorPool(device, descriptorPool, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600906}
907
908
Chia-I Wu9ab61502015-11-06 06:42:02 +0800909LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600910{
911 const VkLayerDispatchTable *disp;
912
913 disp = loader_get_dispatch(device);
914
Courtney Goeltzenleuchterbee18a92015-10-23 14:21:05 -0600915 return disp->ResetDescriptorPool(device, descriptorPool, flags);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600916}
917
Chia-I Wu9ab61502015-11-06 06:42:02 +0800918LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkAllocateDescriptorSets(VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600919{
920 const VkLayerDispatchTable *disp;
921
922 disp = loader_get_dispatch(device);
923
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800924 return disp->AllocateDescriptorSets(device, pAllocateInfo, pDescriptorSets);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600925}
926
Chia-I Wu9ab61502015-11-06 06:42:02 +0800927LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets)
Tony Barbour34ec6922015-07-10 10:50:45 -0600928{
929 const VkLayerDispatchTable *disp;
930
931 disp = loader_get_dispatch(device);
932
Chia-I Wud50a7d72015-10-26 20:48:51 +0800933 return disp->FreeDescriptorSets(device, descriptorPool, descriptorSetCount, pDescriptorSets);
Tony Barbour34ec6922015-07-10 10:50:45 -0600934}
935
Chia-I Wu9ab61502015-11-06 06:42:02 +0800936LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet* pDescriptorCopies)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600937{
938 const VkLayerDispatchTable *disp;
939
940 disp = loader_get_dispatch(device);
941
Chia-I Wu40cf0ae2015-10-26 17:20:32 +0800942 disp->UpdateDescriptorSets(device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, pDescriptorCopies);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600943}
944
Chia-I Wu9ab61502015-11-06 06:42:02 +0800945LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFramebuffer* pFramebuffer)
Jon Ashburn754864f2015-07-23 18:49:07 -0600946{
947 const VkLayerDispatchTable *disp;
948
949 disp = loader_get_dispatch(device);
950
Chia-I Wuf7458c52015-10-26 21:10:41 +0800951 return disp->CreateFramebuffer(device, pCreateInfo, pAllocator, pFramebuffer);
Jon Ashburn754864f2015-07-23 18:49:07 -0600952}
953
Chia-I Wu9ab61502015-11-06 06:42:02 +0800954LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* pAllocator)
Jon Ashburn754864f2015-07-23 18:49:07 -0600955{
956 const VkLayerDispatchTable *disp;
957
958 disp = loader_get_dispatch(device);
959
Chia-I Wuf7458c52015-10-26 21:10:41 +0800960 disp->DestroyFramebuffer(device, framebuffer, pAllocator);
Jon Ashburn754864f2015-07-23 18:49:07 -0600961}
962
Chia-I Wu9ab61502015-11-06 06:42:02 +0800963LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass)
Jon Ashburn754864f2015-07-23 18:49:07 -0600964{
965 const VkLayerDispatchTable *disp;
966
967 disp = loader_get_dispatch(device);
968
Chia-I Wuf7458c52015-10-26 21:10:41 +0800969 return disp->CreateRenderPass(device, pCreateInfo, pAllocator, pRenderPass);
Jon Ashburn754864f2015-07-23 18:49:07 -0600970}
971
Chia-I Wu9ab61502015-11-06 06:42:02 +0800972LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator)
Jon Ashburn754864f2015-07-23 18:49:07 -0600973{
974 const VkLayerDispatchTable *disp;
975
976 disp = loader_get_dispatch(device);
977
Chia-I Wuf7458c52015-10-26 21:10:41 +0800978 disp->DestroyRenderPass(device, renderPass, pAllocator);
Jon Ashburn754864f2015-07-23 18:49:07 -0600979}
980
Chia-I Wu9ab61502015-11-06 06:42:02 +0800981LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity)
Jon Ashburn754864f2015-07-23 18:49:07 -0600982{
983 const VkLayerDispatchTable *disp;
984
985 disp = loader_get_dispatch(device);
986
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600987 disp->GetRenderAreaGranularity(device, renderPass, pGranularity);
Jon Ashburn754864f2015-07-23 18:49:07 -0600988}
989
Chia-I Wu9ab61502015-11-06 06:42:02 +0800990LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool)
Cody Northrope62183e2015-07-09 18:08:05 -0600991{
992 const VkLayerDispatchTable *disp;
993
994 disp = loader_get_dispatch(device);
995
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800996 return disp->CreateCommandPool(device, pCreateInfo, pAllocator, pCommandPool);
Cody Northrope62183e2015-07-09 18:08:05 -0600997}
998
Chia-I Wu9ab61502015-11-06 06:42:02 +0800999LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyCommandPool(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks* pAllocator)
Cody Northrope62183e2015-07-09 18:08:05 -06001000{
1001 const VkLayerDispatchTable *disp;
1002
1003 disp = loader_get_dispatch(device);
1004
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001005 disp->DestroyCommandPool(device, commandPool, pAllocator);
Cody Northrope62183e2015-07-09 18:08:05 -06001006}
1007
Chia-I Wu9ab61502015-11-06 06:42:02 +08001008LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags)
Cody Northrope62183e2015-07-09 18:08:05 -06001009{
1010 const VkLayerDispatchTable *disp;
1011
1012 disp = loader_get_dispatch(device);
1013
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001014 return disp->ResetCommandPool(device, commandPool, flags);
Cody Northrope62183e2015-07-09 18:08:05 -06001015}
1016
Chia-I Wu9ab61502015-11-06 06:42:02 +08001017LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkAllocateCommandBuffers(
Courtney Goeltzenleuchterbee18a92015-10-23 14:21:05 -06001018 VkDevice device,
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001019 const VkCommandBufferAllocateInfo* pAllocateInfo,
1020 VkCommandBuffer* pCommandBuffers)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001021{
1022 const VkLayerDispatchTable *disp;
1023 VkResult res;
1024
1025 disp = loader_get_dispatch(device);
1026
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001027 res = disp->AllocateCommandBuffers(device, pAllocateInfo, pCommandBuffers);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001028 if (res == VK_SUCCESS) {
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001029 for (uint32_t i =0; i < pAllocateInfo->bufferCount; i++) {
1030 if (pCommandBuffers[i]) {
1031 loader_init_dispatch(pCommandBuffers[i], disp);
Courtney Goeltzenleuchterbee18a92015-10-23 14:21:05 -06001032 }
1033 }
Jon Ashburnd55a3942015-05-06 09:02:10 -06001034 }
1035
1036 return res;
1037}
1038
Chia-I Wu9ab61502015-11-06 06:42:02 +08001039LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkFreeCommandBuffers(
Courtney Goeltzenleuchterbee18a92015-10-23 14:21:05 -06001040 VkDevice device,
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001041 VkCommandPool commandPool,
Chia-I Wud50a7d72015-10-26 20:48:51 +08001042 uint32_t commandBufferCount,
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001043 const VkCommandBuffer* pCommandBuffers)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001044{
1045 const VkLayerDispatchTable *disp;
1046
1047 disp = loader_get_dispatch(device);
1048
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001049 disp->FreeCommandBuffers(device, commandPool, commandBufferCount, pCommandBuffers);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001050}
1051
Chia-I Wu9ab61502015-11-06 06:42:02 +08001052LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkBeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo* pBeginInfo)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001053{
1054 const VkLayerDispatchTable *disp;
1055
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001056 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001057
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001058 return disp->BeginCommandBuffer(commandBuffer, pBeginInfo);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001059}
1060
Chia-I Wu9ab61502015-11-06 06:42:02 +08001061LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEndCommandBuffer(VkCommandBuffer commandBuffer)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001062{
1063 const VkLayerDispatchTable *disp;
1064
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001065 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001066
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001067 return disp->EndCommandBuffer(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001068}
1069
Chia-I Wu9ab61502015-11-06 06:42:02 +08001070LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkResetCommandBuffer(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001071{
1072 const VkLayerDispatchTable *disp;
1073
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001074 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001075
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001076 return disp->ResetCommandBuffer(commandBuffer, flags);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001077}
1078
Chia-I Wu9ab61502015-11-06 06:42:02 +08001079LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001080{
1081 const VkLayerDispatchTable *disp;
1082
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001083 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001084
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001085 disp->CmdBindPipeline(commandBuffer, pipelineBindPoint, pipeline);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001086}
1087
Jon Ashburn19d3bf12015-12-30 14:06:55 -07001088LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport* pViewports)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001089{
1090 const VkLayerDispatchTable *disp;
1091
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001092 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001093
Jon Ashburn19d3bf12015-12-30 14:06:55 -07001094 disp->CmdSetViewport(commandBuffer, firstViewport, viewportCount, pViewports);
Courtney Goeltzenleuchter078f8172015-09-21 11:44:06 -06001095}
1096
Jon Ashburn19d3bf12015-12-30 14:06:55 -07001097LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D* pScissors)
Courtney Goeltzenleuchter078f8172015-09-21 11:44:06 -06001098{
1099 const VkLayerDispatchTable *disp;
1100
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001101 disp = loader_get_dispatch(commandBuffer);
Courtney Goeltzenleuchter078f8172015-09-21 11:44:06 -06001102
Jon Ashburn19d3bf12015-12-30 14:06:55 -07001103 disp->CmdSetScissor(commandBuffer, firstScissor, scissorCount, pScissors);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001104}
1105
Chia-I Wu9ab61502015-11-06 06:42:02 +08001106LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001107{
1108 const VkLayerDispatchTable *disp;
1109
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001110 disp = loader_get_dispatch(commandBuffer);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001111
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001112 disp->CmdSetLineWidth(commandBuffer, lineWidth);
Cody Northrop12365112015-08-17 11:10:49 -06001113}
1114
Chia-I Wu9ab61502015-11-06 06:42:02 +08001115LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor)
Cody Northrop12365112015-08-17 11:10:49 -06001116{
1117 const VkLayerDispatchTable *disp;
1118
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001119 disp = loader_get_dispatch(commandBuffer);
Cody Northrop12365112015-08-17 11:10:49 -06001120
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001121 disp->CmdSetDepthBias(commandBuffer, depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001122}
1123
Chia-I Wu9ab61502015-11-06 06:42:02 +08001124LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetBlendConstants(VkCommandBuffer commandBuffer, const float blendConstants[4])
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001125{
1126 const VkLayerDispatchTable *disp;
1127
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001128 disp = loader_get_dispatch(commandBuffer);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001129
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001130 disp->CmdSetBlendConstants(commandBuffer, blendConstants);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001131}
1132
Chia-I Wu9ab61502015-11-06 06:42:02 +08001133LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001134{
1135 const VkLayerDispatchTable *disp;
1136
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001137 disp = loader_get_dispatch(commandBuffer);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001138
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001139 disp->CmdSetDepthBounds(commandBuffer, minDepthBounds, maxDepthBounds);
Cody Northrop82485a82015-08-18 15:21:16 -06001140}
1141
Chia-I Wu9ab61502015-11-06 06:42:02 +08001142LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilCompareMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask)
Cody Northrop82485a82015-08-18 15:21:16 -06001143{
1144 const VkLayerDispatchTable *disp;
1145
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001146 disp = loader_get_dispatch(commandBuffer);
Cody Northrop82485a82015-08-18 15:21:16 -06001147
Chia-I Wu1b99bb22015-10-27 19:25:11 +08001148 disp->CmdSetStencilCompareMask(commandBuffer, faceMask, compareMask);
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001149}
1150
Chia-I Wu9ab61502015-11-06 06:42:02 +08001151LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilWriteMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask)
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001152{
1153 const VkLayerDispatchTable *disp;
1154
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001155 disp = loader_get_dispatch(commandBuffer);
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001156
Chia-I Wu1b99bb22015-10-27 19:25:11 +08001157 disp->CmdSetStencilWriteMask(commandBuffer, faceMask, writeMask);
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001158}
1159
Chia-I Wu9ab61502015-11-06 06:42:02 +08001160LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilReference(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference)
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001161{
1162 const VkLayerDispatchTable *disp;
1163
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001164 disp = loader_get_dispatch(commandBuffer);
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001165
Chia-I Wu1b99bb22015-10-27 19:25:11 +08001166 disp->CmdSetStencilReference(commandBuffer, faceMask, reference);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001167}
1168
Chia-I Wu9ab61502015-11-06 06:42:02 +08001169LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBindDescriptorSets(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001170{
1171 const VkLayerDispatchTable *disp;
1172
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001173 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001174
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001175 disp->CmdBindDescriptorSets(commandBuffer, pipelineBindPoint, layout, firstSet, descriptorSetCount, pDescriptorSets, dynamicOffsetCount, pDynamicOffsets);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001176}
1177
Chia-I Wu9ab61502015-11-06 06:42:02 +08001178LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001179{
1180 const VkLayerDispatchTable *disp;
1181
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001182 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001183
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001184 disp->CmdBindIndexBuffer(commandBuffer, buffer, offset, indexType);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001185}
1186
Jon Ashburn19d3bf12015-12-30 14:06:55 -07001187LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets)
Jon Ashburn754864f2015-07-23 18:49:07 -06001188{
1189 const VkLayerDispatchTable *disp;
1190
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001191 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn754864f2015-07-23 18:49:07 -06001192
Jon Ashburn19d3bf12015-12-30 14:06:55 -07001193 disp->CmdBindVertexBuffers(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets);
Jon Ashburn754864f2015-07-23 18:49:07 -06001194}
1195
Chia-I Wu9ab61502015-11-06 06:42:02 +08001196LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001197{
1198 const VkLayerDispatchTable *disp;
1199
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001200 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001201
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001202 disp->CmdDraw(commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001203}
1204
Chia-I Wu9ab61502015-11-06 06:42:02 +08001205LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001206{
1207 const VkLayerDispatchTable *disp;
1208
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001209 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001210
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001211 disp->CmdDrawIndexed(commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001212}
1213
Chia-I Wu9ab61502015-11-06 06:42:02 +08001214LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001215{
1216 const VkLayerDispatchTable *disp;
1217
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001218 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001219
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001220 disp->CmdDrawIndirect(commandBuffer, buffer, offset, drawCount, stride);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001221}
1222
Chia-I Wu9ab61502015-11-06 06:42:02 +08001223LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001224{
1225 const VkLayerDispatchTable *disp;
1226
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001227 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001228
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001229 disp->CmdDrawIndexedIndirect(commandBuffer, buffer, offset, drawCount, stride);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001230}
1231
Chia-I Wu9ab61502015-11-06 06:42:02 +08001232LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdDispatch(VkCommandBuffer commandBuffer, uint32_t x, uint32_t y, uint32_t z)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001233{
1234 const VkLayerDispatchTable *disp;
1235
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001236 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001237
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001238 disp->CmdDispatch(commandBuffer, x, y, z);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001239}
1240
Chia-I Wu9ab61502015-11-06 06:42:02 +08001241LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001242{
1243 const VkLayerDispatchTable *disp;
1244
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001245 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001246
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001247 disp->CmdDispatchIndirect(commandBuffer, buffer, offset);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001248}
1249
Chia-I Wu9ab61502015-11-06 06:42:02 +08001250LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy* pRegions)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001251{
1252 const VkLayerDispatchTable *disp;
1253
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001254 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001255
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001256 disp->CmdCopyBuffer(commandBuffer, srcBuffer, dstBuffer, regionCount, pRegions);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001257}
1258
Chia-I Wu9ab61502015-11-06 06:42:02 +08001259LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy* pRegions)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001260{
1261 const VkLayerDispatchTable *disp;
1262
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001263 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001264
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001265 disp->CmdCopyImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001266}
1267
Chia-I Wu9ab61502015-11-06 06:42:02 +08001268LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageBlit* pRegions, VkFilter filter)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001269{
1270 const VkLayerDispatchTable *disp;
1271
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001272 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001273
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001274 disp->CmdBlitImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions, filter);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001275}
1276
Chia-I Wu9ab61502015-11-06 06:42:02 +08001277LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001278{
1279 const VkLayerDispatchTable *disp;
1280
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001281 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001282
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001283 disp->CmdCopyBufferToImage(commandBuffer, srcBuffer, dstImage, dstImageLayout, regionCount, pRegions);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001284}
1285
Chia-I Wu9ab61502015-11-06 06:42:02 +08001286LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001287{
1288 const VkLayerDispatchTable *disp;
1289
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001290 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001291
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001292 disp->CmdCopyImageToBuffer(commandBuffer, srcImage, srcImageLayout, dstBuffer, regionCount, pRegions);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001293}
1294
Chia-I Wu9ab61502015-11-06 06:42:02 +08001295LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const uint32_t* pData)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001296{
1297 const VkLayerDispatchTable *disp;
1298
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001299 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001300
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001301 disp->CmdUpdateBuffer(commandBuffer, dstBuffer, dstOffset, dataSize, pData);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001302}
1303
Chia-I Wu9ab61502015-11-06 06:42:02 +08001304LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001305{
1306 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
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001310 disp->CmdFillBuffer(commandBuffer, dstBuffer, dstOffset, size, data);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001311}
1312
Chia-I Wu9ab61502015-11-06 06:42:02 +08001313LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001314{
1315 const VkLayerDispatchTable *disp;
1316
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001317 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001318
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001319 disp->CmdClearColorImage(commandBuffer, image, imageLayout, pColor, rangeCount, pRanges);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001320}
1321
Chia-I Wu9ab61502015-11-06 06:42:02 +08001322LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001323{
1324 const VkLayerDispatchTable *disp;
1325
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001326 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001327
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001328 disp->CmdClearDepthStencilImage(commandBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges);
Chris Forbesd9be82b2015-06-22 17:21:59 +12001329}
1330
Chia-I Wu9ab61502015-11-06 06:42:02 +08001331LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkClearAttachment* pAttachments, uint32_t rectCount, const VkClearRect* pRects)
Chris Forbesd9be82b2015-06-22 17:21:59 +12001332{
1333 const VkLayerDispatchTable *disp;
1334
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001335 disp = loader_get_dispatch(commandBuffer);
Chris Forbesd9be82b2015-06-22 17:21:59 +12001336
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001337 disp->CmdClearAttachments(commandBuffer, attachmentCount, pAttachments, rectCount, pRects);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001338}
1339
Chia-I Wu9ab61502015-11-06 06:42:02 +08001340LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve* pRegions)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001341{
1342 const VkLayerDispatchTable *disp;
1343
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001344 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001345
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001346 disp->CmdResolveImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001347}
1348
Chia-I Wu9ab61502015-11-06 06:42:02 +08001349LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001350{
1351 const VkLayerDispatchTable *disp;
1352
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001353 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001354
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001355 disp->CmdSetEvent(commandBuffer, event, stageMask);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001356}
1357
Chia-I Wu9ab61502015-11-06 06:42:02 +08001358LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001359{
1360 const VkLayerDispatchTable *disp;
1361
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001362 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001363
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001364 disp->CmdResetEvent(commandBuffer, event, stageMask);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001365}
1366
Chia-I Wu9ab61502015-11-06 06:42:02 +08001367LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, VkPipelineStageFlags sourceStageMask, VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const void* const* ppMemoryBarriers)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001368{
1369 const VkLayerDispatchTable *disp;
1370
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001371 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001372
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001373 disp->CmdWaitEvents(commandBuffer, eventCount, pEvents, sourceStageMask, dstStageMask, memoryBarrierCount, ppMemoryBarriers);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001374}
1375
Chia-I Wu9ab61502015-11-06 06:42:02 +08001376LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const void* const* ppMemoryBarriers)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001377{
1378 const VkLayerDispatchTable *disp;
1379
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001380 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001381
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001382 disp->CmdPipelineBarrier(commandBuffer, srcStageMask, dstStageMask, dependencyFlags, memoryBarrierCount, ppMemoryBarriers);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001383}
1384
Chia-I Wu9ab61502015-11-06 06:42:02 +08001385LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t slot, VkFlags flags)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001386{
1387 const VkLayerDispatchTable *disp;
1388
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001389 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001390
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001391 disp->CmdBeginQuery(commandBuffer, queryPool, slot, flags);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001392}
1393
Chia-I Wu9ab61502015-11-06 06:42:02 +08001394LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t slot)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001395{
1396 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->CmdEndQuery(commandBuffer, queryPool, slot);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001401}
1402
Jon Ashburn19d3bf12015-12-30 14:06:55 -07001403LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001404{
1405 const VkLayerDispatchTable *disp;
1406
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001407 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001408
Jon Ashburn19d3bf12015-12-30 14:06:55 -07001409 disp->CmdResetQueryPool(commandBuffer, queryPool, firstQuery, queryCount);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001410}
1411
Chia-I Wu9ab61502015-11-06 06:42:02 +08001412LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t slot)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001413{
1414 const VkLayerDispatchTable *disp;
1415
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001416 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001417
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001418 disp->CmdWriteTimestamp(commandBuffer, pipelineStage, queryPool, slot);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001419}
1420
Jon Ashburn19d3bf12015-12-30 14:06:55 -07001421LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkFlags flags)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001422{
1423 const VkLayerDispatchTable *disp;
1424
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001425 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001426
Jon Ashburn19d3bf12015-12-30 14:06:55 -07001427 disp->CmdCopyQueryPoolResults(commandBuffer, queryPool, firstQuery, queryCount, dstBuffer, dstOffset, stride, flags);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001428}
1429
Chia-I Wuce9b1772015-11-12 06:09:22 +08001430LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void* pValues)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001431{
1432 const VkLayerDispatchTable *disp;
1433
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001434 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001435
Chia-I Wuce9b1772015-11-12 06:09:22 +08001436 disp->CmdPushConstants(commandBuffer, layout, stageFlags, offset, size, pValues);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001437}
1438
Chia-I Wu9ab61502015-11-06 06:42:02 +08001439LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkSubpassContents contents)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001440{
1441 const VkLayerDispatchTable *disp;
1442
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001443 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001444
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001445 disp->CmdBeginRenderPass(commandBuffer, pRenderPassBegin, contents);
Chia-I Wu08accc62015-07-07 11:50:03 +08001446}
1447
Chia-I Wu9ab61502015-11-06 06:42:02 +08001448LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents)
Chia-I Wu08accc62015-07-07 11:50:03 +08001449{
1450 const VkLayerDispatchTable *disp;
1451
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001452 disp = loader_get_dispatch(commandBuffer);
Chia-I Wu08accc62015-07-07 11:50:03 +08001453
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001454 disp->CmdNextSubpass(commandBuffer, contents);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001455}
1456
Chia-I Wu9ab61502015-11-06 06:42:02 +08001457LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdEndRenderPass(VkCommandBuffer commandBuffer)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001458{
1459 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
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001463 disp->CmdEndRenderPass(commandBuffer);
Chia-I Wu0b50a1c2015-06-26 15:34:39 +08001464}
1465
Chia-I Wu9ab61502015-11-06 06:42:02 +08001466LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBuffersCount, const VkCommandBuffer* pCommandBuffers)
Chia-I Wu0b50a1c2015-06-26 15:34:39 +08001467{
1468 const VkLayerDispatchTable *disp;
1469
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001470 disp = loader_get_dispatch(commandBuffer);
Chia-I Wu0b50a1c2015-06-26 15:34:39 +08001471
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001472 disp->CmdExecuteCommands(commandBuffer, commandBuffersCount, pCommandBuffers);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001473}