blob: 13515ad23abd26f0f12421bb8141cbfdc74dab4d [file] [log] [blame]
Jon Ashburnd55a3942015-05-06 09:02:10 -06001/*
2 * Vulkan
3 *
4 * Copyright (C) 2014 LunarG, Inc.
5 *
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.
23 */
Courtney Goeltzenleuchter7f5aafc2015-07-05 11:28:29 -060024#define _GNU_SOURCE
Jon Ashburn27cd5842015-05-12 17:26:48 -060025#include <stdlib.h>
26#include <string.h>
Jon Ashburnd55a3942015-05-06 09:02:10 -060027
Tobin Ehlisb835d1b2015-07-03 10:34:49 -060028#include "vk_loader_platform.h"
Jon Ashburnd55a3942015-05-06 09:02:10 -060029#include "loader.h"
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -060030#include "debug_report.h"
Ian Elliottd3ef02f2015-07-06 14:36:13 -060031#include "wsi_swapchain.h"
Jon Ashburnd55a3942015-05-06 09:02:10 -060032
Tobin Ehlisf37926f2015-05-13 11:57:18 -060033
Jon Ashburnd55a3942015-05-06 09:02:10 -060034/* Trampoline entrypoints */
Jon Ashburn27cd5842015-05-12 17:26:48 -060035LOADER_EXPORT VkResult VKAPI vkCreateInstance(
Courtney Goeltzenleuchter57fb1572015-06-08 15:13:50 -060036 const VkInstanceCreateInfo* pCreateInfo,
Chia-I Wu3432a0c2015-10-27 18:04:07 +080037 const VkAllocationCallbacks* pAllocator,
Courtney Goeltzenleuchter57fb1572015-06-08 15:13:50 -060038 VkInstance* pInstance)
Jon Ashburn27cd5842015-05-12 17:26:48 -060039{
40 struct loader_instance *ptr_instance = NULL;
Jon Ashburn27cd5842015-05-12 17:26:48 -060041 VkResult res = VK_ERROR_INITIALIZATION_FAILED;
Jon Ashburn27cd5842015-05-12 17:26:48 -060042
Jon Ashburn8810c5f2015-08-18 18:04:47 -060043 loader_platform_thread_once(&once_init, loader_initialize);
Jon Ashburn27cd5842015-05-12 17:26:48 -060044
Chia-I Wuf7458c52015-10-26 21:10:41 +080045 if (pAllocator) {
Chia-I Wu3432a0c2015-10-27 18:04:07 +080046 ptr_instance = (struct loader_instance *) pAllocator->pfnAllocation(
Chia-I Wuf7458c52015-10-26 21:10:41 +080047 pAllocator->pUserData,
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -060048 sizeof(struct loader_instance),
49 sizeof(VkInstance),
Chia-I Wu3432a0c2015-10-27 18:04:07 +080050 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -060051 } else {
52 ptr_instance = (struct loader_instance *) malloc(sizeof(struct loader_instance));
53 }
Jon Ashburn27cd5842015-05-12 17:26:48 -060054 if (ptr_instance == NULL) {
55 return VK_ERROR_OUT_OF_HOST_MEMORY;
56 }
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -060057
Jon Ashburn87d6aa92015-08-28 15:19:27 -060058 tls_instance = ptr_instance;
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -060059 loader_platform_thread_lock_mutex(&loader_lock);
Jon Ashburnb82c1852015-08-11 14:49:54 -060060 memset(ptr_instance, 0, sizeof(struct loader_instance));
Jon Ashburn07daee72015-05-21 18:13:33 -060061
Chia-I Wuf7458c52015-10-26 21:10:41 +080062 if (pAllocator) {
63 ptr_instance->alloc_callbacks = *pAllocator;
Courtney Goeltzenleuchter7f5aafc2015-07-05 11:28:29 -060064 }
65
Jon Ashburn3d002332015-08-20 16:35:30 -060066 /* Due to implicit layers need to get layer list even if
Chia-I Wud50a7d72015-10-26 20:48:51 +080067 * enabledLayerNameCount == 0 and VK_INSTANCE_LAYERS is unset. For now always
Jon Ashburn3d002332015-08-20 16:35:30 -060068 * get layer list (both instance and device) via loader_layer_scan(). */
69 memset(&ptr_instance->instance_layer_list, 0, sizeof(ptr_instance->instance_layer_list));
70 memset(&ptr_instance->device_layer_list, 0, sizeof(ptr_instance->device_layer_list));
Jon Ashburne39a4f82015-08-28 13:38:21 -060071 loader_layer_scan(ptr_instance,
72
73
74 &ptr_instance->instance_layer_list,
75 &ptr_instance->device_layer_list);
Jon Ashburn3d002332015-08-20 16:35:30 -060076
77 /* validate the app requested layers to be enabled */
Chia-I Wud50a7d72015-10-26 20:48:51 +080078 if (pCreateInfo->enabledLayerNameCount > 0) {
79 res = loader_validate_layers(pCreateInfo->enabledLayerNameCount,
Jon Ashburn3d002332015-08-20 16:35:30 -060080 pCreateInfo->ppEnabledLayerNames,
81 &ptr_instance->instance_layer_list);
82 if (res != VK_SUCCESS) {
Jon Ashburn1ff17592015-10-09 09:40:30 -060083 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburn3d002332015-08-20 16:35:30 -060084 return res;
85 }
86 }
87
Jon Ashburn8810c5f2015-08-18 18:04:47 -060088 /* Scan/discover all ICD libraries */
89 memset(&ptr_instance->icd_libs, 0, sizeof(ptr_instance->icd_libs));
Jon Ashburne39a4f82015-08-28 13:38:21 -060090 loader_icd_scan(ptr_instance, &ptr_instance->icd_libs);
Jon Ashburn8810c5f2015-08-18 18:04:47 -060091
Jon Ashburneacfa3a2015-08-14 12:51:47 -060092 /* get extensions from all ICD's, merge so no duplicates, then validate */
Jon Ashburne39a4f82015-08-28 13:38:21 -060093 loader_get_icd_loader_instance_extensions(ptr_instance,
94 &ptr_instance->icd_libs,
95 &ptr_instance->ext_list);
96 res = loader_validate_instance_extensions(&ptr_instance->ext_list,
97 &ptr_instance->instance_layer_list,
98 pCreateInfo);
Jon Ashburneacfa3a2015-08-14 12:51:47 -060099 if (res != VK_SUCCESS) {
Jon Ashburne39a4f82015-08-28 13:38:21 -0600100 loader_delete_layer_properties(ptr_instance,
101 &ptr_instance->device_layer_list);
102 loader_delete_layer_properties(ptr_instance,
103 &ptr_instance->instance_layer_list);
104 loader_scanned_icd_clear(ptr_instance, &ptr_instance->icd_libs);
105 loader_destroy_ext_list(ptr_instance, &ptr_instance->ext_list);
Jon Ashburneacfa3a2015-08-14 12:51:47 -0600106 loader_platform_thread_unlock_mutex(&loader_lock);
107 loader_heap_free(ptr_instance, ptr_instance);
108 return res;
109 }
110
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -0600111 ptr_instance->disp = loader_heap_alloc(
112 ptr_instance,
113 sizeof(VkLayerInstanceDispatchTable),
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800114 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -0600115 if (ptr_instance->disp == NULL) {
Jon Ashburne39a4f82015-08-28 13:38:21 -0600116 loader_delete_layer_properties(ptr_instance,
117 &ptr_instance->device_layer_list);
118 loader_delete_layer_properties(ptr_instance,
119 &ptr_instance->instance_layer_list);
120 loader_scanned_icd_clear(ptr_instance,
121 &ptr_instance->icd_libs);
122 loader_destroy_ext_list(ptr_instance,
123 &ptr_instance->ext_list);
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -0600124 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburneacfa3a2015-08-14 12:51:47 -0600125 loader_heap_free(ptr_instance, ptr_instance);
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -0600126 return VK_ERROR_OUT_OF_HOST_MEMORY;
127 }
128 memcpy(ptr_instance->disp, &instance_disp, sizeof(instance_disp));
129 ptr_instance->next = loader.instances;
130 loader.instances = ptr_instance;
131
Jon Ashburnb82c1852015-08-11 14:49:54 -0600132 /* activate any layers on instance chain */
Jon Ashburne39a4f82015-08-28 13:38:21 -0600133 res = loader_enable_instance_layers(ptr_instance,
134 pCreateInfo,
135 &ptr_instance->instance_layer_list);
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -0600136 if (res != VK_SUCCESS) {
Jon Ashburne39a4f82015-08-28 13:38:21 -0600137 loader_delete_layer_properties(ptr_instance,
138 &ptr_instance->device_layer_list);
139 loader_delete_layer_properties(ptr_instance,
140 &ptr_instance->instance_layer_list);
141 loader_scanned_icd_clear(ptr_instance,
142 &ptr_instance->icd_libs);
143 loader_destroy_ext_list(ptr_instance,
144 &ptr_instance->ext_list);
Jon Ashburneacfa3a2015-08-14 12:51:47 -0600145 loader.instances = ptr_instance->next;
146 loader_platform_thread_unlock_mutex(&loader_lock);
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -0600147 loader_heap_free(ptr_instance, ptr_instance->disp);
148 loader_heap_free(ptr_instance, ptr_instance);
149 return res;
150 }
Jon Ashburnb82c1852015-08-11 14:49:54 -0600151 loader_activate_instance_layers(ptr_instance);
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -0600152
Ian Elliottd3ef02f2015-07-06 14:36:13 -0600153 wsi_swapchain_create_instance(ptr_instance, pCreateInfo);
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600154 debug_report_create_instance(ptr_instance, pCreateInfo);
Jon Ashburn07daee72015-05-21 18:13:33 -0600155
Jon Ashburn27cd5842015-05-12 17:26:48 -0600156
Jon Ashburn27cd5842015-05-12 17:26:48 -0600157 *pInstance = (VkInstance) ptr_instance;
Jon Ashburneed0c002015-05-21 17:42:17 -0600158
Chia-I Wuf7458c52015-10-26 21:10:41 +0800159 res = ptr_instance->disp->CreateInstance(pCreateInfo, pAllocator, pInstance);
Jon Ashburneed0c002015-05-21 17:42:17 -0600160
Courtney Goeltzenleuchterd971b612015-06-17 20:51:59 -0600161 /*
162 * Finally have the layers in place and everyone has seen
163 * the CreateInstance command go by. This allows the layer's
164 * GetInstanceProcAddr functions to return valid extension functions
165 * if enabled.
166 */
167 loader_activate_instance_layer_extensions(ptr_instance);
168
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600169 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburn27cd5842015-05-12 17:26:48 -0600170 return res;
171}
172
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600173LOADER_EXPORT void VKAPI vkDestroyInstance(
Chia-I Wuf7458c52015-10-26 21:10:41 +0800174 VkInstance instance,
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800175 const VkAllocationCallbacks* pAllocator)
Jon Ashburn27cd5842015-05-12 17:26:48 -0600176{
177 const VkLayerInstanceDispatchTable *disp;
Jon Ashburne0e64572015-09-30 12:56:42 -0600178 struct loader_instance *ptr_instance = NULL;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600179 disp = loader_get_instance_dispatch(instance);
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -0600180
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600181 loader_platform_thread_lock_mutex(&loader_lock);
182
Jon Ashburne0e64572015-09-30 12:56:42 -0600183 ptr_instance = loader_get_instance(instance);
Chia-I Wuf7458c52015-10-26 21:10:41 +0800184 disp->DestroyInstance(instance, pAllocator);
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -0600185
Courtney Goeltzenleuchter7d0023c2015-06-08 15:09:22 -0600186 loader_deactivate_instance_layers(ptr_instance);
Jon Ashburneacfa3a2015-08-14 12:51:47 -0600187 loader_heap_free(ptr_instance, ptr_instance->disp);
188 loader_heap_free(ptr_instance, ptr_instance);
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600189 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburn27cd5842015-05-12 17:26:48 -0600190}
Jon Ashburn95a77ba2015-05-15 15:09:35 -0600191
Jon Ashburn27cd5842015-05-12 17:26:48 -0600192LOADER_EXPORT VkResult VKAPI vkEnumeratePhysicalDevices(
193 VkInstance instance,
194 uint32_t* pPhysicalDeviceCount,
195 VkPhysicalDevice* pPhysicalDevices)
196{
197 const VkLayerInstanceDispatchTable *disp;
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600198 VkResult res;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600199 disp = loader_get_instance_dispatch(instance);
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600200
201 loader_platform_thread_lock_mutex(&loader_lock);
202 res = disp->EnumeratePhysicalDevices(instance, pPhysicalDeviceCount,
Jon Ashburn27cd5842015-05-12 17:26:48 -0600203 pPhysicalDevices);
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600204 loader_platform_thread_unlock_mutex(&loader_lock);
205 return res;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600206}
207
Jon Ashburn754864f2015-07-23 18:49:07 -0600208
209
210
211
212
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600213LOADER_EXPORT void VKAPI vkGetPhysicalDeviceFeatures(
Jon Ashburn754864f2015-07-23 18:49:07 -0600214 VkPhysicalDevice gpu,
215 VkPhysicalDeviceFeatures *pFeatures)
216{
217 const VkLayerInstanceDispatchTable *disp;
Jon Ashburn754864f2015-07-23 18:49:07 -0600218
219 disp = loader_get_instance_dispatch(gpu);
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600220 disp->GetPhysicalDeviceFeatures(gpu, pFeatures);
Jon Ashburn754864f2015-07-23 18:49:07 -0600221}
222
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600223LOADER_EXPORT void VKAPI vkGetPhysicalDeviceFormatProperties(
Jon Ashburn754864f2015-07-23 18:49:07 -0600224 VkPhysicalDevice gpu,
225 VkFormat format,
226 VkFormatProperties *pFormatInfo)
227{
228 const VkLayerInstanceDispatchTable *disp;
Jon Ashburn754864f2015-07-23 18:49:07 -0600229
230 disp = loader_get_instance_dispatch(gpu);
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600231 disp->GetPhysicalDeviceFormatProperties(gpu, format, pFormatInfo);
Jon Ashburn754864f2015-07-23 18:49:07 -0600232}
233
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600234LOADER_EXPORT void VKAPI vkGetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties)
Jon Ashburn754864f2015-07-23 18:49:07 -0600235{
236 const VkLayerInstanceDispatchTable *disp;
Jon Ashburn754864f2015-07-23 18:49:07 -0600237
238 disp = loader_get_instance_dispatch(physicalDevice);
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600239 disp->GetPhysicalDeviceImageFormatProperties(physicalDevice, format, type, tiling, usage, flags, pImageFormatProperties);
Jon Ashburn754864f2015-07-23 18:49:07 -0600240}
241
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600242LOADER_EXPORT void VKAPI vkGetPhysicalDeviceProperties(
Jon Ashburn27cd5842015-05-12 17:26:48 -0600243 VkPhysicalDevice gpu,
Tony Barbour59a47322015-06-24 16:06:58 -0600244 VkPhysicalDeviceProperties* pProperties)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600245{
Jon Ashburn95a77ba2015-05-15 15:09:35 -0600246 const VkLayerInstanceDispatchTable *disp;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600247
Jon Ashburn95a77ba2015-05-15 15:09:35 -0600248 disp = loader_get_instance_dispatch(gpu);
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600249 disp->GetPhysicalDeviceProperties(gpu, pProperties);
Tony Barbour59a47322015-06-24 16:06:58 -0600250}
251
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600252LOADER_EXPORT void VKAPI vkGetPhysicalDeviceQueueFamilyProperties(
Tony Barbour59a47322015-06-24 16:06:58 -0600253 VkPhysicalDevice gpu,
Chia-I Wud50a7d72015-10-26 20:48:51 +0800254 uint32_t* pQueueFamilyPropertyCount,
Cody Northropd0802882015-08-03 17:04:53 -0600255 VkQueueFamilyProperties* pQueueProperties)
Tony Barbour59a47322015-06-24 16:06:58 -0600256{
257 const VkLayerInstanceDispatchTable *disp;
Tony Barbour59a47322015-06-24 16:06:58 -0600258
259 disp = loader_get_instance_dispatch(gpu);
Chia-I Wud50a7d72015-10-26 20:48:51 +0800260 disp->GetPhysicalDeviceQueueFamilyProperties(gpu, pQueueFamilyPropertyCount, pQueueProperties);
Tony Barbour59a47322015-06-24 16:06:58 -0600261}
262
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600263LOADER_EXPORT void VKAPI vkGetPhysicalDeviceMemoryProperties(
Tony Barbour59a47322015-06-24 16:06:58 -0600264 VkPhysicalDevice gpu,
265 VkPhysicalDeviceMemoryProperties* pMemoryProperties)
266{
267 const VkLayerInstanceDispatchTable *disp;
Tony Barbour59a47322015-06-24 16:06:58 -0600268
269 disp = loader_get_instance_dispatch(gpu);
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600270 disp->GetPhysicalDeviceMemoryProperties(gpu, pMemoryProperties);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600271}
272
Jon Ashburn95a77ba2015-05-15 15:09:35 -0600273LOADER_EXPORT VkResult VKAPI vkCreateDevice(
Courtney Goeltzenleuchterca173b82015-06-25 18:01:43 -0600274 VkPhysicalDevice gpu,
275 const VkDeviceCreateInfo* pCreateInfo,
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800276 const VkAllocationCallbacks* pAllocator,
Courtney Goeltzenleuchterca173b82015-06-25 18:01:43 -0600277 VkDevice* pDevice)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600278{
Jon Ashburnd55a3942015-05-06 09:02:10 -0600279 VkResult res;
280
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600281 loader_platform_thread_lock_mutex(&loader_lock);
Courtney Goeltzenleuchterca173b82015-06-25 18:01:43 -0600282
Chia-I Wuf7458c52015-10-26 21:10:41 +0800283 res = loader_CreateDevice(gpu, pCreateInfo, pAllocator, pDevice);
Courtney Goeltzenleuchterca173b82015-06-25 18:01:43 -0600284
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600285 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600286 return res;
287}
288
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800289LOADER_EXPORT void VKAPI vkDestroyDevice(VkDevice device, const VkAllocationCallbacks* pAllocator)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600290{
291 const VkLayerDispatchTable *disp;
Jon Ashburne39a4f82015-08-28 13:38:21 -0600292 struct loader_device *dev;
293 struct loader_icd *icd = loader_get_icd_and_device(device, &dev);
294 const struct loader_instance *inst = icd->this_instance;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600295 disp = loader_get_dispatch(device);
296
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600297 loader_platform_thread_lock_mutex(&loader_lock);
Chia-I Wuf7458c52015-10-26 21:10:41 +0800298 disp->DestroyDevice(device, pAllocator);
Jon Ashburne39a4f82015-08-28 13:38:21 -0600299 loader_remove_logical_device(inst, device);
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600300 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600301}
302
Courtney Goeltzenleuchter35985f62015-09-14 17:22:16 -0600303LOADER_EXPORT VkResult VKAPI vkEnumerateDeviceExtensionProperties(
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600304 VkPhysicalDevice physicalDevice,
305 const char* pLayerName,
Chia-I Wud50a7d72015-10-26 20:48:51 +0800306 uint32_t* pPropertyCount,
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600307 VkExtensionProperties* pProperties)
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600308{
309 VkResult res;
310
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600311 loader_platform_thread_lock_mutex(&loader_lock);
Jon Ashburnb2ef1372015-07-16 17:19:31 -0600312 //TODO convert over to using instance chain dispatch
Chia-I Wud50a7d72015-10-26 20:48:51 +0800313 res = loader_EnumerateDeviceExtensionProperties(physicalDevice, pLayerName, pPropertyCount, pProperties);
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600314 loader_platform_thread_unlock_mutex(&loader_lock);
Tony Barbour59a47322015-06-24 16:06:58 -0600315 return res;
316}
317
Courtney Goeltzenleuchter35985f62015-09-14 17:22:16 -0600318LOADER_EXPORT VkResult VKAPI vkEnumerateDeviceLayerProperties(
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600319 VkPhysicalDevice physicalDevice,
Chia-I Wud50a7d72015-10-26 20:48:51 +0800320 uint32_t* pPropertyCount,
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600321 VkLayerProperties* pProperties)
Tony Barbour59a47322015-06-24 16:06:58 -0600322{
323 VkResult res;
324
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600325 loader_platform_thread_lock_mutex(&loader_lock);
Jon Ashburnb2ef1372015-07-16 17:19:31 -0600326 //TODO convert over to using instance chain dispatch
Chia-I Wud50a7d72015-10-26 20:48:51 +0800327 res = loader_EnumerateDeviceLayerProperties(physicalDevice, pPropertyCount, pProperties);
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600328 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburn27cd5842015-05-12 17:26:48 -0600329 return res;
330}
331
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600332LOADER_EXPORT void VKAPI vkGetDeviceQueue(VkDevice device, uint32_t queueNodeIndex, uint32_t queueIndex, VkQueue* pQueue)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600333{
334 const VkLayerDispatchTable *disp;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600335
336 disp = loader_get_dispatch(device);
337
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600338 disp->GetDeviceQueue(device, queueNodeIndex, queueIndex, pQueue);
339 loader_set_dispatch(*pQueue, disp);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600340}
341
Chia-I Wu40cf0ae2015-10-26 17:20:32 +0800342LOADER_EXPORT VkResult VKAPI vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600343{
344 const VkLayerDispatchTable *disp;
345
346 disp = loader_get_dispatch(queue);
347
Chia-I Wu40cf0ae2015-10-26 17:20:32 +0800348 return disp->QueueSubmit(queue, submitCount, pSubmits, fence);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600349}
350
351LOADER_EXPORT VkResult VKAPI vkQueueWaitIdle(VkQueue queue)
352{
353 const VkLayerDispatchTable *disp;
354
355 disp = loader_get_dispatch(queue);
356
357 return disp->QueueWaitIdle(queue);
358}
359
360LOADER_EXPORT VkResult VKAPI vkDeviceWaitIdle(VkDevice device)
361{
362 const VkLayerDispatchTable *disp;
363
364 disp = loader_get_dispatch(device);
365
366 return disp->DeviceWaitIdle(device);
367}
368
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800369LOADER_EXPORT VkResult VKAPI vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo, const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600370{
371 const VkLayerDispatchTable *disp;
372
373 disp = loader_get_dispatch(device);
374
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800375 return disp->AllocateMemory(device, pAllocateInfo, pAllocator, pMemory);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600376}
377
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800378LOADER_EXPORT void VKAPI vkFreeMemory(VkDevice device, VkDeviceMemory mem, const VkAllocationCallbacks* pAllocator)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600379{
380 const VkLayerDispatchTable *disp;
381
382 disp = loader_get_dispatch(device);
383
Chia-I Wuf7458c52015-10-26 21:10:41 +0800384 disp->FreeMemory(device, mem, pAllocator);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600385}
386
Jon Ashburnd55a3942015-05-06 09:02:10 -0600387LOADER_EXPORT VkResult VKAPI vkMapMemory(VkDevice device, VkDeviceMemory mem, VkDeviceSize offset, VkDeviceSize size, VkFlags flags, void** ppData)
388{
389 const VkLayerDispatchTable *disp;
390
391 disp = loader_get_dispatch(device);
392
393 return disp->MapMemory(device, mem, offset, size, flags, ppData);
394}
395
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600396LOADER_EXPORT void VKAPI vkUnmapMemory(VkDevice device, VkDeviceMemory mem)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600397{
398 const VkLayerDispatchTable *disp;
399
400 disp = loader_get_dispatch(device);
401
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600402 disp->UnmapMemory(device, mem);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600403}
404
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800405LOADER_EXPORT VkResult VKAPI vkFlushMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600406{
407 const VkLayerDispatchTable *disp;
408
409 disp = loader_get_dispatch(device);
410
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800411 return disp->FlushMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600412}
413
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800414LOADER_EXPORT VkResult VKAPI vkInvalidateMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600415{
416 const VkLayerDispatchTable *disp;
417
418 disp = loader_get_dispatch(device);
419
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800420 return disp->InvalidateMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600421}
422
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600423LOADER_EXPORT void VKAPI vkGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes)
Courtney Goeltzenleuchterfb71f222015-07-09 21:57:28 -0600424{
425 const VkLayerDispatchTable *disp;
426
427 disp = loader_get_dispatch(device);
428
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600429 disp->GetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes);
Courtney Goeltzenleuchterfb71f222015-07-09 21:57:28 -0600430}
431
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600432LOADER_EXPORT VkResult VKAPI vkBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory mem, VkDeviceSize offset)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600433{
434 const VkLayerDispatchTable *disp;
435
Mark Lobodzinski942b1722015-05-11 17:21:15 -0500436 disp = loader_get_dispatch(device);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600437
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600438 return disp->BindBufferMemory(device, buffer, mem, offset);
439}
440
441LOADER_EXPORT VkResult VKAPI vkBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory mem, VkDeviceSize offset)
442{
443 const VkLayerDispatchTable *disp;
444
445 disp = loader_get_dispatch(device);
446
447 return disp->BindImageMemory(device, image, mem, offset);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600448}
449
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600450LOADER_EXPORT void VKAPI vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements)
Jon Ashburn754864f2015-07-23 18:49:07 -0600451{
452 const VkLayerDispatchTable *disp;
453
454 disp = loader_get_dispatch(device);
455
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600456 disp->GetBufferMemoryRequirements(device, buffer, pMemoryRequirements);
Jon Ashburn754864f2015-07-23 18:49:07 -0600457}
458
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600459LOADER_EXPORT void VKAPI vkGetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements)
Jon Ashburn754864f2015-07-23 18:49:07 -0600460{
461 const VkLayerDispatchTable *disp;
462
463 disp = loader_get_dispatch(device);
464
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600465 disp->GetImageMemoryRequirements(device, image, pMemoryRequirements);
Jon Ashburn754864f2015-07-23 18:49:07 -0600466}
467
Chia-I Wud50a7d72015-10-26 20:48:51 +0800468LOADER_EXPORT void VKAPI vkGetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements* pSparseMemoryRequirements)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600469{
470 const VkLayerDispatchTable *disp;
471
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600472 disp = loader_get_dispatch(device);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600473
Chia-I Wud50a7d72015-10-26 20:48:51 +0800474 disp->GetImageSparseMemoryRequirements(device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600475}
476
Chia-I Wud50a7d72015-10-26 20:48:51 +0800477LOADER_EXPORT void VKAPI vkGetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, uint32_t samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t* pPropertyCount, VkSparseImageFormatProperties* pProperties)
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600478{
479 const VkLayerInstanceDispatchTable *disp;
480
481 disp = loader_get_instance_dispatch(physicalDevice);
482
Chia-I Wud50a7d72015-10-26 20:48:51 +0800483 disp->GetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, pPropertyCount, pProperties);
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600484}
485
Chia-I Wu1ff4c3d2015-10-26 16:55:27 +0800486LOADER_EXPORT VkResult VKAPI vkQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence)
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600487{
488 const VkLayerDispatchTable *disp;
489
490 disp = loader_get_dispatch(queue);
491
Chia-I Wu1ff4c3d2015-10-26 16:55:27 +0800492 return disp->QueueBindSparse(queue, bindInfoCount, pBindInfo, fence);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600493}
494
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800495LOADER_EXPORT VkResult VKAPI vkCreateFence(VkDevice device, const VkFenceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600496{
497 const VkLayerDispatchTable *disp;
498
499 disp = loader_get_dispatch(device);
500
Chia-I Wuf7458c52015-10-26 21:10:41 +0800501 return disp->CreateFence(device, pCreateInfo, pAllocator, pFence);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600502}
503
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800504LOADER_EXPORT void VKAPI vkDestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600505{
506 const VkLayerDispatchTable *disp;
507
508 disp = loader_get_dispatch(device);
509
Chia-I Wuf7458c52015-10-26 21:10:41 +0800510 disp->DestroyFence(device, fence, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600511}
512
Courtney Goeltzenleuchter2bf8f902015-06-18 17:28:20 -0600513LOADER_EXPORT VkResult VKAPI vkResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600514{
515 const VkLayerDispatchTable *disp;
516
517 disp = loader_get_dispatch(device);
518
519 return disp->ResetFences(device, fenceCount, pFences);
520}
521
522LOADER_EXPORT VkResult VKAPI vkGetFenceStatus(VkDevice device, VkFence fence)
523{
524 const VkLayerDispatchTable *disp;
525
526 disp = loader_get_dispatch(device);
527
528 return disp->GetFenceStatus(device, fence);
529}
530
Courtney Goeltzenleuchtercd2a0992015-07-09 11:44:38 -0600531LOADER_EXPORT VkResult VKAPI vkWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600532{
533 const VkLayerDispatchTable *disp;
534
535 disp = loader_get_dispatch(device);
536
537 return disp->WaitForFences(device, fenceCount, pFences, waitAll, timeout);
538}
539
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800540LOADER_EXPORT VkResult VKAPI vkCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSemaphore* pSemaphore)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600541{
542 const VkLayerDispatchTable *disp;
543
544 disp = loader_get_dispatch(device);
545
Chia-I Wuf7458c52015-10-26 21:10:41 +0800546 return disp->CreateSemaphore(device, pCreateInfo, pAllocator, pSemaphore);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600547}
548
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800549LOADER_EXPORT void VKAPI vkDestroySemaphore(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600550{
551 const VkLayerDispatchTable *disp;
552
553 disp = loader_get_dispatch(device);
554
Chia-I Wuf7458c52015-10-26 21:10:41 +0800555 disp->DestroySemaphore(device, semaphore, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600556}
557
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800558LOADER_EXPORT VkResult VKAPI vkCreateEvent(VkDevice device, const VkEventCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkEvent* pEvent)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600559{
560 const VkLayerDispatchTable *disp;
561
562 disp = loader_get_dispatch(device);
563
Chia-I Wuf7458c52015-10-26 21:10:41 +0800564 return disp->CreateEvent(device, pCreateInfo, pAllocator, pEvent);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600565}
566
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800567LOADER_EXPORT void VKAPI vkDestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600568{
569 const VkLayerDispatchTable *disp;
570
571 disp = loader_get_dispatch(device);
572
Chia-I Wuf7458c52015-10-26 21:10:41 +0800573 disp->DestroyEvent(device, event, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600574}
575
Jon Ashburnd55a3942015-05-06 09:02:10 -0600576LOADER_EXPORT VkResult VKAPI vkGetEventStatus(VkDevice device, VkEvent event)
577{
578 const VkLayerDispatchTable *disp;
579
580 disp = loader_get_dispatch(device);
581
582 return disp->GetEventStatus(device, event);
583}
584
585LOADER_EXPORT VkResult VKAPI vkSetEvent(VkDevice device, VkEvent event)
586{
587 const VkLayerDispatchTable *disp;
588
589 disp = loader_get_dispatch(device);
590
591 return disp->SetEvent(device, event);
592}
593
594LOADER_EXPORT VkResult VKAPI vkResetEvent(VkDevice device, VkEvent event)
595{
596 const VkLayerDispatchTable *disp;
597
598 disp = loader_get_dispatch(device);
599
600 return disp->ResetEvent(device, event);
601}
602
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800603LOADER_EXPORT VkResult VKAPI vkCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkQueryPool* pQueryPool)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600604{
605 const VkLayerDispatchTable *disp;
606
607 disp = loader_get_dispatch(device);
608
Chia-I Wuf7458c52015-10-26 21:10:41 +0800609 return disp->CreateQueryPool(device, pCreateInfo, pAllocator, pQueryPool);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600610}
611
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800612LOADER_EXPORT void VKAPI vkDestroyQueryPool(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600613{
614 const VkLayerDispatchTable *disp;
615
616 disp = loader_get_dispatch(device);
617
Chia-I Wuf7458c52015-10-26 21:10:41 +0800618 disp->DestroyQueryPool(device, queryPool, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600619}
620
Chia-I Wuccc93a72015-10-26 18:36:20 +0800621LOADER_EXPORT VkResult VKAPI vkGetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount, size_t dataSize, void* pData, VkDeviceSize stride, VkQueryResultFlags flags)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600622{
623 const VkLayerDispatchTable *disp;
624
625 disp = loader_get_dispatch(device);
626
Chia-I Wuccc93a72015-10-26 18:36:20 +0800627 return disp->GetQueryPoolResults(device, queryPool, startQuery, queryCount, dataSize, pData, stride, flags);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600628}
629
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800630LOADER_EXPORT VkResult VKAPI vkCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600631{
632 const VkLayerDispatchTable *disp;
633
634 disp = loader_get_dispatch(device);
635
Chia-I Wuf7458c52015-10-26 21:10:41 +0800636 return disp->CreateBuffer(device, pCreateInfo, pAllocator, pBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600637}
638
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800639LOADER_EXPORT void VKAPI vkDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600640{
641 const VkLayerDispatchTable *disp;
642
643 disp = loader_get_dispatch(device);
644
Chia-I Wuf7458c52015-10-26 21:10:41 +0800645 disp->DestroyBuffer(device, buffer, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600646}
647
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800648LOADER_EXPORT VkResult VKAPI vkCreateBufferView(VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBufferView* pView)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600649{
650 const VkLayerDispatchTable *disp;
651
652 disp = loader_get_dispatch(device);
653
Chia-I Wuf7458c52015-10-26 21:10:41 +0800654 return disp->CreateBufferView(device, pCreateInfo, pAllocator, pView);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600655}
656
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800657LOADER_EXPORT void VKAPI vkDestroyBufferView(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600658{
659 const VkLayerDispatchTable *disp;
660
661 disp = loader_get_dispatch(device);
662
Chia-I Wuf7458c52015-10-26 21:10:41 +0800663 disp->DestroyBufferView(device, bufferView, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600664}
665
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800666LOADER_EXPORT VkResult VKAPI vkCreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImage* pImage)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600667{
668 const VkLayerDispatchTable *disp;
669
670 disp = loader_get_dispatch(device);
671
Chia-I Wuf7458c52015-10-26 21:10:41 +0800672 return disp->CreateImage(device, pCreateInfo, pAllocator, pImage);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600673}
674
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800675LOADER_EXPORT void VKAPI vkDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600676{
677 const VkLayerDispatchTable *disp;
678
679 disp = loader_get_dispatch(device);
680
Chia-I Wuf7458c52015-10-26 21:10:41 +0800681 disp->DestroyImage(device, image, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600682}
683
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600684LOADER_EXPORT void VKAPI vkGetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600685{
686 const VkLayerDispatchTable *disp;
687
688 disp = loader_get_dispatch(device);
689
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600690 disp->GetImageSubresourceLayout(device, image, pSubresource, pLayout);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600691}
692
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800693LOADER_EXPORT VkResult VKAPI vkCreateImageView(VkDevice device, const VkImageViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImageView* pView)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600694{
695 const VkLayerDispatchTable *disp;
696
697 disp = loader_get_dispatch(device);
698
Chia-I Wuf7458c52015-10-26 21:10:41 +0800699 return disp->CreateImageView(device, pCreateInfo, pAllocator, pView);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600700}
701
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800702LOADER_EXPORT void VKAPI vkDestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600703{
704 const VkLayerDispatchTable *disp;
705
706 disp = loader_get_dispatch(device);
707
Chia-I Wuf7458c52015-10-26 21:10:41 +0800708 disp->DestroyImageView(device, imageView, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600709}
710
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800711LOADER_EXPORT VkResult VKAPI vkCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkShaderModule* pShader)
Courtney Goeltzenleuchter2d2cb682015-06-24 18:24:19 -0600712{
713 const VkLayerDispatchTable *disp;
714
715 disp = loader_get_dispatch(device);
716
Chia-I Wuf7458c52015-10-26 21:10:41 +0800717 return disp->CreateShaderModule(device, pCreateInfo, pAllocator, pShader);
Courtney Goeltzenleuchter2d2cb682015-06-24 18:24:19 -0600718}
719
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800720LOADER_EXPORT void VKAPI vkDestroyShaderModule(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600721{
722 const VkLayerDispatchTable *disp;
723
724 disp = loader_get_dispatch(device);
725
Chia-I Wuf7458c52015-10-26 21:10:41 +0800726 disp->DestroyShaderModule(device, shaderModule, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600727}
728
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800729LOADER_EXPORT VkResult VKAPI vkCreateShader(VkDevice device, const VkShaderCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkShader* pShader)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600730{
731 const VkLayerDispatchTable *disp;
732
733 disp = loader_get_dispatch(device);
734
Chia-I Wuf7458c52015-10-26 21:10:41 +0800735 return disp->CreateShader(device, pCreateInfo, pAllocator, pShader);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600736}
737
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800738LOADER_EXPORT void VKAPI vkDestroyShader(VkDevice device, VkShader shader, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600739{
740 const VkLayerDispatchTable *disp;
741
742 disp = loader_get_dispatch(device);
743
Chia-I Wuf7458c52015-10-26 21:10:41 +0800744 disp->DestroyShader(device, shader, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600745}
746
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800747LOADER_EXPORT VkResult VKAPI vkCreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineCache* pPipelineCache)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600748{
749 const VkLayerDispatchTable *disp;
750
751 disp = loader_get_dispatch(device);
752
Chia-I Wuf7458c52015-10-26 21:10:41 +0800753 return disp->CreatePipelineCache(device, pCreateInfo, pAllocator, pPipelineCache);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600754}
755
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800756LOADER_EXPORT void VKAPI vkDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks* pAllocator)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600757{
758 const VkLayerDispatchTable *disp;
759
760 disp = loader_get_dispatch(device);
761
Chia-I Wuf7458c52015-10-26 21:10:41 +0800762 disp->DestroyPipelineCache(device, pipelineCache, pAllocator);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600763}
764
Chia-I Wub16facd2015-10-26 19:17:06 +0800765LOADER_EXPORT VkResult VKAPI vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600766{
767 const VkLayerDispatchTable *disp;
768
769 disp = loader_get_dispatch(device);
770
Chia-I Wub16facd2015-10-26 19:17:06 +0800771 return disp->GetPipelineCacheData(device, pipelineCache, pDataSize, pData);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600772}
773
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800774LOADER_EXPORT VkResult VKAPI vkMergePipelineCaches(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600775{
776 const VkLayerDispatchTable *disp;
777
778 disp = loader_get_dispatch(device);
779
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800780 return disp->MergePipelineCaches(device, dstCache, srcCacheCount, pSrcCaches);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600781}
782
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800783LOADER_EXPORT VkResult VKAPI vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600784{
785 const VkLayerDispatchTable *disp;
786
787 disp = loader_get_dispatch(device);
788
Chia-I Wuf7458c52015-10-26 21:10:41 +0800789 return disp->CreateGraphicsPipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines);
Jon Ashburnc669cc62015-07-09 15:02:25 -0600790}
791
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800792LOADER_EXPORT VkResult VKAPI vkCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines)
Jon Ashburnc669cc62015-07-09 15:02:25 -0600793{
794 const VkLayerDispatchTable *disp;
795
796 disp = loader_get_dispatch(device);
797
Chia-I Wuf7458c52015-10-26 21:10:41 +0800798 return disp->CreateComputePipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600799}
800
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800801LOADER_EXPORT void VKAPI vkDestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600802{
803 const VkLayerDispatchTable *disp;
804
805 disp = loader_get_dispatch(device);
806
Chia-I Wuf7458c52015-10-26 21:10:41 +0800807 disp->DestroyPipeline(device, pipeline, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600808}
809
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800810LOADER_EXPORT VkResult VKAPI vkCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineLayout* pPipelineLayout)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600811{
812 const VkLayerDispatchTable *disp;
813
814 disp = loader_get_dispatch(device);
815
Chia-I Wuf7458c52015-10-26 21:10:41 +0800816 return disp->CreatePipelineLayout(device, pCreateInfo, pAllocator, pPipelineLayout);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600817}
818
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800819LOADER_EXPORT void VKAPI vkDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600820{
821 const VkLayerDispatchTable *disp;
822
823 disp = loader_get_dispatch(device);
824
Chia-I Wuf7458c52015-10-26 21:10:41 +0800825 disp->DestroyPipelineLayout(device, pipelineLayout, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600826}
827
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800828LOADER_EXPORT VkResult VKAPI vkCreateSampler(VkDevice device, const VkSamplerCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSampler* pSampler)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600829{
830 const VkLayerDispatchTable *disp;
831
832 disp = loader_get_dispatch(device);
833
Chia-I Wuf7458c52015-10-26 21:10:41 +0800834 return disp->CreateSampler(device, pCreateInfo, pAllocator, pSampler);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600835}
836
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800837LOADER_EXPORT void VKAPI vkDestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600838{
839 const VkLayerDispatchTable *disp;
840
841 disp = loader_get_dispatch(device);
842
Chia-I Wuf7458c52015-10-26 21:10:41 +0800843 disp->DestroySampler(device, sampler, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600844}
845
846
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800847LOADER_EXPORT VkResult VKAPI vkCreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorSetLayout* pSetLayout)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600848{
849 const VkLayerDispatchTable *disp;
850
851 disp = loader_get_dispatch(device);
852
Chia-I Wuf7458c52015-10-26 21:10:41 +0800853 return disp->CreateDescriptorSetLayout(device, pCreateInfo, pAllocator, pSetLayout);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600854}
855
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800856LOADER_EXPORT void VKAPI vkDestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600857{
858 const VkLayerDispatchTable *disp;
859
860 disp = loader_get_dispatch(device);
861
Chia-I Wuf7458c52015-10-26 21:10:41 +0800862 disp->DestroyDescriptorSetLayout(device, descriptorSetLayout, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600863}
864
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800865LOADER_EXPORT VkResult VKAPI vkCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorPool* pDescriptorPool)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600866{
867 const VkLayerDispatchTable *disp;
868
869 disp = loader_get_dispatch(device);
870
Chia-I Wuf7458c52015-10-26 21:10:41 +0800871 return disp->CreateDescriptorPool(device, pCreateInfo, pAllocator, pDescriptorPool);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600872}
873
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800874LOADER_EXPORT void VKAPI vkDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks* pAllocator)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600875{
876 const VkLayerDispatchTable *disp;
877
878 disp = loader_get_dispatch(device);
879
Chia-I Wuf7458c52015-10-26 21:10:41 +0800880 disp->DestroyDescriptorPool(device, descriptorPool, pAllocator);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600881}
882
883
Courtney Goeltzenleuchterbee18a92015-10-23 14:21:05 -0600884LOADER_EXPORT VkResult VKAPI vkResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600885{
886 const VkLayerDispatchTable *disp;
887
888 disp = loader_get_dispatch(device);
889
Courtney Goeltzenleuchterbee18a92015-10-23 14:21:05 -0600890 return disp->ResetDescriptorPool(device, descriptorPool, flags);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600891}
892
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800893LOADER_EXPORT VkResult VKAPI vkAllocateDescriptorSets(VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600894{
895 const VkLayerDispatchTable *disp;
896
897 disp = loader_get_dispatch(device);
898
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800899 return disp->AllocateDescriptorSets(device, pAllocateInfo, pDescriptorSets);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600900}
901
Chia-I Wud50a7d72015-10-26 20:48:51 +0800902LOADER_EXPORT VkResult VKAPI vkFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets)
Tony Barbour34ec6922015-07-10 10:50:45 -0600903{
904 const VkLayerDispatchTable *disp;
905
906 disp = loader_get_dispatch(device);
907
Chia-I Wud50a7d72015-10-26 20:48:51 +0800908 return disp->FreeDescriptorSets(device, descriptorPool, descriptorSetCount, pDescriptorSets);
Tony Barbour34ec6922015-07-10 10:50:45 -0600909}
910
Chia-I Wu40cf0ae2015-10-26 17:20:32 +0800911LOADER_EXPORT void VKAPI vkUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet* pDescriptorCopies)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600912{
913 const VkLayerDispatchTable *disp;
914
915 disp = loader_get_dispatch(device);
916
Chia-I Wu40cf0ae2015-10-26 17:20:32 +0800917 disp->UpdateDescriptorSets(device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, pDescriptorCopies);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600918}
919
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800920LOADER_EXPORT VkResult VKAPI vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFramebuffer* pFramebuffer)
Jon Ashburn754864f2015-07-23 18:49:07 -0600921{
922 const VkLayerDispatchTable *disp;
923
924 disp = loader_get_dispatch(device);
925
Chia-I Wuf7458c52015-10-26 21:10:41 +0800926 return disp->CreateFramebuffer(device, pCreateInfo, pAllocator, pFramebuffer);
Jon Ashburn754864f2015-07-23 18:49:07 -0600927}
928
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800929LOADER_EXPORT void VKAPI vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* pAllocator)
Jon Ashburn754864f2015-07-23 18:49:07 -0600930{
931 const VkLayerDispatchTable *disp;
932
933 disp = loader_get_dispatch(device);
934
Chia-I Wuf7458c52015-10-26 21:10:41 +0800935 disp->DestroyFramebuffer(device, framebuffer, pAllocator);
Jon Ashburn754864f2015-07-23 18:49:07 -0600936}
937
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800938LOADER_EXPORT VkResult VKAPI vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass)
Jon Ashburn754864f2015-07-23 18:49:07 -0600939{
940 const VkLayerDispatchTable *disp;
941
942 disp = loader_get_dispatch(device);
943
Chia-I Wuf7458c52015-10-26 21:10:41 +0800944 return disp->CreateRenderPass(device, pCreateInfo, pAllocator, pRenderPass);
Jon Ashburn754864f2015-07-23 18:49:07 -0600945}
946
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800947LOADER_EXPORT void VKAPI vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator)
Jon Ashburn754864f2015-07-23 18:49:07 -0600948{
949 const VkLayerDispatchTable *disp;
950
951 disp = loader_get_dispatch(device);
952
Chia-I Wuf7458c52015-10-26 21:10:41 +0800953 disp->DestroyRenderPass(device, renderPass, pAllocator);
Jon Ashburn754864f2015-07-23 18:49:07 -0600954}
955
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600956LOADER_EXPORT void VKAPI vkGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity)
Jon Ashburn754864f2015-07-23 18:49:07 -0600957{
958 const VkLayerDispatchTable *disp;
959
960 disp = loader_get_dispatch(device);
961
Courtney Goeltzenleuchter06d89472015-10-20 16:40:38 -0600962 disp->GetRenderAreaGranularity(device, renderPass, pGranularity);
Jon Ashburn754864f2015-07-23 18:49:07 -0600963}
964
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800965LOADER_EXPORT VkResult VKAPI vkCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool)
Cody Northrope62183e2015-07-09 18:08:05 -0600966{
967 const VkLayerDispatchTable *disp;
968
969 disp = loader_get_dispatch(device);
970
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800971 return disp->CreateCommandPool(device, pCreateInfo, pAllocator, pCommandPool);
Cody Northrope62183e2015-07-09 18:08:05 -0600972}
973
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800974LOADER_EXPORT void VKAPI vkDestroyCommandPool(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks* pAllocator)
Cody Northrope62183e2015-07-09 18:08:05 -0600975{
976 const VkLayerDispatchTable *disp;
977
978 disp = loader_get_dispatch(device);
979
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800980 disp->DestroyCommandPool(device, commandPool, pAllocator);
Cody Northrope62183e2015-07-09 18:08:05 -0600981}
982
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800983LOADER_EXPORT VkResult VKAPI vkResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags)
Cody Northrope62183e2015-07-09 18:08:05 -0600984{
985 const VkLayerDispatchTable *disp;
986
987 disp = loader_get_dispatch(device);
988
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800989 return disp->ResetCommandPool(device, commandPool, flags);
Cody Northrope62183e2015-07-09 18:08:05 -0600990}
991
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800992LOADER_EXPORT VkResult VKAPI vkAllocateCommandBuffers(
Courtney Goeltzenleuchterbee18a92015-10-23 14:21:05 -0600993 VkDevice device,
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800994 const VkCommandBufferAllocateInfo* pAllocateInfo,
995 VkCommandBuffer* pCommandBuffers)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600996{
997 const VkLayerDispatchTable *disp;
998 VkResult res;
999
1000 disp = loader_get_dispatch(device);
1001
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001002 res = disp->AllocateCommandBuffers(device, pAllocateInfo, pCommandBuffers);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001003 if (res == VK_SUCCESS) {
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001004 for (uint32_t i =0; i < pAllocateInfo->bufferCount; i++) {
1005 if (pCommandBuffers[i]) {
1006 loader_init_dispatch(pCommandBuffers[i], disp);
Courtney Goeltzenleuchterbee18a92015-10-23 14:21:05 -06001007 }
1008 }
Jon Ashburnd55a3942015-05-06 09:02:10 -06001009 }
1010
1011 return res;
1012}
1013
Courtney Goeltzenleuchterbee18a92015-10-23 14:21:05 -06001014LOADER_EXPORT void VKAPI vkFreeCommandBuffers(
1015 VkDevice device,
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001016 VkCommandPool commandPool,
Chia-I Wud50a7d72015-10-26 20:48:51 +08001017 uint32_t commandBufferCount,
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001018 const VkCommandBuffer* pCommandBuffers)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001019{
1020 const VkLayerDispatchTable *disp;
1021
1022 disp = loader_get_dispatch(device);
1023
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001024 disp->FreeCommandBuffers(device, commandPool, commandBufferCount, pCommandBuffers);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001025}
1026
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001027LOADER_EXPORT VkResult VKAPI vkBeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo* pBeginInfo)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001028{
1029 const VkLayerDispatchTable *disp;
1030
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001031 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001032
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001033 return disp->BeginCommandBuffer(commandBuffer, pBeginInfo);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001034}
1035
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001036LOADER_EXPORT VkResult VKAPI vkEndCommandBuffer(VkCommandBuffer commandBuffer)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001037{
1038 const VkLayerDispatchTable *disp;
1039
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001040 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001041
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001042 return disp->EndCommandBuffer(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001043}
1044
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001045LOADER_EXPORT VkResult VKAPI vkResetCommandBuffer(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001046{
1047 const VkLayerDispatchTable *disp;
1048
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001049 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001050
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001051 return disp->ResetCommandBuffer(commandBuffer, flags);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001052}
1053
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001054LOADER_EXPORT void VKAPI vkCmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001055{
1056 const VkLayerDispatchTable *disp;
1057
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001058 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001059
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001060 disp->CmdBindPipeline(commandBuffer, pipelineBindPoint, pipeline);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001061}
1062
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001063LOADER_EXPORT void VKAPI vkCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t viewportCount, const VkViewport* pViewports)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001064{
1065 const VkLayerDispatchTable *disp;
1066
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001067 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001068
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001069 disp->CmdSetViewport(commandBuffer, viewportCount, pViewports);
Courtney Goeltzenleuchter078f8172015-09-21 11:44:06 -06001070}
1071
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001072LOADER_EXPORT void VKAPI vkCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t scissorCount, const VkRect2D* pScissors)
Courtney Goeltzenleuchter078f8172015-09-21 11:44:06 -06001073{
1074 const VkLayerDispatchTable *disp;
1075
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001076 disp = loader_get_dispatch(commandBuffer);
Courtney Goeltzenleuchter078f8172015-09-21 11:44:06 -06001077
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001078 disp->CmdSetScissor(commandBuffer, scissorCount, pScissors);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001079}
1080
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001081LOADER_EXPORT void VKAPI vkCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001082{
1083 const VkLayerDispatchTable *disp;
1084
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001085 disp = loader_get_dispatch(commandBuffer);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001086
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001087 disp->CmdSetLineWidth(commandBuffer, lineWidth);
Cody Northrop12365112015-08-17 11:10:49 -06001088}
1089
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001090LOADER_EXPORT void VKAPI vkCmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor)
Cody Northrop12365112015-08-17 11:10:49 -06001091{
1092 const VkLayerDispatchTable *disp;
1093
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001094 disp = loader_get_dispatch(commandBuffer);
Cody Northrop12365112015-08-17 11:10:49 -06001095
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001096 disp->CmdSetDepthBias(commandBuffer, depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001097}
1098
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001099LOADER_EXPORT void VKAPI vkCmdSetBlendConstants(VkCommandBuffer commandBuffer, const float blendConstants[4])
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001100{
1101 const VkLayerDispatchTable *disp;
1102
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001103 disp = loader_get_dispatch(commandBuffer);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001104
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001105 disp->CmdSetBlendConstants(commandBuffer, blendConstants);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001106}
1107
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001108LOADER_EXPORT void VKAPI vkCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001109{
1110 const VkLayerDispatchTable *disp;
1111
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001112 disp = loader_get_dispatch(commandBuffer);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001113
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001114 disp->CmdSetDepthBounds(commandBuffer, minDepthBounds, maxDepthBounds);
Cody Northrop82485a82015-08-18 15:21:16 -06001115}
1116
Chia-I Wu1b99bb22015-10-27 19:25:11 +08001117LOADER_EXPORT void VKAPI vkCmdSetStencilCompareMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask)
Cody Northrop82485a82015-08-18 15:21:16 -06001118{
1119 const VkLayerDispatchTable *disp;
1120
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001121 disp = loader_get_dispatch(commandBuffer);
Cody Northrop82485a82015-08-18 15:21:16 -06001122
Chia-I Wu1b99bb22015-10-27 19:25:11 +08001123 disp->CmdSetStencilCompareMask(commandBuffer, faceMask, compareMask);
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001124}
1125
Chia-I Wu1b99bb22015-10-27 19:25:11 +08001126LOADER_EXPORT void VKAPI vkCmdSetStencilWriteMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask)
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001127{
1128 const VkLayerDispatchTable *disp;
1129
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001130 disp = loader_get_dispatch(commandBuffer);
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001131
Chia-I Wu1b99bb22015-10-27 19:25:11 +08001132 disp->CmdSetStencilWriteMask(commandBuffer, faceMask, writeMask);
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001133}
1134
Chia-I Wu1b99bb22015-10-27 19:25:11 +08001135LOADER_EXPORT void VKAPI vkCmdSetStencilReference(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference)
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001136{
1137 const VkLayerDispatchTable *disp;
1138
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001139 disp = loader_get_dispatch(commandBuffer);
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001140
Chia-I Wu1b99bb22015-10-27 19:25:11 +08001141 disp->CmdSetStencilReference(commandBuffer, faceMask, reference);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001142}
1143
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001144LOADER_EXPORT void VKAPI 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 -06001145{
1146 const VkLayerDispatchTable *disp;
1147
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001148 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001149
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001150 disp->CmdBindDescriptorSets(commandBuffer, pipelineBindPoint, layout, firstSet, descriptorSetCount, pDescriptorSets, dynamicOffsetCount, pDynamicOffsets);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001151}
1152
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001153LOADER_EXPORT void VKAPI vkCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001154{
1155 const VkLayerDispatchTable *disp;
1156
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001157 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001158
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001159 disp->CmdBindIndexBuffer(commandBuffer, buffer, offset, indexType);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001160}
1161
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001162LOADER_EXPORT void VKAPI vkCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t startBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets)
Jon Ashburn754864f2015-07-23 18:49:07 -06001163{
1164 const VkLayerDispatchTable *disp;
1165
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001166 disp = loader_get_dispatch(commandBuffer);
Jon Ashburn754864f2015-07-23 18:49:07 -06001167
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001168 disp->CmdBindVertexBuffers(commandBuffer, startBinding, bindingCount, pBuffers, pOffsets);
Jon Ashburn754864f2015-07-23 18:49:07 -06001169}
1170
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001171LOADER_EXPORT void VKAPI vkCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001172{
1173 const VkLayerDispatchTable *disp;
1174
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001175 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001176
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001177 disp->CmdDraw(commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001178}
1179
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001180LOADER_EXPORT void VKAPI 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 -06001181{
1182 const VkLayerDispatchTable *disp;
1183
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001184 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001185
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001186 disp->CmdDrawIndexed(commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001187}
1188
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001189LOADER_EXPORT void VKAPI vkCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001190{
1191 const VkLayerDispatchTable *disp;
1192
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001193 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001194
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001195 disp->CmdDrawIndirect(commandBuffer, buffer, offset, drawCount, stride);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001196}
1197
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001198LOADER_EXPORT void VKAPI vkCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001199{
1200 const VkLayerDispatchTable *disp;
1201
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001202 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001203
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001204 disp->CmdDrawIndexedIndirect(commandBuffer, buffer, offset, drawCount, stride);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001205}
1206
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001207LOADER_EXPORT void VKAPI vkCmdDispatch(VkCommandBuffer commandBuffer, uint32_t x, uint32_t y, uint32_t z)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001208{
1209 const VkLayerDispatchTable *disp;
1210
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001211 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001212
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001213 disp->CmdDispatch(commandBuffer, x, y, z);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001214}
1215
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001216LOADER_EXPORT void VKAPI vkCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001217{
1218 const VkLayerDispatchTable *disp;
1219
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001220 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001221
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001222 disp->CmdDispatchIndirect(commandBuffer, buffer, offset);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001223}
1224
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001225LOADER_EXPORT void VKAPI vkCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy* pRegions)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001226{
1227 const VkLayerDispatchTable *disp;
1228
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001229 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001230
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001231 disp->CmdCopyBuffer(commandBuffer, srcBuffer, dstBuffer, regionCount, pRegions);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001232}
1233
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001234LOADER_EXPORT void VKAPI vkCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy* pRegions)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001235{
1236 const VkLayerDispatchTable *disp;
1237
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001238 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001239
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001240 disp->CmdCopyImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001241}
1242
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001243LOADER_EXPORT void VKAPI 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 -06001244{
1245 const VkLayerDispatchTable *disp;
1246
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001247 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001248
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001249 disp->CmdBlitImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions, filter);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001250}
1251
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001252LOADER_EXPORT void VKAPI vkCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001253{
1254 const VkLayerDispatchTable *disp;
1255
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001256 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001257
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001258 disp->CmdCopyBufferToImage(commandBuffer, srcBuffer, dstImage, dstImageLayout, regionCount, pRegions);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001259}
1260
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001261LOADER_EXPORT void VKAPI vkCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001262{
1263 const VkLayerDispatchTable *disp;
1264
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001265 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001266
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001267 disp->CmdCopyImageToBuffer(commandBuffer, srcImage, srcImageLayout, dstBuffer, regionCount, pRegions);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001268}
1269
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001270LOADER_EXPORT void VKAPI vkCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const uint32_t* pData)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001271{
1272 const VkLayerDispatchTable *disp;
1273
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001274 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001275
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001276 disp->CmdUpdateBuffer(commandBuffer, dstBuffer, dstOffset, dataSize, pData);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001277}
1278
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001279LOADER_EXPORT void VKAPI vkCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001280{
1281 const VkLayerDispatchTable *disp;
1282
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001283 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001284
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001285 disp->CmdFillBuffer(commandBuffer, dstBuffer, dstOffset, size, data);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001286}
1287
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001288LOADER_EXPORT void VKAPI vkCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001289{
1290 const VkLayerDispatchTable *disp;
1291
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001292 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001293
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001294 disp->CmdClearColorImage(commandBuffer, image, imageLayout, pColor, rangeCount, pRanges);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001295}
1296
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001297LOADER_EXPORT void VKAPI vkCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001298{
1299 const VkLayerDispatchTable *disp;
1300
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001301 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001302
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001303 disp->CmdClearDepthStencilImage(commandBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges);
Chris Forbesd9be82b2015-06-22 17:21:59 +12001304}
1305
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001306LOADER_EXPORT void VKAPI vkCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkClearAttachment* pAttachments, uint32_t rectCount, const VkClearRect* pRects)
Chris Forbesd9be82b2015-06-22 17:21:59 +12001307{
1308 const VkLayerDispatchTable *disp;
1309
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001310 disp = loader_get_dispatch(commandBuffer);
Chris Forbesd9be82b2015-06-22 17:21:59 +12001311
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001312 disp->CmdClearAttachments(commandBuffer, attachmentCount, pAttachments, rectCount, pRects);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001313}
1314
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001315LOADER_EXPORT void VKAPI vkCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve* pRegions)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001316{
1317 const VkLayerDispatchTable *disp;
1318
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001319 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001320
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001321 disp->CmdResolveImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001322}
1323
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001324LOADER_EXPORT void VKAPI vkCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001325{
1326 const VkLayerDispatchTable *disp;
1327
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001328 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001329
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001330 disp->CmdSetEvent(commandBuffer, event, stageMask);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001331}
1332
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001333LOADER_EXPORT void VKAPI vkCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001334{
1335 const VkLayerDispatchTable *disp;
1336
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001337 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001338
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001339 disp->CmdResetEvent(commandBuffer, event, stageMask);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001340}
1341
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001342LOADER_EXPORT void VKAPI vkCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, VkPipelineStageFlags sourceStageMask, VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const void* const* ppMemoryBarriers)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001343{
1344 const VkLayerDispatchTable *disp;
1345
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001346 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001347
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001348 disp->CmdWaitEvents(commandBuffer, eventCount, pEvents, sourceStageMask, dstStageMask, memoryBarrierCount, ppMemoryBarriers);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001349}
1350
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001351LOADER_EXPORT void VKAPI vkCmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const void* const* ppMemoryBarriers)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001352{
1353 const VkLayerDispatchTable *disp;
1354
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001355 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001356
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001357 disp->CmdPipelineBarrier(commandBuffer, srcStageMask, dstStageMask, dependencyFlags, memoryBarrierCount, ppMemoryBarriers);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001358}
1359
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001360LOADER_EXPORT void VKAPI vkCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t slot, VkFlags flags)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001361{
1362 const VkLayerDispatchTable *disp;
1363
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001364 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001365
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001366 disp->CmdBeginQuery(commandBuffer, queryPool, slot, flags);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001367}
1368
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001369LOADER_EXPORT void VKAPI vkCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t slot)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001370{
1371 const VkLayerDispatchTable *disp;
1372
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001373 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001374
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001375 disp->CmdEndQuery(commandBuffer, queryPool, slot);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001376}
1377
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001378LOADER_EXPORT void VKAPI vkCmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001379{
1380 const VkLayerDispatchTable *disp;
1381
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001382 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001383
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001384 disp->CmdResetQueryPool(commandBuffer, queryPool, startQuery, queryCount);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001385}
1386
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001387LOADER_EXPORT void VKAPI vkCmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t slot)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001388{
1389 const VkLayerDispatchTable *disp;
1390
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001391 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001392
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001393 disp->CmdWriteTimestamp(commandBuffer, pipelineStage, queryPool, slot);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001394}
1395
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001396LOADER_EXPORT void VKAPI vkCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkFlags flags)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001397{
1398 const VkLayerDispatchTable *disp;
1399
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001400 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001401
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001402 disp->CmdCopyQueryPoolResults(commandBuffer, queryPool, startQuery, queryCount, dstBuffer, dstOffset, stride, flags);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001403}
1404
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001405LOADER_EXPORT void VKAPI vkCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void* values)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001406{
1407 const VkLayerDispatchTable *disp;
1408
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001409 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001410
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001411 disp->CmdPushConstants(commandBuffer, layout, stageFlags, offset, size, values);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001412}
1413
Chia-I Wu1b99bb22015-10-27 19:25:11 +08001414LOADER_EXPORT void VKAPI vkCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkSubpassContents contents)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001415{
1416 const VkLayerDispatchTable *disp;
1417
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001418 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001419
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001420 disp->CmdBeginRenderPass(commandBuffer, pRenderPassBegin, contents);
Chia-I Wu08accc62015-07-07 11:50:03 +08001421}
1422
Chia-I Wu1b99bb22015-10-27 19:25:11 +08001423LOADER_EXPORT void VKAPI vkCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents)
Chia-I Wu08accc62015-07-07 11:50:03 +08001424{
1425 const VkLayerDispatchTable *disp;
1426
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001427 disp = loader_get_dispatch(commandBuffer);
Chia-I Wu08accc62015-07-07 11:50:03 +08001428
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001429 disp->CmdNextSubpass(commandBuffer, contents);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001430}
1431
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001432LOADER_EXPORT void VKAPI vkCmdEndRenderPass(VkCommandBuffer commandBuffer)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001433{
1434 const VkLayerDispatchTable *disp;
1435
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001436 disp = loader_get_dispatch(commandBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001437
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001438 disp->CmdEndRenderPass(commandBuffer);
Chia-I Wu0b50a1c2015-06-26 15:34:39 +08001439}
1440
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001441LOADER_EXPORT void VKAPI vkCmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBuffersCount, const VkCommandBuffer* pCommandBuffers)
Chia-I Wu0b50a1c2015-06-26 15:34:39 +08001442{
1443 const VkLayerDispatchTable *disp;
1444
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001445 disp = loader_get_dispatch(commandBuffer);
Chia-I Wu0b50a1c2015-06-26 15:34:39 +08001446
Chia-I Wu3432a0c2015-10-27 18:04:07 +08001447 disp->CmdExecuteCommands(commandBuffer, commandBuffersCount, pCommandBuffers);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001448}