blob: 8ae81355bc0e6586ac36e2663914b26174aa6f7c [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,
37 VkInstance* pInstance)
Jon Ashburn27cd5842015-05-12 17:26:48 -060038{
39 struct loader_instance *ptr_instance = NULL;
Jon Ashburn27cd5842015-05-12 17:26:48 -060040 VkResult res = VK_ERROR_INITIALIZATION_FAILED;
Jon Ashburn27cd5842015-05-12 17:26:48 -060041
Jon Ashburn8810c5f2015-08-18 18:04:47 -060042 loader_platform_thread_once(&once_init, loader_initialize);
Jon Ashburn27cd5842015-05-12 17:26:48 -060043
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -060044 if (pCreateInfo->pAllocCb
45 && pCreateInfo->pAllocCb->pfnAlloc
46 && pCreateInfo->pAllocCb->pfnFree) {
47 ptr_instance = (struct loader_instance *) pCreateInfo->pAllocCb->pfnAlloc(
48 pCreateInfo->pAllocCb->pUserData,
49 sizeof(struct loader_instance),
50 sizeof(VkInstance),
51 VK_SYSTEM_ALLOC_TYPE_API_OBJECT);
52 } else {
53 ptr_instance = (struct loader_instance *) malloc(sizeof(struct loader_instance));
54 }
Jon Ashburn27cd5842015-05-12 17:26:48 -060055 if (ptr_instance == NULL) {
56 return VK_ERROR_OUT_OF_HOST_MEMORY;
57 }
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -060058
Jon Ashburn87d6aa92015-08-28 15:19:27 -060059 tls_instance = ptr_instance;
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -060060 loader_platform_thread_lock_mutex(&loader_lock);
Jon Ashburnb82c1852015-08-11 14:49:54 -060061 memset(ptr_instance, 0, sizeof(struct loader_instance));
Jon Ashburn07daee72015-05-21 18:13:33 -060062
Courtney Goeltzenleuchter7f5aafc2015-07-05 11:28:29 -060063 if (pCreateInfo->pAllocCb
64 && pCreateInfo->pAllocCb->pfnAlloc
65 && pCreateInfo->pAllocCb->pfnFree) {
66 ptr_instance->alloc_callbacks.pUserData = pCreateInfo->pAllocCb->pUserData;
67 ptr_instance->alloc_callbacks.pfnAlloc = pCreateInfo->pAllocCb->pfnAlloc;
68 ptr_instance->alloc_callbacks.pfnFree = pCreateInfo->pAllocCb->pfnFree;
69 }
70
Jon Ashburn3d002332015-08-20 16:35:30 -060071 /* Due to implicit layers need to get layer list even if
72 * layerCount == 0 and VK_INSTANCE_LAYERS is unset. For now always
73 * get layer list (both instance and device) via loader_layer_scan(). */
74 memset(&ptr_instance->instance_layer_list, 0, sizeof(ptr_instance->instance_layer_list));
75 memset(&ptr_instance->device_layer_list, 0, sizeof(ptr_instance->device_layer_list));
Jon Ashburne39a4f82015-08-28 13:38:21 -060076 loader_layer_scan(ptr_instance,
77
78
79 &ptr_instance->instance_layer_list,
80 &ptr_instance->device_layer_list);
Jon Ashburn3d002332015-08-20 16:35:30 -060081
82 /* validate the app requested layers to be enabled */
83 if (pCreateInfo->layerCount > 0) {
84 res = loader_validate_layers(pCreateInfo->layerCount,
85 pCreateInfo->ppEnabledLayerNames,
86 &ptr_instance->instance_layer_list);
87 if (res != VK_SUCCESS) {
88 return res;
89 }
90 }
91
Jon Ashburn8810c5f2015-08-18 18:04:47 -060092 /* Scan/discover all ICD libraries */
93 memset(&ptr_instance->icd_libs, 0, sizeof(ptr_instance->icd_libs));
Jon Ashburne39a4f82015-08-28 13:38:21 -060094 loader_icd_scan(ptr_instance, &ptr_instance->icd_libs);
Jon Ashburn8810c5f2015-08-18 18:04:47 -060095
Jon Ashburneacfa3a2015-08-14 12:51:47 -060096 /* get extensions from all ICD's, merge so no duplicates, then validate */
Jon Ashburne39a4f82015-08-28 13:38:21 -060097 loader_get_icd_loader_instance_extensions(ptr_instance,
98 &ptr_instance->icd_libs,
99 &ptr_instance->ext_list);
100 res = loader_validate_instance_extensions(&ptr_instance->ext_list,
101 &ptr_instance->instance_layer_list,
102 pCreateInfo);
Jon Ashburneacfa3a2015-08-14 12:51:47 -0600103 if (res != VK_SUCCESS) {
Jon Ashburne39a4f82015-08-28 13:38:21 -0600104 loader_delete_layer_properties(ptr_instance,
105 &ptr_instance->device_layer_list);
106 loader_delete_layer_properties(ptr_instance,
107 &ptr_instance->instance_layer_list);
108 loader_scanned_icd_clear(ptr_instance, &ptr_instance->icd_libs);
109 loader_destroy_ext_list(ptr_instance, &ptr_instance->ext_list);
Jon Ashburneacfa3a2015-08-14 12:51:47 -0600110 loader_platform_thread_unlock_mutex(&loader_lock);
111 loader_heap_free(ptr_instance, ptr_instance);
112 return res;
113 }
114
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -0600115 ptr_instance->disp = loader_heap_alloc(
116 ptr_instance,
117 sizeof(VkLayerInstanceDispatchTable),
118 VK_SYSTEM_ALLOC_TYPE_INTERNAL);
119 if (ptr_instance->disp == NULL) {
Jon Ashburne39a4f82015-08-28 13:38:21 -0600120 loader_delete_layer_properties(ptr_instance,
121 &ptr_instance->device_layer_list);
122 loader_delete_layer_properties(ptr_instance,
123 &ptr_instance->instance_layer_list);
124 loader_scanned_icd_clear(ptr_instance,
125 &ptr_instance->icd_libs);
126 loader_destroy_ext_list(ptr_instance,
127 &ptr_instance->ext_list);
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -0600128 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburneacfa3a2015-08-14 12:51:47 -0600129 loader_heap_free(ptr_instance, ptr_instance);
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -0600130 return VK_ERROR_OUT_OF_HOST_MEMORY;
131 }
132 memcpy(ptr_instance->disp, &instance_disp, sizeof(instance_disp));
133 ptr_instance->next = loader.instances;
134 loader.instances = ptr_instance;
135
Jon Ashburnb82c1852015-08-11 14:49:54 -0600136 /* activate any layers on instance chain */
Jon Ashburne39a4f82015-08-28 13:38:21 -0600137 res = loader_enable_instance_layers(ptr_instance,
138 pCreateInfo,
139 &ptr_instance->instance_layer_list);
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -0600140 if (res != VK_SUCCESS) {
Jon Ashburne39a4f82015-08-28 13:38:21 -0600141 loader_delete_layer_properties(ptr_instance,
142 &ptr_instance->device_layer_list);
143 loader_delete_layer_properties(ptr_instance,
144 &ptr_instance->instance_layer_list);
145 loader_scanned_icd_clear(ptr_instance,
146 &ptr_instance->icd_libs);
147 loader_destroy_ext_list(ptr_instance,
148 &ptr_instance->ext_list);
Jon Ashburneacfa3a2015-08-14 12:51:47 -0600149 loader.instances = ptr_instance->next;
150 loader_platform_thread_unlock_mutex(&loader_lock);
Courtney Goeltzenleuchter81095102015-07-06 09:08:37 -0600151 loader_heap_free(ptr_instance, ptr_instance->disp);
152 loader_heap_free(ptr_instance, ptr_instance);
153 return res;
154 }
Jon Ashburnb82c1852015-08-11 14:49:54 -0600155 loader_activate_instance_layers(ptr_instance);
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -0600156
Ian Elliottd3ef02f2015-07-06 14:36:13 -0600157 wsi_swapchain_create_instance(ptr_instance, pCreateInfo);
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600158 debug_report_create_instance(ptr_instance, pCreateInfo);
Jon Ashburn07daee72015-05-21 18:13:33 -0600159
Jon Ashburn27cd5842015-05-12 17:26:48 -0600160
Jon Ashburn27cd5842015-05-12 17:26:48 -0600161 *pInstance = (VkInstance) ptr_instance;
Jon Ashburneed0c002015-05-21 17:42:17 -0600162
163 res = ptr_instance->disp->CreateInstance(pCreateInfo, pInstance);
164
Courtney Goeltzenleuchterd971b612015-06-17 20:51:59 -0600165 /*
166 * Finally have the layers in place and everyone has seen
167 * the CreateInstance command go by. This allows the layer's
168 * GetInstanceProcAddr functions to return valid extension functions
169 * if enabled.
170 */
171 loader_activate_instance_layer_extensions(ptr_instance);
172
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600173 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburn27cd5842015-05-12 17:26:48 -0600174 return res;
175}
176
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600177LOADER_EXPORT void VKAPI vkDestroyInstance(
Jon Ashburn27cd5842015-05-12 17:26:48 -0600178 VkInstance instance)
179{
180 const VkLayerInstanceDispatchTable *disp;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600181 disp = loader_get_instance_dispatch(instance);
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -0600182
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600183 loader_platform_thread_lock_mutex(&loader_lock);
184
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600185 disp->DestroyInstance(instance);
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -0600186
Courtney Goeltzenleuchter7d0023c2015-06-08 15:09:22 -0600187 struct loader_instance *ptr_instance = loader_instance(instance);
188 loader_deactivate_instance_layers(ptr_instance);
Jon Ashburneacfa3a2015-08-14 12:51:47 -0600189 loader_heap_free(ptr_instance, ptr_instance->disp);
190 loader_heap_free(ptr_instance, ptr_instance);
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600191 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburn27cd5842015-05-12 17:26:48 -0600192}
Jon Ashburn95a77ba2015-05-15 15:09:35 -0600193
Jon Ashburn27cd5842015-05-12 17:26:48 -0600194LOADER_EXPORT VkResult VKAPI vkEnumeratePhysicalDevices(
195 VkInstance instance,
196 uint32_t* pPhysicalDeviceCount,
197 VkPhysicalDevice* pPhysicalDevices)
198{
199 const VkLayerInstanceDispatchTable *disp;
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600200 VkResult res;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600201 disp = loader_get_instance_dispatch(instance);
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600202
203 loader_platform_thread_lock_mutex(&loader_lock);
204 res = disp->EnumeratePhysicalDevices(instance, pPhysicalDeviceCount,
Jon Ashburn27cd5842015-05-12 17:26:48 -0600205 pPhysicalDevices);
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600206 loader_platform_thread_unlock_mutex(&loader_lock);
207 return res;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600208}
209
Jon Ashburn754864f2015-07-23 18:49:07 -0600210
211
212
213
214
215LOADER_EXPORT VkResult VKAPI vkGetPhysicalDeviceFeatures(
216 VkPhysicalDevice gpu,
217 VkPhysicalDeviceFeatures *pFeatures)
218{
219 const VkLayerInstanceDispatchTable *disp;
220 VkResult res;
221
222 disp = loader_get_instance_dispatch(gpu);
223 res = disp->GetPhysicalDeviceFeatures(gpu, pFeatures);
224 return res;
225}
226
227LOADER_EXPORT VkResult VKAPI vkGetPhysicalDeviceFormatProperties(
228 VkPhysicalDevice gpu,
229 VkFormat format,
230 VkFormatProperties *pFormatInfo)
231{
232 const VkLayerInstanceDispatchTable *disp;
233 VkResult res;
234
235 disp = loader_get_instance_dispatch(gpu);
236 res = disp->GetPhysicalDeviceFormatProperties(gpu, format, pFormatInfo);
237 return res;
238}
239
Courtney Goeltzenleuchtera22097a2015-09-10 13:44:12 -0600240LOADER_EXPORT VkResult VKAPI vkGetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties)
Jon Ashburn754864f2015-07-23 18:49:07 -0600241{
242 const VkLayerInstanceDispatchTable *disp;
243 VkResult res;
244
245 disp = loader_get_instance_dispatch(physicalDevice);
Courtney Goeltzenleuchtera22097a2015-09-10 13:44:12 -0600246 res = disp->GetPhysicalDeviceImageFormatProperties(physicalDevice, format, type, tiling, usage, flags, pImageFormatProperties);
Jon Ashburn754864f2015-07-23 18:49:07 -0600247 return res;
248}
249
Tony Barbour59a47322015-06-24 16:06:58 -0600250LOADER_EXPORT VkResult VKAPI vkGetPhysicalDeviceProperties(
Jon Ashburn27cd5842015-05-12 17:26:48 -0600251 VkPhysicalDevice gpu,
Tony Barbour59a47322015-06-24 16:06:58 -0600252 VkPhysicalDeviceProperties* pProperties)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600253{
Jon Ashburn95a77ba2015-05-15 15:09:35 -0600254 const VkLayerInstanceDispatchTable *disp;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600255 VkResult res;
256
Jon Ashburn95a77ba2015-05-15 15:09:35 -0600257 disp = loader_get_instance_dispatch(gpu);
Tony Barbour59a47322015-06-24 16:06:58 -0600258 res = disp->GetPhysicalDeviceProperties(gpu, pProperties);
Tony Barbour59a47322015-06-24 16:06:58 -0600259 return res;
260}
261
Cody Northropd0802882015-08-03 17:04:53 -0600262LOADER_EXPORT VkResult VKAPI vkGetPhysicalDeviceQueueFamilyProperties(
Tony Barbour59a47322015-06-24 16:06:58 -0600263 VkPhysicalDevice gpu,
Cody Northropd0802882015-08-03 17:04:53 -0600264 uint32_t* pCount,
265 VkQueueFamilyProperties* pQueueProperties)
Tony Barbour59a47322015-06-24 16:06:58 -0600266{
267 const VkLayerInstanceDispatchTable *disp;
268 VkResult res;
269
270 disp = loader_get_instance_dispatch(gpu);
Cody Northropd0802882015-08-03 17:04:53 -0600271 res = disp->GetPhysicalDeviceQueueFamilyProperties(gpu, pCount, pQueueProperties);
Tony Barbour59a47322015-06-24 16:06:58 -0600272 return res;
273}
274
275LOADER_EXPORT VkResult VKAPI vkGetPhysicalDeviceMemoryProperties(
276 VkPhysicalDevice gpu,
277 VkPhysicalDeviceMemoryProperties* pMemoryProperties)
278{
279 const VkLayerInstanceDispatchTable *disp;
280 VkResult res;
281
282 disp = loader_get_instance_dispatch(gpu);
Tony Barbour59a47322015-06-24 16:06:58 -0600283 res = disp->GetPhysicalDeviceMemoryProperties(gpu, pMemoryProperties);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600284 return res;
285}
286
Jon Ashburn95a77ba2015-05-15 15:09:35 -0600287LOADER_EXPORT VkResult VKAPI vkCreateDevice(
Courtney Goeltzenleuchterca173b82015-06-25 18:01:43 -0600288 VkPhysicalDevice gpu,
289 const VkDeviceCreateInfo* pCreateInfo,
290 VkDevice* pDevice)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600291{
Jon Ashburnd55a3942015-05-06 09:02:10 -0600292 VkResult res;
293
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600294 loader_platform_thread_lock_mutex(&loader_lock);
Courtney Goeltzenleuchterca173b82015-06-25 18:01:43 -0600295
296 res = loader_CreateDevice(gpu, pCreateInfo, pDevice);
297
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600298 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600299 return res;
300}
301
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600302LOADER_EXPORT void VKAPI vkDestroyDevice(VkDevice device)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600303{
304 const VkLayerDispatchTable *disp;
Jon Ashburne39a4f82015-08-28 13:38:21 -0600305 struct loader_device *dev;
306 struct loader_icd *icd = loader_get_icd_and_device(device, &dev);
307 const struct loader_instance *inst = icd->this_instance;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600308 disp = loader_get_dispatch(device);
309
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600310 loader_platform_thread_lock_mutex(&loader_lock);
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600311 disp->DestroyDevice(device);
Jon Ashburne39a4f82015-08-28 13:38:21 -0600312 loader_remove_logical_device(inst, device);
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600313 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600314}
315
Courtney Goeltzenleuchter35985f62015-09-14 17:22:16 -0600316LOADER_EXPORT VkResult VKAPI vkEnumerateDeviceExtensionProperties(
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600317 VkPhysicalDevice physicalDevice,
318 const char* pLayerName,
319 uint32_t* pCount,
320 VkExtensionProperties* pProperties)
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600321{
322 VkResult res;
323
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600324 loader_platform_thread_lock_mutex(&loader_lock);
Jon Ashburnb2ef1372015-07-16 17:19:31 -0600325 //TODO convert over to using instance chain dispatch
Courtney Goeltzenleuchter35985f62015-09-14 17:22:16 -0600326 res = loader_EnumerateDeviceExtensionProperties(physicalDevice, pLayerName, pCount, pProperties);
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600327 loader_platform_thread_unlock_mutex(&loader_lock);
Tony Barbour59a47322015-06-24 16:06:58 -0600328 return res;
329}
330
Courtney Goeltzenleuchter35985f62015-09-14 17:22:16 -0600331LOADER_EXPORT VkResult VKAPI vkEnumerateDeviceLayerProperties(
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600332 VkPhysicalDevice physicalDevice,
333 uint32_t* pCount,
334 VkLayerProperties* pProperties)
Tony Barbour59a47322015-06-24 16:06:58 -0600335{
336 VkResult res;
337
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600338 loader_platform_thread_lock_mutex(&loader_lock);
Jon Ashburnb2ef1372015-07-16 17:19:31 -0600339 //TODO convert over to using instance chain dispatch
Courtney Goeltzenleuchter35985f62015-09-14 17:22:16 -0600340 res = loader_EnumerateDeviceLayerProperties(physicalDevice, pCount, pProperties);
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600341 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburn27cd5842015-05-12 17:26:48 -0600342 return res;
343}
344
Jon Ashburnd55a3942015-05-06 09:02:10 -0600345LOADER_EXPORT VkResult VKAPI vkGetDeviceQueue(VkDevice device, uint32_t queueNodeIndex, uint32_t queueIndex, VkQueue* pQueue)
346{
347 const VkLayerDispatchTable *disp;
348 VkResult res;
349
350 disp = loader_get_dispatch(device);
351
352 res = disp->GetDeviceQueue(device, queueNodeIndex, queueIndex, pQueue);
353 if (res == VK_SUCCESS) {
354 loader_set_dispatch(*pQueue, disp);
355 }
356
357 return res;
358}
359
360LOADER_EXPORT VkResult VKAPI vkQueueSubmit(VkQueue queue, uint32_t cmdBufferCount, const VkCmdBuffer* pCmdBuffers, VkFence fence)
361{
362 const VkLayerDispatchTable *disp;
363
364 disp = loader_get_dispatch(queue);
365
366 return disp->QueueSubmit(queue, cmdBufferCount, pCmdBuffers, fence);
367}
368
369LOADER_EXPORT VkResult VKAPI vkQueueWaitIdle(VkQueue queue)
370{
371 const VkLayerDispatchTable *disp;
372
373 disp = loader_get_dispatch(queue);
374
375 return disp->QueueWaitIdle(queue);
376}
377
378LOADER_EXPORT VkResult VKAPI vkDeviceWaitIdle(VkDevice device)
379{
380 const VkLayerDispatchTable *disp;
381
382 disp = loader_get_dispatch(device);
383
384 return disp->DeviceWaitIdle(device);
385}
386
387LOADER_EXPORT VkResult VKAPI vkAllocMemory(VkDevice device, const VkMemoryAllocInfo* pAllocInfo, VkDeviceMemory* pMem)
388{
389 const VkLayerDispatchTable *disp;
390
391 disp = loader_get_dispatch(device);
392
393 return disp->AllocMemory(device, pAllocInfo, pMem);
394}
395
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600396LOADER_EXPORT void VKAPI vkFreeMemory(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->FreeMemory(device, mem);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600403}
404
Jon Ashburnd55a3942015-05-06 09:02:10 -0600405LOADER_EXPORT VkResult VKAPI vkMapMemory(VkDevice device, VkDeviceMemory mem, VkDeviceSize offset, VkDeviceSize size, VkFlags flags, void** ppData)
406{
407 const VkLayerDispatchTable *disp;
408
409 disp = loader_get_dispatch(device);
410
411 return disp->MapMemory(device, mem, offset, size, flags, ppData);
412}
413
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600414LOADER_EXPORT void VKAPI vkUnmapMemory(VkDevice device, VkDeviceMemory mem)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600415{
416 const VkLayerDispatchTable *disp;
417
418 disp = loader_get_dispatch(device);
419
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600420 disp->UnmapMemory(device, mem);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600421}
422
423LOADER_EXPORT VkResult VKAPI vkFlushMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges)
424{
425 const VkLayerDispatchTable *disp;
426
427 disp = loader_get_dispatch(device);
428
429 return disp->FlushMappedMemoryRanges(device, memRangeCount, pMemRanges);
430}
431
432LOADER_EXPORT VkResult VKAPI vkInvalidateMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges)
433{
434 const VkLayerDispatchTable *disp;
435
436 disp = loader_get_dispatch(device);
437
438 return disp->InvalidateMappedMemoryRanges(device, memRangeCount, pMemRanges);
439}
440
Courtney Goeltzenleuchterfb71f222015-07-09 21:57:28 -0600441LOADER_EXPORT VkResult VKAPI vkGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes)
442{
443 const VkLayerDispatchTable *disp;
444
445 disp = loader_get_dispatch(device);
446
447 return disp->GetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes);
448}
449
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600450LOADER_EXPORT VkResult VKAPI vkBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory mem, VkDeviceSize offset)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600451{
452 const VkLayerDispatchTable *disp;
453
Mark Lobodzinski942b1722015-05-11 17:21:15 -0500454 disp = loader_get_dispatch(device);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600455
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600456 return disp->BindBufferMemory(device, buffer, mem, offset);
457}
458
459LOADER_EXPORT VkResult VKAPI vkBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory mem, VkDeviceSize offset)
460{
461 const VkLayerDispatchTable *disp;
462
463 disp = loader_get_dispatch(device);
464
465 return disp->BindImageMemory(device, image, mem, offset);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600466}
467
Jon Ashburn754864f2015-07-23 18:49:07 -0600468LOADER_EXPORT VkResult VKAPI vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements)
469{
470 const VkLayerDispatchTable *disp;
471
472 disp = loader_get_dispatch(device);
473
474 return disp->GetBufferMemoryRequirements(device, buffer, pMemoryRequirements);
475}
476
477LOADER_EXPORT VkResult VKAPI vkGetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements)
478{
479 const VkLayerDispatchTable *disp;
480
481 disp = loader_get_dispatch(device);
482
483 return disp->GetImageMemoryRequirements(device, image, pMemoryRequirements);
484}
485
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600486LOADER_EXPORT VkResult VKAPI vkGetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t* pNumRequirements, VkSparseImageMemoryRequirements* pSparseMemoryRequirements)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600487{
488 const VkLayerDispatchTable *disp;
489
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600490 disp = loader_get_dispatch(device);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600491
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600492 return disp->GetImageSparseMemoryRequirements(device, image, pNumRequirements, pSparseMemoryRequirements);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600493}
494
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600495LOADER_EXPORT VkResult VKAPI vkGetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, uint32_t samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t* pNumProperties, VkSparseImageFormatProperties* pProperties)
496{
497 const VkLayerInstanceDispatchTable *disp;
498
499 disp = loader_get_instance_dispatch(physicalDevice);
500
501 return disp->GetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, pNumProperties, pProperties);
502}
503
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600504LOADER_EXPORT VkResult VKAPI vkQueueBindSparseBufferMemory(VkQueue queue, VkBuffer buffer, uint32_t numBindings, const VkSparseMemoryBindInfo* pBindInfo)
505{
506 const VkLayerDispatchTable *disp;
507
508 disp = loader_get_dispatch(queue);
509
510 return disp->QueueBindSparseBufferMemory(queue, buffer, numBindings, pBindInfo);
511}
512
Jon Ashburn754864f2015-07-23 18:49:07 -0600513LOADER_EXPORT VkResult VKAPI vkQueueBindSparseImageOpaqueMemory(VkQueue queue, VkImage image, uint32_t numBindings, const VkSparseMemoryBindInfo* pBindInfo)
514{
515 const VkLayerDispatchTable *disp;
516
517 disp = loader_get_dispatch(queue);
518
519 return disp->QueueBindSparseImageOpaqueMemory(queue, image, numBindings, pBindInfo);
520}
521
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600522LOADER_EXPORT VkResult VKAPI vkQueueBindSparseImageMemory(VkQueue queue, VkImage image, uint32_t numBindings, const VkSparseImageMemoryBindInfo* pBindInfo)
523{
524 const VkLayerDispatchTable *disp;
525
526 disp = loader_get_dispatch(queue);
527
528 return disp->QueueBindSparseImageMemory(queue, image, numBindings, pBindInfo);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600529}
530
531LOADER_EXPORT VkResult VKAPI vkCreateFence(VkDevice device, const VkFenceCreateInfo* pCreateInfo, VkFence* pFence)
532{
533 const VkLayerDispatchTable *disp;
534
535 disp = loader_get_dispatch(device);
536
537 return disp->CreateFence(device, pCreateInfo, pFence);
538}
539
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600540LOADER_EXPORT void VKAPI vkDestroyFence(VkDevice device, VkFence fence)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600541{
542 const VkLayerDispatchTable *disp;
543
544 disp = loader_get_dispatch(device);
545
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600546 disp->DestroyFence(device, fence);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600547}
548
Courtney Goeltzenleuchter2bf8f902015-06-18 17:28:20 -0600549LOADER_EXPORT VkResult VKAPI vkResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600550{
551 const VkLayerDispatchTable *disp;
552
553 disp = loader_get_dispatch(device);
554
555 return disp->ResetFences(device, fenceCount, pFences);
556}
557
558LOADER_EXPORT VkResult VKAPI vkGetFenceStatus(VkDevice device, VkFence fence)
559{
560 const VkLayerDispatchTable *disp;
561
562 disp = loader_get_dispatch(device);
563
564 return disp->GetFenceStatus(device, fence);
565}
566
Courtney Goeltzenleuchtercd2a0992015-07-09 11:44:38 -0600567LOADER_EXPORT VkResult VKAPI vkWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600568{
569 const VkLayerDispatchTable *disp;
570
571 disp = loader_get_dispatch(device);
572
573 return disp->WaitForFences(device, fenceCount, pFences, waitAll, timeout);
574}
575
576LOADER_EXPORT VkResult VKAPI vkCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo, VkSemaphore* pSemaphore)
577{
578 const VkLayerDispatchTable *disp;
579
580 disp = loader_get_dispatch(device);
581
582 return disp->CreateSemaphore(device, pCreateInfo, pSemaphore);
583}
584
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600585LOADER_EXPORT void VKAPI vkDestroySemaphore(VkDevice device, VkSemaphore semaphore)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600586{
587 const VkLayerDispatchTable *disp;
588
589 disp = loader_get_dispatch(device);
590
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600591 disp->DestroySemaphore(device, semaphore);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600592}
593
Jon Ashburnd55a3942015-05-06 09:02:10 -0600594LOADER_EXPORT VkResult VKAPI vkQueueSignalSemaphore(VkQueue queue, VkSemaphore semaphore)
595{
596 const VkLayerDispatchTable *disp;
597
598 disp = loader_get_dispatch(queue);
599
600 return disp->QueueSignalSemaphore(queue, semaphore);
601}
602
603LOADER_EXPORT VkResult VKAPI vkQueueWaitSemaphore(VkQueue queue, VkSemaphore semaphore)
604{
605 const VkLayerDispatchTable *disp;
606
607 disp = loader_get_dispatch(queue);
608
609 return disp->QueueWaitSemaphore(queue, semaphore);
610}
611
612LOADER_EXPORT VkResult VKAPI vkCreateEvent(VkDevice device, const VkEventCreateInfo* pCreateInfo, VkEvent* pEvent)
613{
614 const VkLayerDispatchTable *disp;
615
616 disp = loader_get_dispatch(device);
617
618 return disp->CreateEvent(device, pCreateInfo, pEvent);
619}
620
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600621LOADER_EXPORT void VKAPI vkDestroyEvent(VkDevice device, VkEvent event)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600622{
623 const VkLayerDispatchTable *disp;
624
625 disp = loader_get_dispatch(device);
626
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600627 disp->DestroyEvent(device, event);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600628}
629
Jon Ashburnd55a3942015-05-06 09:02:10 -0600630LOADER_EXPORT VkResult VKAPI vkGetEventStatus(VkDevice device, VkEvent event)
631{
632 const VkLayerDispatchTable *disp;
633
634 disp = loader_get_dispatch(device);
635
636 return disp->GetEventStatus(device, event);
637}
638
639LOADER_EXPORT VkResult VKAPI vkSetEvent(VkDevice device, VkEvent event)
640{
641 const VkLayerDispatchTable *disp;
642
643 disp = loader_get_dispatch(device);
644
645 return disp->SetEvent(device, event);
646}
647
648LOADER_EXPORT VkResult VKAPI vkResetEvent(VkDevice device, VkEvent event)
649{
650 const VkLayerDispatchTable *disp;
651
652 disp = loader_get_dispatch(device);
653
654 return disp->ResetEvent(device, event);
655}
656
657LOADER_EXPORT VkResult VKAPI vkCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, VkQueryPool* pQueryPool)
658{
659 const VkLayerDispatchTable *disp;
660
661 disp = loader_get_dispatch(device);
662
663 return disp->CreateQueryPool(device, pCreateInfo, pQueryPool);
664}
665
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600666LOADER_EXPORT void VKAPI vkDestroyQueryPool(VkDevice device, VkQueryPool queryPool)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600667{
668 const VkLayerDispatchTable *disp;
669
670 disp = loader_get_dispatch(device);
671
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600672 disp->DestroyQueryPool(device, queryPool);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600673}
674
Jon Ashburnd55a3942015-05-06 09:02:10 -0600675LOADER_EXPORT VkResult VKAPI vkGetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount, size_t* pDataSize, void* pData, VkQueryResultFlags flags)
676{
677 const VkLayerDispatchTable *disp;
678
679 disp = loader_get_dispatch(device);
680
681 return disp->GetQueryPoolResults(device, queryPool, startQuery, queryCount, pDataSize, pData, flags);
682}
683
Jon Ashburnd55a3942015-05-06 09:02:10 -0600684LOADER_EXPORT VkResult VKAPI vkCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateInfo, VkBuffer* pBuffer)
685{
686 const VkLayerDispatchTable *disp;
687
688 disp = loader_get_dispatch(device);
689
690 return disp->CreateBuffer(device, pCreateInfo, pBuffer);
691}
692
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600693LOADER_EXPORT void VKAPI vkDestroyBuffer(VkDevice device, VkBuffer buffer)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600694{
695 const VkLayerDispatchTable *disp;
696
697 disp = loader_get_dispatch(device);
698
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600699 disp->DestroyBuffer(device, buffer);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600700}
701
Jon Ashburnd55a3942015-05-06 09:02:10 -0600702LOADER_EXPORT VkResult VKAPI vkCreateBufferView(VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, VkBufferView* pView)
703{
704 const VkLayerDispatchTable *disp;
705
706 disp = loader_get_dispatch(device);
707
708 return disp->CreateBufferView(device, pCreateInfo, pView);
709}
710
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600711LOADER_EXPORT void VKAPI vkDestroyBufferView(VkDevice device, VkBufferView bufferView)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600712{
713 const VkLayerDispatchTable *disp;
714
715 disp = loader_get_dispatch(device);
716
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600717 disp->DestroyBufferView(device, bufferView);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600718}
719
Jon Ashburnd55a3942015-05-06 09:02:10 -0600720LOADER_EXPORT VkResult VKAPI vkCreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo, VkImage* pImage)
721{
722 const VkLayerDispatchTable *disp;
723
724 disp = loader_get_dispatch(device);
725
726 return disp->CreateImage(device, pCreateInfo, pImage);
727}
728
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600729LOADER_EXPORT void VKAPI vkDestroyImage(VkDevice device, VkImage image)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600730{
731 const VkLayerDispatchTable *disp;
732
733 disp = loader_get_dispatch(device);
734
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600735 disp->DestroyImage(device, image);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600736}
737
Tony Barbour59a47322015-06-24 16:06:58 -0600738LOADER_EXPORT VkResult VKAPI vkGetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600739{
740 const VkLayerDispatchTable *disp;
741
742 disp = loader_get_dispatch(device);
743
Tony Barbour59a47322015-06-24 16:06:58 -0600744 return disp->GetImageSubresourceLayout(device, image, pSubresource, pLayout);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600745}
746
747LOADER_EXPORT VkResult VKAPI vkCreateImageView(VkDevice device, const VkImageViewCreateInfo* pCreateInfo, VkImageView* pView)
748{
749 const VkLayerDispatchTable *disp;
750
751 disp = loader_get_dispatch(device);
752
753 return disp->CreateImageView(device, pCreateInfo, pView);
754}
755
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600756LOADER_EXPORT void VKAPI vkDestroyImageView(VkDevice device, VkImageView imageView)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600757{
758 const VkLayerDispatchTable *disp;
759
760 disp = loader_get_dispatch(device);
761
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600762 disp->DestroyImageView(device, imageView);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600763}
764
Courtney Goeltzenleuchter2d2cb682015-06-24 18:24:19 -0600765LOADER_EXPORT VkResult VKAPI vkCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, VkShaderModule* pShader)
766{
767 const VkLayerDispatchTable *disp;
768
769 disp = loader_get_dispatch(device);
770
771 return disp->CreateShaderModule(device, pCreateInfo, pShader);
772}
773
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600774LOADER_EXPORT void VKAPI vkDestroyShaderModule(VkDevice device, VkShaderModule shaderModule)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600775{
776 const VkLayerDispatchTable *disp;
777
778 disp = loader_get_dispatch(device);
779
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600780 disp->DestroyShaderModule(device, shaderModule);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600781}
782
Jon Ashburnd55a3942015-05-06 09:02:10 -0600783LOADER_EXPORT VkResult VKAPI vkCreateShader(VkDevice device, const VkShaderCreateInfo* pCreateInfo, VkShader* pShader)
784{
785 const VkLayerDispatchTable *disp;
786
787 disp = loader_get_dispatch(device);
788
789 return disp->CreateShader(device, pCreateInfo, pShader);
790}
791
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600792LOADER_EXPORT void VKAPI vkDestroyShader(VkDevice device, VkShader shader)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600793{
794 const VkLayerDispatchTable *disp;
795
796 disp = loader_get_dispatch(device);
797
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600798 disp->DestroyShader(device, shader);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600799}
800
Jon Ashburnc669cc62015-07-09 15:02:25 -0600801LOADER_EXPORT VkResult VKAPI vkCreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, VkPipelineCache* pPipelineCache)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600802{
803 const VkLayerDispatchTable *disp;
804
805 disp = loader_get_dispatch(device);
806
Jon Ashburnc669cc62015-07-09 15:02:25 -0600807 return disp->CreatePipelineCache(device, pCreateInfo, pPipelineCache);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600808}
809
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600810LOADER_EXPORT void VKAPI vkDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600811{
812 const VkLayerDispatchTable *disp;
813
814 disp = loader_get_dispatch(device);
815
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600816 disp->DestroyPipelineCache(device, pipelineCache);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600817}
818
Jon Ashburnc669cc62015-07-09 15:02:25 -0600819LOADER_EXPORT size_t VKAPI vkGetPipelineCacheSize(VkDevice device, VkPipelineCache pipelineCache)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600820{
821 const VkLayerDispatchTable *disp;
822
823 disp = loader_get_dispatch(device);
824
Jon Ashburnc669cc62015-07-09 15:02:25 -0600825 return disp->GetPipelineCacheSize(device, pipelineCache);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600826}
827
Jon Ashburnc669cc62015-07-09 15:02:25 -0600828LOADER_EXPORT VkResult VKAPI vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, void* pData)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600829{
830 const VkLayerDispatchTable *disp;
831
832 disp = loader_get_dispatch(device);
833
Jon Ashburnc669cc62015-07-09 15:02:25 -0600834 return disp->GetPipelineCacheData(device, pipelineCache, pData);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600835}
836
Jon Ashburnc669cc62015-07-09 15:02:25 -0600837LOADER_EXPORT VkResult VKAPI vkMergePipelineCaches(VkDevice device, VkPipelineCache destCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600838{
839 const VkLayerDispatchTable *disp;
840
841 disp = loader_get_dispatch(device);
842
Jon Ashburnc669cc62015-07-09 15:02:25 -0600843 return disp->MergePipelineCaches(device, destCache, srcCacheCount, pSrcCaches);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600844}
845
Jon Ashburnc669cc62015-07-09 15:02:25 -0600846LOADER_EXPORT VkResult VKAPI vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, const VkGraphicsPipelineCreateInfo* pCreateInfos, VkPipeline* pPipelines)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600847{
848 const VkLayerDispatchTable *disp;
849
850 disp = loader_get_dispatch(device);
851
Jon Ashburnc669cc62015-07-09 15:02:25 -0600852 return disp->CreateGraphicsPipelines(device, pipelineCache, count, pCreateInfos, pPipelines);
853}
854
855LOADER_EXPORT VkResult VKAPI vkCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, const VkComputePipelineCreateInfo* pCreateInfos, VkPipeline* pPipelines)
856{
857 const VkLayerDispatchTable *disp;
858
859 disp = loader_get_dispatch(device);
860
861 return disp->CreateComputePipelines(device, pipelineCache, count, pCreateInfos, pPipelines);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600862}
863
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600864LOADER_EXPORT void VKAPI vkDestroyPipeline(VkDevice device, VkPipeline pipeline)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600865{
866 const VkLayerDispatchTable *disp;
867
868 disp = loader_get_dispatch(device);
869
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600870 disp->DestroyPipeline(device, pipeline);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600871}
872
Jon Ashburnd55a3942015-05-06 09:02:10 -0600873LOADER_EXPORT VkResult VKAPI vkCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, VkPipelineLayout* pPipelineLayout)
874{
875 const VkLayerDispatchTable *disp;
876
877 disp = loader_get_dispatch(device);
878
879 return disp->CreatePipelineLayout(device, pCreateInfo, pPipelineLayout);
880}
881
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600882LOADER_EXPORT void VKAPI vkDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600883{
884 const VkLayerDispatchTable *disp;
885
886 disp = loader_get_dispatch(device);
887
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600888 disp->DestroyPipelineLayout(device, pipelineLayout);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600889}
890
Jon Ashburnd55a3942015-05-06 09:02:10 -0600891LOADER_EXPORT VkResult VKAPI vkCreateSampler(VkDevice device, const VkSamplerCreateInfo* pCreateInfo, VkSampler* pSampler)
892{
893 const VkLayerDispatchTable *disp;
894
895 disp = loader_get_dispatch(device);
896
897 return disp->CreateSampler(device, pCreateInfo, pSampler);
898}
899
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600900LOADER_EXPORT void VKAPI vkDestroySampler(VkDevice device, VkSampler sampler)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600901{
902 const VkLayerDispatchTable *disp;
903
904 disp = loader_get_dispatch(device);
905
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600906 disp->DestroySampler(device, sampler);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600907}
908
909
Jon Ashburnd55a3942015-05-06 09:02:10 -0600910LOADER_EXPORT VkResult VKAPI vkCreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayout* pSetLayout)
911{
912 const VkLayerDispatchTable *disp;
913
914 disp = loader_get_dispatch(device);
915
916 return disp->CreateDescriptorSetLayout(device, pCreateInfo, pSetLayout);
917}
918
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600919LOADER_EXPORT void VKAPI vkDestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600920{
921 const VkLayerDispatchTable *disp;
922
923 disp = loader_get_dispatch(device);
924
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600925 disp->DestroyDescriptorSetLayout(device, descriptorSetLayout);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600926}
927
Courtney Goeltzenleuchterfe908d32015-09-16 16:12:45 -0600928LOADER_EXPORT VkResult VKAPI vkCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, VkDescriptorPool* pDescriptorPool)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600929{
930 const VkLayerDispatchTable *disp;
931
932 disp = loader_get_dispatch(device);
933
Courtney Goeltzenleuchterfe908d32015-09-16 16:12:45 -0600934 return disp->CreateDescriptorPool(device, pCreateInfo, pDescriptorPool);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600935}
936
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600937LOADER_EXPORT void VKAPI vkDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600938{
939 const VkLayerDispatchTable *disp;
940
941 disp = loader_get_dispatch(device);
942
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600943 disp->DestroyDescriptorPool(device, descriptorPool);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600944}
945
946
Jon Ashburnd55a3942015-05-06 09:02:10 -0600947LOADER_EXPORT VkResult VKAPI vkResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool)
948{
949 const VkLayerDispatchTable *disp;
950
951 disp = loader_get_dispatch(device);
952
953 return disp->ResetDescriptorPool(device, descriptorPool);
954}
955
Cody Northrop1e4f8022015-08-03 12:47:29 -0600956LOADER_EXPORT VkResult VKAPI vkAllocDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorSetUsage setUsage, uint32_t count, const VkDescriptorSetLayout* pSetLayouts, VkDescriptorSet* pDescriptorSets)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600957{
958 const VkLayerDispatchTable *disp;
959
960 disp = loader_get_dispatch(device);
961
Cody Northrop1e4f8022015-08-03 12:47:29 -0600962 return disp->AllocDescriptorSets(device, descriptorPool, setUsage, count, pSetLayouts, pDescriptorSets);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600963}
964
Tony Barbour34ec6922015-07-10 10:50:45 -0600965LOADER_EXPORT VkResult VKAPI vkFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t count, const VkDescriptorSet* pDescriptorSets)
966{
967 const VkLayerDispatchTable *disp;
968
969 disp = loader_get_dispatch(device);
970
971 return disp->FreeDescriptorSets(device, descriptorPool, count, pDescriptorSets);
972}
973
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600974LOADER_EXPORT void VKAPI vkUpdateDescriptorSets(VkDevice device, uint32_t writeCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t copyCount, const VkCopyDescriptorSet* pDescriptorCopies)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600975{
976 const VkLayerDispatchTable *disp;
977
978 disp = loader_get_dispatch(device);
979
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600980 disp->UpdateDescriptorSets(device, writeCount, pDescriptorWrites, copyCount, pDescriptorCopies);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600981}
982
Jon Ashburn754864f2015-07-23 18:49:07 -0600983LOADER_EXPORT VkResult VKAPI vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, VkFramebuffer* pFramebuffer)
984{
985 const VkLayerDispatchTable *disp;
986
987 disp = loader_get_dispatch(device);
988
989 return disp->CreateFramebuffer(device, pCreateInfo, pFramebuffer);
990}
991
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600992LOADER_EXPORT void VKAPI vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer)
Jon Ashburn754864f2015-07-23 18:49:07 -0600993{
994 const VkLayerDispatchTable *disp;
995
996 disp = loader_get_dispatch(device);
997
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600998 disp->DestroyFramebuffer(device, framebuffer);
Jon Ashburn754864f2015-07-23 18:49:07 -0600999}
1000
1001LOADER_EXPORT VkResult VKAPI vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, VkRenderPass* pRenderPass)
1002{
1003 const VkLayerDispatchTable *disp;
1004
1005 disp = loader_get_dispatch(device);
1006
1007 return disp->CreateRenderPass(device, pCreateInfo, pRenderPass);
1008}
1009
Mark Lobodzinski2141f652015-09-07 13:59:43 -06001010LOADER_EXPORT void VKAPI vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass)
Jon Ashburn754864f2015-07-23 18:49:07 -06001011{
1012 const VkLayerDispatchTable *disp;
1013
1014 disp = loader_get_dispatch(device);
1015
Mark Lobodzinski2141f652015-09-07 13:59:43 -06001016 disp->DestroyRenderPass(device, renderPass);
Jon Ashburn754864f2015-07-23 18:49:07 -06001017}
1018
1019LOADER_EXPORT VkResult VKAPI vkGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity)
1020{
1021 const VkLayerDispatchTable *disp;
1022
1023 disp = loader_get_dispatch(device);
1024
1025 return disp->GetRenderAreaGranularity(device, renderPass, pGranularity);
1026}
1027
Cody Northrope62183e2015-07-09 18:08:05 -06001028LOADER_EXPORT VkResult VKAPI vkCreateCommandPool(VkDevice device, const VkCmdPoolCreateInfo* pCreateInfo, VkCmdPool* pCmdPool)
1029{
1030 const VkLayerDispatchTable *disp;
1031
1032 disp = loader_get_dispatch(device);
1033
1034 return disp->CreateCommandPool(device, pCreateInfo, pCmdPool);
1035}
1036
Mark Lobodzinski2141f652015-09-07 13:59:43 -06001037LOADER_EXPORT void VKAPI vkDestroyCommandPool(VkDevice device, VkCmdPool cmdPool)
Cody Northrope62183e2015-07-09 18:08:05 -06001038{
1039 const VkLayerDispatchTable *disp;
1040
1041 disp = loader_get_dispatch(device);
1042
Mark Lobodzinski2141f652015-09-07 13:59:43 -06001043 disp->DestroyCommandPool(device, cmdPool);
Cody Northrope62183e2015-07-09 18:08:05 -06001044}
1045
1046LOADER_EXPORT VkResult VKAPI vkResetCommandPool(VkDevice device, VkCmdPool cmdPool, VkCmdPoolResetFlags flags)
1047{
1048 const VkLayerDispatchTable *disp;
1049
1050 disp = loader_get_dispatch(device);
1051
1052 return disp->ResetCommandPool(device, cmdPool, flags);
1053}
1054
Jon Ashburnd55a3942015-05-06 09:02:10 -06001055LOADER_EXPORT VkResult VKAPI vkCreateCommandBuffer(VkDevice device, const VkCmdBufferCreateInfo* pCreateInfo, VkCmdBuffer* pCmdBuffer)
1056{
1057 const VkLayerDispatchTable *disp;
1058 VkResult res;
1059
1060 disp = loader_get_dispatch(device);
1061
1062 res = disp->CreateCommandBuffer(device, pCreateInfo, pCmdBuffer);
1063 if (res == VK_SUCCESS) {
1064 loader_init_dispatch(*pCmdBuffer, disp);
1065 }
1066
1067 return res;
1068}
1069
Mark Lobodzinski2141f652015-09-07 13:59:43 -06001070LOADER_EXPORT void VKAPI vkDestroyCommandBuffer(VkDevice device, VkCmdBuffer cmdBuffer)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001071{
1072 const VkLayerDispatchTable *disp;
1073
1074 disp = loader_get_dispatch(device);
1075
Mark Lobodzinski2141f652015-09-07 13:59:43 -06001076 disp->DestroyCommandBuffer(device, cmdBuffer);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001077}
1078
Jon Ashburnd55a3942015-05-06 09:02:10 -06001079LOADER_EXPORT VkResult VKAPI vkBeginCommandBuffer(VkCmdBuffer cmdBuffer, const VkCmdBufferBeginInfo* pBeginInfo)
1080{
1081 const VkLayerDispatchTable *disp;
1082
1083 disp = loader_get_dispatch(cmdBuffer);
1084
1085 return disp->BeginCommandBuffer(cmdBuffer, pBeginInfo);
1086}
1087
1088LOADER_EXPORT VkResult VKAPI vkEndCommandBuffer(VkCmdBuffer cmdBuffer)
1089{
1090 const VkLayerDispatchTable *disp;
1091
1092 disp = loader_get_dispatch(cmdBuffer);
1093
1094 return disp->EndCommandBuffer(cmdBuffer);
1095}
1096
Cody Northrope62183e2015-07-09 18:08:05 -06001097LOADER_EXPORT VkResult VKAPI vkResetCommandBuffer(VkCmdBuffer cmdBuffer, VkCmdBufferResetFlags flags)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001098{
1099 const VkLayerDispatchTable *disp;
1100
1101 disp = loader_get_dispatch(cmdBuffer);
1102
Cody Northrope62183e2015-07-09 18:08:05 -06001103 return disp->ResetCommandBuffer(cmdBuffer, flags);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001104}
1105
1106LOADER_EXPORT void VKAPI vkCmdBindPipeline(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline)
1107{
1108 const VkLayerDispatchTable *disp;
1109
1110 disp = loader_get_dispatch(cmdBuffer);
1111
1112 disp->CmdBindPipeline(cmdBuffer, pipelineBindPoint, pipeline);
1113}
1114
Courtney Goeltzenleuchter078f8172015-09-21 11:44:06 -06001115LOADER_EXPORT void VKAPI vkCmdSetViewport(VkCmdBuffer cmdBuffer, uint32_t viewportCount, const VkViewport* pViewports)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001116{
1117 const VkLayerDispatchTable *disp;
1118
1119 disp = loader_get_dispatch(cmdBuffer);
1120
Courtney Goeltzenleuchter078f8172015-09-21 11:44:06 -06001121 disp->CmdSetViewport(cmdBuffer, viewportCount, pViewports);
1122}
1123
1124LOADER_EXPORT void VKAPI vkCmdSetScissor(VkCmdBuffer cmdBuffer, uint32_t scissorCount, const VkRect2D* pScissors)
1125{
1126 const VkLayerDispatchTable *disp;
1127
1128 disp = loader_get_dispatch(cmdBuffer);
1129
1130 disp->CmdSetScissor(cmdBuffer, scissorCount, pScissors);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001131}
1132
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001133LOADER_EXPORT void VKAPI vkCmdSetLineWidth(VkCmdBuffer cmdBuffer, float lineWidth)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001134{
1135 const VkLayerDispatchTable *disp;
1136
1137 disp = loader_get_dispatch(cmdBuffer);
1138
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001139 disp->CmdSetLineWidth(cmdBuffer, lineWidth);
Cody Northrop12365112015-08-17 11:10:49 -06001140}
1141
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001142LOADER_EXPORT void VKAPI vkCmdSetDepthBias(VkCmdBuffer cmdBuffer, float depthBias, float depthBiasClamp, float slopeScaledDepthBias)
Cody Northrop12365112015-08-17 11:10:49 -06001143{
1144 const VkLayerDispatchTable *disp;
1145
1146 disp = loader_get_dispatch(cmdBuffer);
1147
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001148 disp->CmdSetDepthBias(cmdBuffer, depthBias, depthBiasClamp, slopeScaledDepthBias);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001149}
1150
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001151LOADER_EXPORT void VKAPI vkCmdSetBlendConstants(VkCmdBuffer cmdBuffer, const float blendConst[4])
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001152{
1153 const VkLayerDispatchTable *disp;
1154
1155 disp = loader_get_dispatch(cmdBuffer);
1156
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001157 disp->CmdSetBlendConstants(cmdBuffer, blendConst);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001158}
1159
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001160LOADER_EXPORT void VKAPI vkCmdSetDepthBounds(VkCmdBuffer cmdBuffer, float minDepthBounds, float maxDepthBounds)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001161{
1162 const VkLayerDispatchTable *disp;
1163
1164 disp = loader_get_dispatch(cmdBuffer);
1165
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001166 disp->CmdSetDepthBounds(cmdBuffer, minDepthBounds, maxDepthBounds);
Cody Northrop82485a82015-08-18 15:21:16 -06001167}
1168
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001169LOADER_EXPORT void VKAPI vkCmdSetStencilCompareMask(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilCompareMask)
Cody Northrop82485a82015-08-18 15:21:16 -06001170{
1171 const VkLayerDispatchTable *disp;
1172
1173 disp = loader_get_dispatch(cmdBuffer);
1174
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001175 disp->CmdSetStencilCompareMask(cmdBuffer, faceMask, stencilCompareMask);
1176}
1177
1178LOADER_EXPORT void VKAPI vkCmdSetStencilWriteMask(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilWriteMask)
1179{
1180 const VkLayerDispatchTable *disp;
1181
1182 disp = loader_get_dispatch(cmdBuffer);
1183
1184 disp->CmdSetStencilWriteMask(cmdBuffer, faceMask, stencilWriteMask);
1185}
1186
1187LOADER_EXPORT void VKAPI vkCmdSetStencilReference(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilReference)
1188{
1189 const VkLayerDispatchTable *disp;
1190
1191 disp = loader_get_dispatch(cmdBuffer);
1192
1193 disp->CmdSetStencilReference(cmdBuffer, faceMask, stencilReference);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001194}
1195
Mark Lobodzinskif2093b62015-06-15 13:21:21 -06001196LOADER_EXPORT void VKAPI vkCmdBindDescriptorSets(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t setCount, const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001197{
1198 const VkLayerDispatchTable *disp;
1199
1200 disp = loader_get_dispatch(cmdBuffer);
1201
Mark Lobodzinskif2093b62015-06-15 13:21:21 -06001202 disp->CmdBindDescriptorSets(cmdBuffer, pipelineBindPoint, layout, firstSet, setCount, pDescriptorSets, dynamicOffsetCount, pDynamicOffsets);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001203}
1204
Jon Ashburnd55a3942015-05-06 09:02:10 -06001205LOADER_EXPORT void VKAPI vkCmdBindIndexBuffer(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType)
1206{
1207 const VkLayerDispatchTable *disp;
1208
1209 disp = loader_get_dispatch(cmdBuffer);
1210
1211 disp->CmdBindIndexBuffer(cmdBuffer, buffer, offset, indexType);
1212}
1213
Jon Ashburn754864f2015-07-23 18:49:07 -06001214LOADER_EXPORT void VKAPI vkCmdBindVertexBuffers(VkCmdBuffer cmdBuffer, uint32_t startBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets)
1215{
1216 const VkLayerDispatchTable *disp;
1217
1218 disp = loader_get_dispatch(cmdBuffer);
1219
1220 disp->CmdBindVertexBuffers(cmdBuffer, startBinding, bindingCount, pBuffers, pOffsets);
1221}
1222
Courtney Goeltzenleuchter08c26372015-09-23 12:31:50 -06001223LOADER_EXPORT void VKAPI vkCmdDraw(VkCmdBuffer cmdBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001224{
1225 const VkLayerDispatchTable *disp;
1226
1227 disp = loader_get_dispatch(cmdBuffer);
1228
Courtney Goeltzenleuchter08c26372015-09-23 12:31:50 -06001229 disp->CmdDraw(cmdBuffer, vertexCount, instanceCount, firstVertex, firstInstance);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001230}
1231
Courtney Goeltzenleuchter08c26372015-09-23 12:31:50 -06001232LOADER_EXPORT void VKAPI vkCmdDrawIndexed(VkCmdBuffer cmdBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001233{
1234 const VkLayerDispatchTable *disp;
1235
1236 disp = loader_get_dispatch(cmdBuffer);
1237
Courtney Goeltzenleuchter08c26372015-09-23 12:31:50 -06001238 disp->CmdDrawIndexed(cmdBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001239}
1240
1241LOADER_EXPORT void VKAPI vkCmdDrawIndirect(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride)
1242{
1243 const VkLayerDispatchTable *disp;
1244
1245 disp = loader_get_dispatch(cmdBuffer);
1246
1247 disp->CmdDrawIndirect(cmdBuffer, buffer, offset, count, stride);
1248}
1249
1250LOADER_EXPORT void VKAPI vkCmdDrawIndexedIndirect(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride)
1251{
1252 const VkLayerDispatchTable *disp;
1253
1254 disp = loader_get_dispatch(cmdBuffer);
1255
1256 disp->CmdDrawIndexedIndirect(cmdBuffer, buffer, offset, count, stride);
1257}
1258
1259LOADER_EXPORT void VKAPI vkCmdDispatch(VkCmdBuffer cmdBuffer, uint32_t x, uint32_t y, uint32_t z)
1260{
1261 const VkLayerDispatchTable *disp;
1262
1263 disp = loader_get_dispatch(cmdBuffer);
1264
1265 disp->CmdDispatch(cmdBuffer, x, y, z);
1266}
1267
1268LOADER_EXPORT void VKAPI vkCmdDispatchIndirect(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset)
1269{
1270 const VkLayerDispatchTable *disp;
1271
1272 disp = loader_get_dispatch(cmdBuffer);
1273
1274 disp->CmdDispatchIndirect(cmdBuffer, buffer, offset);
1275}
1276
1277LOADER_EXPORT void VKAPI vkCmdCopyBuffer(VkCmdBuffer cmdBuffer, VkBuffer srcBuffer, VkBuffer destBuffer, uint32_t regionCount, const VkBufferCopy* pRegions)
1278{
1279 const VkLayerDispatchTable *disp;
1280
1281 disp = loader_get_dispatch(cmdBuffer);
1282
1283 disp->CmdCopyBuffer(cmdBuffer, srcBuffer, destBuffer, regionCount, pRegions);
1284}
1285
1286LOADER_EXPORT void VKAPI vkCmdCopyImage(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageCopy* pRegions)
1287{
1288 const VkLayerDispatchTable *disp;
1289
1290 disp = loader_get_dispatch(cmdBuffer);
1291
1292 disp->CmdCopyImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions);
1293}
1294
Mark Lobodzinskiee5eef12015-05-22 14:43:25 -05001295LOADER_EXPORT void VKAPI vkCmdBlitImage(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageBlit* pRegions, VkTexFilter filter)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001296{
1297 const VkLayerDispatchTable *disp;
1298
1299 disp = loader_get_dispatch(cmdBuffer);
1300
Mark Lobodzinskiee5eef12015-05-22 14:43:25 -05001301 disp->CmdBlitImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions, filter);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001302}
1303
1304LOADER_EXPORT void VKAPI vkCmdCopyBufferToImage(VkCmdBuffer cmdBuffer, VkBuffer srcBuffer, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions)
1305{
1306 const VkLayerDispatchTable *disp;
1307
1308 disp = loader_get_dispatch(cmdBuffer);
1309
1310 disp->CmdCopyBufferToImage(cmdBuffer, srcBuffer, destImage, destImageLayout, regionCount, pRegions);
1311}
1312
1313LOADER_EXPORT void VKAPI vkCmdCopyImageToBuffer(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer destBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions)
1314{
1315 const VkLayerDispatchTable *disp;
1316
1317 disp = loader_get_dispatch(cmdBuffer);
1318
1319 disp->CmdCopyImageToBuffer(cmdBuffer, srcImage, srcImageLayout, destBuffer, regionCount, pRegions);
1320}
1321
Jon Ashburnd55a3942015-05-06 09:02:10 -06001322LOADER_EXPORT void VKAPI vkCmdUpdateBuffer(VkCmdBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize dataSize, const uint32_t* pData)
1323{
1324 const VkLayerDispatchTable *disp;
1325
1326 disp = loader_get_dispatch(cmdBuffer);
1327
1328 disp->CmdUpdateBuffer(cmdBuffer, destBuffer, destOffset, dataSize, pData);
1329}
1330
1331LOADER_EXPORT void VKAPI vkCmdFillBuffer(VkCmdBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize fillSize, uint32_t data)
1332{
1333 const VkLayerDispatchTable *disp;
1334
1335 disp = loader_get_dispatch(cmdBuffer);
1336
1337 disp->CmdFillBuffer(cmdBuffer, destBuffer, destOffset, fillSize, data);
1338}
1339
Chris Forbesf0796e12015-06-24 14:34:53 +12001340LOADER_EXPORT void VKAPI vkCmdClearColorImage(VkCmdBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001341{
1342 const VkLayerDispatchTable *disp;
1343
1344 disp = loader_get_dispatch(cmdBuffer);
1345
1346 disp->CmdClearColorImage(cmdBuffer, image, imageLayout, pColor, rangeCount, pRanges);
1347}
1348
Courtney Goeltzenleuchter45df9e12015-09-15 18:03:22 -06001349LOADER_EXPORT void VKAPI vkCmdClearDepthStencilImage(VkCmdBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001350{
1351 const VkLayerDispatchTable *disp;
1352
1353 disp = loader_get_dispatch(cmdBuffer);
1354
Courtney Goeltzenleuchter45df9e12015-09-15 18:03:22 -06001355 disp->CmdClearDepthStencilImage(cmdBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges);
Chris Forbesd9be82b2015-06-22 17:21:59 +12001356}
1357
Chris Forbesf0796e12015-06-24 14:34:53 +12001358LOADER_EXPORT void VKAPI vkCmdClearColorAttachment(VkCmdBuffer cmdBuffer, uint32_t colorAttachment, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rectCount, const VkRect3D* pRects)
Chris Forbesd9be82b2015-06-22 17:21:59 +12001359{
1360 const VkLayerDispatchTable *disp;
1361
1362 disp = loader_get_dispatch(cmdBuffer);
1363
1364 disp->CmdClearColorAttachment(cmdBuffer, colorAttachment, imageLayout, pColor, rectCount, pRects);
1365}
1366
Courtney Goeltzenleuchter45df9e12015-09-15 18:03:22 -06001367LOADER_EXPORT void VKAPI vkCmdClearDepthStencilAttachment(VkCmdBuffer cmdBuffer, VkImageAspectFlags imageAspectMask, VkImageLayout imageLayout, const VkClearDepthStencilValue *pDepthStencil, uint32_t rectCount, const VkRect3D* pRects)
Chris Forbesd9be82b2015-06-22 17:21:59 +12001368{
1369 const VkLayerDispatchTable *disp;
1370
1371 disp = loader_get_dispatch(cmdBuffer);
1372
Courtney Goeltzenleuchter45df9e12015-09-15 18:03:22 -06001373 disp->CmdClearDepthStencilAttachment(cmdBuffer, imageAspectMask, imageLayout, pDepthStencil, rectCount, pRects);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001374}
1375
1376LOADER_EXPORT void VKAPI vkCmdResolveImage(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageResolve* pRegions)
1377{
1378 const VkLayerDispatchTable *disp;
1379
1380 disp = loader_get_dispatch(cmdBuffer);
1381
1382 disp->CmdResolveImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions);
1383}
1384
Tony Barbour0b2cfb22015-06-29 16:20:35 -06001385LOADER_EXPORT void VKAPI vkCmdSetEvent(VkCmdBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001386{
1387 const VkLayerDispatchTable *disp;
1388
1389 disp = loader_get_dispatch(cmdBuffer);
1390
Tony Barbour0b2cfb22015-06-29 16:20:35 -06001391 disp->CmdSetEvent(cmdBuffer, event, stageMask);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001392}
1393
Tony Barbour0b2cfb22015-06-29 16:20:35 -06001394LOADER_EXPORT void VKAPI vkCmdResetEvent(VkCmdBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001395{
1396 const VkLayerDispatchTable *disp;
1397
1398 disp = loader_get_dispatch(cmdBuffer);
1399
Tony Barbour0b2cfb22015-06-29 16:20:35 -06001400 disp->CmdResetEvent(cmdBuffer, event, stageMask);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001401}
1402
Courtney Goeltzenleuchterdbd20322015-07-12 12:58:58 -06001403LOADER_EXPORT void VKAPI vkCmdWaitEvents(VkCmdBuffer cmdBuffer, uint32_t eventCount, const VkEvent* pEvents, VkPipelineStageFlags sourceStageMask, VkPipelineStageFlags destStageMask, uint32_t memBarrierCount, const void* const* ppMemBarriers)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001404{
1405 const VkLayerDispatchTable *disp;
1406
1407 disp = loader_get_dispatch(cmdBuffer);
1408
Tony Barbour0b2cfb22015-06-29 16:20:35 -06001409 disp->CmdWaitEvents(cmdBuffer, eventCount, pEvents, sourceStageMask, destStageMask, memBarrierCount, ppMemBarriers);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001410}
1411
Courtney Goeltzenleuchterceebbb12015-07-12 13:07:46 -06001412LOADER_EXPORT void VKAPI vkCmdPipelineBarrier(VkCmdBuffer cmdBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags destStageMask, VkBool32 byRegion, uint32_t memBarrierCount, const void* const* ppMemBarriers)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001413{
1414 const VkLayerDispatchTable *disp;
1415
1416 disp = loader_get_dispatch(cmdBuffer);
1417
Courtney Goeltzenleuchterceebbb12015-07-12 13:07:46 -06001418 disp->CmdPipelineBarrier(cmdBuffer, srcStageMask, destStageMask, byRegion, memBarrierCount, ppMemBarriers);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001419}
1420
1421LOADER_EXPORT void VKAPI vkCmdBeginQuery(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot, VkFlags flags)
1422{
1423 const VkLayerDispatchTable *disp;
1424
1425 disp = loader_get_dispatch(cmdBuffer);
1426
1427 disp->CmdBeginQuery(cmdBuffer, queryPool, slot, flags);
1428}
1429
1430LOADER_EXPORT void VKAPI vkCmdEndQuery(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot)
1431{
1432 const VkLayerDispatchTable *disp;
1433
1434 disp = loader_get_dispatch(cmdBuffer);
1435
1436 disp->CmdEndQuery(cmdBuffer, queryPool, slot);
1437}
1438
1439LOADER_EXPORT void VKAPI vkCmdResetQueryPool(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount)
1440{
1441 const VkLayerDispatchTable *disp;
1442
1443 disp = loader_get_dispatch(cmdBuffer);
1444
1445 disp->CmdResetQueryPool(cmdBuffer, queryPool, startQuery, queryCount);
1446}
1447
1448LOADER_EXPORT void VKAPI vkCmdWriteTimestamp(VkCmdBuffer cmdBuffer, VkTimestampType timestampType, VkBuffer destBuffer, VkDeviceSize destOffset)
1449{
1450 const VkLayerDispatchTable *disp;
1451
1452 disp = loader_get_dispatch(cmdBuffer);
1453
1454 disp->CmdWriteTimestamp(cmdBuffer, timestampType, destBuffer, destOffset);
1455}
1456
1457LOADER_EXPORT void VKAPI vkCmdCopyQueryPoolResults(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize destStride, VkFlags flags)
1458{
1459 const VkLayerDispatchTable *disp;
1460
1461 disp = loader_get_dispatch(cmdBuffer);
1462
1463 disp->CmdCopyQueryPoolResults(cmdBuffer, queryPool, startQuery, queryCount, destBuffer, destOffset, destStride, flags);
1464}
1465
Jon Ashburn754864f2015-07-23 18:49:07 -06001466LOADER_EXPORT void VKAPI vkCmdPushConstants(VkCmdBuffer cmdBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t start, uint32_t length, const void* values)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001467{
1468 const VkLayerDispatchTable *disp;
1469
Jon Ashburn754864f2015-07-23 18:49:07 -06001470 disp = loader_get_dispatch(cmdBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001471
Courtney Goeltzenleuchterab7db3b2015-07-27 14:04:01 -06001472 disp->CmdPushConstants(cmdBuffer, layout, stageFlags, start, length, values);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001473}
1474
Chia-I Wu08accc62015-07-07 11:50:03 +08001475LOADER_EXPORT void VKAPI vkCmdBeginRenderPass(VkCmdBuffer cmdBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkRenderPassContents contents)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001476{
1477 const VkLayerDispatchTable *disp;
1478
1479 disp = loader_get_dispatch(cmdBuffer);
1480
Chia-I Wu08accc62015-07-07 11:50:03 +08001481 disp->CmdBeginRenderPass(cmdBuffer, pRenderPassBegin, contents);
1482}
1483
1484LOADER_EXPORT void VKAPI vkCmdNextSubpass(VkCmdBuffer cmdBuffer, VkRenderPassContents contents)
1485{
1486 const VkLayerDispatchTable *disp;
1487
1488 disp = loader_get_dispatch(cmdBuffer);
1489
1490 disp->CmdNextSubpass(cmdBuffer, contents);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001491}
1492
Chia-I Wu0b50a1c2015-06-26 15:34:39 +08001493LOADER_EXPORT void VKAPI vkCmdEndRenderPass(VkCmdBuffer cmdBuffer)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001494{
1495 const VkLayerDispatchTable *disp;
1496
1497 disp = loader_get_dispatch(cmdBuffer);
1498
Chia-I Wu0b50a1c2015-06-26 15:34:39 +08001499 disp->CmdEndRenderPass(cmdBuffer);
1500}
1501
1502LOADER_EXPORT void VKAPI vkCmdExecuteCommands(VkCmdBuffer cmdBuffer, uint32_t cmdBuffersCount, const VkCmdBuffer* pCmdBuffers)
1503{
1504 const VkLayerDispatchTable *disp;
1505
1506 disp = loader_get_dispatch(cmdBuffer);
1507
1508 disp->CmdExecuteCommands(cmdBuffer, cmdBuffersCount, pCmdBuffers);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001509}