Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1 | /* |
| 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 Goeltzenleuchter | 7f5aafc | 2015-07-05 11:28:29 -0600 | [diff] [blame] | 24 | #define _GNU_SOURCE |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 25 | #include <stdlib.h> |
| 26 | #include <string.h> |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 27 | |
Tobin Ehlis | b835d1b | 2015-07-03 10:34:49 -0600 | [diff] [blame] | 28 | #include "vk_loader_platform.h" |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 29 | #include "loader.h" |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 30 | #include "debug_report.h" |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 31 | |
Tobin Ehlis | f37926f | 2015-05-13 11:57:18 -0600 | [diff] [blame] | 32 | #if defined(WIN32) |
| 33 | // On Windows need to disable global optimization for function entrypoints or |
| 34 | // else mhook will not be able to hook all of them |
| 35 | #pragma optimize( "g", off ) |
| 36 | #endif |
| 37 | |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 38 | /* Trampoline entrypoints */ |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 39 | LOADER_EXPORT VkResult VKAPI vkCreateInstance( |
Courtney Goeltzenleuchter | 57fb157 | 2015-06-08 15:13:50 -0600 | [diff] [blame] | 40 | const VkInstanceCreateInfo* pCreateInfo, |
| 41 | VkInstance* pInstance) |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 42 | { |
| 43 | struct loader_instance *ptr_instance = NULL; |
| 44 | |
| 45 | VkResult res = VK_ERROR_INITIALIZATION_FAILED; |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 46 | |
| 47 | /* Scan/discover all ICD libraries in a single-threaded manner */ |
| 48 | loader_platform_thread_once(&once_icd, loader_icd_scan); |
| 49 | |
| 50 | /* get layer libraries in a single-threaded manner */ |
Jon Ashburn | 5ef2060 | 2015-07-02 09:40:15 -0600 | [diff] [blame] | 51 | loader_platform_thread_once(&once_layer, loader_layer_scan); |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 52 | |
| 53 | /* merge any duplicate extensions */ |
| 54 | loader_platform_thread_once(&once_exts, loader_coalesce_extensions); |
| 55 | |
Courtney Goeltzenleuchter | 366b27a | 2015-07-06 20:14:18 -0600 | [diff] [blame] | 56 | res = loader_validate_layers(pCreateInfo->layerCount, |
| 57 | pCreateInfo->ppEnabledLayerNames, |
Jon Ashburn | 2d0c4bb | 2015-07-06 15:40:35 -0600 | [diff] [blame] | 58 | &loader.scanned_layers); |
Courtney Goeltzenleuchter | 3b8c5ff | 2015-07-06 17:45:08 -0600 | [diff] [blame] | 59 | if (res != VK_SUCCESS) { |
| 60 | return res; |
| 61 | } |
| 62 | |
| 63 | res = loader_validate_instance_extensions(pCreateInfo); |
| 64 | if (res != VK_SUCCESS) { |
| 65 | return res; |
| 66 | } |
| 67 | |
Courtney Goeltzenleuchter | 8109510 | 2015-07-06 09:08:37 -0600 | [diff] [blame] | 68 | if (pCreateInfo->pAllocCb |
| 69 | && pCreateInfo->pAllocCb->pfnAlloc |
| 70 | && pCreateInfo->pAllocCb->pfnFree) { |
| 71 | ptr_instance = (struct loader_instance *) pCreateInfo->pAllocCb->pfnAlloc( |
| 72 | pCreateInfo->pAllocCb->pUserData, |
| 73 | sizeof(struct loader_instance), |
| 74 | sizeof(VkInstance), |
| 75 | VK_SYSTEM_ALLOC_TYPE_API_OBJECT); |
| 76 | } else { |
| 77 | ptr_instance = (struct loader_instance *) malloc(sizeof(struct loader_instance)); |
| 78 | } |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 79 | if (ptr_instance == NULL) { |
| 80 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 81 | } |
Courtney Goeltzenleuchter | 8109510 | 2015-07-06 09:08:37 -0600 | [diff] [blame] | 82 | |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 83 | memset(ptr_instance, 0, sizeof(struct loader_instance)); |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 84 | |
Courtney Goeltzenleuchter | 8109510 | 2015-07-06 09:08:37 -0600 | [diff] [blame] | 85 | loader_platform_thread_lock_mutex(&loader_lock); |
Jon Ashburn | 07daee7 | 2015-05-21 18:13:33 -0600 | [diff] [blame] | 86 | |
Courtney Goeltzenleuchter | 7f5aafc | 2015-07-05 11:28:29 -0600 | [diff] [blame] | 87 | if (pCreateInfo->pAllocCb |
| 88 | && pCreateInfo->pAllocCb->pfnAlloc |
| 89 | && pCreateInfo->pAllocCb->pfnFree) { |
| 90 | ptr_instance->alloc_callbacks.pUserData = pCreateInfo->pAllocCb->pUserData; |
| 91 | ptr_instance->alloc_callbacks.pfnAlloc = pCreateInfo->pAllocCb->pfnAlloc; |
| 92 | ptr_instance->alloc_callbacks.pfnFree = pCreateInfo->pAllocCb->pfnFree; |
| 93 | } |
| 94 | |
Courtney Goeltzenleuchter | 8109510 | 2015-07-06 09:08:37 -0600 | [diff] [blame] | 95 | ptr_instance->disp = loader_heap_alloc( |
| 96 | ptr_instance, |
| 97 | sizeof(VkLayerInstanceDispatchTable), |
| 98 | VK_SYSTEM_ALLOC_TYPE_INTERNAL); |
| 99 | if (ptr_instance->disp == NULL) { |
| 100 | loader_platform_thread_unlock_mutex(&loader_lock); |
| 101 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 102 | } |
| 103 | memcpy(ptr_instance->disp, &instance_disp, sizeof(instance_disp)); |
| 104 | ptr_instance->next = loader.instances; |
| 105 | loader.instances = ptr_instance; |
| 106 | |
| 107 | res = loader_enable_instance_layers(ptr_instance, pCreateInfo); |
| 108 | if (res != VK_SUCCESS) { |
| 109 | loader_heap_free(ptr_instance, ptr_instance->disp); |
| 110 | loader_heap_free(ptr_instance, ptr_instance); |
| 111 | return res; |
| 112 | } |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 113 | |
Courtney Goeltzenleuchter | 110fdf9 | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 114 | debug_report_create_instance(ptr_instance, pCreateInfo); |
Jon Ashburn | 07daee7 | 2015-05-21 18:13:33 -0600 | [diff] [blame] | 115 | |
| 116 | /* enable any layers on instance chain */ |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 117 | loader_activate_instance_layers(ptr_instance); |
| 118 | |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 119 | *pInstance = (VkInstance) ptr_instance; |
Jon Ashburn | eed0c00 | 2015-05-21 17:42:17 -0600 | [diff] [blame] | 120 | |
| 121 | res = ptr_instance->disp->CreateInstance(pCreateInfo, pInstance); |
| 122 | |
Courtney Goeltzenleuchter | d971b61 | 2015-06-17 20:51:59 -0600 | [diff] [blame] | 123 | /* |
| 124 | * Finally have the layers in place and everyone has seen |
| 125 | * the CreateInstance command go by. This allows the layer's |
| 126 | * GetInstanceProcAddr functions to return valid extension functions |
| 127 | * if enabled. |
| 128 | */ |
| 129 | loader_activate_instance_layer_extensions(ptr_instance); |
| 130 | |
Jon Ashburn | 6301a0f | 2015-05-29 13:15:39 -0600 | [diff] [blame] | 131 | loader_platform_thread_unlock_mutex(&loader_lock); |
| 132 | |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 133 | return res; |
| 134 | } |
| 135 | |
| 136 | LOADER_EXPORT VkResult VKAPI vkDestroyInstance( |
| 137 | VkInstance instance) |
| 138 | { |
| 139 | const VkLayerInstanceDispatchTable *disp; |
Jon Ashburn | 6301a0f | 2015-05-29 13:15:39 -0600 | [diff] [blame] | 140 | VkResult res; |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 141 | disp = loader_get_instance_dispatch(instance); |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 142 | |
Jon Ashburn | 6301a0f | 2015-05-29 13:15:39 -0600 | [diff] [blame] | 143 | loader_platform_thread_lock_mutex(&loader_lock); |
| 144 | |
| 145 | res = disp->DestroyInstance(instance); |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 146 | |
Courtney Goeltzenleuchter | 7d0023c | 2015-06-08 15:09:22 -0600 | [diff] [blame] | 147 | struct loader_instance *ptr_instance = loader_instance(instance); |
| 148 | loader_deactivate_instance_layers(ptr_instance); |
Courtney Goeltzenleuchter | 7d0023c | 2015-06-08 15:09:22 -0600 | [diff] [blame] | 149 | |
| 150 | free(ptr_instance); |
| 151 | |
Jon Ashburn | 6301a0f | 2015-05-29 13:15:39 -0600 | [diff] [blame] | 152 | loader_platform_thread_unlock_mutex(&loader_lock); |
| 153 | |
Courtney Goeltzenleuchter | 7d0023c | 2015-06-08 15:09:22 -0600 | [diff] [blame] | 154 | return res; |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 155 | } |
Jon Ashburn | 95a77ba | 2015-05-15 15:09:35 -0600 | [diff] [blame] | 156 | |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 157 | LOADER_EXPORT VkResult VKAPI vkEnumeratePhysicalDevices( |
| 158 | VkInstance instance, |
| 159 | uint32_t* pPhysicalDeviceCount, |
| 160 | VkPhysicalDevice* pPhysicalDevices) |
| 161 | { |
| 162 | const VkLayerInstanceDispatchTable *disp; |
Jon Ashburn | 6301a0f | 2015-05-29 13:15:39 -0600 | [diff] [blame] | 163 | VkResult res; |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 164 | disp = loader_get_instance_dispatch(instance); |
Jon Ashburn | 6301a0f | 2015-05-29 13:15:39 -0600 | [diff] [blame] | 165 | |
| 166 | loader_platform_thread_lock_mutex(&loader_lock); |
| 167 | res = disp->EnumeratePhysicalDevices(instance, pPhysicalDeviceCount, |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 168 | pPhysicalDevices); |
Jon Ashburn | 6301a0f | 2015-05-29 13:15:39 -0600 | [diff] [blame] | 169 | loader_platform_thread_unlock_mutex(&loader_lock); |
| 170 | return res; |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 171 | } |
| 172 | |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 173 | LOADER_EXPORT VkResult VKAPI vkGetPhysicalDeviceProperties( |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 174 | VkPhysicalDevice gpu, |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 175 | VkPhysicalDeviceProperties* pProperties) |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 176 | { |
Jon Ashburn | 95a77ba | 2015-05-15 15:09:35 -0600 | [diff] [blame] | 177 | const VkLayerInstanceDispatchTable *disp; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 178 | VkResult res; |
| 179 | |
Jon Ashburn | 95a77ba | 2015-05-15 15:09:35 -0600 | [diff] [blame] | 180 | disp = loader_get_instance_dispatch(gpu); |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 181 | res = disp->GetPhysicalDeviceProperties(gpu, pProperties); |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 182 | return res; |
| 183 | } |
| 184 | |
| 185 | LOADER_EXPORT VkResult VKAPI vkGetPhysicalDevicePerformance( |
| 186 | VkPhysicalDevice gpu, |
| 187 | VkPhysicalDevicePerformance* pPerformance) |
| 188 | { |
| 189 | const VkLayerInstanceDispatchTable *disp; |
| 190 | VkResult res; |
| 191 | |
| 192 | disp = loader_get_instance_dispatch(gpu); |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 193 | res = disp->GetPhysicalDevicePerformance(gpu, pPerformance); |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 194 | return res; |
| 195 | } |
| 196 | |
| 197 | LOADER_EXPORT VkResult VKAPI vkGetPhysicalDeviceQueueCount( |
| 198 | VkPhysicalDevice gpu, |
| 199 | uint32_t* pCount) |
| 200 | { |
| 201 | const VkLayerInstanceDispatchTable *disp; |
| 202 | VkResult res; |
| 203 | |
| 204 | disp = loader_get_instance_dispatch(gpu); |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 205 | res = disp->GetPhysicalDeviceQueueCount(gpu, pCount); |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 206 | return res; |
| 207 | } |
| 208 | |
| 209 | LOADER_EXPORT VkResult VKAPI vkGetPhysicalDeviceQueueProperties( |
| 210 | VkPhysicalDevice gpu, |
| 211 | uint32_t count, |
| 212 | VkPhysicalDeviceQueueProperties* pQueueProperties) |
| 213 | { |
| 214 | const VkLayerInstanceDispatchTable *disp; |
| 215 | VkResult res; |
| 216 | |
| 217 | disp = loader_get_instance_dispatch(gpu); |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 218 | res = disp->GetPhysicalDeviceQueueProperties(gpu, count, pQueueProperties); |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 219 | return res; |
| 220 | } |
| 221 | |
| 222 | LOADER_EXPORT VkResult VKAPI vkGetPhysicalDeviceMemoryProperties( |
| 223 | VkPhysicalDevice gpu, |
| 224 | VkPhysicalDeviceMemoryProperties* pMemoryProperties) |
| 225 | { |
| 226 | const VkLayerInstanceDispatchTable *disp; |
| 227 | VkResult res; |
| 228 | |
| 229 | disp = loader_get_instance_dispatch(gpu); |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 230 | res = disp->GetPhysicalDeviceMemoryProperties(gpu, pMemoryProperties); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 231 | return res; |
| 232 | } |
| 233 | |
Chris Forbes | bc0bb77 | 2015-06-21 22:55:02 +1200 | [diff] [blame] | 234 | LOADER_EXPORT VkResult VKAPI vkGetPhysicalDeviceFeatures( |
| 235 | VkPhysicalDevice gpu, |
| 236 | VkPhysicalDeviceFeatures *pFeatures) |
| 237 | { |
| 238 | const VkLayerInstanceDispatchTable *disp; |
| 239 | VkResult res; |
| 240 | |
| 241 | disp = loader_get_instance_dispatch(gpu); |
Chris Forbes | bc0bb77 | 2015-06-21 22:55:02 +1200 | [diff] [blame] | 242 | res = disp->GetPhysicalDeviceFeatures(gpu, pFeatures); |
Chris Forbes | bc0bb77 | 2015-06-21 22:55:02 +1200 | [diff] [blame] | 243 | return res; |
| 244 | } |
| 245 | |
| 246 | LOADER_EXPORT VkResult VKAPI vkGetPhysicalDeviceFormatInfo( |
| 247 | VkPhysicalDevice gpu, |
| 248 | VkFormat format, |
| 249 | VkFormatProperties *pFormatInfo) |
| 250 | { |
| 251 | const VkLayerInstanceDispatchTable *disp; |
| 252 | VkResult res; |
| 253 | |
| 254 | disp = loader_get_instance_dispatch(gpu); |
Chris Forbes | bc0bb77 | 2015-06-21 22:55:02 +1200 | [diff] [blame] | 255 | res = disp->GetPhysicalDeviceFormatInfo(gpu, format, pFormatInfo); |
Chris Forbes | bc0bb77 | 2015-06-21 22:55:02 +1200 | [diff] [blame] | 256 | return res; |
| 257 | } |
| 258 | |
| 259 | LOADER_EXPORT VkResult VKAPI vkGetPhysicalDeviceLimits( |
| 260 | VkPhysicalDevice gpu, |
| 261 | VkPhysicalDeviceLimits *pLimits) |
| 262 | { |
| 263 | const VkLayerInstanceDispatchTable *disp; |
| 264 | VkResult res; |
| 265 | |
| 266 | disp = loader_get_instance_dispatch(gpu); |
Chris Forbes | bc0bb77 | 2015-06-21 22:55:02 +1200 | [diff] [blame] | 267 | res = disp->GetPhysicalDeviceLimits(gpu, pLimits); |
Chris Forbes | bc0bb77 | 2015-06-21 22:55:02 +1200 | [diff] [blame] | 268 | return res; |
| 269 | } |
| 270 | |
Jon Ashburn | 95a77ba | 2015-05-15 15:09:35 -0600 | [diff] [blame] | 271 | LOADER_EXPORT VkResult VKAPI vkCreateDevice( |
Courtney Goeltzenleuchter | ca173b8 | 2015-06-25 18:01:43 -0600 | [diff] [blame] | 272 | VkPhysicalDevice gpu, |
| 273 | const VkDeviceCreateInfo* pCreateInfo, |
| 274 | VkDevice* pDevice) |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 275 | { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 276 | VkResult res; |
| 277 | |
Jon Ashburn | 6301a0f | 2015-05-29 13:15:39 -0600 | [diff] [blame] | 278 | loader_platform_thread_lock_mutex(&loader_lock); |
Courtney Goeltzenleuchter | ca173b8 | 2015-06-25 18:01:43 -0600 | [diff] [blame] | 279 | |
| 280 | res = loader_CreateDevice(gpu, pCreateInfo, pDevice); |
| 281 | |
Jon Ashburn | 6301a0f | 2015-05-29 13:15:39 -0600 | [diff] [blame] | 282 | loader_platform_thread_unlock_mutex(&loader_lock); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 283 | return res; |
| 284 | } |
| 285 | |
| 286 | LOADER_EXPORT VkResult VKAPI vkDestroyDevice(VkDevice device) |
| 287 | { |
| 288 | const VkLayerDispatchTable *disp; |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 289 | VkResult res; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 290 | |
| 291 | disp = loader_get_dispatch(device); |
| 292 | |
Jon Ashburn | 6301a0f | 2015-05-29 13:15:39 -0600 | [diff] [blame] | 293 | loader_platform_thread_lock_mutex(&loader_lock); |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 294 | res = disp->DestroyDevice(device); |
Jon Ashburn | dc6fcad | 2015-06-10 10:06:06 -0600 | [diff] [blame] | 295 | loader_remove_logical_device(device); |
Jon Ashburn | 6301a0f | 2015-05-29 13:15:39 -0600 | [diff] [blame] | 296 | loader_platform_thread_unlock_mutex(&loader_lock); |
| 297 | return res; |
| 298 | } |
| 299 | |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 300 | LOADER_EXPORT VkResult VKAPI vkGetPhysicalDeviceExtensionProperties( |
Courtney Goeltzenleuchter | 110fdf9 | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 301 | VkPhysicalDevice physicalDevice, |
| 302 | const char* pLayerName, |
| 303 | uint32_t* pCount, |
| 304 | VkExtensionProperties* pProperties) |
Jon Ashburn | 6301a0f | 2015-05-29 13:15:39 -0600 | [diff] [blame] | 305 | { |
| 306 | VkResult res; |
| 307 | |
Courtney Goeltzenleuchter | 110fdf9 | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 308 | loader_platform_thread_lock_mutex(&loader_lock); |
| 309 | res = loader_GetPhysicalDeviceExtensionProperties(physicalDevice, pLayerName, pCount, pProperties); |
| 310 | loader_platform_thread_unlock_mutex(&loader_lock); |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 311 | return res; |
| 312 | } |
| 313 | |
Courtney Goeltzenleuchter | 110fdf9 | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 314 | LOADER_EXPORT VkResult VKAPI vkGetPhysicalDeviceLayerProperties( |
| 315 | VkPhysicalDevice physicalDevice, |
| 316 | uint32_t* pCount, |
| 317 | VkLayerProperties* pProperties) |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 318 | { |
| 319 | VkResult res; |
| 320 | |
Courtney Goeltzenleuchter | 110fdf9 | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 321 | loader_platform_thread_lock_mutex(&loader_lock); |
| 322 | res = loader_GetPhysicalDeviceLayerProperties(physicalDevice, pCount, pProperties); |
| 323 | loader_platform_thread_unlock_mutex(&loader_lock); |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 324 | return res; |
| 325 | } |
| 326 | |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 327 | LOADER_EXPORT VkResult VKAPI vkGetDeviceQueue(VkDevice device, uint32_t queueNodeIndex, uint32_t queueIndex, VkQueue* pQueue) |
| 328 | { |
| 329 | const VkLayerDispatchTable *disp; |
| 330 | VkResult res; |
| 331 | |
| 332 | disp = loader_get_dispatch(device); |
| 333 | |
| 334 | res = disp->GetDeviceQueue(device, queueNodeIndex, queueIndex, pQueue); |
| 335 | if (res == VK_SUCCESS) { |
| 336 | loader_set_dispatch(*pQueue, disp); |
| 337 | } |
| 338 | |
| 339 | return res; |
| 340 | } |
| 341 | |
| 342 | LOADER_EXPORT VkResult VKAPI vkQueueSubmit(VkQueue queue, uint32_t cmdBufferCount, const VkCmdBuffer* pCmdBuffers, VkFence fence) |
| 343 | { |
| 344 | const VkLayerDispatchTable *disp; |
| 345 | |
| 346 | disp = loader_get_dispatch(queue); |
| 347 | |
| 348 | return disp->QueueSubmit(queue, cmdBufferCount, pCmdBuffers, fence); |
| 349 | } |
| 350 | |
| 351 | LOADER_EXPORT VkResult VKAPI vkQueueWaitIdle(VkQueue queue) |
| 352 | { |
| 353 | const VkLayerDispatchTable *disp; |
| 354 | |
| 355 | disp = loader_get_dispatch(queue); |
| 356 | |
| 357 | return disp->QueueWaitIdle(queue); |
| 358 | } |
| 359 | |
| 360 | LOADER_EXPORT VkResult VKAPI vkDeviceWaitIdle(VkDevice device) |
| 361 | { |
| 362 | const VkLayerDispatchTable *disp; |
| 363 | |
| 364 | disp = loader_get_dispatch(device); |
| 365 | |
| 366 | return disp->DeviceWaitIdle(device); |
| 367 | } |
| 368 | |
| 369 | LOADER_EXPORT VkResult VKAPI vkAllocMemory(VkDevice device, const VkMemoryAllocInfo* pAllocInfo, VkDeviceMemory* pMem) |
| 370 | { |
| 371 | const VkLayerDispatchTable *disp; |
| 372 | |
| 373 | disp = loader_get_dispatch(device); |
| 374 | |
| 375 | return disp->AllocMemory(device, pAllocInfo, pMem); |
| 376 | } |
| 377 | |
| 378 | LOADER_EXPORT VkResult VKAPI vkFreeMemory(VkDevice device, VkDeviceMemory mem) |
| 379 | { |
| 380 | const VkLayerDispatchTable *disp; |
| 381 | |
| 382 | disp = loader_get_dispatch(device); |
| 383 | |
| 384 | return disp->FreeMemory(device, mem); |
| 385 | } |
| 386 | |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 387 | LOADER_EXPORT VkResult VKAPI vkMapMemory(VkDevice device, VkDeviceMemory mem, VkDeviceSize offset, VkDeviceSize size, VkFlags flags, void** ppData) |
| 388 | { |
| 389 | const VkLayerDispatchTable *disp; |
| 390 | |
| 391 | disp = loader_get_dispatch(device); |
| 392 | |
| 393 | return disp->MapMemory(device, mem, offset, size, flags, ppData); |
| 394 | } |
| 395 | |
| 396 | LOADER_EXPORT VkResult VKAPI vkUnmapMemory(VkDevice device, VkDeviceMemory mem) |
| 397 | { |
| 398 | const VkLayerDispatchTable *disp; |
| 399 | |
| 400 | disp = loader_get_dispatch(device); |
| 401 | |
| 402 | return disp->UnmapMemory(device, mem); |
| 403 | } |
| 404 | |
| 405 | LOADER_EXPORT VkResult VKAPI vkFlushMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges) |
| 406 | { |
| 407 | const VkLayerDispatchTable *disp; |
| 408 | |
| 409 | disp = loader_get_dispatch(device); |
| 410 | |
| 411 | return disp->FlushMappedMemoryRanges(device, memRangeCount, pMemRanges); |
| 412 | } |
| 413 | |
| 414 | LOADER_EXPORT VkResult VKAPI vkInvalidateMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges) |
| 415 | { |
| 416 | const VkLayerDispatchTable *disp; |
| 417 | |
| 418 | disp = loader_get_dispatch(device); |
| 419 | |
| 420 | return disp->InvalidateMappedMemoryRanges(device, memRangeCount, pMemRanges); |
| 421 | } |
| 422 | |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 423 | LOADER_EXPORT VkResult VKAPI vkDestroyObject(VkDevice device, VkObjectType objType, VkObject object) |
| 424 | { |
| 425 | const VkLayerDispatchTable *disp; |
| 426 | |
| 427 | disp = loader_get_dispatch(device); |
| 428 | |
| 429 | return disp->DestroyObject(device, objType, object); |
| 430 | } |
| 431 | |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 432 | LOADER_EXPORT VkResult VKAPI vkGetObjectMemoryRequirements(VkDevice device, VkObjectType objType, VkObject object, VkMemoryRequirements* pMemoryRequirements) |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 433 | { |
| 434 | const VkLayerDispatchTable *disp; |
| 435 | |
| 436 | disp = loader_get_dispatch(device); |
| 437 | |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 438 | return disp->GetObjectMemoryRequirements(device, objType, object, pMemoryRequirements); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 439 | } |
| 440 | |
Mark Lobodzinski | 2306535 | 2015-05-29 09:32:35 -0500 | [diff] [blame] | 441 | LOADER_EXPORT VkResult VKAPI vkBindObjectMemory(VkDevice device, VkObjectType objType, VkObject object, VkDeviceMemory mem, VkDeviceSize offset) |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 442 | { |
| 443 | const VkLayerDispatchTable *disp; |
| 444 | |
Mark Lobodzinski | 942b172 | 2015-05-11 17:21:15 -0500 | [diff] [blame] | 445 | disp = loader_get_dispatch(device); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 446 | |
Mark Lobodzinski | 2306535 | 2015-05-29 09:32:35 -0500 | [diff] [blame] | 447 | return disp->BindObjectMemory(device, objType, object, mem, offset); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 448 | } |
| 449 | |
Mark Lobodzinski | 16e8bef | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 450 | LOADER_EXPORT VkResult VKAPI vkGetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t* pNumRequirements, VkSparseImageMemoryRequirements* pSparseMemoryRequirements) |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 451 | { |
| 452 | const VkLayerDispatchTable *disp; |
| 453 | |
Mark Lobodzinski | 16e8bef | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 454 | disp = loader_get_dispatch(device); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 455 | |
Mark Lobodzinski | 16e8bef | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 456 | return disp->GetImageSparseMemoryRequirements(device, image, pNumRequirements, pSparseMemoryRequirements); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 457 | } |
| 458 | |
Mark Lobodzinski | 16e8bef | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 459 | LOADER_EXPORT VkResult VKAPI vkGetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, uint32_t samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t* pNumProperties, VkSparseImageFormatProperties* pProperties) |
| 460 | { |
| 461 | const VkLayerInstanceDispatchTable *disp; |
| 462 | |
| 463 | disp = loader_get_instance_dispatch(physicalDevice); |
| 464 | |
| 465 | return disp->GetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, pNumProperties, pProperties); |
| 466 | } |
| 467 | |
| 468 | LOADER_EXPORT VkResult VKAPI vkQueueBindSparseImageOpaqueMemory(VkQueue queue, VkImage image, uint32_t numBindings, const VkSparseMemoryBindInfo* pBindInfo) |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 469 | { |
| 470 | const VkLayerDispatchTable *disp; |
| 471 | |
| 472 | disp = loader_get_dispatch(queue); |
| 473 | |
Mark Lobodzinski | 16e8bef | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 474 | return disp->QueueBindSparseImageOpaqueMemory(queue, image, numBindings, pBindInfo); |
| 475 | } |
| 476 | |
| 477 | LOADER_EXPORT VkResult VKAPI vkQueueBindSparseBufferMemory(VkQueue queue, VkBuffer buffer, uint32_t numBindings, const VkSparseMemoryBindInfo* pBindInfo) |
| 478 | { |
| 479 | const VkLayerDispatchTable *disp; |
| 480 | |
| 481 | disp = loader_get_dispatch(queue); |
| 482 | |
| 483 | return disp->QueueBindSparseBufferMemory(queue, buffer, numBindings, pBindInfo); |
| 484 | } |
| 485 | |
| 486 | LOADER_EXPORT VkResult VKAPI vkQueueBindSparseImageMemory(VkQueue queue, VkImage image, uint32_t numBindings, const VkSparseImageMemoryBindInfo* pBindInfo) |
| 487 | { |
| 488 | const VkLayerDispatchTable *disp; |
| 489 | |
| 490 | disp = loader_get_dispatch(queue); |
| 491 | |
| 492 | return disp->QueueBindSparseImageMemory(queue, image, numBindings, pBindInfo); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 493 | } |
| 494 | |
| 495 | LOADER_EXPORT VkResult VKAPI vkCreateFence(VkDevice device, const VkFenceCreateInfo* pCreateInfo, VkFence* pFence) |
| 496 | { |
| 497 | const VkLayerDispatchTable *disp; |
| 498 | |
| 499 | disp = loader_get_dispatch(device); |
| 500 | |
| 501 | return disp->CreateFence(device, pCreateInfo, pFence); |
| 502 | } |
| 503 | |
Courtney Goeltzenleuchter | 2bf8f90 | 2015-06-18 17:28:20 -0600 | [diff] [blame] | 504 | LOADER_EXPORT VkResult VKAPI vkResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences) |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 505 | { |
| 506 | const VkLayerDispatchTable *disp; |
| 507 | |
| 508 | disp = loader_get_dispatch(device); |
| 509 | |
| 510 | return disp->ResetFences(device, fenceCount, pFences); |
| 511 | } |
| 512 | |
| 513 | LOADER_EXPORT VkResult VKAPI vkGetFenceStatus(VkDevice device, VkFence fence) |
| 514 | { |
| 515 | const VkLayerDispatchTable *disp; |
| 516 | |
| 517 | disp = loader_get_dispatch(device); |
| 518 | |
| 519 | return disp->GetFenceStatus(device, fence); |
| 520 | } |
| 521 | |
Courtney Goeltzenleuchter | cd2a099 | 2015-07-09 11:44:38 -0600 | [diff] [blame^] | 522 | LOADER_EXPORT VkResult VKAPI vkWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout) |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 523 | { |
| 524 | const VkLayerDispatchTable *disp; |
| 525 | |
| 526 | disp = loader_get_dispatch(device); |
| 527 | |
| 528 | return disp->WaitForFences(device, fenceCount, pFences, waitAll, timeout); |
| 529 | } |
| 530 | |
| 531 | LOADER_EXPORT VkResult VKAPI vkCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo, VkSemaphore* pSemaphore) |
| 532 | { |
| 533 | const VkLayerDispatchTable *disp; |
| 534 | |
| 535 | disp = loader_get_dispatch(device); |
| 536 | |
| 537 | return disp->CreateSemaphore(device, pCreateInfo, pSemaphore); |
| 538 | } |
| 539 | |
| 540 | LOADER_EXPORT VkResult VKAPI vkQueueSignalSemaphore(VkQueue queue, VkSemaphore semaphore) |
| 541 | { |
| 542 | const VkLayerDispatchTable *disp; |
| 543 | |
| 544 | disp = loader_get_dispatch(queue); |
| 545 | |
| 546 | return disp->QueueSignalSemaphore(queue, semaphore); |
| 547 | } |
| 548 | |
| 549 | LOADER_EXPORT VkResult VKAPI vkQueueWaitSemaphore(VkQueue queue, VkSemaphore semaphore) |
| 550 | { |
| 551 | const VkLayerDispatchTable *disp; |
| 552 | |
| 553 | disp = loader_get_dispatch(queue); |
| 554 | |
| 555 | return disp->QueueWaitSemaphore(queue, semaphore); |
| 556 | } |
| 557 | |
| 558 | LOADER_EXPORT VkResult VKAPI vkCreateEvent(VkDevice device, const VkEventCreateInfo* pCreateInfo, VkEvent* pEvent) |
| 559 | { |
| 560 | const VkLayerDispatchTable *disp; |
| 561 | |
| 562 | disp = loader_get_dispatch(device); |
| 563 | |
| 564 | return disp->CreateEvent(device, pCreateInfo, pEvent); |
| 565 | } |
| 566 | |
| 567 | LOADER_EXPORT VkResult VKAPI vkGetEventStatus(VkDevice device, VkEvent event) |
| 568 | { |
| 569 | const VkLayerDispatchTable *disp; |
| 570 | |
| 571 | disp = loader_get_dispatch(device); |
| 572 | |
| 573 | return disp->GetEventStatus(device, event); |
| 574 | } |
| 575 | |
| 576 | LOADER_EXPORT VkResult VKAPI vkSetEvent(VkDevice device, VkEvent event) |
| 577 | { |
| 578 | const VkLayerDispatchTable *disp; |
| 579 | |
| 580 | disp = loader_get_dispatch(device); |
| 581 | |
| 582 | return disp->SetEvent(device, event); |
| 583 | } |
| 584 | |
| 585 | LOADER_EXPORT VkResult VKAPI vkResetEvent(VkDevice device, VkEvent event) |
| 586 | { |
| 587 | const VkLayerDispatchTable *disp; |
| 588 | |
| 589 | disp = loader_get_dispatch(device); |
| 590 | |
| 591 | return disp->ResetEvent(device, event); |
| 592 | } |
| 593 | |
| 594 | LOADER_EXPORT VkResult VKAPI vkCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, VkQueryPool* pQueryPool) |
| 595 | { |
| 596 | const VkLayerDispatchTable *disp; |
| 597 | |
| 598 | disp = loader_get_dispatch(device); |
| 599 | |
| 600 | return disp->CreateQueryPool(device, pCreateInfo, pQueryPool); |
| 601 | } |
| 602 | |
| 603 | LOADER_EXPORT VkResult VKAPI vkGetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount, size_t* pDataSize, void* pData, VkQueryResultFlags flags) |
| 604 | { |
| 605 | const VkLayerDispatchTable *disp; |
| 606 | |
| 607 | disp = loader_get_dispatch(device); |
| 608 | |
| 609 | return disp->GetQueryPoolResults(device, queryPool, startQuery, queryCount, pDataSize, pData, flags); |
| 610 | } |
| 611 | |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 612 | LOADER_EXPORT VkResult VKAPI vkCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateInfo, VkBuffer* pBuffer) |
| 613 | { |
| 614 | const VkLayerDispatchTable *disp; |
| 615 | |
| 616 | disp = loader_get_dispatch(device); |
| 617 | |
| 618 | return disp->CreateBuffer(device, pCreateInfo, pBuffer); |
| 619 | } |
| 620 | |
| 621 | LOADER_EXPORT VkResult VKAPI vkCreateBufferView(VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, VkBufferView* pView) |
| 622 | { |
| 623 | const VkLayerDispatchTable *disp; |
| 624 | |
| 625 | disp = loader_get_dispatch(device); |
| 626 | |
| 627 | return disp->CreateBufferView(device, pCreateInfo, pView); |
| 628 | } |
| 629 | |
| 630 | LOADER_EXPORT VkResult VKAPI vkCreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo, VkImage* pImage) |
| 631 | { |
| 632 | const VkLayerDispatchTable *disp; |
| 633 | |
| 634 | disp = loader_get_dispatch(device); |
| 635 | |
| 636 | return disp->CreateImage(device, pCreateInfo, pImage); |
| 637 | } |
| 638 | |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 639 | LOADER_EXPORT VkResult VKAPI vkGetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout) |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 640 | { |
| 641 | const VkLayerDispatchTable *disp; |
| 642 | |
| 643 | disp = loader_get_dispatch(device); |
| 644 | |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 645 | return disp->GetImageSubresourceLayout(device, image, pSubresource, pLayout); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 646 | } |
| 647 | |
| 648 | LOADER_EXPORT VkResult VKAPI vkCreateImageView(VkDevice device, const VkImageViewCreateInfo* pCreateInfo, VkImageView* pView) |
| 649 | { |
| 650 | const VkLayerDispatchTable *disp; |
| 651 | |
| 652 | disp = loader_get_dispatch(device); |
| 653 | |
| 654 | return disp->CreateImageView(device, pCreateInfo, pView); |
| 655 | } |
| 656 | |
| 657 | LOADER_EXPORT VkResult VKAPI vkCreateColorAttachmentView(VkDevice device, const VkColorAttachmentViewCreateInfo* pCreateInfo, VkColorAttachmentView* pView) |
| 658 | { |
| 659 | const VkLayerDispatchTable *disp; |
| 660 | |
| 661 | disp = loader_get_dispatch(device); |
| 662 | |
| 663 | return disp->CreateColorAttachmentView(device, pCreateInfo, pView); |
| 664 | } |
| 665 | |
| 666 | LOADER_EXPORT VkResult VKAPI vkCreateDepthStencilView(VkDevice device, const VkDepthStencilViewCreateInfo* pCreateInfo, VkDepthStencilView* pView) |
| 667 | { |
| 668 | const VkLayerDispatchTable *disp; |
| 669 | |
| 670 | disp = loader_get_dispatch(device); |
| 671 | |
| 672 | return disp->CreateDepthStencilView(device, pCreateInfo, pView); |
| 673 | } |
| 674 | |
Courtney Goeltzenleuchter | 2d2cb68 | 2015-06-24 18:24:19 -0600 | [diff] [blame] | 675 | LOADER_EXPORT VkResult VKAPI vkCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, VkShaderModule* pShader) |
| 676 | { |
| 677 | const VkLayerDispatchTable *disp; |
| 678 | |
| 679 | disp = loader_get_dispatch(device); |
| 680 | |
| 681 | return disp->CreateShaderModule(device, pCreateInfo, pShader); |
| 682 | } |
| 683 | |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 684 | LOADER_EXPORT VkResult VKAPI vkCreateShader(VkDevice device, const VkShaderCreateInfo* pCreateInfo, VkShader* pShader) |
| 685 | { |
| 686 | const VkLayerDispatchTable *disp; |
| 687 | |
| 688 | disp = loader_get_dispatch(device); |
| 689 | |
| 690 | return disp->CreateShader(device, pCreateInfo, pShader); |
| 691 | } |
| 692 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 693 | LOADER_EXPORT VkResult VKAPI vkCreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, VkPipelineCache* pPipelineCache) |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 694 | { |
| 695 | const VkLayerDispatchTable *disp; |
| 696 | |
| 697 | disp = loader_get_dispatch(device); |
| 698 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 699 | return disp->CreatePipelineCache(device, pCreateInfo, pPipelineCache); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 700 | } |
| 701 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 702 | LOADER_EXPORT VkResult VKAPI vkDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache) |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 703 | { |
| 704 | const VkLayerDispatchTable *disp; |
| 705 | |
| 706 | disp = loader_get_dispatch(device); |
| 707 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 708 | return disp->DestroyPipelineCache(device, pipelineCache); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 709 | } |
| 710 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 711 | LOADER_EXPORT size_t VKAPI vkGetPipelineCacheSize(VkDevice device, VkPipelineCache pipelineCache) |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 712 | { |
| 713 | const VkLayerDispatchTable *disp; |
| 714 | |
| 715 | disp = loader_get_dispatch(device); |
| 716 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 717 | return disp->GetPipelineCacheSize(device, pipelineCache); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 718 | } |
| 719 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 720 | LOADER_EXPORT VkResult VKAPI vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, void* pData) |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 721 | { |
| 722 | const VkLayerDispatchTable *disp; |
| 723 | |
| 724 | disp = loader_get_dispatch(device); |
| 725 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 726 | return disp->GetPipelineCacheData(device, pipelineCache, pData); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 727 | } |
| 728 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 729 | LOADER_EXPORT VkResult VKAPI vkMergePipelineCaches(VkDevice device, VkPipelineCache destCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches) |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 730 | { |
| 731 | const VkLayerDispatchTable *disp; |
| 732 | |
| 733 | disp = loader_get_dispatch(device); |
| 734 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 735 | return disp->MergePipelineCaches(device, destCache, srcCacheCount, pSrcCaches); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 736 | } |
| 737 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 738 | LOADER_EXPORT VkResult VKAPI vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, const VkGraphicsPipelineCreateInfo* pCreateInfos, VkPipeline* pPipelines) |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 739 | { |
| 740 | const VkLayerDispatchTable *disp; |
| 741 | |
| 742 | disp = loader_get_dispatch(device); |
| 743 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 744 | return disp->CreateGraphicsPipelines(device, pipelineCache, count, pCreateInfos, pPipelines); |
| 745 | } |
| 746 | |
| 747 | LOADER_EXPORT VkResult VKAPI vkCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, const VkComputePipelineCreateInfo* pCreateInfos, VkPipeline* pPipelines) |
| 748 | { |
| 749 | const VkLayerDispatchTable *disp; |
| 750 | |
| 751 | disp = loader_get_dispatch(device); |
| 752 | |
| 753 | return disp->CreateComputePipelines(device, pipelineCache, count, pCreateInfos, pPipelines); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 754 | } |
| 755 | |
| 756 | LOADER_EXPORT VkResult VKAPI vkCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, VkPipelineLayout* pPipelineLayout) |
| 757 | { |
| 758 | const VkLayerDispatchTable *disp; |
| 759 | |
| 760 | disp = loader_get_dispatch(device); |
| 761 | |
| 762 | return disp->CreatePipelineLayout(device, pCreateInfo, pPipelineLayout); |
| 763 | } |
| 764 | |
| 765 | LOADER_EXPORT VkResult VKAPI vkCreateSampler(VkDevice device, const VkSamplerCreateInfo* pCreateInfo, VkSampler* pSampler) |
| 766 | { |
| 767 | const VkLayerDispatchTable *disp; |
| 768 | |
| 769 | disp = loader_get_dispatch(device); |
| 770 | |
| 771 | return disp->CreateSampler(device, pCreateInfo, pSampler); |
| 772 | } |
| 773 | |
| 774 | LOADER_EXPORT VkResult VKAPI vkCreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayout* pSetLayout) |
| 775 | { |
| 776 | const VkLayerDispatchTable *disp; |
| 777 | |
| 778 | disp = loader_get_dispatch(device); |
| 779 | |
| 780 | return disp->CreateDescriptorSetLayout(device, pCreateInfo, pSetLayout); |
| 781 | } |
| 782 | |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 783 | LOADER_EXPORT VkResult VKAPI vkCreateDescriptorPool(VkDevice device, VkDescriptorPoolUsage poolUsage, uint32_t maxSets, const VkDescriptorPoolCreateInfo* pCreateInfo, VkDescriptorPool* pDescriptorPool) |
| 784 | { |
| 785 | const VkLayerDispatchTable *disp; |
| 786 | |
| 787 | disp = loader_get_dispatch(device); |
| 788 | |
| 789 | return disp->CreateDescriptorPool(device, poolUsage, maxSets, pCreateInfo, pDescriptorPool); |
| 790 | } |
| 791 | |
| 792 | LOADER_EXPORT VkResult VKAPI vkResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool) |
| 793 | { |
| 794 | const VkLayerDispatchTable *disp; |
| 795 | |
| 796 | disp = loader_get_dispatch(device); |
| 797 | |
| 798 | return disp->ResetDescriptorPool(device, descriptorPool); |
| 799 | } |
| 800 | |
| 801 | LOADER_EXPORT VkResult VKAPI vkAllocDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorSetUsage setUsage, uint32_t count, const VkDescriptorSetLayout* pSetLayouts, VkDescriptorSet* pDescriptorSets, uint32_t* pCount) |
| 802 | { |
| 803 | const VkLayerDispatchTable *disp; |
| 804 | |
| 805 | disp = loader_get_dispatch(device); |
| 806 | |
| 807 | return disp->AllocDescriptorSets(device, descriptorPool, setUsage, count, pSetLayouts, pDescriptorSets, pCount); |
| 808 | } |
| 809 | |
Chia-I Wu | 9d00ed7 | 2015-05-25 16:27:55 +0800 | [diff] [blame] | 810 | LOADER_EXPORT VkResult VKAPI vkUpdateDescriptorSets(VkDevice device, uint32_t writeCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t copyCount, const VkCopyDescriptorSet* pDescriptorCopies) |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 811 | { |
| 812 | const VkLayerDispatchTable *disp; |
| 813 | |
| 814 | disp = loader_get_dispatch(device); |
| 815 | |
Chia-I Wu | 9d00ed7 | 2015-05-25 16:27:55 +0800 | [diff] [blame] | 816 | return disp->UpdateDescriptorSets(device, writeCount, pDescriptorWrites, copyCount, pDescriptorCopies); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 817 | } |
| 818 | |
| 819 | LOADER_EXPORT VkResult VKAPI vkCreateDynamicViewportState(VkDevice device, const VkDynamicVpStateCreateInfo* pCreateInfo, VkDynamicVpState* pState) |
| 820 | { |
| 821 | const VkLayerDispatchTable *disp; |
| 822 | |
| 823 | disp = loader_get_dispatch(device); |
| 824 | |
| 825 | return disp->CreateDynamicViewportState(device, pCreateInfo, pState); |
| 826 | } |
| 827 | |
| 828 | LOADER_EXPORT VkResult VKAPI vkCreateDynamicRasterState(VkDevice device, const VkDynamicRsStateCreateInfo* pCreateInfo, VkDynamicRsState* pState) |
| 829 | { |
| 830 | const VkLayerDispatchTable *disp; |
| 831 | |
| 832 | disp = loader_get_dispatch(device); |
| 833 | |
| 834 | return disp->CreateDynamicRasterState(device, pCreateInfo, pState); |
| 835 | } |
| 836 | |
| 837 | LOADER_EXPORT VkResult VKAPI vkCreateDynamicColorBlendState(VkDevice device, const VkDynamicCbStateCreateInfo* pCreateInfo, VkDynamicCbState* pState) |
| 838 | { |
| 839 | const VkLayerDispatchTable *disp; |
| 840 | |
| 841 | disp = loader_get_dispatch(device); |
| 842 | |
| 843 | return disp->CreateDynamicColorBlendState(device, pCreateInfo, pState); |
| 844 | } |
| 845 | |
| 846 | LOADER_EXPORT VkResult VKAPI vkCreateDynamicDepthStencilState(VkDevice device, const VkDynamicDsStateCreateInfo* pCreateInfo, VkDynamicDsState* pState) |
| 847 | { |
| 848 | const VkLayerDispatchTable *disp; |
| 849 | |
| 850 | disp = loader_get_dispatch(device); |
| 851 | |
| 852 | return disp->CreateDynamicDepthStencilState(device, pCreateInfo, pState); |
| 853 | } |
| 854 | |
| 855 | LOADER_EXPORT VkResult VKAPI vkCreateCommandBuffer(VkDevice device, const VkCmdBufferCreateInfo* pCreateInfo, VkCmdBuffer* pCmdBuffer) |
| 856 | { |
| 857 | const VkLayerDispatchTable *disp; |
| 858 | VkResult res; |
| 859 | |
| 860 | disp = loader_get_dispatch(device); |
| 861 | |
| 862 | res = disp->CreateCommandBuffer(device, pCreateInfo, pCmdBuffer); |
| 863 | if (res == VK_SUCCESS) { |
| 864 | loader_init_dispatch(*pCmdBuffer, disp); |
| 865 | } |
| 866 | |
| 867 | return res; |
| 868 | } |
| 869 | |
| 870 | LOADER_EXPORT VkResult VKAPI vkBeginCommandBuffer(VkCmdBuffer cmdBuffer, const VkCmdBufferBeginInfo* pBeginInfo) |
| 871 | { |
| 872 | const VkLayerDispatchTable *disp; |
| 873 | |
| 874 | disp = loader_get_dispatch(cmdBuffer); |
| 875 | |
| 876 | return disp->BeginCommandBuffer(cmdBuffer, pBeginInfo); |
| 877 | } |
| 878 | |
| 879 | LOADER_EXPORT VkResult VKAPI vkEndCommandBuffer(VkCmdBuffer cmdBuffer) |
| 880 | { |
| 881 | const VkLayerDispatchTable *disp; |
| 882 | |
| 883 | disp = loader_get_dispatch(cmdBuffer); |
| 884 | |
| 885 | return disp->EndCommandBuffer(cmdBuffer); |
| 886 | } |
| 887 | |
| 888 | LOADER_EXPORT VkResult VKAPI vkResetCommandBuffer(VkCmdBuffer cmdBuffer) |
| 889 | { |
| 890 | const VkLayerDispatchTable *disp; |
| 891 | |
| 892 | disp = loader_get_dispatch(cmdBuffer); |
| 893 | |
| 894 | return disp->ResetCommandBuffer(cmdBuffer); |
| 895 | } |
| 896 | |
| 897 | LOADER_EXPORT void VKAPI vkCmdBindPipeline(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) |
| 898 | { |
| 899 | const VkLayerDispatchTable *disp; |
| 900 | |
| 901 | disp = loader_get_dispatch(cmdBuffer); |
| 902 | |
| 903 | disp->CmdBindPipeline(cmdBuffer, pipelineBindPoint, pipeline); |
| 904 | } |
| 905 | |
| 906 | LOADER_EXPORT void VKAPI vkCmdBindDynamicStateObject(VkCmdBuffer cmdBuffer, VkStateBindPoint stateBindPoint, VkDynamicStateObject state) |
| 907 | { |
| 908 | const VkLayerDispatchTable *disp; |
| 909 | |
| 910 | disp = loader_get_dispatch(cmdBuffer); |
| 911 | |
| 912 | disp->CmdBindDynamicStateObject(cmdBuffer, stateBindPoint, state); |
| 913 | } |
| 914 | |
Mark Lobodzinski | f2093b6 | 2015-06-15 13:21:21 -0600 | [diff] [blame] | 915 | LOADER_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 Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 916 | { |
| 917 | const VkLayerDispatchTable *disp; |
| 918 | |
| 919 | disp = loader_get_dispatch(cmdBuffer); |
| 920 | |
Mark Lobodzinski | f2093b6 | 2015-06-15 13:21:21 -0600 | [diff] [blame] | 921 | disp->CmdBindDescriptorSets(cmdBuffer, pipelineBindPoint, layout, firstSet, setCount, pDescriptorSets, dynamicOffsetCount, pDynamicOffsets); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 922 | } |
| 923 | |
| 924 | LOADER_EXPORT void VKAPI vkCmdBindVertexBuffers(VkCmdBuffer cmdBuffer, uint32_t startBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets) |
| 925 | { |
| 926 | const VkLayerDispatchTable *disp; |
| 927 | |
| 928 | disp = loader_get_dispatch(cmdBuffer); |
| 929 | |
| 930 | disp->CmdBindVertexBuffers(cmdBuffer, startBinding, bindingCount, pBuffers, pOffsets); |
| 931 | } |
| 932 | |
| 933 | LOADER_EXPORT void VKAPI vkCmdBindIndexBuffer(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType) |
| 934 | { |
| 935 | const VkLayerDispatchTable *disp; |
| 936 | |
| 937 | disp = loader_get_dispatch(cmdBuffer); |
| 938 | |
| 939 | disp->CmdBindIndexBuffer(cmdBuffer, buffer, offset, indexType); |
| 940 | } |
| 941 | |
| 942 | LOADER_EXPORT void VKAPI vkCmdDraw(VkCmdBuffer cmdBuffer, uint32_t firstVertex, uint32_t vertexCount, uint32_t firstInstance, uint32_t instanceCount) |
| 943 | { |
| 944 | const VkLayerDispatchTable *disp; |
| 945 | |
| 946 | disp = loader_get_dispatch(cmdBuffer); |
| 947 | |
| 948 | disp->CmdDraw(cmdBuffer, firstVertex, vertexCount, firstInstance, instanceCount); |
| 949 | } |
| 950 | |
| 951 | LOADER_EXPORT void VKAPI vkCmdDrawIndexed(VkCmdBuffer cmdBuffer, uint32_t firstIndex, uint32_t indexCount, int32_t vertexOffset, uint32_t firstInstance, uint32_t instanceCount) |
| 952 | { |
| 953 | const VkLayerDispatchTable *disp; |
| 954 | |
| 955 | disp = loader_get_dispatch(cmdBuffer); |
| 956 | |
| 957 | disp->CmdDrawIndexed(cmdBuffer, firstIndex, indexCount, vertexOffset, firstInstance, instanceCount); |
| 958 | } |
| 959 | |
| 960 | LOADER_EXPORT void VKAPI vkCmdDrawIndirect(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride) |
| 961 | { |
| 962 | const VkLayerDispatchTable *disp; |
| 963 | |
| 964 | disp = loader_get_dispatch(cmdBuffer); |
| 965 | |
| 966 | disp->CmdDrawIndirect(cmdBuffer, buffer, offset, count, stride); |
| 967 | } |
| 968 | |
| 969 | LOADER_EXPORT void VKAPI vkCmdDrawIndexedIndirect(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride) |
| 970 | { |
| 971 | const VkLayerDispatchTable *disp; |
| 972 | |
| 973 | disp = loader_get_dispatch(cmdBuffer); |
| 974 | |
| 975 | disp->CmdDrawIndexedIndirect(cmdBuffer, buffer, offset, count, stride); |
| 976 | } |
| 977 | |
| 978 | LOADER_EXPORT void VKAPI vkCmdDispatch(VkCmdBuffer cmdBuffer, uint32_t x, uint32_t y, uint32_t z) |
| 979 | { |
| 980 | const VkLayerDispatchTable *disp; |
| 981 | |
| 982 | disp = loader_get_dispatch(cmdBuffer); |
| 983 | |
| 984 | disp->CmdDispatch(cmdBuffer, x, y, z); |
| 985 | } |
| 986 | |
| 987 | LOADER_EXPORT void VKAPI vkCmdDispatchIndirect(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset) |
| 988 | { |
| 989 | const VkLayerDispatchTable *disp; |
| 990 | |
| 991 | disp = loader_get_dispatch(cmdBuffer); |
| 992 | |
| 993 | disp->CmdDispatchIndirect(cmdBuffer, buffer, offset); |
| 994 | } |
| 995 | |
| 996 | LOADER_EXPORT void VKAPI vkCmdCopyBuffer(VkCmdBuffer cmdBuffer, VkBuffer srcBuffer, VkBuffer destBuffer, uint32_t regionCount, const VkBufferCopy* pRegions) |
| 997 | { |
| 998 | const VkLayerDispatchTable *disp; |
| 999 | |
| 1000 | disp = loader_get_dispatch(cmdBuffer); |
| 1001 | |
| 1002 | disp->CmdCopyBuffer(cmdBuffer, srcBuffer, destBuffer, regionCount, pRegions); |
| 1003 | } |
| 1004 | |
| 1005 | LOADER_EXPORT void VKAPI vkCmdCopyImage(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageCopy* pRegions) |
| 1006 | { |
| 1007 | const VkLayerDispatchTable *disp; |
| 1008 | |
| 1009 | disp = loader_get_dispatch(cmdBuffer); |
| 1010 | |
| 1011 | disp->CmdCopyImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions); |
| 1012 | } |
| 1013 | |
Mark Lobodzinski | ee5eef1 | 2015-05-22 14:43:25 -0500 | [diff] [blame] | 1014 | LOADER_EXPORT void VKAPI vkCmdBlitImage(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageBlit* pRegions, VkTexFilter filter) |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1015 | { |
| 1016 | const VkLayerDispatchTable *disp; |
| 1017 | |
| 1018 | disp = loader_get_dispatch(cmdBuffer); |
| 1019 | |
Mark Lobodzinski | ee5eef1 | 2015-05-22 14:43:25 -0500 | [diff] [blame] | 1020 | disp->CmdBlitImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions, filter); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1021 | } |
| 1022 | |
| 1023 | LOADER_EXPORT void VKAPI vkCmdCopyBufferToImage(VkCmdBuffer cmdBuffer, VkBuffer srcBuffer, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions) |
| 1024 | { |
| 1025 | const VkLayerDispatchTable *disp; |
| 1026 | |
| 1027 | disp = loader_get_dispatch(cmdBuffer); |
| 1028 | |
| 1029 | disp->CmdCopyBufferToImage(cmdBuffer, srcBuffer, destImage, destImageLayout, regionCount, pRegions); |
| 1030 | } |
| 1031 | |
| 1032 | LOADER_EXPORT void VKAPI vkCmdCopyImageToBuffer(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer destBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions) |
| 1033 | { |
| 1034 | const VkLayerDispatchTable *disp; |
| 1035 | |
| 1036 | disp = loader_get_dispatch(cmdBuffer); |
| 1037 | |
| 1038 | disp->CmdCopyImageToBuffer(cmdBuffer, srcImage, srcImageLayout, destBuffer, regionCount, pRegions); |
| 1039 | } |
| 1040 | |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1041 | LOADER_EXPORT void VKAPI vkCmdUpdateBuffer(VkCmdBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize dataSize, const uint32_t* pData) |
| 1042 | { |
| 1043 | const VkLayerDispatchTable *disp; |
| 1044 | |
| 1045 | disp = loader_get_dispatch(cmdBuffer); |
| 1046 | |
| 1047 | disp->CmdUpdateBuffer(cmdBuffer, destBuffer, destOffset, dataSize, pData); |
| 1048 | } |
| 1049 | |
| 1050 | LOADER_EXPORT void VKAPI vkCmdFillBuffer(VkCmdBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize fillSize, uint32_t data) |
| 1051 | { |
| 1052 | const VkLayerDispatchTable *disp; |
| 1053 | |
| 1054 | disp = loader_get_dispatch(cmdBuffer); |
| 1055 | |
| 1056 | disp->CmdFillBuffer(cmdBuffer, destBuffer, destOffset, fillSize, data); |
| 1057 | } |
| 1058 | |
Chris Forbes | f0796e1 | 2015-06-24 14:34:53 +1200 | [diff] [blame] | 1059 | LOADER_EXPORT void VKAPI vkCmdClearColorImage(VkCmdBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1060 | { |
| 1061 | const VkLayerDispatchTable *disp; |
| 1062 | |
| 1063 | disp = loader_get_dispatch(cmdBuffer); |
| 1064 | |
| 1065 | disp->CmdClearColorImage(cmdBuffer, image, imageLayout, pColor, rangeCount, pRanges); |
| 1066 | } |
| 1067 | |
Chris Forbes | d9be82b | 2015-06-22 17:21:59 +1200 | [diff] [blame] | 1068 | LOADER_EXPORT void VKAPI vkCmdClearDepthStencilImage(VkCmdBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, float depth, uint32_t stencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1069 | { |
| 1070 | const VkLayerDispatchTable *disp; |
| 1071 | |
| 1072 | disp = loader_get_dispatch(cmdBuffer); |
| 1073 | |
Chris Forbes | d9be82b | 2015-06-22 17:21:59 +1200 | [diff] [blame] | 1074 | disp->CmdClearDepthStencilImage(cmdBuffer, image, imageLayout, depth, stencil, rangeCount, pRanges); |
| 1075 | } |
| 1076 | |
Chris Forbes | f0796e1 | 2015-06-24 14:34:53 +1200 | [diff] [blame] | 1077 | LOADER_EXPORT void VKAPI vkCmdClearColorAttachment(VkCmdBuffer cmdBuffer, uint32_t colorAttachment, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rectCount, const VkRect3D* pRects) |
Chris Forbes | d9be82b | 2015-06-22 17:21:59 +1200 | [diff] [blame] | 1078 | { |
| 1079 | const VkLayerDispatchTable *disp; |
| 1080 | |
| 1081 | disp = loader_get_dispatch(cmdBuffer); |
| 1082 | |
| 1083 | disp->CmdClearColorAttachment(cmdBuffer, colorAttachment, imageLayout, pColor, rectCount, pRects); |
| 1084 | } |
| 1085 | |
| 1086 | LOADER_EXPORT void VKAPI vkCmdClearDepthStencilAttachment(VkCmdBuffer cmdBuffer, VkImageAspectFlags imageAspectMask, VkImageLayout imageLayout, float depth, uint32_t stencil, uint32_t rectCount, const VkRect3D* pRects) |
| 1087 | { |
| 1088 | const VkLayerDispatchTable *disp; |
| 1089 | |
| 1090 | disp = loader_get_dispatch(cmdBuffer); |
| 1091 | |
| 1092 | disp->CmdClearDepthStencilAttachment(cmdBuffer, imageAspectMask, imageLayout, depth, stencil, rectCount, pRects); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1093 | } |
| 1094 | |
| 1095 | LOADER_EXPORT void VKAPI vkCmdResolveImage(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageResolve* pRegions) |
| 1096 | { |
| 1097 | const VkLayerDispatchTable *disp; |
| 1098 | |
| 1099 | disp = loader_get_dispatch(cmdBuffer); |
| 1100 | |
| 1101 | disp->CmdResolveImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions); |
| 1102 | } |
| 1103 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 1104 | LOADER_EXPORT void VKAPI vkCmdSetEvent(VkCmdBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask) |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1105 | { |
| 1106 | const VkLayerDispatchTable *disp; |
| 1107 | |
| 1108 | disp = loader_get_dispatch(cmdBuffer); |
| 1109 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 1110 | disp->CmdSetEvent(cmdBuffer, event, stageMask); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1111 | } |
| 1112 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 1113 | LOADER_EXPORT void VKAPI vkCmdResetEvent(VkCmdBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask) |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1114 | { |
| 1115 | const VkLayerDispatchTable *disp; |
| 1116 | |
| 1117 | disp = loader_get_dispatch(cmdBuffer); |
| 1118 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 1119 | disp->CmdResetEvent(cmdBuffer, event, stageMask); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1120 | } |
| 1121 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 1122 | LOADER_EXPORT void VKAPI vkCmdWaitEvents(VkCmdBuffer cmdBuffer, uint32_t eventCount, const VkEvent* pEvents, VkPipelineStageFlags sourceStageMask, VkPipelineStageFlags destStageMask, uint32_t memBarrierCount, const void** ppMemBarriers) |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1123 | { |
| 1124 | const VkLayerDispatchTable *disp; |
| 1125 | |
| 1126 | disp = loader_get_dispatch(cmdBuffer); |
| 1127 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 1128 | disp->CmdWaitEvents(cmdBuffer, eventCount, pEvents, sourceStageMask, destStageMask, memBarrierCount, ppMemBarriers); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1129 | } |
| 1130 | |
Courtney Goeltzenleuchter | cd2a099 | 2015-07-09 11:44:38 -0600 | [diff] [blame^] | 1131 | LOADER_EXPORT void VKAPI vkCmdPipelineBarrier(VkCmdBuffer cmdBuffer, VkPipelineStageFlags sourceStageMask, VkPipelineStageFlags destStageMask, VkBool32 byRegion, uint32_t memBarrierCount, const void** ppMemBarriers) |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1132 | { |
| 1133 | const VkLayerDispatchTable *disp; |
| 1134 | |
| 1135 | disp = loader_get_dispatch(cmdBuffer); |
| 1136 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 1137 | disp->CmdPipelineBarrier(cmdBuffer, sourceStageMask, destStageMask, byRegion, memBarrierCount, ppMemBarriers); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1138 | } |
| 1139 | |
| 1140 | LOADER_EXPORT void VKAPI vkCmdBeginQuery(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot, VkFlags flags) |
| 1141 | { |
| 1142 | const VkLayerDispatchTable *disp; |
| 1143 | |
| 1144 | disp = loader_get_dispatch(cmdBuffer); |
| 1145 | |
| 1146 | disp->CmdBeginQuery(cmdBuffer, queryPool, slot, flags); |
| 1147 | } |
| 1148 | |
| 1149 | LOADER_EXPORT void VKAPI vkCmdEndQuery(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot) |
| 1150 | { |
| 1151 | const VkLayerDispatchTable *disp; |
| 1152 | |
| 1153 | disp = loader_get_dispatch(cmdBuffer); |
| 1154 | |
| 1155 | disp->CmdEndQuery(cmdBuffer, queryPool, slot); |
| 1156 | } |
| 1157 | |
| 1158 | LOADER_EXPORT void VKAPI vkCmdResetQueryPool(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount) |
| 1159 | { |
| 1160 | const VkLayerDispatchTable *disp; |
| 1161 | |
| 1162 | disp = loader_get_dispatch(cmdBuffer); |
| 1163 | |
| 1164 | disp->CmdResetQueryPool(cmdBuffer, queryPool, startQuery, queryCount); |
| 1165 | } |
| 1166 | |
| 1167 | LOADER_EXPORT void VKAPI vkCmdWriteTimestamp(VkCmdBuffer cmdBuffer, VkTimestampType timestampType, VkBuffer destBuffer, VkDeviceSize destOffset) |
| 1168 | { |
| 1169 | const VkLayerDispatchTable *disp; |
| 1170 | |
| 1171 | disp = loader_get_dispatch(cmdBuffer); |
| 1172 | |
| 1173 | disp->CmdWriteTimestamp(cmdBuffer, timestampType, destBuffer, destOffset); |
| 1174 | } |
| 1175 | |
| 1176 | LOADER_EXPORT void VKAPI vkCmdCopyQueryPoolResults(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize destStride, VkFlags flags) |
| 1177 | { |
| 1178 | const VkLayerDispatchTable *disp; |
| 1179 | |
| 1180 | disp = loader_get_dispatch(cmdBuffer); |
| 1181 | |
| 1182 | disp->CmdCopyQueryPoolResults(cmdBuffer, queryPool, startQuery, queryCount, destBuffer, destOffset, destStride, flags); |
| 1183 | } |
| 1184 | |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1185 | LOADER_EXPORT VkResult VKAPI vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, VkFramebuffer* pFramebuffer) |
| 1186 | { |
| 1187 | const VkLayerDispatchTable *disp; |
| 1188 | |
| 1189 | disp = loader_get_dispatch(device); |
| 1190 | |
| 1191 | return disp->CreateFramebuffer(device, pCreateInfo, pFramebuffer); |
| 1192 | } |
| 1193 | |
| 1194 | LOADER_EXPORT VkResult VKAPI vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, VkRenderPass* pRenderPass) |
| 1195 | { |
| 1196 | const VkLayerDispatchTable *disp; |
| 1197 | |
| 1198 | disp = loader_get_dispatch(device); |
| 1199 | |
| 1200 | return disp->CreateRenderPass(device, pCreateInfo, pRenderPass); |
| 1201 | } |
| 1202 | |
| 1203 | LOADER_EXPORT void VKAPI vkCmdBeginRenderPass(VkCmdBuffer cmdBuffer, const VkRenderPassBegin* pRenderPassBegin) |
| 1204 | { |
| 1205 | const VkLayerDispatchTable *disp; |
| 1206 | |
| 1207 | disp = loader_get_dispatch(cmdBuffer); |
| 1208 | |
| 1209 | disp->CmdBeginRenderPass(cmdBuffer, pRenderPassBegin); |
| 1210 | } |
| 1211 | |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 1212 | LOADER_EXPORT void VKAPI vkCmdEndRenderPass(VkCmdBuffer cmdBuffer) |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1213 | { |
| 1214 | const VkLayerDispatchTable *disp; |
| 1215 | |
| 1216 | disp = loader_get_dispatch(cmdBuffer); |
| 1217 | |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 1218 | disp->CmdEndRenderPass(cmdBuffer); |
| 1219 | } |
| 1220 | |
| 1221 | LOADER_EXPORT void VKAPI vkCmdExecuteCommands(VkCmdBuffer cmdBuffer, uint32_t cmdBuffersCount, const VkCmdBuffer* pCmdBuffers) |
| 1222 | { |
| 1223 | const VkLayerDispatchTable *disp; |
| 1224 | |
| 1225 | disp = loader_get_dispatch(cmdBuffer); |
| 1226 | |
| 1227 | disp->CmdExecuteCommands(cmdBuffer, cmdBuffersCount, pCmdBuffers); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1228 | } |