blob: 9cca6aa936b0081ffa117075c2037eb1ae3aa55a [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 Ashburne5b9bba2016-01-18 12:20:03 -070046 VkInstance created_instance = VK_NULL_HANDLE;
Jon Ashburn27cd5842015-05-12 17:26:48 -060047 VkResult res = VK_ERROR_INITIALIZATION_FAILED;
Courtney Goeltzenleuchter7415d5a2015-12-09 15:48:16 -070048 VkDebugReportCallbackEXT instance_callback = VK_NULL_HANDLE;
Courtney Goeltzenleuchter82887272015-12-02 15:29:33 -070049 void *pNext = (void *) pCreateInfo->pNext;
Jon Ashburn27cd5842015-05-12 17:26:48 -060050
Jon Ashburn8810c5f2015-08-18 18:04:47 -060051 loader_platform_thread_once(&once_init, loader_initialize);
Jon Ashburn27cd5842015-05-12 17:26:48 -060052
Jon Ashburnf9af1d32016-01-25 14:51:47 -070053#if 0
54 if (pAllocator) {
Chia-I Wu3432a0c2015-10-27 18:04:07 +080055 ptr_instance = (struct loader_instance *) pAllocator->pfnAllocation(
Chia-I Wuf7458c52015-10-26 21:10:41 +080056 pAllocator->pUserData,
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -060057 sizeof(struct loader_instance),
Jon Ashburn6a118ae2016-01-07 15:21:14 -070058 sizeof(int *),
Chia-I Wu3432a0c2015-10-27 18:04:07 +080059 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -060060 } else {
Jon Ashburnf9af1d32016-01-25 14:51:47 -070061#endif
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -060062 ptr_instance = (struct loader_instance *) malloc(sizeof(struct loader_instance));
Jon Ashburnf9af1d32016-01-25 14:51:47 -070063 //}
Jon Ashburn27cd5842015-05-12 17:26:48 -060064 if (ptr_instance == NULL) {
65 return VK_ERROR_OUT_OF_HOST_MEMORY;
66 }
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -060067
Jon Ashburn87d6aa92015-08-28 15:19:27 -060068 tls_instance = ptr_instance;
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -060069 loader_platform_thread_lock_mutex(&loader_lock);
Jon Ashburnb82c1852015-08-11 14:49:54 -060070 memset(ptr_instance, 0, sizeof(struct loader_instance));
Jon Ashburnf9af1d32016-01-25 14:51:47 -070071#if 0
Chia-I Wuf7458c52015-10-26 21:10:41 +080072 if (pAllocator) {
73 ptr_instance->alloc_callbacks = *pAllocator;
Courtney Goeltzenleuchter7f5aafc2015-07-05 11:28:29 -060074 }
Jon Ashburnf9af1d32016-01-25 14:51:47 -070075#endif
Courtney Goeltzenleuchter7f5aafc2015-07-05 11:28:29 -060076
Courtney Goeltzenleuchter45cde5d2015-12-03 13:45:51 -070077 /*
78 * Look for a debug report create info structure
79 * and setup a callback if found.
80 */
81 while (pNext) {
Courtney Goeltzenleuchter7415d5a2015-12-09 15:48:16 -070082 if (((VkInstanceCreateInfo *)pNext)->sType == VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT) {
83 instance_callback = (VkDebugReportCallbackEXT) ptr_instance;
Jon Ashburnf9af1d32016-01-25 14:51:47 -070084 if (util_CreateDebugReportCallback(ptr_instance, pNext, NULL, instance_callback)) {
Courtney Goeltzenleuchter45cde5d2015-12-03 13:45:51 -070085 loader_heap_free(ptr_instance, ptr_instance);
Courtney Goeltzenleuchter82887272015-12-02 15:29:33 -070086 loader_platform_thread_unlock_mutex(&loader_lock);
87 return VK_ERROR_OUT_OF_HOST_MEMORY;
88 }
89 }
Courtney Goeltzenleuchter45cde5d2015-12-03 13:45:51 -070090 pNext = (void *) ((VkInstanceCreateInfo *)pNext)->pNext;
Courtney Goeltzenleuchter82887272015-12-02 15:29:33 -070091 }
92
Jon Ashburn3d002332015-08-20 16:35:30 -060093 /* Due to implicit layers need to get layer list even if
Jon Ashburnf19916e2016-01-11 13:12:43 -070094 * enabledLayerCount == 0 and VK_INSTANCE_LAYERS is unset. For now always
Jon Ashburn3d002332015-08-20 16:35:30 -060095 * get layer list (both instance and device) via loader_layer_scan(). */
96 memset(&ptr_instance->instance_layer_list, 0, sizeof(ptr_instance->instance_layer_list));
97 memset(&ptr_instance->device_layer_list, 0, sizeof(ptr_instance->device_layer_list));
Jon Ashburne39a4f82015-08-28 13:38:21 -060098 loader_layer_scan(ptr_instance,
Jon Ashburne39a4f82015-08-28 13:38:21 -060099 &ptr_instance->instance_layer_list,
100 &ptr_instance->device_layer_list);
Jon Ashburn3d002332015-08-20 16:35:30 -0600101
102 /* validate the app requested layers to be enabled */
Jon Ashburnf19916e2016-01-11 13:12:43 -0700103 if (pCreateInfo->enabledLayerCount > 0) {
104 res = loader_validate_layers(pCreateInfo->enabledLayerCount,
Jon Ashburn3d002332015-08-20 16:35:30 -0600105 pCreateInfo->ppEnabledLayerNames,
106 &ptr_instance->instance_layer_list);
107 if (res != VK_SUCCESS) {
Jon Ashburnf9af1d32016-01-25 14:51:47 -0700108 util_DestroyDebugReportCallback(ptr_instance, instance_callback, NULL);
Courtney Goeltzenleuchter45cde5d2015-12-03 13:45:51 -0700109 loader_heap_free(ptr_instance, ptr_instance);
Jon Ashburn1ff17592015-10-09 09:40:30 -0600110 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburn3d002332015-08-20 16:35:30 -0600111 return res;
112 }
113 }
114
Jon Ashburn8810c5f2015-08-18 18:04:47 -0600115 /* Scan/discover all ICD libraries */
116 memset(&ptr_instance->icd_libs, 0, sizeof(ptr_instance->icd_libs));
Jon Ashburne39a4f82015-08-28 13:38:21 -0600117 loader_icd_scan(ptr_instance, &ptr_instance->icd_libs);
Jon Ashburn8810c5f2015-08-18 18:04:47 -0600118
Jon Ashburneacfa3a2015-08-14 12:51:47 -0600119 /* get extensions from all ICD's, merge so no duplicates, then validate */
Jon Ashburne39a4f82015-08-28 13:38:21 -0600120 loader_get_icd_loader_instance_extensions(ptr_instance,
121 &ptr_instance->icd_libs,
122 &ptr_instance->ext_list);
123 res = loader_validate_instance_extensions(&ptr_instance->ext_list,
124 &ptr_instance->instance_layer_list,
125 pCreateInfo);
Jon Ashburneacfa3a2015-08-14 12:51:47 -0600126 if (res != VK_SUCCESS) {
Jon Ashburne39a4f82015-08-28 13:38:21 -0600127 loader_delete_layer_properties(ptr_instance,
128 &ptr_instance->device_layer_list);
129 loader_delete_layer_properties(ptr_instance,
130 &ptr_instance->instance_layer_list);
131 loader_scanned_icd_clear(ptr_instance, &ptr_instance->icd_libs);
Jon Ashburn6e6a2162015-12-10 08:51:10 -0700132 loader_destroy_generic_list(ptr_instance, (struct loader_generic_list *)
133 &ptr_instance->ext_list);
Jon Ashburnf9af1d32016-01-25 14:51:47 -0700134 util_DestroyDebugReportCallback(ptr_instance, instance_callback, NULL);
Jon Ashburneacfa3a2015-08-14 12:51:47 -0600135 loader_platform_thread_unlock_mutex(&loader_lock);
136 loader_heap_free(ptr_instance, ptr_instance);
137 return res;
138 }
139
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -0600140 ptr_instance->disp = loader_heap_alloc(
141 ptr_instance,
142 sizeof(VkLayerInstanceDispatchTable),
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800143 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -0600144 if (ptr_instance->disp == NULL) {
Jon Ashburne39a4f82015-08-28 13:38:21 -0600145 loader_delete_layer_properties(ptr_instance,
146 &ptr_instance->device_layer_list);
147 loader_delete_layer_properties(ptr_instance,
148 &ptr_instance->instance_layer_list);
149 loader_scanned_icd_clear(ptr_instance,
150 &ptr_instance->icd_libs);
Jon Ashburn6e6a2162015-12-10 08:51:10 -0700151 loader_destroy_generic_list(ptr_instance, (struct loader_generic_list *)
Jon Ashburne39a4f82015-08-28 13:38:21 -0600152 &ptr_instance->ext_list);
Jon Ashburnf9af1d32016-01-25 14:51:47 -0700153 util_DestroyDebugReportCallback(ptr_instance, instance_callback, NULL);
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -0600154 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburneacfa3a2015-08-14 12:51:47 -0600155 loader_heap_free(ptr_instance, ptr_instance);
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -0600156 return VK_ERROR_OUT_OF_HOST_MEMORY;
157 }
158 memcpy(ptr_instance->disp, &instance_disp, sizeof(instance_disp));
159 ptr_instance->next = loader.instances;
160 loader.instances = ptr_instance;
161
Jon Ashburnb82c1852015-08-11 14:49:54 -0600162 /* activate any layers on instance chain */
Jon Ashburne39a4f82015-08-28 13:38:21 -0600163 res = loader_enable_instance_layers(ptr_instance,
164 pCreateInfo,
165 &ptr_instance->instance_layer_list);
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -0600166 if (res != VK_SUCCESS) {
Jon Ashburne39a4f82015-08-28 13:38:21 -0600167 loader_delete_layer_properties(ptr_instance,
168 &ptr_instance->device_layer_list);
169 loader_delete_layer_properties(ptr_instance,
170 &ptr_instance->instance_layer_list);
171 loader_scanned_icd_clear(ptr_instance,
172 &ptr_instance->icd_libs);
Jon Ashburn6e6a2162015-12-10 08:51:10 -0700173 loader_destroy_generic_list(ptr_instance, (struct loader_generic_list *)
Jon Ashburne39a4f82015-08-28 13:38:21 -0600174 &ptr_instance->ext_list);
Jon Ashburneacfa3a2015-08-14 12:51:47 -0600175 loader.instances = ptr_instance->next;
Jon Ashburnf9af1d32016-01-25 14:51:47 -0700176 util_DestroyDebugReportCallback(ptr_instance, instance_callback, NULL);
Jon Ashburneacfa3a2015-08-14 12:51:47 -0600177 loader_platform_thread_unlock_mutex(&loader_lock);
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -0600178 loader_heap_free(ptr_instance, ptr_instance->disp);
179 loader_heap_free(ptr_instance, ptr_instance);
180 return res;
181 }
Jon Ashburn07daee72015-05-21 18:13:33 -0600182
Jon Ashburne5b9bba2016-01-18 12:20:03 -0700183 created_instance = (VkInstance) ptr_instance;
Jon Ashburnccd00a62016-01-27 10:56:10 -0700184 res = loader_create_instance_chain(pCreateInfo, pAllocator, ptr_instance, created_instance);
Jon Ashburneed0c002015-05-21 17:42:17 -0600185
Jon Ashburne46cf7c2016-01-14 13:51:55 -0700186 if (res == VK_SUCCESS) {
Courtney Goeltzenleuchter00150eb2016-01-08 12:18:43 -0700187 wsi_create_instance(ptr_instance, pCreateInfo);
188 debug_report_create_instance(ptr_instance, pCreateInfo);
189
Jon Ashburne5b9bba2016-01-18 12:20:03 -0700190 *pInstance = created_instance;
Courtney Goeltzenleuchter00150eb2016-01-08 12:18:43 -0700191
Jon Ashburne46cf7c2016-01-14 13:51:55 -0700192 /*
193 * Finally have the layers in place and everyone has seen
194 * the CreateInstance command go by. This allows the layer's
195 * GetInstanceProcAddr functions to return valid extension functions
196 * if enabled.
197 */
198 loader_activate_instance_layer_extensions(ptr_instance, *pInstance);
Courtney Goeltzenleuchter00150eb2016-01-08 12:18:43 -0700199 } else {
200 // TODO: cleanup here.
Jon Ashburne46cf7c2016-01-14 13:51:55 -0700201 }
Courtney Goeltzenleuchter00150eb2016-01-08 12:18:43 -0700202
Courtney Goeltzenleuchter45cde5d2015-12-03 13:45:51 -0700203 /* Remove temporary debug_report callback */
Jon Ashburnf9af1d32016-01-25 14:51:47 -0700204 util_DestroyDebugReportCallback(ptr_instance, instance_callback, NULL);
Courtney Goeltzenleuchter45cde5d2015-12-03 13:45:51 -0700205
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600206 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburn27cd5842015-05-12 17:26:48 -0600207 return res;
208}
209
Chia-I Wu9ab61502015-11-06 06:42:02 +0800210LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyInstance(
Chia-I Wuf7458c52015-10-26 21:10:41 +0800211 VkInstance instance,
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800212 const VkAllocationCallbacks* pAllocator)
Jon Ashburn27cd5842015-05-12 17:26:48 -0600213{
214 const VkLayerInstanceDispatchTable *disp;
Jon Ashburne0e64572015-09-30 12:56:42 -0600215 struct loader_instance *ptr_instance = NULL;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600216 disp = loader_get_instance_dispatch(instance);
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -0600217
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600218 loader_platform_thread_lock_mutex(&loader_lock);
219
Courtney Goeltzenleuchter45cde5d2015-12-03 13:45:51 -0700220 /* TODO: Do we need a temporary callback here to catch cleanup issues? */
221
Jon Ashburne0e64572015-09-30 12:56:42 -0600222 ptr_instance = loader_get_instance(instance);
Chia-I Wuf7458c52015-10-26 21:10:41 +0800223 disp->DestroyInstance(instance, pAllocator);
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -0600224
Courtney Goeltzenleuchter7d0023c2015-06-08 15:09:22 -0600225 loader_deactivate_instance_layers(ptr_instance);
Jon Ashburneacfa3a2015-08-14 12:51:47 -0600226 loader_heap_free(ptr_instance, ptr_instance->disp);
227 loader_heap_free(ptr_instance, ptr_instance);
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600228 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburn27cd5842015-05-12 17:26:48 -0600229}
Jon Ashburn95a77ba2015-05-15 15:09:35 -0600230
Chia-I Wu9ab61502015-11-06 06:42:02 +0800231LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDevices(
Jon Ashburn27cd5842015-05-12 17:26:48 -0600232 VkInstance instance,
233 uint32_t* pPhysicalDeviceCount,
234 VkPhysicalDevice* pPhysicalDevices)
235{
236 const VkLayerInstanceDispatchTable *disp;
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600237 VkResult res;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600238 disp = loader_get_instance_dispatch(instance);
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600239
240 loader_platform_thread_lock_mutex(&loader_lock);
241 res = disp->EnumeratePhysicalDevices(instance, pPhysicalDeviceCount,
Jon Ashburn27cd5842015-05-12 17:26:48 -0600242 pPhysicalDevices);
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600243 loader_platform_thread_unlock_mutex(&loader_lock);
244 return res;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600245}
246
Chia-I Wu9ab61502015-11-06 06:42:02 +0800247LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFeatures(
Jon Ashburn754864f2015-07-23 18:49:07 -0600248 VkPhysicalDevice gpu,
249 VkPhysicalDeviceFeatures *pFeatures)
250{
251 const VkLayerInstanceDispatchTable *disp;
Jon Ashburn754864f2015-07-23 18:49:07 -0600252
253 disp = loader_get_instance_dispatch(gpu);
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600254 disp->GetPhysicalDeviceFeatures(gpu, pFeatures);
Jon Ashburn754864f2015-07-23 18:49:07 -0600255}
256
Chia-I Wu9ab61502015-11-06 06:42:02 +0800257LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFormatProperties(
Jon Ashburn754864f2015-07-23 18:49:07 -0600258 VkPhysicalDevice gpu,
259 VkFormat format,
260 VkFormatProperties *pFormatInfo)
261{
262 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
Chia-I Wu9ab61502015-11-06 06:42:02 +0800268LOADER_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 -0600269{
270 const VkLayerInstanceDispatchTable *disp;
Jon Ashburn754864f2015-07-23 18:49:07 -0600271
272 disp = loader_get_instance_dispatch(physicalDevice);
Chia-I Wu17241042015-10-31 00:31:16 +0800273 return disp->GetPhysicalDeviceImageFormatProperties(physicalDevice, format, type, tiling, usage, flags, pImageFormatProperties);
Jon Ashburn754864f2015-07-23 18:49:07 -0600274}
275
Chia-I Wu9ab61502015-11-06 06:42:02 +0800276LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceProperties(
Jon Ashburn27cd5842015-05-12 17:26:48 -0600277 VkPhysicalDevice gpu,
Tony Barbour59a47322015-06-24 16:06:58 -0600278 VkPhysicalDeviceProperties* pProperties)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600279{
Jon Ashburn95a77ba2015-05-15 15:09:35 -0600280 const VkLayerInstanceDispatchTable *disp;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600281
Jon Ashburn95a77ba2015-05-15 15:09:35 -0600282 disp = loader_get_instance_dispatch(gpu);
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600283 disp->GetPhysicalDeviceProperties(gpu, pProperties);
Tony Barbour59a47322015-06-24 16:06:58 -0600284}
285
Chia-I Wu9ab61502015-11-06 06:42:02 +0800286LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties(
Tony Barbour59a47322015-06-24 16:06:58 -0600287 VkPhysicalDevice gpu,
Chia-I Wud50a7d72015-10-26 20:48:51 +0800288 uint32_t* pQueueFamilyPropertyCount,
Cody Northropd0802882015-08-03 17:04:53 -0600289 VkQueueFamilyProperties* pQueueProperties)
Tony Barbour59a47322015-06-24 16:06:58 -0600290{
291 const VkLayerInstanceDispatchTable *disp;
Tony Barbour59a47322015-06-24 16:06:58 -0600292
293 disp = loader_get_instance_dispatch(gpu);
Chia-I Wud50a7d72015-10-26 20:48:51 +0800294 disp->GetPhysicalDeviceQueueFamilyProperties(gpu, pQueueFamilyPropertyCount, pQueueProperties);
Tony Barbour59a47322015-06-24 16:06:58 -0600295}
296
Chia-I Wu9ab61502015-11-06 06:42:02 +0800297LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties(
Tony Barbour59a47322015-06-24 16:06:58 -0600298 VkPhysicalDevice gpu,
299 VkPhysicalDeviceMemoryProperties* pMemoryProperties)
300{
301 const VkLayerInstanceDispatchTable *disp;
Tony Barbour59a47322015-06-24 16:06:58 -0600302
303 disp = loader_get_instance_dispatch(gpu);
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600304 disp->GetPhysicalDeviceMemoryProperties(gpu, pMemoryProperties);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600305}
306
Chia-I Wu9ab61502015-11-06 06:42:02 +0800307LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(
Courtney Goeltzenleuchterca173b82015-06-25 18:01:43 -0600308 VkPhysicalDevice gpu,
309 const VkDeviceCreateInfo* pCreateInfo,
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800310 const VkAllocationCallbacks* pAllocator,
Courtney Goeltzenleuchterca173b82015-06-25 18:01:43 -0600311 VkDevice* pDevice)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600312{
Jon Ashburnd55a3942015-05-06 09:02:10 -0600313 VkResult res;
314
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600315 loader_platform_thread_lock_mutex(&loader_lock);
Courtney Goeltzenleuchterca173b82015-06-25 18:01:43 -0600316
Chia-I Wuf7458c52015-10-26 21:10:41 +0800317 res = loader_CreateDevice(gpu, pCreateInfo, pAllocator, pDevice);
Courtney Goeltzenleuchterca173b82015-06-25 18:01:43 -0600318
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600319 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600320 return res;
321}
322
Chia-I Wu9ab61502015-11-06 06:42:02 +0800323LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyDevice(VkDevice device, const VkAllocationCallbacks* pAllocator)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600324{
325 const VkLayerDispatchTable *disp;
Jon Ashburne39a4f82015-08-28 13:38:21 -0600326 struct loader_device *dev;
327 struct loader_icd *icd = loader_get_icd_and_device(device, &dev);
328 const struct loader_instance *inst = icd->this_instance;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600329 disp = loader_get_dispatch(device);
330
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600331 loader_platform_thread_lock_mutex(&loader_lock);
Chia-I Wuf7458c52015-10-26 21:10:41 +0800332 disp->DestroyDevice(device, pAllocator);
Jon Ashburn781a7ae2015-11-19 15:43:26 -0700333 dev->device = NULL;
334 loader_remove_logical_device(inst, icd, dev);
335
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600336 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600337}
338
Chia-I Wu9ab61502015-11-06 06:42:02 +0800339LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceExtensionProperties(
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600340 VkPhysicalDevice physicalDevice,
341 const char* pLayerName,
Chia-I Wud50a7d72015-10-26 20:48:51 +0800342 uint32_t* pPropertyCount,
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600343 VkExtensionProperties* pProperties)
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600344{
345 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. */
353 if (pLayerName == NULL || strlen(pLayerName) == 0) {
354 const VkLayerInstanceDispatchTable *disp;
355
356 disp = loader_get_instance_dispatch(physicalDevice);
357 res = disp->EnumerateDeviceExtensionProperties(physicalDevice, NULL, pPropertyCount, pProperties);
358 } else {
359 res = loader_EnumerateDeviceExtensionProperties(physicalDevice, pLayerName, pPropertyCount, pProperties);
360 }
361
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600362 loader_platform_thread_unlock_mutex(&loader_lock);
Tony Barbour59a47322015-06-24 16:06:58 -0600363 return res;
364}
365
Chia-I Wu9ab61502015-11-06 06:42:02 +0800366LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceLayerProperties(
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600367 VkPhysicalDevice physicalDevice,
Chia-I Wud50a7d72015-10-26 20:48:51 +0800368 uint32_t* pPropertyCount,
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600369 VkLayerProperties* pProperties)
Tony Barbour59a47322015-06-24 16:06:58 -0600370{
371 VkResult res;
372
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600373 loader_platform_thread_lock_mutex(&loader_lock);
Jon Ashburn00eb6c02015-11-02 17:40:01 -0700374
375 /* Don't dispatch this call down the instance chain, want all device layers
376 enumerated and instance chain may not contain all device layers */
Chia-I Wud50a7d72015-10-26 20:48:51 +0800377 res = loader_EnumerateDeviceLayerProperties(physicalDevice, pPropertyCount, pProperties);
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600378 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburn27cd5842015-05-12 17:26:48 -0600379 return res;
380}
381
Chia-I Wu9ab61502015-11-06 06:42:02 +0800382LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetDeviceQueue(VkDevice device, uint32_t queueNodeIndex, uint32_t queueIndex, VkQueue* pQueue)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600383{
384 const VkLayerDispatchTable *disp;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600385
386 disp = loader_get_dispatch(device);
387
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600388 disp->GetDeviceQueue(device, queueNodeIndex, queueIndex, pQueue);
389 loader_set_dispatch(*pQueue, disp);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600390}
391
Chia-I Wu9ab61502015-11-06 06:42:02 +0800392LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600393{
394 const VkLayerDispatchTable *disp;
395
396 disp = loader_get_dispatch(queue);
397
Chia-I Wu40cf0ae2015-10-26 17:20:32 +0800398 return disp->QueueSubmit(queue, submitCount, pSubmits, fence);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600399}
400
Chia-I Wu9ab61502015-11-06 06:42:02 +0800401LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkQueueWaitIdle(VkQueue queue)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600402{
403 const VkLayerDispatchTable *disp;
404
405 disp = loader_get_dispatch(queue);
406
407 return disp->QueueWaitIdle(queue);
408}
409
Chia-I Wu9ab61502015-11-06 06:42:02 +0800410LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkDeviceWaitIdle(VkDevice device)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600411{
412 const VkLayerDispatchTable *disp;
413
414 disp = loader_get_dispatch(device);
415
416 return disp->DeviceWaitIdle(device);
417}
418
Chia-I Wu9ab61502015-11-06 06:42:02 +0800419LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo, const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600420{
421 const VkLayerDispatchTable *disp;
422
423 disp = loader_get_dispatch(device);
424
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800425 return disp->AllocateMemory(device, pAllocateInfo, pAllocator, pMemory);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600426}
427
Chia-I Wu9ab61502015-11-06 06:42:02 +0800428LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkFreeMemory(VkDevice device, VkDeviceMemory mem, const VkAllocationCallbacks* pAllocator)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600429{
430 const VkLayerDispatchTable *disp;
431
432 disp = loader_get_dispatch(device);
433
Chia-I Wuf7458c52015-10-26 21:10:41 +0800434 disp->FreeMemory(device, mem, pAllocator);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600435}
436
Chia-I Wu9ab61502015-11-06 06:42:02 +0800437LOADER_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 -0600438{
439 const VkLayerDispatchTable *disp;
440
441 disp = loader_get_dispatch(device);
442
443 return disp->MapMemory(device, mem, offset, size, flags, ppData);
444}
445
Chia-I Wu9ab61502015-11-06 06:42:02 +0800446LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkUnmapMemory(VkDevice device, VkDeviceMemory mem)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600447{
448 const VkLayerDispatchTable *disp;
449
450 disp = loader_get_dispatch(device);
451
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600452 disp->UnmapMemory(device, mem);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600453}
454
Chia-I Wu9ab61502015-11-06 06:42:02 +0800455LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkFlushMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600456{
457 const VkLayerDispatchTable *disp;
458
459 disp = loader_get_dispatch(device);
460
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800461 return disp->FlushMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600462}
463
Chia-I Wu9ab61502015-11-06 06:42:02 +0800464LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkInvalidateMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600465{
466 const VkLayerDispatchTable *disp;
467
468 disp = loader_get_dispatch(device);
469
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800470 return disp->InvalidateMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600471}
472
Chia-I Wu9ab61502015-11-06 06:42:02 +0800473LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes)
Courtney Goeltzenleuchterfb71f222015-07-09 21:57:28 -0600474{
475 const VkLayerDispatchTable *disp;
476
477 disp = loader_get_dispatch(device);
478
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600479 disp->GetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes);
Courtney Goeltzenleuchterfb71f222015-07-09 21:57:28 -0600480}
481
Chia-I Wu9ab61502015-11-06 06:42:02 +0800482LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory mem, VkDeviceSize offset)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600483{
484 const VkLayerDispatchTable *disp;
485
Mark Lobodzinski942b1722015-05-11 17:21:15 -0500486 disp = loader_get_dispatch(device);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600487
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600488 return disp->BindBufferMemory(device, buffer, mem, offset);
489}
490
Chia-I Wu9ab61502015-11-06 06:42:02 +0800491LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory mem, VkDeviceSize offset)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600492{
493 const VkLayerDispatchTable *disp;
494
495 disp = loader_get_dispatch(device);
496
497 return disp->BindImageMemory(device, image, mem, offset);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600498}
499
Chia-I Wu9ab61502015-11-06 06:42:02 +0800500LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements)
Jon Ashburn754864f2015-07-23 18:49:07 -0600501{
502 const VkLayerDispatchTable *disp;
503
504 disp = loader_get_dispatch(device);
505
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600506 disp->GetBufferMemoryRequirements(device, buffer, pMemoryRequirements);
Jon Ashburn754864f2015-07-23 18:49:07 -0600507}
508
Chia-I Wu9ab61502015-11-06 06:42:02 +0800509LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements)
Jon Ashburn754864f2015-07-23 18:49:07 -0600510{
511 const VkLayerDispatchTable *disp;
512
513 disp = loader_get_dispatch(device);
514
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600515 disp->GetImageMemoryRequirements(device, image, pMemoryRequirements);
Jon Ashburn754864f2015-07-23 18:49:07 -0600516}
517
Chia-I Wu9ab61502015-11-06 06:42:02 +0800518LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements* pSparseMemoryRequirements)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600519{
520 const VkLayerDispatchTable *disp;
521
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600522 disp = loader_get_dispatch(device);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600523
Chia-I Wud50a7d72015-10-26 20:48:51 +0800524 disp->GetImageSparseMemoryRequirements(device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600525}
526
Chia-I Wu9ab61502015-11-06 06:42:02 +0800527LOADER_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 -0600528{
529 const VkLayerInstanceDispatchTable *disp;
530
531 disp = loader_get_instance_dispatch(physicalDevice);
532
Chia-I Wud50a7d72015-10-26 20:48:51 +0800533 disp->GetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, pPropertyCount, pProperties);
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600534}
535
Chia-I Wu9ab61502015-11-06 06:42:02 +0800536LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence)
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600537{
538 const VkLayerDispatchTable *disp;
539
540 disp = loader_get_dispatch(queue);
541
Chia-I Wu1ff4c3d2015-10-26 16:55:27 +0800542 return disp->QueueBindSparse(queue, bindInfoCount, pBindInfo, fence);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600543}
544
Chia-I Wu9ab61502015-11-06 06:42:02 +0800545LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateFence(VkDevice device, const VkFenceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600546{
547 const VkLayerDispatchTable *disp;
548
549 disp = loader_get_dispatch(device);
550
Chia-I Wuf7458c52015-10-26 21:10:41 +0800551 return disp->CreateFence(device, pCreateInfo, pAllocator, pFence);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600552}
553
Chia-I Wu9ab61502015-11-06 06:42:02 +0800554LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600555{
556 const VkLayerDispatchTable *disp;
557
558 disp = loader_get_dispatch(device);
559
Chia-I Wuf7458c52015-10-26 21:10:41 +0800560 disp->DestroyFence(device, fence, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600561}
562
Chia-I Wu9ab61502015-11-06 06:42:02 +0800563LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600564{
565 const VkLayerDispatchTable *disp;
566
567 disp = loader_get_dispatch(device);
568
569 return disp->ResetFences(device, fenceCount, pFences);
570}
571
Chia-I Wu9ab61502015-11-06 06:42:02 +0800572LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceStatus(VkDevice device, VkFence fence)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600573{
574 const VkLayerDispatchTable *disp;
575
576 disp = loader_get_dispatch(device);
577
578 return disp->GetFenceStatus(device, fence);
579}
580
Chia-I Wu9ab61502015-11-06 06:42:02 +0800581LOADER_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 -0600582{
583 const VkLayerDispatchTable *disp;
584
585 disp = loader_get_dispatch(device);
586
587 return disp->WaitForFences(device, fenceCount, pFences, waitAll, timeout);
588}
589
Chia-I Wu9ab61502015-11-06 06:42:02 +0800590LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSemaphore* pSemaphore)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600591{
592 const VkLayerDispatchTable *disp;
593
594 disp = loader_get_dispatch(device);
595
Chia-I Wuf7458c52015-10-26 21:10:41 +0800596 return disp->CreateSemaphore(device, pCreateInfo, pAllocator, pSemaphore);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600597}
598
Chia-I Wu9ab61502015-11-06 06:42:02 +0800599LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroySemaphore(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600600{
601 const VkLayerDispatchTable *disp;
602
603 disp = loader_get_dispatch(device);
604
Chia-I Wuf7458c52015-10-26 21:10:41 +0800605 disp->DestroySemaphore(device, semaphore, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600606}
607
Chia-I Wu9ab61502015-11-06 06:42:02 +0800608LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateEvent(VkDevice device, const VkEventCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkEvent* pEvent)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600609{
610 const VkLayerDispatchTable *disp;
611
612 disp = loader_get_dispatch(device);
613
Chia-I Wuf7458c52015-10-26 21:10:41 +0800614 return disp->CreateEvent(device, pCreateInfo, pAllocator, pEvent);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600615}
616
Chia-I Wu9ab61502015-11-06 06:42:02 +0800617LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600618{
619 const VkLayerDispatchTable *disp;
620
621 disp = loader_get_dispatch(device);
622
Chia-I Wuf7458c52015-10-26 21:10:41 +0800623 disp->DestroyEvent(device, event, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600624}
625
Chia-I Wu9ab61502015-11-06 06:42:02 +0800626LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetEventStatus(VkDevice device, VkEvent event)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600627{
628 const VkLayerDispatchTable *disp;
629
630 disp = loader_get_dispatch(device);
631
632 return disp->GetEventStatus(device, event);
633}
634
Chia-I Wu9ab61502015-11-06 06:42:02 +0800635LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkSetEvent(VkDevice device, VkEvent event)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600636{
637 const VkLayerDispatchTable *disp;
638
639 disp = loader_get_dispatch(device);
640
641 return disp->SetEvent(device, event);
642}
643
Chia-I Wu9ab61502015-11-06 06:42:02 +0800644LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkResetEvent(VkDevice device, VkEvent event)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600645{
646 const VkLayerDispatchTable *disp;
647
648 disp = loader_get_dispatch(device);
649
650 return disp->ResetEvent(device, event);
651}
652
Chia-I Wu9ab61502015-11-06 06:42:02 +0800653LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkQueryPool* pQueryPool)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600654{
655 const VkLayerDispatchTable *disp;
656
657 disp = loader_get_dispatch(device);
658
Chia-I Wuf7458c52015-10-26 21:10:41 +0800659 return disp->CreateQueryPool(device, pCreateInfo, pAllocator, pQueryPool);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600660}
661
Chia-I Wu9ab61502015-11-06 06:42:02 +0800662LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyQueryPool(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600663{
664 const VkLayerDispatchTable *disp;
665
666 disp = loader_get_dispatch(device);
667
Chia-I Wuf7458c52015-10-26 21:10:41 +0800668 disp->DestroyQueryPool(device, queryPool, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600669}
670
Jon Ashburn19d3bf12015-12-30 14:06:55 -0700671LOADER_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 -0600672{
673 const VkLayerDispatchTable *disp;
674
675 disp = loader_get_dispatch(device);
676
Jon Ashburn19d3bf12015-12-30 14:06:55 -0700677 return disp->GetQueryPoolResults(device, queryPool, firstQuery, queryCount, dataSize, pData, stride, flags);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600678}
679
Chia-I Wu9ab61502015-11-06 06:42:02 +0800680LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600681{
682 const VkLayerDispatchTable *disp;
683
684 disp = loader_get_dispatch(device);
685
Chia-I Wuf7458c52015-10-26 21:10:41 +0800686 return disp->CreateBuffer(device, pCreateInfo, pAllocator, pBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600687}
688
Chia-I Wu9ab61502015-11-06 06:42:02 +0800689LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600690{
691 const VkLayerDispatchTable *disp;
692
693 disp = loader_get_dispatch(device);
694
Chia-I Wuf7458c52015-10-26 21:10:41 +0800695 disp->DestroyBuffer(device, buffer, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600696}
697
Chia-I Wu9ab61502015-11-06 06:42:02 +0800698LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateBufferView(VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBufferView* pView)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600699{
700 const VkLayerDispatchTable *disp;
701
702 disp = loader_get_dispatch(device);
703
Chia-I Wuf7458c52015-10-26 21:10:41 +0800704 return disp->CreateBufferView(device, pCreateInfo, pAllocator, pView);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600705}
706
Chia-I Wu9ab61502015-11-06 06:42:02 +0800707LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyBufferView(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600708{
709 const VkLayerDispatchTable *disp;
710
711 disp = loader_get_dispatch(device);
712
Chia-I Wuf7458c52015-10-26 21:10:41 +0800713 disp->DestroyBufferView(device, bufferView, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600714}
715
Chia-I Wu9ab61502015-11-06 06:42:02 +0800716LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImage* pImage)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600717{
718 const VkLayerDispatchTable *disp;
719
720 disp = loader_get_dispatch(device);
721
Chia-I Wuf7458c52015-10-26 21:10:41 +0800722 return disp->CreateImage(device, pCreateInfo, pAllocator, pImage);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600723}
724
Chia-I Wu9ab61502015-11-06 06:42:02 +0800725LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600726{
727 const VkLayerDispatchTable *disp;
728
729 disp = loader_get_dispatch(device);
730
Chia-I Wuf7458c52015-10-26 21:10:41 +0800731 disp->DestroyImage(device, image, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600732}
733
Chia-I Wu9ab61502015-11-06 06:42:02 +0800734LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600735{
736 const VkLayerDispatchTable *disp;
737
738 disp = loader_get_dispatch(device);
739
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600740 disp->GetImageSubresourceLayout(device, image, pSubresource, pLayout);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600741}
742
Chia-I Wu9ab61502015-11-06 06:42:02 +0800743LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateImageView(VkDevice device, const VkImageViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImageView* pView)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600744{
745 const VkLayerDispatchTable *disp;
746
747 disp = loader_get_dispatch(device);
748
Chia-I Wuf7458c52015-10-26 21:10:41 +0800749 return disp->CreateImageView(device, pCreateInfo, pAllocator, pView);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600750}
751
Chia-I Wu9ab61502015-11-06 06:42:02 +0800752LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600753{
754 const VkLayerDispatchTable *disp;
755
756 disp = loader_get_dispatch(device);
757
Chia-I Wuf7458c52015-10-26 21:10:41 +0800758 disp->DestroyImageView(device, imageView, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600759}
760
Chia-I Wu9ab61502015-11-06 06:42:02 +0800761LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkShaderModule* pShader)
Courtney Goeltzenleuchter2d2cb682015-06-24 18:24:19 -0600762{
763 const VkLayerDispatchTable *disp;
764
765 disp = loader_get_dispatch(device);
766
Chia-I Wuf7458c52015-10-26 21:10:41 +0800767 return disp->CreateShaderModule(device, pCreateInfo, pAllocator, pShader);
Courtney Goeltzenleuchter2d2cb682015-06-24 18:24:19 -0600768}
769
Chia-I Wu9ab61502015-11-06 06:42:02 +0800770LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyShaderModule(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600771{
772 const VkLayerDispatchTable *disp;
773
774 disp = loader_get_dispatch(device);
775
Chia-I Wuf7458c52015-10-26 21:10:41 +0800776 disp->DestroyShaderModule(device, shaderModule, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600777}
778
Chia-I Wu9ab61502015-11-06 06:42:02 +0800779LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineCache* pPipelineCache)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600780{
781 const VkLayerDispatchTable *disp;
782
783 disp = loader_get_dispatch(device);
784
Chia-I Wuf7458c52015-10-26 21:10:41 +0800785 return disp->CreatePipelineCache(device, pCreateInfo, pAllocator, pPipelineCache);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600786}
787
Chia-I Wu9ab61502015-11-06 06:42:02 +0800788LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks* pAllocator)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600789{
790 const VkLayerDispatchTable *disp;
791
792 disp = loader_get_dispatch(device);
793
Chia-I Wuf7458c52015-10-26 21:10:41 +0800794 disp->DestroyPipelineCache(device, pipelineCache, pAllocator);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600795}
796
Chia-I Wu9ab61502015-11-06 06:42:02 +0800797LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600798{
799 const VkLayerDispatchTable *disp;
800
801 disp = loader_get_dispatch(device);
802
Chia-I Wub16facd2015-10-26 19:17:06 +0800803 return disp->GetPipelineCacheData(device, pipelineCache, pDataSize, pData);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600804}
805
Chia-I Wu9ab61502015-11-06 06:42:02 +0800806LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkMergePipelineCaches(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600807{
808 const VkLayerDispatchTable *disp;
809
810 disp = loader_get_dispatch(device);
811
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800812 return disp->MergePipelineCaches(device, dstCache, srcCacheCount, pSrcCaches);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600813}
814
Chia-I Wu9ab61502015-11-06 06:42:02 +0800815LOADER_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 -0600816{
817 const VkLayerDispatchTable *disp;
818
819 disp = loader_get_dispatch(device);
820
Chia-I Wuf7458c52015-10-26 21:10:41 +0800821 return disp->CreateGraphicsPipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines);
Jon Ashburnc669cc62015-07-09 15:02:25 -0600822}
823
Chia-I Wu9ab61502015-11-06 06:42:02 +0800824LOADER_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 -0600825{
826 const VkLayerDispatchTable *disp;
827
828 disp = loader_get_dispatch(device);
829
Chia-I Wuf7458c52015-10-26 21:10:41 +0800830 return disp->CreateComputePipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600831}
832
Chia-I Wu9ab61502015-11-06 06:42:02 +0800833LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600834{
835 const VkLayerDispatchTable *disp;
836
837 disp = loader_get_dispatch(device);
838
Chia-I Wuf7458c52015-10-26 21:10:41 +0800839 disp->DestroyPipeline(device, pipeline, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600840}
841
Chia-I Wu9ab61502015-11-06 06:42:02 +0800842LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineLayout* pPipelineLayout)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600843{
844 const VkLayerDispatchTable *disp;
845
846 disp = loader_get_dispatch(device);
847
Chia-I Wuf7458c52015-10-26 21:10:41 +0800848 return disp->CreatePipelineLayout(device, pCreateInfo, pAllocator, pPipelineLayout);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600849}
850
Chia-I Wu9ab61502015-11-06 06:42:02 +0800851LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600852{
853 const VkLayerDispatchTable *disp;
854
855 disp = loader_get_dispatch(device);
856
Chia-I Wuf7458c52015-10-26 21:10:41 +0800857 disp->DestroyPipelineLayout(device, pipelineLayout, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600858}
859
Chia-I Wu9ab61502015-11-06 06:42:02 +0800860LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateSampler(VkDevice device, const VkSamplerCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSampler* pSampler)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600861{
862 const VkLayerDispatchTable *disp;
863
864 disp = loader_get_dispatch(device);
865
Chia-I Wuf7458c52015-10-26 21:10:41 +0800866 return disp->CreateSampler(device, pCreateInfo, pAllocator, pSampler);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600867}
868
Chia-I Wu9ab61502015-11-06 06:42:02 +0800869LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600870{
871 const VkLayerDispatchTable *disp;
872
873 disp = loader_get_dispatch(device);
874
Chia-I Wuf7458c52015-10-26 21:10:41 +0800875 disp->DestroySampler(device, sampler, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600876}
877
878
Chia-I Wu9ab61502015-11-06 06:42:02 +0800879LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorSetLayout* pSetLayout)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600880{
881 const VkLayerDispatchTable *disp;
882
883 disp = loader_get_dispatch(device);
884
Chia-I Wuf7458c52015-10-26 21:10:41 +0800885 return disp->CreateDescriptorSetLayout(device, pCreateInfo, pAllocator, pSetLayout);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600886}
887
Chia-I Wu9ab61502015-11-06 06:42:02 +0800888LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600889{
890 const VkLayerDispatchTable *disp;
891
892 disp = loader_get_dispatch(device);
893
Chia-I Wuf7458c52015-10-26 21:10:41 +0800894 disp->DestroyDescriptorSetLayout(device, descriptorSetLayout, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600895}
896
Chia-I Wu9ab61502015-11-06 06:42:02 +0800897LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorPool* pDescriptorPool)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600898{
899 const VkLayerDispatchTable *disp;
900
901 disp = loader_get_dispatch(device);
902
Chia-I Wuf7458c52015-10-26 21:10:41 +0800903 return disp->CreateDescriptorPool(device, pCreateInfo, pAllocator, pDescriptorPool);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600904}
905
Chia-I Wu9ab61502015-11-06 06:42:02 +0800906LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600907{
908 const VkLayerDispatchTable *disp;
909
910 disp = loader_get_dispatch(device);
911
Chia-I Wuf7458c52015-10-26 21:10:41 +0800912 disp->DestroyDescriptorPool(device, descriptorPool, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600913}
914
915
Chia-I Wu9ab61502015-11-06 06:42:02 +0800916LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600917{
918 const VkLayerDispatchTable *disp;
919
920 disp = loader_get_dispatch(device);
921
Courtney Goeltzenleuchterbee18a92015-10-23 14:21:05 -0600922 return disp->ResetDescriptorPool(device, descriptorPool, flags);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600923}
924
Chia-I Wu9ab61502015-11-06 06:42:02 +0800925LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkAllocateDescriptorSets(VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600926{
927 const VkLayerDispatchTable *disp;
928
929 disp = loader_get_dispatch(device);
930
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800931 return disp->AllocateDescriptorSets(device, pAllocateInfo, pDescriptorSets);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600932}
933
Chia-I Wu9ab61502015-11-06 06:42:02 +0800934LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets)
Tony Barbour34ec6922015-07-10 10:50:45 -0600935{
936 const VkLayerDispatchTable *disp;
937
938 disp = loader_get_dispatch(device);
939
Chia-I Wud50a7d72015-10-26 20:48:51 +0800940 return disp->FreeDescriptorSets(device, descriptorPool, descriptorSetCount, pDescriptorSets);
Tony Barbour34ec6922015-07-10 10:50:45 -0600941}
942
Chia-I Wu9ab61502015-11-06 06:42:02 +0800943LOADER_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 -0600944{
945 const VkLayerDispatchTable *disp;
946
947 disp = loader_get_dispatch(device);
948
Chia-I Wu40cf0ae2015-10-26 17:20:32 +0800949 disp->UpdateDescriptorSets(device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, pDescriptorCopies);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600950}
951
Chia-I Wu9ab61502015-11-06 06:42:02 +0800952LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFramebuffer* pFramebuffer)
Jon Ashburn754864f2015-07-23 18:49:07 -0600953{
954 const VkLayerDispatchTable *disp;
955
956 disp = loader_get_dispatch(device);
957
Chia-I Wuf7458c52015-10-26 21:10:41 +0800958 return disp->CreateFramebuffer(device, pCreateInfo, pAllocator, pFramebuffer);
Jon Ashburn754864f2015-07-23 18:49:07 -0600959}
960
Chia-I Wu9ab61502015-11-06 06:42:02 +0800961LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* pAllocator)
Jon Ashburn754864f2015-07-23 18:49:07 -0600962{
963 const VkLayerDispatchTable *disp;
964
965 disp = loader_get_dispatch(device);
966
Chia-I Wuf7458c52015-10-26 21:10:41 +0800967 disp->DestroyFramebuffer(device, framebuffer, pAllocator);
Jon Ashburn754864f2015-07-23 18:49:07 -0600968}
969
Chia-I Wu9ab61502015-11-06 06:42:02 +0800970LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass)
Jon Ashburn754864f2015-07-23 18:49:07 -0600971{
972 const VkLayerDispatchTable *disp;
973
974 disp = loader_get_dispatch(device);
975
Chia-I Wuf7458c52015-10-26 21:10:41 +0800976 return disp->CreateRenderPass(device, pCreateInfo, pAllocator, pRenderPass);
Jon Ashburn754864f2015-07-23 18:49:07 -0600977}
978
Chia-I Wu9ab61502015-11-06 06:42:02 +0800979LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator)
Jon Ashburn754864f2015-07-23 18:49:07 -0600980{
981 const VkLayerDispatchTable *disp;
982
983 disp = loader_get_dispatch(device);
984
Chia-I Wuf7458c52015-10-26 21:10:41 +0800985 disp->DestroyRenderPass(device, renderPass, pAllocator);
Jon Ashburn754864f2015-07-23 18:49:07 -0600986}
987
Chia-I Wu9ab61502015-11-06 06:42:02 +0800988LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity)
Jon Ashburn754864f2015-07-23 18:49:07 -0600989{
990 const VkLayerDispatchTable *disp;
991
992 disp = loader_get_dispatch(device);
993
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600994 disp->GetRenderAreaGranularity(device, renderPass, pGranularity);
Jon Ashburn754864f2015-07-23 18:49:07 -0600995}
996
Chia-I Wu9ab61502015-11-06 06:42:02 +0800997LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool)
Cody Northrope62183e2015-07-09 18:08:05 -0600998{
999 const VkLayerDispatchTable *disp;
1000
1001 disp = loader_get_dispatch(device);
1002
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001003 return disp->CreateCommandPool(device, pCreateInfo, pAllocator, pCommandPool);
Cody Northrope62183e2015-07-09 18:08:05 -06001004}
1005
Chia-I Wu9ab61502015-11-06 06:42:02 +08001006LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyCommandPool(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks* pAllocator)
Cody Northrope62183e2015-07-09 18:08:05 -06001007{
1008 const VkLayerDispatchTable *disp;
1009
1010 disp = loader_get_dispatch(device);
1011
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001012 disp->DestroyCommandPool(device, commandPool, pAllocator);
Cody Northrope62183e2015-07-09 18:08:05 -06001013}
1014
Chia-I Wu9ab61502015-11-06 06:42:02 +08001015LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags)
Cody Northrope62183e2015-07-09 18:08:05 -06001016{
1017 const VkLayerDispatchTable *disp;
1018
1019 disp = loader_get_dispatch(device);
1020
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001021 return disp->ResetCommandPool(device, commandPool, flags);
Cody Northrope62183e2015-07-09 18:08:05 -06001022}
1023
Chia-I Wu9ab61502015-11-06 06:42:02 +08001024LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkAllocateCommandBuffers(
Courtney Goeltzenleuchterbee18a92015-10-23 14:21:05 -06001025 VkDevice device,
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001026 const VkCommandBufferAllocateInfo* pAllocateInfo,
1027 VkCommandBuffer* pCommandBuffers)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001028{
1029 const VkLayerDispatchTable *disp;
1030 VkResult res;
1031
1032 disp = loader_get_dispatch(device);
1033
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001034 res = disp->AllocateCommandBuffers(device, pAllocateInfo, pCommandBuffers);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001035 if (res == VK_SUCCESS) {
Jon Ashburnf19916e2016-01-11 13:12:43 -07001036 for (uint32_t i =0; i < pAllocateInfo->commandBufferCount; i++) {
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001037 if (pCommandBuffers[i]) {
1038 loader_init_dispatch(pCommandBuffers[i], disp);
Courtney Goeltzenleuchterbee18a92015-10-23 14:21:05 -06001039 }
1040 }
Jon Ashburnd55a3942015-05-06 09:02:10 -06001041 }
1042
1043 return res;
1044}
1045
Chia-I Wu9ab61502015-11-06 06:42:02 +08001046LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkFreeCommandBuffers(
Courtney Goeltzenleuchterbee18a92015-10-23 14:21:05 -06001047 VkDevice device,
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001048 VkCommandPool commandPool,
Chia-I Wud50a7d72015-10-26 20:48:51 +08001049 uint32_t commandBufferCount,
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001050 const VkCommandBuffer* pCommandBuffers)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001051{
1052 const VkLayerDispatchTable *disp;
1053
1054 disp = loader_get_dispatch(device);
1055
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001056 disp->FreeCommandBuffers(device, commandPool, commandBufferCount, pCommandBuffers);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001057}
1058
Chia-I Wu9ab61502015-11-06 06:42:02 +08001059LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkBeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo* pBeginInfo)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001060{
1061 const VkLayerDispatchTable *disp;
1062
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001063 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001064
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001065 return disp->BeginCommandBuffer(commandBuffer, pBeginInfo);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001066}
1067
Chia-I Wu9ab61502015-11-06 06:42:02 +08001068LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEndCommandBuffer(VkCommandBuffer commandBuffer)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001069{
1070 const VkLayerDispatchTable *disp;
1071
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001072 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001073
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001074 return disp->EndCommandBuffer(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001075}
1076
Chia-I Wu9ab61502015-11-06 06:42:02 +08001077LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkResetCommandBuffer(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001078{
1079 const VkLayerDispatchTable *disp;
1080
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001081 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001082
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001083 return disp->ResetCommandBuffer(commandBuffer, flags);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001084}
1085
Chia-I Wu9ab61502015-11-06 06:42:02 +08001086LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001087{
1088 const VkLayerDispatchTable *disp;
1089
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001090 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001091
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001092 disp->CmdBindPipeline(commandBuffer, pipelineBindPoint, pipeline);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001093}
1094
Jon Ashburn19d3bf12015-12-30 14:06:55 -07001095LOADER_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 -06001096{
1097 const VkLayerDispatchTable *disp;
1098
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001099 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001100
Jon Ashburn19d3bf12015-12-30 14:06:55 -07001101 disp->CmdSetViewport(commandBuffer, firstViewport, viewportCount, pViewports);
Courtney Goeltzenleuchter078f8172015-09-21 11:44:06 -06001102}
1103
Jon Ashburn19d3bf12015-12-30 14:06:55 -07001104LOADER_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 -06001105{
1106 const VkLayerDispatchTable *disp;
1107
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001108 disp = loader_get_dispatch(commandBuffer);
Courtney Goeltzenleuchter078f8172015-09-21 11:44:06 -06001109
Jon Ashburn19d3bf12015-12-30 14:06:55 -07001110 disp->CmdSetScissor(commandBuffer, firstScissor, scissorCount, pScissors);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001111}
1112
Chia-I Wu9ab61502015-11-06 06:42:02 +08001113LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001114{
1115 const VkLayerDispatchTable *disp;
1116
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001117 disp = loader_get_dispatch(commandBuffer);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001118
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001119 disp->CmdSetLineWidth(commandBuffer, lineWidth);
Cody Northrop12365112015-08-17 11:10:49 -06001120}
1121
Chia-I Wu9ab61502015-11-06 06:42:02 +08001122LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor)
Cody Northrop12365112015-08-17 11:10:49 -06001123{
1124 const VkLayerDispatchTable *disp;
1125
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001126 disp = loader_get_dispatch(commandBuffer);
Cody Northrop12365112015-08-17 11:10:49 -06001127
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001128 disp->CmdSetDepthBias(commandBuffer, depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001129}
1130
Chia-I Wu9ab61502015-11-06 06:42:02 +08001131LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetBlendConstants(VkCommandBuffer commandBuffer, const float blendConstants[4])
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001132{
1133 const VkLayerDispatchTable *disp;
1134
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001135 disp = loader_get_dispatch(commandBuffer);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001136
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001137 disp->CmdSetBlendConstants(commandBuffer, blendConstants);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001138}
1139
Chia-I Wu9ab61502015-11-06 06:42:02 +08001140LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001141{
1142 const VkLayerDispatchTable *disp;
1143
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001144 disp = loader_get_dispatch(commandBuffer);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001145
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001146 disp->CmdSetDepthBounds(commandBuffer, minDepthBounds, maxDepthBounds);
Cody Northrop82485a82015-08-18 15:21:16 -06001147}
1148
Chia-I Wu9ab61502015-11-06 06:42:02 +08001149LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilCompareMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask)
Cody Northrop82485a82015-08-18 15:21:16 -06001150{
1151 const VkLayerDispatchTable *disp;
1152
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001153 disp = loader_get_dispatch(commandBuffer);
Cody Northrop82485a82015-08-18 15:21:16 -06001154
Chia-I Wu1b99bb22015-10-27 19:25:11 +08001155 disp->CmdSetStencilCompareMask(commandBuffer, faceMask, compareMask);
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001156}
1157
Chia-I Wu9ab61502015-11-06 06:42:02 +08001158LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilWriteMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask)
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001159{
1160 const VkLayerDispatchTable *disp;
1161
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001162 disp = loader_get_dispatch(commandBuffer);
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001163
Chia-I Wu1b99bb22015-10-27 19:25:11 +08001164 disp->CmdSetStencilWriteMask(commandBuffer, faceMask, writeMask);
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001165}
1166
Chia-I Wu9ab61502015-11-06 06:42:02 +08001167LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilReference(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference)
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001168{
1169 const VkLayerDispatchTable *disp;
1170
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001171 disp = loader_get_dispatch(commandBuffer);
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001172
Chia-I Wu1b99bb22015-10-27 19:25:11 +08001173 disp->CmdSetStencilReference(commandBuffer, faceMask, reference);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001174}
1175
Chia-I Wu9ab61502015-11-06 06:42:02 +08001176LOADER_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 -06001177{
1178 const VkLayerDispatchTable *disp;
1179
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001180 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001181
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001182 disp->CmdBindDescriptorSets(commandBuffer, pipelineBindPoint, layout, firstSet, descriptorSetCount, pDescriptorSets, dynamicOffsetCount, pDynamicOffsets);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001183}
1184
Chia-I Wu9ab61502015-11-06 06:42:02 +08001185LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001186{
1187 const VkLayerDispatchTable *disp;
1188
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001189 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001190
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001191 disp->CmdBindIndexBuffer(commandBuffer, buffer, offset, indexType);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001192}
1193
Jon Ashburn19d3bf12015-12-30 14:06:55 -07001194LOADER_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 -06001195{
1196 const VkLayerDispatchTable *disp;
1197
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001198 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn754864f2015-07-23 18:49:07 -06001199
Jon Ashburn19d3bf12015-12-30 14:06:55 -07001200 disp->CmdBindVertexBuffers(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets);
Jon Ashburn754864f2015-07-23 18:49:07 -06001201}
1202
Chia-I Wu9ab61502015-11-06 06:42:02 +08001203LOADER_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 -06001204{
1205 const VkLayerDispatchTable *disp;
1206
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001207 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001208
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001209 disp->CmdDraw(commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001210}
1211
Chia-I Wu9ab61502015-11-06 06:42:02 +08001212LOADER_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 -06001213{
1214 const VkLayerDispatchTable *disp;
1215
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001216 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001217
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001218 disp->CmdDrawIndexed(commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001219}
1220
Chia-I Wu9ab61502015-11-06 06:42:02 +08001221LOADER_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 -06001222{
1223 const VkLayerDispatchTable *disp;
1224
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001225 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001226
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001227 disp->CmdDrawIndirect(commandBuffer, buffer, offset, drawCount, stride);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001228}
1229
Chia-I Wu9ab61502015-11-06 06:42:02 +08001230LOADER_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 -06001231{
1232 const VkLayerDispatchTable *disp;
1233
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001234 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001235
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001236 disp->CmdDrawIndexedIndirect(commandBuffer, buffer, offset, drawCount, stride);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001237}
1238
Chia-I Wu9ab61502015-11-06 06:42:02 +08001239LOADER_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 -06001240{
1241 const VkLayerDispatchTable *disp;
1242
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001243 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001244
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001245 disp->CmdDispatch(commandBuffer, x, y, z);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001246}
1247
Chia-I Wu9ab61502015-11-06 06:42:02 +08001248LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001249{
1250 const VkLayerDispatchTable *disp;
1251
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001252 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001253
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001254 disp->CmdDispatchIndirect(commandBuffer, buffer, offset);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001255}
1256
Chia-I Wu9ab61502015-11-06 06:42:02 +08001257LOADER_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 -06001258{
1259 const VkLayerDispatchTable *disp;
1260
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001261 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001262
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001263 disp->CmdCopyBuffer(commandBuffer, srcBuffer, dstBuffer, regionCount, pRegions);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001264}
1265
Chia-I Wu9ab61502015-11-06 06:42:02 +08001266LOADER_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 -06001267{
1268 const VkLayerDispatchTable *disp;
1269
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001270 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001271
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001272 disp->CmdCopyImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001273}
1274
Chia-I Wu9ab61502015-11-06 06:42:02 +08001275LOADER_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 -06001276{
1277 const VkLayerDispatchTable *disp;
1278
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001279 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001280
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001281 disp->CmdBlitImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions, filter);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001282}
1283
Chia-I Wu9ab61502015-11-06 06:42:02 +08001284LOADER_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 -06001285{
1286 const VkLayerDispatchTable *disp;
1287
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001288 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001289
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001290 disp->CmdCopyBufferToImage(commandBuffer, srcBuffer, dstImage, dstImageLayout, regionCount, pRegions);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001291}
1292
Chia-I Wu9ab61502015-11-06 06:42:02 +08001293LOADER_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 -06001294{
1295 const VkLayerDispatchTable *disp;
1296
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001297 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001298
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001299 disp->CmdCopyImageToBuffer(commandBuffer, srcImage, srcImageLayout, dstBuffer, regionCount, pRegions);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001300}
1301
Chia-I Wu9ab61502015-11-06 06:42:02 +08001302LOADER_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 -06001303{
1304 const VkLayerDispatchTable *disp;
1305
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001306 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001307
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001308 disp->CmdUpdateBuffer(commandBuffer, dstBuffer, dstOffset, dataSize, pData);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001309}
1310
Chia-I Wu9ab61502015-11-06 06:42:02 +08001311LOADER_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 -06001312{
1313 const VkLayerDispatchTable *disp;
1314
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001315 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001316
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001317 disp->CmdFillBuffer(commandBuffer, dstBuffer, dstOffset, size, data);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001318}
1319
Chia-I Wu9ab61502015-11-06 06:42:02 +08001320LOADER_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 -06001321{
1322 const VkLayerDispatchTable *disp;
1323
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001324 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001325
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001326 disp->CmdClearColorImage(commandBuffer, image, imageLayout, pColor, rangeCount, pRanges);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001327}
1328
Chia-I Wu9ab61502015-11-06 06:42:02 +08001329LOADER_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 -06001330{
1331 const VkLayerDispatchTable *disp;
1332
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001333 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001334
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001335 disp->CmdClearDepthStencilImage(commandBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges);
Chris Forbesd9be82b2015-06-22 17:21:59 +12001336}
1337
Chia-I Wu9ab61502015-11-06 06:42:02 +08001338LOADER_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 +12001339{
1340 const VkLayerDispatchTable *disp;
1341
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001342 disp = loader_get_dispatch(commandBuffer);
Chris Forbesd9be82b2015-06-22 17:21:59 +12001343
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001344 disp->CmdClearAttachments(commandBuffer, attachmentCount, pAttachments, rectCount, pRects);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001345}
1346
Chia-I Wu9ab61502015-11-06 06:42:02 +08001347LOADER_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 -06001348{
1349 const VkLayerDispatchTable *disp;
1350
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001351 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001352
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001353 disp->CmdResolveImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001354}
1355
Chia-I Wu9ab61502015-11-06 06:42:02 +08001356LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001357{
1358 const VkLayerDispatchTable *disp;
1359
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001360 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001361
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001362 disp->CmdSetEvent(commandBuffer, event, stageMask);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001363}
1364
Chia-I Wu9ab61502015-11-06 06:42:02 +08001365LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001366{
1367 const VkLayerDispatchTable *disp;
1368
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001369 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001370
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001371 disp->CmdResetEvent(commandBuffer, event, stageMask);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001372}
1373
Jon Ashburnf19916e2016-01-11 13:12:43 -07001374LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdWaitEvents(
1375 VkCommandBuffer commandBuffer,
1376 uint32_t eventCount,
1377 const VkEvent* pEvents,
1378 VkPipelineStageFlags sourceStageMask,
1379 VkPipelineStageFlags dstStageMask,
1380 uint32_t memoryBarrierCount,
1381 const VkMemoryBarrier* pMemoryBarriers,
1382 uint32_t bufferMemoryBarrierCount,
1383 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
1384 uint32_t imageMemoryBarrierCount,
1385 const VkImageMemoryBarrier* pImageMemoryBarriers)
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
Jon Ashburnf19916e2016-01-11 13:12:43 -07001391 disp->CmdWaitEvents(commandBuffer, eventCount, pEvents, sourceStageMask,
1392 dstStageMask, memoryBarrierCount, pMemoryBarriers,
1393 bufferMemoryBarrierCount, pBufferMemoryBarriers,
1394 imageMemoryBarrierCount, pImageMemoryBarriers);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001395}
1396
Jon Ashburnf19916e2016-01-11 13:12:43 -07001397LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdPipelineBarrier(
1398 VkCommandBuffer commandBuffer,
1399 VkPipelineStageFlags srcStageMask,
1400 VkPipelineStageFlags dstStageMask,
1401 VkDependencyFlags dependencyFlags,
1402 uint32_t memoryBarrierCount,
1403 const VkMemoryBarrier* pMemoryBarriers,
1404 uint32_t bufferMemoryBarrierCount,
1405 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
1406 uint32_t imageMemoryBarrierCount,
1407 const VkImageMemoryBarrier* pImageMemoryBarriers)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001408{
1409 const VkLayerDispatchTable *disp;
1410
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001411 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001412
Jon Ashburnf19916e2016-01-11 13:12:43 -07001413 disp->CmdPipelineBarrier(commandBuffer, srcStageMask, dstStageMask,
1414 dependencyFlags, memoryBarrierCount, pMemoryBarriers,
1415 bufferMemoryBarrierCount, pBufferMemoryBarriers,
1416 imageMemoryBarrierCount, pImageMemoryBarriers);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001417}
1418
Chia-I Wu9ab61502015-11-06 06:42:02 +08001419LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t slot, VkFlags flags)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001420{
1421 const VkLayerDispatchTable *disp;
1422
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001423 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001424
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001425 disp->CmdBeginQuery(commandBuffer, queryPool, slot, flags);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001426}
1427
Chia-I Wu9ab61502015-11-06 06:42:02 +08001428LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t slot)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001429{
1430 const VkLayerDispatchTable *disp;
1431
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001432 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001433
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001434 disp->CmdEndQuery(commandBuffer, queryPool, slot);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001435}
1436
Jon Ashburn19d3bf12015-12-30 14:06:55 -07001437LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001438{
1439 const VkLayerDispatchTable *disp;
1440
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001441 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001442
Jon Ashburn19d3bf12015-12-30 14:06:55 -07001443 disp->CmdResetQueryPool(commandBuffer, queryPool, firstQuery, queryCount);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001444}
1445
Chia-I Wu9ab61502015-11-06 06:42:02 +08001446LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t slot)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001447{
1448 const VkLayerDispatchTable *disp;
1449
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001450 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001451
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001452 disp->CmdWriteTimestamp(commandBuffer, pipelineStage, queryPool, slot);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001453}
1454
Jon Ashburn19d3bf12015-12-30 14:06:55 -07001455LOADER_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 -06001456{
1457 const VkLayerDispatchTable *disp;
1458
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001459 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001460
Jon Ashburn19d3bf12015-12-30 14:06:55 -07001461 disp->CmdCopyQueryPoolResults(commandBuffer, queryPool, firstQuery, queryCount, dstBuffer, dstOffset, stride, flags);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001462}
1463
Chia-I Wuce9b1772015-11-12 06:09:22 +08001464LOADER_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 -06001465{
1466 const VkLayerDispatchTable *disp;
1467
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001468 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001469
Chia-I Wuce9b1772015-11-12 06:09:22 +08001470 disp->CmdPushConstants(commandBuffer, layout, stageFlags, offset, size, pValues);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001471}
1472
Chia-I Wu9ab61502015-11-06 06:42:02 +08001473LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkSubpassContents contents)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001474{
1475 const VkLayerDispatchTable *disp;
1476
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001477 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001478
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001479 disp->CmdBeginRenderPass(commandBuffer, pRenderPassBegin, contents);
Chia-I Wu08accc62015-07-07 11:50:03 +08001480}
1481
Chia-I Wu9ab61502015-11-06 06:42:02 +08001482LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents)
Chia-I Wu08accc62015-07-07 11:50:03 +08001483{
1484 const VkLayerDispatchTable *disp;
1485
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001486 disp = loader_get_dispatch(commandBuffer);
Chia-I Wu08accc62015-07-07 11:50:03 +08001487
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001488 disp->CmdNextSubpass(commandBuffer, contents);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001489}
1490
Chia-I Wu9ab61502015-11-06 06:42:02 +08001491LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdEndRenderPass(VkCommandBuffer commandBuffer)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001492{
1493 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
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001497 disp->CmdEndRenderPass(commandBuffer);
Chia-I Wu0b50a1c2015-06-26 15:34:39 +08001498}
1499
Chia-I Wu9ab61502015-11-06 06:42:02 +08001500LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBuffersCount, const VkCommandBuffer* pCommandBuffers)
Chia-I Wu0b50a1c2015-06-26 15:34:39 +08001501{
1502 const VkLayerDispatchTable *disp;
1503
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001504 disp = loader_get_dispatch(commandBuffer);
Chia-I Wu0b50a1c2015-06-26 15:34:39 +08001505
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001506 disp->CmdExecuteCommands(commandBuffer, commandBuffersCount, pCommandBuffers);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001507}