blob: 2ac48eef9514d75fff6363e8603404a24c022335 [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 Ashburne0e64572015-09-30 12:56:42 -0600181 struct loader_instance *ptr_instance = NULL;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600182 disp = loader_get_instance_dispatch(instance);
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -0600183
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600184 loader_platform_thread_lock_mutex(&loader_lock);
185
Jon Ashburne0e64572015-09-30 12:56:42 -0600186 ptr_instance = loader_get_instance(instance);
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600187 disp->DestroyInstance(instance);
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -0600188
Courtney Goeltzenleuchter7d0023c2015-06-08 15:09:22 -0600189 loader_deactivate_instance_layers(ptr_instance);
Jon Ashburneacfa3a2015-08-14 12:51:47 -0600190 loader_heap_free(ptr_instance, ptr_instance->disp);
191 loader_heap_free(ptr_instance, ptr_instance);
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600192 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburn27cd5842015-05-12 17:26:48 -0600193}
Jon Ashburn95a77ba2015-05-15 15:09:35 -0600194
Jon Ashburn27cd5842015-05-12 17:26:48 -0600195LOADER_EXPORT VkResult VKAPI vkEnumeratePhysicalDevices(
196 VkInstance instance,
197 uint32_t* pPhysicalDeviceCount,
198 VkPhysicalDevice* pPhysicalDevices)
199{
200 const VkLayerInstanceDispatchTable *disp;
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600201 VkResult res;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600202 disp = loader_get_instance_dispatch(instance);
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600203
204 loader_platform_thread_lock_mutex(&loader_lock);
205 res = disp->EnumeratePhysicalDevices(instance, pPhysicalDeviceCount,
Jon Ashburn27cd5842015-05-12 17:26:48 -0600206 pPhysicalDevices);
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600207 loader_platform_thread_unlock_mutex(&loader_lock);
208 return res;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600209}
210
Jon Ashburn754864f2015-07-23 18:49:07 -0600211
212
213
214
215
216LOADER_EXPORT VkResult VKAPI vkGetPhysicalDeviceFeatures(
217 VkPhysicalDevice gpu,
218 VkPhysicalDeviceFeatures *pFeatures)
219{
220 const VkLayerInstanceDispatchTable *disp;
221 VkResult res;
222
223 disp = loader_get_instance_dispatch(gpu);
224 res = disp->GetPhysicalDeviceFeatures(gpu, pFeatures);
225 return res;
226}
227
228LOADER_EXPORT VkResult VKAPI vkGetPhysicalDeviceFormatProperties(
229 VkPhysicalDevice gpu,
230 VkFormat format,
231 VkFormatProperties *pFormatInfo)
232{
233 const VkLayerInstanceDispatchTable *disp;
234 VkResult res;
235
236 disp = loader_get_instance_dispatch(gpu);
237 res = disp->GetPhysicalDeviceFormatProperties(gpu, format, pFormatInfo);
238 return res;
239}
240
Courtney Goeltzenleuchtera22097a2015-09-10 13:44:12 -0600241LOADER_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 -0600242{
243 const VkLayerInstanceDispatchTable *disp;
244 VkResult res;
245
246 disp = loader_get_instance_dispatch(physicalDevice);
Courtney Goeltzenleuchtera22097a2015-09-10 13:44:12 -0600247 res = disp->GetPhysicalDeviceImageFormatProperties(physicalDevice, format, type, tiling, usage, flags, pImageFormatProperties);
Jon Ashburn754864f2015-07-23 18:49:07 -0600248 return res;
249}
250
Tony Barbour59a47322015-06-24 16:06:58 -0600251LOADER_EXPORT VkResult VKAPI vkGetPhysicalDeviceProperties(
Jon Ashburn27cd5842015-05-12 17:26:48 -0600252 VkPhysicalDevice gpu,
Tony Barbour59a47322015-06-24 16:06:58 -0600253 VkPhysicalDeviceProperties* pProperties)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600254{
Jon Ashburn95a77ba2015-05-15 15:09:35 -0600255 const VkLayerInstanceDispatchTable *disp;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600256 VkResult res;
257
Jon Ashburn95a77ba2015-05-15 15:09:35 -0600258 disp = loader_get_instance_dispatch(gpu);
Tony Barbour59a47322015-06-24 16:06:58 -0600259 res = disp->GetPhysicalDeviceProperties(gpu, pProperties);
Tony Barbour59a47322015-06-24 16:06:58 -0600260 return res;
261}
262
Cody Northropd0802882015-08-03 17:04:53 -0600263LOADER_EXPORT VkResult VKAPI vkGetPhysicalDeviceQueueFamilyProperties(
Tony Barbour59a47322015-06-24 16:06:58 -0600264 VkPhysicalDevice gpu,
Cody Northropd0802882015-08-03 17:04:53 -0600265 uint32_t* pCount,
266 VkQueueFamilyProperties* pQueueProperties)
Tony Barbour59a47322015-06-24 16:06:58 -0600267{
268 const VkLayerInstanceDispatchTable *disp;
269 VkResult res;
270
271 disp = loader_get_instance_dispatch(gpu);
Cody Northropd0802882015-08-03 17:04:53 -0600272 res = disp->GetPhysicalDeviceQueueFamilyProperties(gpu, pCount, pQueueProperties);
Tony Barbour59a47322015-06-24 16:06:58 -0600273 return res;
274}
275
276LOADER_EXPORT VkResult VKAPI vkGetPhysicalDeviceMemoryProperties(
277 VkPhysicalDevice gpu,
278 VkPhysicalDeviceMemoryProperties* pMemoryProperties)
279{
280 const VkLayerInstanceDispatchTable *disp;
281 VkResult res;
282
283 disp = loader_get_instance_dispatch(gpu);
Tony Barbour59a47322015-06-24 16:06:58 -0600284 res = disp->GetPhysicalDeviceMemoryProperties(gpu, pMemoryProperties);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600285 return res;
286}
287
Jon Ashburn95a77ba2015-05-15 15:09:35 -0600288LOADER_EXPORT VkResult VKAPI vkCreateDevice(
Courtney Goeltzenleuchterca173b82015-06-25 18:01:43 -0600289 VkPhysicalDevice gpu,
290 const VkDeviceCreateInfo* pCreateInfo,
291 VkDevice* pDevice)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600292{
Jon Ashburnd55a3942015-05-06 09:02:10 -0600293 VkResult res;
294
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600295 loader_platform_thread_lock_mutex(&loader_lock);
Courtney Goeltzenleuchterca173b82015-06-25 18:01:43 -0600296
297 res = loader_CreateDevice(gpu, pCreateInfo, pDevice);
298
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600299 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600300 return res;
301}
302
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600303LOADER_EXPORT void VKAPI vkDestroyDevice(VkDevice device)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600304{
305 const VkLayerDispatchTable *disp;
Jon Ashburne39a4f82015-08-28 13:38:21 -0600306 struct loader_device *dev;
307 struct loader_icd *icd = loader_get_icd_and_device(device, &dev);
308 const struct loader_instance *inst = icd->this_instance;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600309 disp = loader_get_dispatch(device);
310
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600311 loader_platform_thread_lock_mutex(&loader_lock);
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600312 disp->DestroyDevice(device);
Jon Ashburne39a4f82015-08-28 13:38:21 -0600313 loader_remove_logical_device(inst, device);
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600314 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburn6301a0f2015-05-29 13:15:39 -0600315}
316
Courtney Goeltzenleuchter35985f62015-09-14 17:22:16 -0600317LOADER_EXPORT VkResult VKAPI vkEnumerateDeviceExtensionProperties(
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600318 VkPhysicalDevice physicalDevice,
319 const char* pLayerName,
320 uint32_t* pCount,
321 VkExtensionProperties* pProperties)
Jon Ashburn6301a0f2015-05-29 13:15:39 -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
Courtney Goeltzenleuchter35985f62015-09-14 17:22:16 -0600327 res = loader_EnumerateDeviceExtensionProperties(physicalDevice, pLayerName, pCount, pProperties);
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600328 loader_platform_thread_unlock_mutex(&loader_lock);
Tony Barbour59a47322015-06-24 16:06:58 -0600329 return res;
330}
331
Courtney Goeltzenleuchter35985f62015-09-14 17:22:16 -0600332LOADER_EXPORT VkResult VKAPI vkEnumerateDeviceLayerProperties(
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600333 VkPhysicalDevice physicalDevice,
334 uint32_t* pCount,
335 VkLayerProperties* pProperties)
Tony Barbour59a47322015-06-24 16:06:58 -0600336{
337 VkResult res;
338
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600339 loader_platform_thread_lock_mutex(&loader_lock);
Jon Ashburnb2ef1372015-07-16 17:19:31 -0600340 //TODO convert over to using instance chain dispatch
Courtney Goeltzenleuchter35985f62015-09-14 17:22:16 -0600341 res = loader_EnumerateDeviceLayerProperties(physicalDevice, pCount, pProperties);
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600342 loader_platform_thread_unlock_mutex(&loader_lock);
Jon Ashburn27cd5842015-05-12 17:26:48 -0600343 return res;
344}
345
Jon Ashburnd55a3942015-05-06 09:02:10 -0600346LOADER_EXPORT VkResult VKAPI vkGetDeviceQueue(VkDevice device, uint32_t queueNodeIndex, uint32_t queueIndex, VkQueue* pQueue)
347{
348 const VkLayerDispatchTable *disp;
349 VkResult res;
350
351 disp = loader_get_dispatch(device);
352
353 res = disp->GetDeviceQueue(device, queueNodeIndex, queueIndex, pQueue);
354 if (res == VK_SUCCESS) {
355 loader_set_dispatch(*pQueue, disp);
356 }
357
358 return res;
359}
360
361LOADER_EXPORT VkResult VKAPI vkQueueSubmit(VkQueue queue, uint32_t cmdBufferCount, const VkCmdBuffer* pCmdBuffers, VkFence fence)
362{
363 const VkLayerDispatchTable *disp;
364
365 disp = loader_get_dispatch(queue);
366
367 return disp->QueueSubmit(queue, cmdBufferCount, pCmdBuffers, fence);
368}
369
370LOADER_EXPORT VkResult VKAPI vkQueueWaitIdle(VkQueue queue)
371{
372 const VkLayerDispatchTable *disp;
373
374 disp = loader_get_dispatch(queue);
375
376 return disp->QueueWaitIdle(queue);
377}
378
379LOADER_EXPORT VkResult VKAPI vkDeviceWaitIdle(VkDevice device)
380{
381 const VkLayerDispatchTable *disp;
382
383 disp = loader_get_dispatch(device);
384
385 return disp->DeviceWaitIdle(device);
386}
387
388LOADER_EXPORT VkResult VKAPI vkAllocMemory(VkDevice device, const VkMemoryAllocInfo* pAllocInfo, VkDeviceMemory* pMem)
389{
390 const VkLayerDispatchTable *disp;
391
392 disp = loader_get_dispatch(device);
393
394 return disp->AllocMemory(device, pAllocInfo, pMem);
395}
396
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600397LOADER_EXPORT void VKAPI vkFreeMemory(VkDevice device, VkDeviceMemory mem)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600398{
399 const VkLayerDispatchTable *disp;
400
401 disp = loader_get_dispatch(device);
402
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600403 disp->FreeMemory(device, mem);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600404}
405
Jon Ashburnd55a3942015-05-06 09:02:10 -0600406LOADER_EXPORT VkResult VKAPI vkMapMemory(VkDevice device, VkDeviceMemory mem, VkDeviceSize offset, VkDeviceSize size, VkFlags flags, void** ppData)
407{
408 const VkLayerDispatchTable *disp;
409
410 disp = loader_get_dispatch(device);
411
412 return disp->MapMemory(device, mem, offset, size, flags, ppData);
413}
414
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600415LOADER_EXPORT void VKAPI vkUnmapMemory(VkDevice device, VkDeviceMemory mem)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600416{
417 const VkLayerDispatchTable *disp;
418
419 disp = loader_get_dispatch(device);
420
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600421 disp->UnmapMemory(device, mem);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600422}
423
424LOADER_EXPORT VkResult VKAPI vkFlushMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges)
425{
426 const VkLayerDispatchTable *disp;
427
428 disp = loader_get_dispatch(device);
429
430 return disp->FlushMappedMemoryRanges(device, memRangeCount, pMemRanges);
431}
432
433LOADER_EXPORT VkResult VKAPI vkInvalidateMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges)
434{
435 const VkLayerDispatchTable *disp;
436
437 disp = loader_get_dispatch(device);
438
439 return disp->InvalidateMappedMemoryRanges(device, memRangeCount, pMemRanges);
440}
441
Courtney Goeltzenleuchterfb71f222015-07-09 21:57:28 -0600442LOADER_EXPORT VkResult VKAPI vkGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes)
443{
444 const VkLayerDispatchTable *disp;
445
446 disp = loader_get_dispatch(device);
447
448 return disp->GetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes);
449}
450
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600451LOADER_EXPORT VkResult VKAPI vkBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory mem, VkDeviceSize offset)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600452{
453 const VkLayerDispatchTable *disp;
454
Mark Lobodzinski942b1722015-05-11 17:21:15 -0500455 disp = loader_get_dispatch(device);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600456
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600457 return disp->BindBufferMemory(device, buffer, mem, offset);
458}
459
460LOADER_EXPORT VkResult VKAPI vkBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory mem, VkDeviceSize offset)
461{
462 const VkLayerDispatchTable *disp;
463
464 disp = loader_get_dispatch(device);
465
466 return disp->BindImageMemory(device, image, mem, offset);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600467}
468
Jon Ashburn754864f2015-07-23 18:49:07 -0600469LOADER_EXPORT VkResult VKAPI vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements)
470{
471 const VkLayerDispatchTable *disp;
472
473 disp = loader_get_dispatch(device);
474
475 return disp->GetBufferMemoryRequirements(device, buffer, pMemoryRequirements);
476}
477
478LOADER_EXPORT VkResult VKAPI vkGetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements)
479{
480 const VkLayerDispatchTable *disp;
481
482 disp = loader_get_dispatch(device);
483
484 return disp->GetImageMemoryRequirements(device, image, pMemoryRequirements);
485}
486
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600487LOADER_EXPORT VkResult VKAPI vkGetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t* pNumRequirements, VkSparseImageMemoryRequirements* pSparseMemoryRequirements)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600488{
489 const VkLayerDispatchTable *disp;
490
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600491 disp = loader_get_dispatch(device);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600492
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600493 return disp->GetImageSparseMemoryRequirements(device, image, pNumRequirements, pSparseMemoryRequirements);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600494}
495
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600496LOADER_EXPORT VkResult VKAPI vkGetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, uint32_t samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t* pNumProperties, VkSparseImageFormatProperties* pProperties)
497{
498 const VkLayerInstanceDispatchTable *disp;
499
500 disp = loader_get_instance_dispatch(physicalDevice);
501
502 return disp->GetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, pNumProperties, pProperties);
503}
504
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600505LOADER_EXPORT VkResult VKAPI vkQueueBindSparseBufferMemory(VkQueue queue, VkBuffer buffer, uint32_t numBindings, const VkSparseMemoryBindInfo* pBindInfo)
506{
507 const VkLayerDispatchTable *disp;
508
509 disp = loader_get_dispatch(queue);
510
511 return disp->QueueBindSparseBufferMemory(queue, buffer, numBindings, pBindInfo);
512}
513
Jon Ashburn754864f2015-07-23 18:49:07 -0600514LOADER_EXPORT VkResult VKAPI vkQueueBindSparseImageOpaqueMemory(VkQueue queue, VkImage image, uint32_t numBindings, const VkSparseMemoryBindInfo* pBindInfo)
515{
516 const VkLayerDispatchTable *disp;
517
518 disp = loader_get_dispatch(queue);
519
520 return disp->QueueBindSparseImageOpaqueMemory(queue, image, numBindings, pBindInfo);
521}
522
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600523LOADER_EXPORT VkResult VKAPI vkQueueBindSparseImageMemory(VkQueue queue, VkImage image, uint32_t numBindings, const VkSparseImageMemoryBindInfo* pBindInfo)
524{
525 const VkLayerDispatchTable *disp;
526
527 disp = loader_get_dispatch(queue);
528
529 return disp->QueueBindSparseImageMemory(queue, image, numBindings, pBindInfo);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600530}
531
532LOADER_EXPORT VkResult VKAPI vkCreateFence(VkDevice device, const VkFenceCreateInfo* pCreateInfo, VkFence* pFence)
533{
534 const VkLayerDispatchTable *disp;
535
536 disp = loader_get_dispatch(device);
537
538 return disp->CreateFence(device, pCreateInfo, pFence);
539}
540
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600541LOADER_EXPORT void VKAPI vkDestroyFence(VkDevice device, VkFence fence)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600542{
543 const VkLayerDispatchTable *disp;
544
545 disp = loader_get_dispatch(device);
546
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600547 disp->DestroyFence(device, fence);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600548}
549
Courtney Goeltzenleuchter2bf8f902015-06-18 17:28:20 -0600550LOADER_EXPORT VkResult VKAPI vkResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600551{
552 const VkLayerDispatchTable *disp;
553
554 disp = loader_get_dispatch(device);
555
556 return disp->ResetFences(device, fenceCount, pFences);
557}
558
559LOADER_EXPORT VkResult VKAPI vkGetFenceStatus(VkDevice device, VkFence fence)
560{
561 const VkLayerDispatchTable *disp;
562
563 disp = loader_get_dispatch(device);
564
565 return disp->GetFenceStatus(device, fence);
566}
567
Courtney Goeltzenleuchtercd2a0992015-07-09 11:44:38 -0600568LOADER_EXPORT VkResult VKAPI vkWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600569{
570 const VkLayerDispatchTable *disp;
571
572 disp = loader_get_dispatch(device);
573
574 return disp->WaitForFences(device, fenceCount, pFences, waitAll, timeout);
575}
576
577LOADER_EXPORT VkResult VKAPI vkCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo, VkSemaphore* pSemaphore)
578{
579 const VkLayerDispatchTable *disp;
580
581 disp = loader_get_dispatch(device);
582
583 return disp->CreateSemaphore(device, pCreateInfo, pSemaphore);
584}
585
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600586LOADER_EXPORT void VKAPI vkDestroySemaphore(VkDevice device, VkSemaphore semaphore)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600587{
588 const VkLayerDispatchTable *disp;
589
590 disp = loader_get_dispatch(device);
591
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600592 disp->DestroySemaphore(device, semaphore);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600593}
594
Jon Ashburnd55a3942015-05-06 09:02:10 -0600595LOADER_EXPORT VkResult VKAPI vkQueueSignalSemaphore(VkQueue queue, VkSemaphore semaphore)
596{
597 const VkLayerDispatchTable *disp;
598
599 disp = loader_get_dispatch(queue);
600
601 return disp->QueueSignalSemaphore(queue, semaphore);
602}
603
604LOADER_EXPORT VkResult VKAPI vkQueueWaitSemaphore(VkQueue queue, VkSemaphore semaphore)
605{
606 const VkLayerDispatchTable *disp;
607
608 disp = loader_get_dispatch(queue);
609
610 return disp->QueueWaitSemaphore(queue, semaphore);
611}
612
613LOADER_EXPORT VkResult VKAPI vkCreateEvent(VkDevice device, const VkEventCreateInfo* pCreateInfo, VkEvent* pEvent)
614{
615 const VkLayerDispatchTable *disp;
616
617 disp = loader_get_dispatch(device);
618
619 return disp->CreateEvent(device, pCreateInfo, pEvent);
620}
621
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600622LOADER_EXPORT void VKAPI vkDestroyEvent(VkDevice device, VkEvent event)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600623{
624 const VkLayerDispatchTable *disp;
625
626 disp = loader_get_dispatch(device);
627
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600628 disp->DestroyEvent(device, event);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600629}
630
Jon Ashburnd55a3942015-05-06 09:02:10 -0600631LOADER_EXPORT VkResult VKAPI vkGetEventStatus(VkDevice device, VkEvent event)
632{
633 const VkLayerDispatchTable *disp;
634
635 disp = loader_get_dispatch(device);
636
637 return disp->GetEventStatus(device, event);
638}
639
640LOADER_EXPORT VkResult VKAPI vkSetEvent(VkDevice device, VkEvent event)
641{
642 const VkLayerDispatchTable *disp;
643
644 disp = loader_get_dispatch(device);
645
646 return disp->SetEvent(device, event);
647}
648
649LOADER_EXPORT VkResult VKAPI vkResetEvent(VkDevice device, VkEvent event)
650{
651 const VkLayerDispatchTable *disp;
652
653 disp = loader_get_dispatch(device);
654
655 return disp->ResetEvent(device, event);
656}
657
658LOADER_EXPORT VkResult VKAPI vkCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, VkQueryPool* pQueryPool)
659{
660 const VkLayerDispatchTable *disp;
661
662 disp = loader_get_dispatch(device);
663
664 return disp->CreateQueryPool(device, pCreateInfo, pQueryPool);
665}
666
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600667LOADER_EXPORT void VKAPI vkDestroyQueryPool(VkDevice device, VkQueryPool queryPool)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600668{
669 const VkLayerDispatchTable *disp;
670
671 disp = loader_get_dispatch(device);
672
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600673 disp->DestroyQueryPool(device, queryPool);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600674}
675
Jon Ashburnd55a3942015-05-06 09:02:10 -0600676LOADER_EXPORT VkResult VKAPI vkGetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount, size_t* pDataSize, void* pData, VkQueryResultFlags flags)
677{
678 const VkLayerDispatchTable *disp;
679
680 disp = loader_get_dispatch(device);
681
682 return disp->GetQueryPoolResults(device, queryPool, startQuery, queryCount, pDataSize, pData, flags);
683}
684
Jon Ashburnd55a3942015-05-06 09:02:10 -0600685LOADER_EXPORT VkResult VKAPI vkCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateInfo, VkBuffer* pBuffer)
686{
687 const VkLayerDispatchTable *disp;
688
689 disp = loader_get_dispatch(device);
690
691 return disp->CreateBuffer(device, pCreateInfo, pBuffer);
692}
693
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600694LOADER_EXPORT void VKAPI vkDestroyBuffer(VkDevice device, VkBuffer buffer)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600695{
696 const VkLayerDispatchTable *disp;
697
698 disp = loader_get_dispatch(device);
699
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600700 disp->DestroyBuffer(device, buffer);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600701}
702
Jon Ashburnd55a3942015-05-06 09:02:10 -0600703LOADER_EXPORT VkResult VKAPI vkCreateBufferView(VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, VkBufferView* pView)
704{
705 const VkLayerDispatchTable *disp;
706
707 disp = loader_get_dispatch(device);
708
709 return disp->CreateBufferView(device, pCreateInfo, pView);
710}
711
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600712LOADER_EXPORT void VKAPI vkDestroyBufferView(VkDevice device, VkBufferView bufferView)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600713{
714 const VkLayerDispatchTable *disp;
715
716 disp = loader_get_dispatch(device);
717
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600718 disp->DestroyBufferView(device, bufferView);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600719}
720
Jon Ashburnd55a3942015-05-06 09:02:10 -0600721LOADER_EXPORT VkResult VKAPI vkCreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo, VkImage* pImage)
722{
723 const VkLayerDispatchTable *disp;
724
725 disp = loader_get_dispatch(device);
726
727 return disp->CreateImage(device, pCreateInfo, pImage);
728}
729
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600730LOADER_EXPORT void VKAPI vkDestroyImage(VkDevice device, VkImage image)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600731{
732 const VkLayerDispatchTable *disp;
733
734 disp = loader_get_dispatch(device);
735
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600736 disp->DestroyImage(device, image);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600737}
738
Tony Barbour59a47322015-06-24 16:06:58 -0600739LOADER_EXPORT VkResult VKAPI vkGetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600740{
741 const VkLayerDispatchTable *disp;
742
743 disp = loader_get_dispatch(device);
744
Tony Barbour59a47322015-06-24 16:06:58 -0600745 return disp->GetImageSubresourceLayout(device, image, pSubresource, pLayout);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600746}
747
748LOADER_EXPORT VkResult VKAPI vkCreateImageView(VkDevice device, const VkImageViewCreateInfo* pCreateInfo, VkImageView* pView)
749{
750 const VkLayerDispatchTable *disp;
751
752 disp = loader_get_dispatch(device);
753
754 return disp->CreateImageView(device, pCreateInfo, pView);
755}
756
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600757LOADER_EXPORT void VKAPI vkDestroyImageView(VkDevice device, VkImageView imageView)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600758{
759 const VkLayerDispatchTable *disp;
760
761 disp = loader_get_dispatch(device);
762
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600763 disp->DestroyImageView(device, imageView);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600764}
765
Courtney Goeltzenleuchter2d2cb682015-06-24 18:24:19 -0600766LOADER_EXPORT VkResult VKAPI vkCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, VkShaderModule* pShader)
767{
768 const VkLayerDispatchTable *disp;
769
770 disp = loader_get_dispatch(device);
771
772 return disp->CreateShaderModule(device, pCreateInfo, pShader);
773}
774
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600775LOADER_EXPORT void VKAPI vkDestroyShaderModule(VkDevice device, VkShaderModule shaderModule)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600776{
777 const VkLayerDispatchTable *disp;
778
779 disp = loader_get_dispatch(device);
780
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600781 disp->DestroyShaderModule(device, shaderModule);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600782}
783
Jon Ashburnd55a3942015-05-06 09:02:10 -0600784LOADER_EXPORT VkResult VKAPI vkCreateShader(VkDevice device, const VkShaderCreateInfo* pCreateInfo, VkShader* pShader)
785{
786 const VkLayerDispatchTable *disp;
787
788 disp = loader_get_dispatch(device);
789
790 return disp->CreateShader(device, pCreateInfo, pShader);
791}
792
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600793LOADER_EXPORT void VKAPI vkDestroyShader(VkDevice device, VkShader shader)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600794{
795 const VkLayerDispatchTable *disp;
796
797 disp = loader_get_dispatch(device);
798
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600799 disp->DestroyShader(device, shader);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600800}
801
Jon Ashburnc669cc62015-07-09 15:02:25 -0600802LOADER_EXPORT VkResult VKAPI vkCreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, VkPipelineCache* pPipelineCache)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600803{
804 const VkLayerDispatchTable *disp;
805
806 disp = loader_get_dispatch(device);
807
Jon Ashburnc669cc62015-07-09 15:02:25 -0600808 return disp->CreatePipelineCache(device, pCreateInfo, pPipelineCache);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600809}
810
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600811LOADER_EXPORT void VKAPI vkDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600812{
813 const VkLayerDispatchTable *disp;
814
815 disp = loader_get_dispatch(device);
816
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600817 disp->DestroyPipelineCache(device, pipelineCache);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600818}
819
Jon Ashburnc669cc62015-07-09 15:02:25 -0600820LOADER_EXPORT size_t VKAPI vkGetPipelineCacheSize(VkDevice device, VkPipelineCache pipelineCache)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600821{
822 const VkLayerDispatchTable *disp;
823
824 disp = loader_get_dispatch(device);
825
Jon Ashburnc669cc62015-07-09 15:02:25 -0600826 return disp->GetPipelineCacheSize(device, pipelineCache);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600827}
828
Jon Ashburnc669cc62015-07-09 15:02:25 -0600829LOADER_EXPORT VkResult VKAPI vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, void* pData)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600830{
831 const VkLayerDispatchTable *disp;
832
833 disp = loader_get_dispatch(device);
834
Jon Ashburnc669cc62015-07-09 15:02:25 -0600835 return disp->GetPipelineCacheData(device, pipelineCache, pData);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600836}
837
Jon Ashburnc669cc62015-07-09 15:02:25 -0600838LOADER_EXPORT VkResult VKAPI vkMergePipelineCaches(VkDevice device, VkPipelineCache destCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600839{
840 const VkLayerDispatchTable *disp;
841
842 disp = loader_get_dispatch(device);
843
Jon Ashburnc669cc62015-07-09 15:02:25 -0600844 return disp->MergePipelineCaches(device, destCache, srcCacheCount, pSrcCaches);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600845}
846
Jon Ashburnc669cc62015-07-09 15:02:25 -0600847LOADER_EXPORT VkResult VKAPI vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, const VkGraphicsPipelineCreateInfo* pCreateInfos, VkPipeline* pPipelines)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600848{
849 const VkLayerDispatchTable *disp;
850
851 disp = loader_get_dispatch(device);
852
Jon Ashburnc669cc62015-07-09 15:02:25 -0600853 return disp->CreateGraphicsPipelines(device, pipelineCache, count, pCreateInfos, pPipelines);
854}
855
856LOADER_EXPORT VkResult VKAPI vkCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, const VkComputePipelineCreateInfo* pCreateInfos, VkPipeline* pPipelines)
857{
858 const VkLayerDispatchTable *disp;
859
860 disp = loader_get_dispatch(device);
861
862 return disp->CreateComputePipelines(device, pipelineCache, count, pCreateInfos, pPipelines);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600863}
864
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600865LOADER_EXPORT void VKAPI vkDestroyPipeline(VkDevice device, VkPipeline pipeline)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600866{
867 const VkLayerDispatchTable *disp;
868
869 disp = loader_get_dispatch(device);
870
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600871 disp->DestroyPipeline(device, pipeline);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600872}
873
Jon Ashburnd55a3942015-05-06 09:02:10 -0600874LOADER_EXPORT VkResult VKAPI vkCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, VkPipelineLayout* pPipelineLayout)
875{
876 const VkLayerDispatchTable *disp;
877
878 disp = loader_get_dispatch(device);
879
880 return disp->CreatePipelineLayout(device, pCreateInfo, pPipelineLayout);
881}
882
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600883LOADER_EXPORT void VKAPI vkDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600884{
885 const VkLayerDispatchTable *disp;
886
887 disp = loader_get_dispatch(device);
888
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600889 disp->DestroyPipelineLayout(device, pipelineLayout);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600890}
891
Jon Ashburnd55a3942015-05-06 09:02:10 -0600892LOADER_EXPORT VkResult VKAPI vkCreateSampler(VkDevice device, const VkSamplerCreateInfo* pCreateInfo, VkSampler* pSampler)
893{
894 const VkLayerDispatchTable *disp;
895
896 disp = loader_get_dispatch(device);
897
898 return disp->CreateSampler(device, pCreateInfo, pSampler);
899}
900
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600901LOADER_EXPORT void VKAPI vkDestroySampler(VkDevice device, VkSampler sampler)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600902{
903 const VkLayerDispatchTable *disp;
904
905 disp = loader_get_dispatch(device);
906
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600907 disp->DestroySampler(device, sampler);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600908}
909
910
Jon Ashburnd55a3942015-05-06 09:02:10 -0600911LOADER_EXPORT VkResult VKAPI vkCreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayout* pSetLayout)
912{
913 const VkLayerDispatchTable *disp;
914
915 disp = loader_get_dispatch(device);
916
917 return disp->CreateDescriptorSetLayout(device, pCreateInfo, pSetLayout);
918}
919
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600920LOADER_EXPORT void VKAPI vkDestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600921{
922 const VkLayerDispatchTable *disp;
923
924 disp = loader_get_dispatch(device);
925
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600926 disp->DestroyDescriptorSetLayout(device, descriptorSetLayout);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600927}
928
Courtney Goeltzenleuchterfe908d32015-09-16 16:12:45 -0600929LOADER_EXPORT VkResult VKAPI vkCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, VkDescriptorPool* pDescriptorPool)
Jon Ashburnd55a3942015-05-06 09:02:10 -0600930{
931 const VkLayerDispatchTable *disp;
932
933 disp = loader_get_dispatch(device);
934
Courtney Goeltzenleuchterfe908d32015-09-16 16:12:45 -0600935 return disp->CreateDescriptorPool(device, pCreateInfo, pDescriptorPool);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600936}
937
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600938LOADER_EXPORT void VKAPI vkDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600939{
940 const VkLayerDispatchTable *disp;
941
942 disp = loader_get_dispatch(device);
943
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600944 disp->DestroyDescriptorPool(device, descriptorPool);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600945}
946
947
Jon Ashburnd55a3942015-05-06 09:02:10 -0600948LOADER_EXPORT VkResult VKAPI vkResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool)
949{
950 const VkLayerDispatchTable *disp;
951
952 disp = loader_get_dispatch(device);
953
954 return disp->ResetDescriptorPool(device, descriptorPool);
955}
956
Cody Northrop1e4f8022015-08-03 12:47:29 -0600957LOADER_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 -0600958{
959 const VkLayerDispatchTable *disp;
960
961 disp = loader_get_dispatch(device);
962
Cody Northrop1e4f8022015-08-03 12:47:29 -0600963 return disp->AllocDescriptorSets(device, descriptorPool, setUsage, count, pSetLayouts, pDescriptorSets);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600964}
965
Tony Barbour34ec6922015-07-10 10:50:45 -0600966LOADER_EXPORT VkResult VKAPI vkFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t count, const VkDescriptorSet* pDescriptorSets)
967{
968 const VkLayerDispatchTable *disp;
969
970 disp = loader_get_dispatch(device);
971
972 return disp->FreeDescriptorSets(device, descriptorPool, count, pDescriptorSets);
973}
974
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600975LOADER_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 -0600976{
977 const VkLayerDispatchTable *disp;
978
979 disp = loader_get_dispatch(device);
980
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600981 disp->UpdateDescriptorSets(device, writeCount, pDescriptorWrites, copyCount, pDescriptorCopies);
Jon Ashburnd55a3942015-05-06 09:02:10 -0600982}
983
Jon Ashburn754864f2015-07-23 18:49:07 -0600984LOADER_EXPORT VkResult VKAPI vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, VkFramebuffer* pFramebuffer)
985{
986 const VkLayerDispatchTable *disp;
987
988 disp = loader_get_dispatch(device);
989
990 return disp->CreateFramebuffer(device, pCreateInfo, pFramebuffer);
991}
992
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600993LOADER_EXPORT void VKAPI vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer)
Jon Ashburn754864f2015-07-23 18:49:07 -0600994{
995 const VkLayerDispatchTable *disp;
996
997 disp = loader_get_dispatch(device);
998
Mark Lobodzinski2141f652015-09-07 13:59:43 -0600999 disp->DestroyFramebuffer(device, framebuffer);
Jon Ashburn754864f2015-07-23 18:49:07 -06001000}
1001
1002LOADER_EXPORT VkResult VKAPI vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, VkRenderPass* pRenderPass)
1003{
1004 const VkLayerDispatchTable *disp;
1005
1006 disp = loader_get_dispatch(device);
1007
1008 return disp->CreateRenderPass(device, pCreateInfo, pRenderPass);
1009}
1010
Mark Lobodzinski2141f652015-09-07 13:59:43 -06001011LOADER_EXPORT void VKAPI vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass)
Jon Ashburn754864f2015-07-23 18:49:07 -06001012{
1013 const VkLayerDispatchTable *disp;
1014
1015 disp = loader_get_dispatch(device);
1016
Mark Lobodzinski2141f652015-09-07 13:59:43 -06001017 disp->DestroyRenderPass(device, renderPass);
Jon Ashburn754864f2015-07-23 18:49:07 -06001018}
1019
1020LOADER_EXPORT VkResult VKAPI vkGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity)
1021{
1022 const VkLayerDispatchTable *disp;
1023
1024 disp = loader_get_dispatch(device);
1025
1026 return disp->GetRenderAreaGranularity(device, renderPass, pGranularity);
1027}
1028
Cody Northrope62183e2015-07-09 18:08:05 -06001029LOADER_EXPORT VkResult VKAPI vkCreateCommandPool(VkDevice device, const VkCmdPoolCreateInfo* pCreateInfo, VkCmdPool* pCmdPool)
1030{
1031 const VkLayerDispatchTable *disp;
1032
1033 disp = loader_get_dispatch(device);
1034
1035 return disp->CreateCommandPool(device, pCreateInfo, pCmdPool);
1036}
1037
Mark Lobodzinski2141f652015-09-07 13:59:43 -06001038LOADER_EXPORT void VKAPI vkDestroyCommandPool(VkDevice device, VkCmdPool cmdPool)
Cody Northrope62183e2015-07-09 18:08:05 -06001039{
1040 const VkLayerDispatchTable *disp;
1041
1042 disp = loader_get_dispatch(device);
1043
Mark Lobodzinski2141f652015-09-07 13:59:43 -06001044 disp->DestroyCommandPool(device, cmdPool);
Cody Northrope62183e2015-07-09 18:08:05 -06001045}
1046
1047LOADER_EXPORT VkResult VKAPI vkResetCommandPool(VkDevice device, VkCmdPool cmdPool, VkCmdPoolResetFlags flags)
1048{
1049 const VkLayerDispatchTable *disp;
1050
1051 disp = loader_get_dispatch(device);
1052
1053 return disp->ResetCommandPool(device, cmdPool, flags);
1054}
1055
Jon Ashburnd55a3942015-05-06 09:02:10 -06001056LOADER_EXPORT VkResult VKAPI vkCreateCommandBuffer(VkDevice device, const VkCmdBufferCreateInfo* pCreateInfo, VkCmdBuffer* pCmdBuffer)
1057{
1058 const VkLayerDispatchTable *disp;
1059 VkResult res;
1060
1061 disp = loader_get_dispatch(device);
1062
1063 res = disp->CreateCommandBuffer(device, pCreateInfo, pCmdBuffer);
1064 if (res == VK_SUCCESS) {
1065 loader_init_dispatch(*pCmdBuffer, disp);
1066 }
1067
1068 return res;
1069}
1070
Mark Lobodzinski2141f652015-09-07 13:59:43 -06001071LOADER_EXPORT void VKAPI vkDestroyCommandBuffer(VkDevice device, VkCmdBuffer cmdBuffer)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001072{
1073 const VkLayerDispatchTable *disp;
1074
1075 disp = loader_get_dispatch(device);
1076
Mark Lobodzinski2141f652015-09-07 13:59:43 -06001077 disp->DestroyCommandBuffer(device, cmdBuffer);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001078}
1079
Jon Ashburnd55a3942015-05-06 09:02:10 -06001080LOADER_EXPORT VkResult VKAPI vkBeginCommandBuffer(VkCmdBuffer cmdBuffer, const VkCmdBufferBeginInfo* pBeginInfo)
1081{
1082 const VkLayerDispatchTable *disp;
1083
1084 disp = loader_get_dispatch(cmdBuffer);
1085
1086 return disp->BeginCommandBuffer(cmdBuffer, pBeginInfo);
1087}
1088
1089LOADER_EXPORT VkResult VKAPI vkEndCommandBuffer(VkCmdBuffer cmdBuffer)
1090{
1091 const VkLayerDispatchTable *disp;
1092
1093 disp = loader_get_dispatch(cmdBuffer);
1094
1095 return disp->EndCommandBuffer(cmdBuffer);
1096}
1097
Cody Northrope62183e2015-07-09 18:08:05 -06001098LOADER_EXPORT VkResult VKAPI vkResetCommandBuffer(VkCmdBuffer cmdBuffer, VkCmdBufferResetFlags flags)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001099{
1100 const VkLayerDispatchTable *disp;
1101
1102 disp = loader_get_dispatch(cmdBuffer);
1103
Cody Northrope62183e2015-07-09 18:08:05 -06001104 return disp->ResetCommandBuffer(cmdBuffer, flags);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001105}
1106
1107LOADER_EXPORT void VKAPI vkCmdBindPipeline(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline)
1108{
1109 const VkLayerDispatchTable *disp;
1110
1111 disp = loader_get_dispatch(cmdBuffer);
1112
1113 disp->CmdBindPipeline(cmdBuffer, pipelineBindPoint, pipeline);
1114}
1115
Courtney Goeltzenleuchter078f8172015-09-21 11:44:06 -06001116LOADER_EXPORT void VKAPI vkCmdSetViewport(VkCmdBuffer cmdBuffer, uint32_t viewportCount, const VkViewport* pViewports)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001117{
1118 const VkLayerDispatchTable *disp;
1119
1120 disp = loader_get_dispatch(cmdBuffer);
1121
Courtney Goeltzenleuchter078f8172015-09-21 11:44:06 -06001122 disp->CmdSetViewport(cmdBuffer, viewportCount, pViewports);
1123}
1124
1125LOADER_EXPORT void VKAPI vkCmdSetScissor(VkCmdBuffer cmdBuffer, uint32_t scissorCount, const VkRect2D* pScissors)
1126{
1127 const VkLayerDispatchTable *disp;
1128
1129 disp = loader_get_dispatch(cmdBuffer);
1130
1131 disp->CmdSetScissor(cmdBuffer, scissorCount, pScissors);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001132}
1133
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001134LOADER_EXPORT void VKAPI vkCmdSetLineWidth(VkCmdBuffer cmdBuffer, float lineWidth)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001135{
1136 const VkLayerDispatchTable *disp;
1137
1138 disp = loader_get_dispatch(cmdBuffer);
1139
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001140 disp->CmdSetLineWidth(cmdBuffer, lineWidth);
Cody Northrop12365112015-08-17 11:10:49 -06001141}
1142
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001143LOADER_EXPORT void VKAPI vkCmdSetDepthBias(VkCmdBuffer cmdBuffer, float depthBias, float depthBiasClamp, float slopeScaledDepthBias)
Cody Northrop12365112015-08-17 11:10:49 -06001144{
1145 const VkLayerDispatchTable *disp;
1146
1147 disp = loader_get_dispatch(cmdBuffer);
1148
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001149 disp->CmdSetDepthBias(cmdBuffer, depthBias, depthBiasClamp, slopeScaledDepthBias);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001150}
1151
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001152LOADER_EXPORT void VKAPI vkCmdSetBlendConstants(VkCmdBuffer cmdBuffer, const float blendConst[4])
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001153{
1154 const VkLayerDispatchTable *disp;
1155
1156 disp = loader_get_dispatch(cmdBuffer);
1157
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001158 disp->CmdSetBlendConstants(cmdBuffer, blendConst);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001159}
1160
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001161LOADER_EXPORT void VKAPI vkCmdSetDepthBounds(VkCmdBuffer cmdBuffer, float minDepthBounds, float maxDepthBounds)
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001162{
1163 const VkLayerDispatchTable *disp;
1164
1165 disp = loader_get_dispatch(cmdBuffer);
1166
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001167 disp->CmdSetDepthBounds(cmdBuffer, minDepthBounds, maxDepthBounds);
Cody Northrop82485a82015-08-18 15:21:16 -06001168}
1169
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001170LOADER_EXPORT void VKAPI vkCmdSetStencilCompareMask(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilCompareMask)
Cody Northrop82485a82015-08-18 15:21:16 -06001171{
1172 const VkLayerDispatchTable *disp;
1173
1174 disp = loader_get_dispatch(cmdBuffer);
1175
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -06001176 disp->CmdSetStencilCompareMask(cmdBuffer, faceMask, stencilCompareMask);
1177}
1178
1179LOADER_EXPORT void VKAPI vkCmdSetStencilWriteMask(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilWriteMask)
1180{
1181 const VkLayerDispatchTable *disp;
1182
1183 disp = loader_get_dispatch(cmdBuffer);
1184
1185 disp->CmdSetStencilWriteMask(cmdBuffer, faceMask, stencilWriteMask);
1186}
1187
1188LOADER_EXPORT void VKAPI vkCmdSetStencilReference(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilReference)
1189{
1190 const VkLayerDispatchTable *disp;
1191
1192 disp = loader_get_dispatch(cmdBuffer);
1193
1194 disp->CmdSetStencilReference(cmdBuffer, faceMask, stencilReference);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001195}
1196
Mark Lobodzinskif2093b62015-06-15 13:21:21 -06001197LOADER_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 -06001198{
1199 const VkLayerDispatchTable *disp;
1200
1201 disp = loader_get_dispatch(cmdBuffer);
1202
Mark Lobodzinskif2093b62015-06-15 13:21:21 -06001203 disp->CmdBindDescriptorSets(cmdBuffer, pipelineBindPoint, layout, firstSet, setCount, pDescriptorSets, dynamicOffsetCount, pDynamicOffsets);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001204}
1205
Jon Ashburnd55a3942015-05-06 09:02:10 -06001206LOADER_EXPORT void VKAPI vkCmdBindIndexBuffer(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType)
1207{
1208 const VkLayerDispatchTable *disp;
1209
1210 disp = loader_get_dispatch(cmdBuffer);
1211
1212 disp->CmdBindIndexBuffer(cmdBuffer, buffer, offset, indexType);
1213}
1214
Jon Ashburn754864f2015-07-23 18:49:07 -06001215LOADER_EXPORT void VKAPI vkCmdBindVertexBuffers(VkCmdBuffer cmdBuffer, uint32_t startBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets)
1216{
1217 const VkLayerDispatchTable *disp;
1218
1219 disp = loader_get_dispatch(cmdBuffer);
1220
1221 disp->CmdBindVertexBuffers(cmdBuffer, startBinding, bindingCount, pBuffers, pOffsets);
1222}
1223
Courtney Goeltzenleuchter08c26372015-09-23 12:31:50 -06001224LOADER_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 -06001225{
1226 const VkLayerDispatchTable *disp;
1227
1228 disp = loader_get_dispatch(cmdBuffer);
1229
Courtney Goeltzenleuchter08c26372015-09-23 12:31:50 -06001230 disp->CmdDraw(cmdBuffer, vertexCount, instanceCount, firstVertex, firstInstance);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001231}
1232
Courtney Goeltzenleuchter08c26372015-09-23 12:31:50 -06001233LOADER_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 -06001234{
1235 const VkLayerDispatchTable *disp;
1236
1237 disp = loader_get_dispatch(cmdBuffer);
1238
Courtney Goeltzenleuchter08c26372015-09-23 12:31:50 -06001239 disp->CmdDrawIndexed(cmdBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001240}
1241
1242LOADER_EXPORT void VKAPI vkCmdDrawIndirect(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride)
1243{
1244 const VkLayerDispatchTable *disp;
1245
1246 disp = loader_get_dispatch(cmdBuffer);
1247
1248 disp->CmdDrawIndirect(cmdBuffer, buffer, offset, count, stride);
1249}
1250
1251LOADER_EXPORT void VKAPI vkCmdDrawIndexedIndirect(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride)
1252{
1253 const VkLayerDispatchTable *disp;
1254
1255 disp = loader_get_dispatch(cmdBuffer);
1256
1257 disp->CmdDrawIndexedIndirect(cmdBuffer, buffer, offset, count, stride);
1258}
1259
1260LOADER_EXPORT void VKAPI vkCmdDispatch(VkCmdBuffer cmdBuffer, uint32_t x, uint32_t y, uint32_t z)
1261{
1262 const VkLayerDispatchTable *disp;
1263
1264 disp = loader_get_dispatch(cmdBuffer);
1265
1266 disp->CmdDispatch(cmdBuffer, x, y, z);
1267}
1268
1269LOADER_EXPORT void VKAPI vkCmdDispatchIndirect(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset)
1270{
1271 const VkLayerDispatchTable *disp;
1272
1273 disp = loader_get_dispatch(cmdBuffer);
1274
1275 disp->CmdDispatchIndirect(cmdBuffer, buffer, offset);
1276}
1277
1278LOADER_EXPORT void VKAPI vkCmdCopyBuffer(VkCmdBuffer cmdBuffer, VkBuffer srcBuffer, VkBuffer destBuffer, uint32_t regionCount, const VkBufferCopy* pRegions)
1279{
1280 const VkLayerDispatchTable *disp;
1281
1282 disp = loader_get_dispatch(cmdBuffer);
1283
1284 disp->CmdCopyBuffer(cmdBuffer, srcBuffer, destBuffer, regionCount, pRegions);
1285}
1286
1287LOADER_EXPORT void VKAPI vkCmdCopyImage(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageCopy* pRegions)
1288{
1289 const VkLayerDispatchTable *disp;
1290
1291 disp = loader_get_dispatch(cmdBuffer);
1292
1293 disp->CmdCopyImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions);
1294}
1295
Mark Lobodzinskiee5eef12015-05-22 14:43:25 -05001296LOADER_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 -06001297{
1298 const VkLayerDispatchTable *disp;
1299
1300 disp = loader_get_dispatch(cmdBuffer);
1301
Mark Lobodzinskiee5eef12015-05-22 14:43:25 -05001302 disp->CmdBlitImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions, filter);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001303}
1304
1305LOADER_EXPORT void VKAPI vkCmdCopyBufferToImage(VkCmdBuffer cmdBuffer, VkBuffer srcBuffer, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions)
1306{
1307 const VkLayerDispatchTable *disp;
1308
1309 disp = loader_get_dispatch(cmdBuffer);
1310
1311 disp->CmdCopyBufferToImage(cmdBuffer, srcBuffer, destImage, destImageLayout, regionCount, pRegions);
1312}
1313
1314LOADER_EXPORT void VKAPI vkCmdCopyImageToBuffer(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer destBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions)
1315{
1316 const VkLayerDispatchTable *disp;
1317
1318 disp = loader_get_dispatch(cmdBuffer);
1319
1320 disp->CmdCopyImageToBuffer(cmdBuffer, srcImage, srcImageLayout, destBuffer, regionCount, pRegions);
1321}
1322
Jon Ashburnd55a3942015-05-06 09:02:10 -06001323LOADER_EXPORT void VKAPI vkCmdUpdateBuffer(VkCmdBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize dataSize, const uint32_t* pData)
1324{
1325 const VkLayerDispatchTable *disp;
1326
1327 disp = loader_get_dispatch(cmdBuffer);
1328
1329 disp->CmdUpdateBuffer(cmdBuffer, destBuffer, destOffset, dataSize, pData);
1330}
1331
1332LOADER_EXPORT void VKAPI vkCmdFillBuffer(VkCmdBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize fillSize, uint32_t data)
1333{
1334 const VkLayerDispatchTable *disp;
1335
1336 disp = loader_get_dispatch(cmdBuffer);
1337
1338 disp->CmdFillBuffer(cmdBuffer, destBuffer, destOffset, fillSize, data);
1339}
1340
Chris Forbesf0796e12015-06-24 14:34:53 +12001341LOADER_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 -06001342{
1343 const VkLayerDispatchTable *disp;
1344
1345 disp = loader_get_dispatch(cmdBuffer);
1346
1347 disp->CmdClearColorImage(cmdBuffer, image, imageLayout, pColor, rangeCount, pRanges);
1348}
1349
Courtney Goeltzenleuchter45df9e12015-09-15 18:03:22 -06001350LOADER_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 -06001351{
1352 const VkLayerDispatchTable *disp;
1353
1354 disp = loader_get_dispatch(cmdBuffer);
1355
Courtney Goeltzenleuchter45df9e12015-09-15 18:03:22 -06001356 disp->CmdClearDepthStencilImage(cmdBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges);
Chris Forbesd9be82b2015-06-22 17:21:59 +12001357}
1358
Chris Forbesf0796e12015-06-24 14:34:53 +12001359LOADER_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 +12001360{
1361 const VkLayerDispatchTable *disp;
1362
1363 disp = loader_get_dispatch(cmdBuffer);
1364
1365 disp->CmdClearColorAttachment(cmdBuffer, colorAttachment, imageLayout, pColor, rectCount, pRects);
1366}
1367
Courtney Goeltzenleuchter45df9e12015-09-15 18:03:22 -06001368LOADER_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 +12001369{
1370 const VkLayerDispatchTable *disp;
1371
1372 disp = loader_get_dispatch(cmdBuffer);
1373
Courtney Goeltzenleuchter45df9e12015-09-15 18:03:22 -06001374 disp->CmdClearDepthStencilAttachment(cmdBuffer, imageAspectMask, imageLayout, pDepthStencil, rectCount, pRects);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001375}
1376
1377LOADER_EXPORT void VKAPI vkCmdResolveImage(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageResolve* pRegions)
1378{
1379 const VkLayerDispatchTable *disp;
1380
1381 disp = loader_get_dispatch(cmdBuffer);
1382
1383 disp->CmdResolveImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions);
1384}
1385
Tony Barbour0b2cfb22015-06-29 16:20:35 -06001386LOADER_EXPORT void VKAPI vkCmdSetEvent(VkCmdBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001387{
1388 const VkLayerDispatchTable *disp;
1389
1390 disp = loader_get_dispatch(cmdBuffer);
1391
Tony Barbour0b2cfb22015-06-29 16:20:35 -06001392 disp->CmdSetEvent(cmdBuffer, event, stageMask);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001393}
1394
Tony Barbour0b2cfb22015-06-29 16:20:35 -06001395LOADER_EXPORT void VKAPI vkCmdResetEvent(VkCmdBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001396{
1397 const VkLayerDispatchTable *disp;
1398
1399 disp = loader_get_dispatch(cmdBuffer);
1400
Tony Barbour0b2cfb22015-06-29 16:20:35 -06001401 disp->CmdResetEvent(cmdBuffer, event, stageMask);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001402}
1403
Courtney Goeltzenleuchterdbd20322015-07-12 12:58:58 -06001404LOADER_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 -06001405{
1406 const VkLayerDispatchTable *disp;
1407
1408 disp = loader_get_dispatch(cmdBuffer);
1409
Tony Barbour0b2cfb22015-06-29 16:20:35 -06001410 disp->CmdWaitEvents(cmdBuffer, eventCount, pEvents, sourceStageMask, destStageMask, memBarrierCount, ppMemBarriers);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001411}
1412
Courtney Goeltzenleuchterceebbb12015-07-12 13:07:46 -06001413LOADER_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 -06001414{
1415 const VkLayerDispatchTable *disp;
1416
1417 disp = loader_get_dispatch(cmdBuffer);
1418
Courtney Goeltzenleuchterceebbb12015-07-12 13:07:46 -06001419 disp->CmdPipelineBarrier(cmdBuffer, srcStageMask, destStageMask, byRegion, memBarrierCount, ppMemBarriers);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001420}
1421
1422LOADER_EXPORT void VKAPI vkCmdBeginQuery(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot, VkFlags flags)
1423{
1424 const VkLayerDispatchTable *disp;
1425
1426 disp = loader_get_dispatch(cmdBuffer);
1427
1428 disp->CmdBeginQuery(cmdBuffer, queryPool, slot, flags);
1429}
1430
1431LOADER_EXPORT void VKAPI vkCmdEndQuery(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot)
1432{
1433 const VkLayerDispatchTable *disp;
1434
1435 disp = loader_get_dispatch(cmdBuffer);
1436
1437 disp->CmdEndQuery(cmdBuffer, queryPool, slot);
1438}
1439
1440LOADER_EXPORT void VKAPI vkCmdResetQueryPool(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount)
1441{
1442 const VkLayerDispatchTable *disp;
1443
1444 disp = loader_get_dispatch(cmdBuffer);
1445
1446 disp->CmdResetQueryPool(cmdBuffer, queryPool, startQuery, queryCount);
1447}
1448
1449LOADER_EXPORT void VKAPI vkCmdWriteTimestamp(VkCmdBuffer cmdBuffer, VkTimestampType timestampType, VkBuffer destBuffer, VkDeviceSize destOffset)
1450{
1451 const VkLayerDispatchTable *disp;
1452
1453 disp = loader_get_dispatch(cmdBuffer);
1454
1455 disp->CmdWriteTimestamp(cmdBuffer, timestampType, destBuffer, destOffset);
1456}
1457
1458LOADER_EXPORT void VKAPI vkCmdCopyQueryPoolResults(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize destStride, VkFlags flags)
1459{
1460 const VkLayerDispatchTable *disp;
1461
1462 disp = loader_get_dispatch(cmdBuffer);
1463
1464 disp->CmdCopyQueryPoolResults(cmdBuffer, queryPool, startQuery, queryCount, destBuffer, destOffset, destStride, flags);
1465}
1466
Jon Ashburn754864f2015-07-23 18:49:07 -06001467LOADER_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 -06001468{
1469 const VkLayerDispatchTable *disp;
1470
Jon Ashburn754864f2015-07-23 18:49:07 -06001471 disp = loader_get_dispatch(cmdBuffer);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001472
Courtney Goeltzenleuchterab7db3b2015-07-27 14:04:01 -06001473 disp->CmdPushConstants(cmdBuffer, layout, stageFlags, start, length, values);
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001474}
1475
Chia-I Wu08accc62015-07-07 11:50:03 +08001476LOADER_EXPORT void VKAPI vkCmdBeginRenderPass(VkCmdBuffer cmdBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkRenderPassContents contents)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001477{
1478 const VkLayerDispatchTable *disp;
1479
1480 disp = loader_get_dispatch(cmdBuffer);
1481
Chia-I Wu08accc62015-07-07 11:50:03 +08001482 disp->CmdBeginRenderPass(cmdBuffer, pRenderPassBegin, contents);
1483}
1484
1485LOADER_EXPORT void VKAPI vkCmdNextSubpass(VkCmdBuffer cmdBuffer, VkRenderPassContents contents)
1486{
1487 const VkLayerDispatchTable *disp;
1488
1489 disp = loader_get_dispatch(cmdBuffer);
1490
1491 disp->CmdNextSubpass(cmdBuffer, contents);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001492}
1493
Chia-I Wu0b50a1c2015-06-26 15:34:39 +08001494LOADER_EXPORT void VKAPI vkCmdEndRenderPass(VkCmdBuffer cmdBuffer)
Jon Ashburnd55a3942015-05-06 09:02:10 -06001495{
1496 const VkLayerDispatchTable *disp;
1497
1498 disp = loader_get_dispatch(cmdBuffer);
1499
Chia-I Wu0b50a1c2015-06-26 15:34:39 +08001500 disp->CmdEndRenderPass(cmdBuffer);
1501}
1502
1503LOADER_EXPORT void VKAPI vkCmdExecuteCommands(VkCmdBuffer cmdBuffer, uint32_t cmdBuffersCount, const VkCmdBuffer* pCmdBuffers)
1504{
1505 const VkLayerDispatchTable *disp;
1506
1507 disp = loader_get_dispatch(cmdBuffer);
1508
1509 disp->CmdExecuteCommands(cmdBuffer, cmdBuffersCount, pCmdBuffers);
Jon Ashburnd55a3942015-05-06 09:02:10 -06001510}