Jon Ashburn | 2139a3e | 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 | */ |
Jon Ashburn | fce93d9 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 24 | #include <stdlib.h> |
| 25 | #include <string.h> |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 26 | |
Jon Ashburn | fce93d9 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 27 | #include "loader_platform.h" |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 28 | #include "loader.h" |
Jon Ashburn | cedc15f | 2015-05-21 18:13:33 -0600 | [diff] [blame] | 29 | #include "wsi_lunarg.h" |
Courtney Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 30 | #include "debug_report.h" |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 31 | |
Tobin Ehlis | 3126f01 | 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 | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 38 | /* Trampoline entrypoints */ |
Jon Ashburn | fce93d9 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 39 | LOADER_EXPORT VkResult VKAPI vkCreateInstance( |
| 40 | const VkInstanceCreateInfo* pCreateInfo, |
| 41 | VkInstance* pInstance) |
| 42 | { |
| 43 | struct loader_instance *ptr_instance = NULL; |
| 44 | |
| 45 | VkResult res = VK_ERROR_INITIALIZATION_FAILED; |
Jon Ashburn | fce93d9 | 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 */ |
| 51 | loader_platform_thread_once(&once_layer, layer_lib_scan); |
| 52 | |
| 53 | /* merge any duplicate extensions */ |
| 54 | loader_platform_thread_once(&once_exts, loader_coalesce_extensions); |
| 55 | |
| 56 | ptr_instance = (struct loader_instance*) malloc(sizeof(struct loader_instance)); |
| 57 | if (ptr_instance == NULL) { |
| 58 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 59 | } |
| 60 | memset(ptr_instance, 0, sizeof(struct loader_instance)); |
Courtney Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 61 | ptr_instance->app_extension_count = pCreateInfo->extensionCount; |
| 62 | ptr_instance->app_extension_props = (ptr_instance->app_extension_count > 0) ? |
| 63 | malloc(sizeof (VkExtensionProperties) * ptr_instance->app_extension_count) : NULL; |
| 64 | if (ptr_instance->app_extension_props == NULL && (ptr_instance->app_extension_count > 0)) |
Jon Ashburn | fce93d9 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 65 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
Courtney Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 66 | |
| 67 | /* |
| 68 | * Make local copy of extension properties indicated by application. |
| 69 | */ |
| 70 | if (ptr_instance->app_extension_props) { |
| 71 | memcpy(ptr_instance->app_extension_props, |
| 72 | pCreateInfo->pEnabledExtensions, |
| 73 | sizeof(VkExtensionProperties) * ptr_instance->app_extension_count); |
Jon Ashburn | fce93d9 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 74 | } |
Courtney Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 75 | |
Jon Ashburn | bfa43b7 | 2015-05-19 14:33:18 -0600 | [diff] [blame] | 76 | ptr_instance->disp = malloc(sizeof(VkLayerInstanceDispatchTable)); |
| 77 | if (ptr_instance->disp == NULL) |
| 78 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 79 | memcpy(ptr_instance->disp, &instance_disp, sizeof(instance_disp)); |
Jon Ashburn | fce93d9 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 80 | ptr_instance->next = loader.instances; |
| 81 | loader.instances = ptr_instance; |
Jon Ashburn | cedc15f | 2015-05-21 18:13:33 -0600 | [diff] [blame] | 82 | |
Courtney Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 83 | loader_enable_instance_layers(ptr_instance); |
| 84 | |
| 85 | debug_report_create_instance(ptr_instance); |
| 86 | wsi_lunarg_create_instance(ptr_instance); |
Jon Ashburn | cedc15f | 2015-05-21 18:13:33 -0600 | [diff] [blame] | 87 | |
| 88 | /* enable any layers on instance chain */ |
Jon Ashburn | fce93d9 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 89 | loader_activate_instance_layers(ptr_instance); |
| 90 | |
Jon Ashburn | fce93d9 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 91 | *pInstance = (VkInstance) ptr_instance; |
Jon Ashburn | a179dcf | 2015-05-21 17:42:17 -0600 | [diff] [blame] | 92 | |
| 93 | res = ptr_instance->disp->CreateInstance(pCreateInfo, pInstance); |
| 94 | |
Courtney Goeltzenleuchter | 23b5f8d | 2015-06-17 20:51:59 -0600 | [diff] [blame] | 95 | /* |
| 96 | * Finally have the layers in place and everyone has seen |
| 97 | * the CreateInstance command go by. This allows the layer's |
| 98 | * GetInstanceProcAddr functions to return valid extension functions |
| 99 | * if enabled. |
| 100 | */ |
| 101 | loader_activate_instance_layer_extensions(ptr_instance); |
| 102 | |
Jon Ashburn | fce93d9 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 103 | return res; |
| 104 | } |
| 105 | |
| 106 | LOADER_EXPORT VkResult VKAPI vkDestroyInstance( |
| 107 | VkInstance instance) |
| 108 | { |
| 109 | const VkLayerInstanceDispatchTable *disp; |
| 110 | |
| 111 | disp = loader_get_instance_dispatch(instance); |
Courtney Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 112 | |
Courtney Goeltzenleuchter | 3d8dc1f | 2015-06-08 15:09:22 -0600 | [diff] [blame^] | 113 | VkResult res = disp->DestroyInstance(instance); |
Courtney Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 114 | |
Courtney Goeltzenleuchter | 3d8dc1f | 2015-06-08 15:09:22 -0600 | [diff] [blame^] | 115 | struct loader_instance *ptr_instance = loader_instance(instance); |
| 116 | loader_deactivate_instance_layers(ptr_instance); |
| 117 | loader_destroy_ext_list(&ptr_instance->enabled_instance_extensions); |
| 118 | loader_destroy_ext_list(&ptr_instance->activated_layer_list); |
| 119 | |
| 120 | free(ptr_instance); |
| 121 | |
| 122 | return res; |
Jon Ashburn | fce93d9 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 123 | } |
Jon Ashburn | 2666e2f | 2015-05-15 15:09:35 -0600 | [diff] [blame] | 124 | |
Jon Ashburn | fce93d9 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 125 | LOADER_EXPORT VkResult VKAPI vkEnumeratePhysicalDevices( |
| 126 | VkInstance instance, |
| 127 | uint32_t* pPhysicalDeviceCount, |
| 128 | VkPhysicalDevice* pPhysicalDevices) |
| 129 | { |
| 130 | const VkLayerInstanceDispatchTable *disp; |
| 131 | |
| 132 | disp = loader_get_instance_dispatch(instance); |
| 133 | return disp->EnumeratePhysicalDevices(instance, pPhysicalDeviceCount, |
| 134 | pPhysicalDevices); |
| 135 | } |
| 136 | |
| 137 | LOADER_EXPORT VkResult VKAPI vkGetPhysicalDeviceInfo( |
| 138 | VkPhysicalDevice gpu, |
| 139 | VkPhysicalDeviceInfoType infoType, |
| 140 | size_t* pDataSize, |
| 141 | void* pData) |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 142 | { |
Jon Ashburn | 2666e2f | 2015-05-15 15:09:35 -0600 | [diff] [blame] | 143 | const VkLayerInstanceDispatchTable *disp; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 144 | VkResult res; |
| 145 | |
Jon Ashburn | 2666e2f | 2015-05-15 15:09:35 -0600 | [diff] [blame] | 146 | disp = loader_get_instance_dispatch(gpu); |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 147 | |
| 148 | res = disp->GetPhysicalDeviceInfo(gpu, infoType, pDataSize, pData); |
Jon Ashburn | 2666e2f | 2015-05-15 15:09:35 -0600 | [diff] [blame] | 149 | //TODO add check for extension enabled |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 150 | if (infoType == VK_PHYSICAL_DEVICE_INFO_TYPE_DISPLAY_PROPERTIES_WSI && pData && res == VK_SUCCESS) { |
| 151 | VkDisplayPropertiesWSI *info = pData; |
| 152 | size_t count = *pDataSize / sizeof(*info), i; |
| 153 | for (i = 0; i < count; i++) { |
| 154 | loader_set_dispatch(info[i].display, disp); |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | return res; |
| 159 | } |
| 160 | |
Jon Ashburn | 2666e2f | 2015-05-15 15:09:35 -0600 | [diff] [blame] | 161 | LOADER_EXPORT VkResult VKAPI vkCreateDevice( |
| 162 | VkPhysicalDevice gpu, |
| 163 | const VkDeviceCreateInfo* pCreateInfo, |
| 164 | VkDevice* pDevice) |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 165 | { |
Jon Ashburn | 2666e2f | 2015-05-15 15:09:35 -0600 | [diff] [blame] | 166 | const VkLayerInstanceDispatchTable *disp; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 167 | VkResult res; |
| 168 | |
Jon Ashburn | 2666e2f | 2015-05-15 15:09:35 -0600 | [diff] [blame] | 169 | disp = loader_get_instance_dispatch(gpu); |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 170 | |
Jon Ashburn | 2666e2f | 2015-05-15 15:09:35 -0600 | [diff] [blame] | 171 | // CreateDevice is dispatched on the instance chain |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 172 | res = disp->CreateDevice(gpu, pCreateInfo, pDevice); |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 173 | return res; |
| 174 | } |
| 175 | |
| 176 | LOADER_EXPORT VkResult VKAPI vkDestroyDevice(VkDevice device) |
| 177 | { |
| 178 | const VkLayerDispatchTable *disp; |
Jon Ashburn | fce93d9 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 179 | VkResult res; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 180 | |
| 181 | disp = loader_get_dispatch(device); |
| 182 | |
Jon Ashburn | fce93d9 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 183 | res = disp->DestroyDevice(device); |
| 184 | // TODO need to keep track of device objs to be able to get icd/gpu to deactivate |
| 185 | //loader_deactivate_device_layer(device); |
| 186 | return res; |
| 187 | } |
| 188 | |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 189 | LOADER_EXPORT VkResult VKAPI vkGetDeviceQueue(VkDevice device, uint32_t queueNodeIndex, uint32_t queueIndex, VkQueue* pQueue) |
| 190 | { |
| 191 | const VkLayerDispatchTable *disp; |
| 192 | VkResult res; |
| 193 | |
| 194 | disp = loader_get_dispatch(device); |
| 195 | |
| 196 | res = disp->GetDeviceQueue(device, queueNodeIndex, queueIndex, pQueue); |
| 197 | if (res == VK_SUCCESS) { |
| 198 | loader_set_dispatch(*pQueue, disp); |
| 199 | } |
| 200 | |
| 201 | return res; |
| 202 | } |
| 203 | |
| 204 | LOADER_EXPORT VkResult VKAPI vkQueueSubmit(VkQueue queue, uint32_t cmdBufferCount, const VkCmdBuffer* pCmdBuffers, VkFence fence) |
| 205 | { |
| 206 | const VkLayerDispatchTable *disp; |
| 207 | |
| 208 | disp = loader_get_dispatch(queue); |
| 209 | |
| 210 | return disp->QueueSubmit(queue, cmdBufferCount, pCmdBuffers, fence); |
| 211 | } |
| 212 | |
| 213 | LOADER_EXPORT VkResult VKAPI vkQueueWaitIdle(VkQueue queue) |
| 214 | { |
| 215 | const VkLayerDispatchTable *disp; |
| 216 | |
| 217 | disp = loader_get_dispatch(queue); |
| 218 | |
| 219 | return disp->QueueWaitIdle(queue); |
| 220 | } |
| 221 | |
| 222 | LOADER_EXPORT VkResult VKAPI vkDeviceWaitIdle(VkDevice device) |
| 223 | { |
| 224 | const VkLayerDispatchTable *disp; |
| 225 | |
| 226 | disp = loader_get_dispatch(device); |
| 227 | |
| 228 | return disp->DeviceWaitIdle(device); |
| 229 | } |
| 230 | |
| 231 | LOADER_EXPORT VkResult VKAPI vkAllocMemory(VkDevice device, const VkMemoryAllocInfo* pAllocInfo, VkDeviceMemory* pMem) |
| 232 | { |
| 233 | const VkLayerDispatchTable *disp; |
| 234 | |
| 235 | disp = loader_get_dispatch(device); |
| 236 | |
| 237 | return disp->AllocMemory(device, pAllocInfo, pMem); |
| 238 | } |
| 239 | |
| 240 | LOADER_EXPORT VkResult VKAPI vkFreeMemory(VkDevice device, VkDeviceMemory mem) |
| 241 | { |
| 242 | const VkLayerDispatchTable *disp; |
| 243 | |
| 244 | disp = loader_get_dispatch(device); |
| 245 | |
| 246 | return disp->FreeMemory(device, mem); |
| 247 | } |
| 248 | |
| 249 | LOADER_EXPORT VkResult VKAPI vkSetMemoryPriority(VkDevice device, VkDeviceMemory mem, VkMemoryPriority priority) |
| 250 | { |
| 251 | const VkLayerDispatchTable *disp; |
| 252 | |
| 253 | disp = loader_get_dispatch(device); |
| 254 | |
| 255 | return disp->SetMemoryPriority(device, mem, priority); |
| 256 | } |
| 257 | |
| 258 | LOADER_EXPORT VkResult VKAPI vkMapMemory(VkDevice device, VkDeviceMemory mem, VkDeviceSize offset, VkDeviceSize size, VkFlags flags, void** ppData) |
| 259 | { |
| 260 | const VkLayerDispatchTable *disp; |
| 261 | |
| 262 | disp = loader_get_dispatch(device); |
| 263 | |
| 264 | return disp->MapMemory(device, mem, offset, size, flags, ppData); |
| 265 | } |
| 266 | |
| 267 | LOADER_EXPORT VkResult VKAPI vkUnmapMemory(VkDevice device, VkDeviceMemory mem) |
| 268 | { |
| 269 | const VkLayerDispatchTable *disp; |
| 270 | |
| 271 | disp = loader_get_dispatch(device); |
| 272 | |
| 273 | return disp->UnmapMemory(device, mem); |
| 274 | } |
| 275 | |
| 276 | LOADER_EXPORT VkResult VKAPI vkFlushMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges) |
| 277 | { |
| 278 | const VkLayerDispatchTable *disp; |
| 279 | |
| 280 | disp = loader_get_dispatch(device); |
| 281 | |
| 282 | return disp->FlushMappedMemoryRanges(device, memRangeCount, pMemRanges); |
| 283 | } |
| 284 | |
| 285 | LOADER_EXPORT VkResult VKAPI vkInvalidateMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges) |
| 286 | { |
| 287 | const VkLayerDispatchTable *disp; |
| 288 | |
| 289 | disp = loader_get_dispatch(device); |
| 290 | |
| 291 | return disp->InvalidateMappedMemoryRanges(device, memRangeCount, pMemRanges); |
| 292 | } |
| 293 | |
| 294 | LOADER_EXPORT VkResult VKAPI vkPinSystemMemory(VkDevice device, const void* pSysMem, size_t memSize, VkDeviceMemory* pMem) |
| 295 | { |
| 296 | const VkLayerDispatchTable *disp; |
| 297 | |
| 298 | disp = loader_get_dispatch(device); |
| 299 | |
| 300 | return disp->PinSystemMemory(device, pSysMem, memSize, pMem); |
| 301 | } |
| 302 | |
| 303 | LOADER_EXPORT VkResult VKAPI vkGetMultiDeviceCompatibility(VkPhysicalDevice gpu0, VkPhysicalDevice gpu1, VkPhysicalDeviceCompatibilityInfo* pInfo) |
| 304 | { |
Jon Ashburn | 2666e2f | 2015-05-15 15:09:35 -0600 | [diff] [blame] | 305 | const VkLayerInstanceDispatchTable *disp; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 306 | |
Jon Ashburn | 2666e2f | 2015-05-15 15:09:35 -0600 | [diff] [blame] | 307 | disp = loader_get_instance_dispatch(gpu0); |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 308 | |
| 309 | return disp->GetMultiDeviceCompatibility(gpu0, gpu1, pInfo); |
| 310 | } |
| 311 | |
| 312 | LOADER_EXPORT VkResult VKAPI vkOpenSharedMemory(VkDevice device, const VkMemoryOpenInfo* pOpenInfo, VkDeviceMemory* pMem) |
| 313 | { |
| 314 | const VkLayerDispatchTable *disp; |
| 315 | |
| 316 | disp = loader_get_dispatch(device); |
| 317 | |
| 318 | return disp->OpenSharedMemory(device, pOpenInfo, pMem); |
| 319 | } |
| 320 | |
| 321 | LOADER_EXPORT VkResult VKAPI vkOpenSharedSemaphore(VkDevice device, const VkSemaphoreOpenInfo* pOpenInfo, VkSemaphore* pSemaphore) |
| 322 | { |
| 323 | const VkLayerDispatchTable *disp; |
| 324 | |
| 325 | disp = loader_get_dispatch(device); |
| 326 | |
| 327 | return disp->OpenSharedSemaphore(device, pOpenInfo, pSemaphore); |
| 328 | } |
| 329 | |
| 330 | LOADER_EXPORT VkResult VKAPI vkOpenPeerMemory(VkDevice device, const VkPeerMemoryOpenInfo* pOpenInfo, VkDeviceMemory* pMem) |
| 331 | { |
| 332 | const VkLayerDispatchTable *disp; |
| 333 | |
| 334 | disp = loader_get_dispatch(device); |
| 335 | |
| 336 | return disp->OpenPeerMemory(device, pOpenInfo, pMem); |
| 337 | } |
| 338 | |
| 339 | LOADER_EXPORT VkResult VKAPI vkOpenPeerImage(VkDevice device, const VkPeerImageOpenInfo* pOpenInfo, VkImage* pImage, VkDeviceMemory* pMem) |
| 340 | { |
| 341 | const VkLayerDispatchTable *disp; |
| 342 | |
| 343 | disp = loader_get_dispatch(device); |
| 344 | |
| 345 | return disp->OpenPeerImage(device, pOpenInfo, pImage, pMem); |
| 346 | } |
| 347 | |
| 348 | LOADER_EXPORT VkResult VKAPI vkDestroyObject(VkDevice device, VkObjectType objType, VkObject object) |
| 349 | { |
| 350 | const VkLayerDispatchTable *disp; |
| 351 | |
| 352 | disp = loader_get_dispatch(device); |
| 353 | |
| 354 | return disp->DestroyObject(device, objType, object); |
| 355 | } |
| 356 | |
| 357 | LOADER_EXPORT VkResult VKAPI vkGetObjectInfo(VkDevice device, VkObjectType objType, VkObject object, VkObjectInfoType infoType, size_t* pDataSize, void* pData) |
| 358 | { |
| 359 | const VkLayerDispatchTable *disp; |
| 360 | |
| 361 | disp = loader_get_dispatch(device); |
| 362 | |
| 363 | return disp->GetObjectInfo(device, objType, object, infoType, pDataSize, pData); |
| 364 | } |
| 365 | |
Mark Lobodzinski | 2318261 | 2015-05-29 09:32:35 -0500 | [diff] [blame] | 366 | LOADER_EXPORT VkResult VKAPI vkBindObjectMemory(VkDevice device, VkObjectType objType, VkObject object, VkDeviceMemory mem, VkDeviceSize offset) |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 367 | { |
| 368 | const VkLayerDispatchTable *disp; |
| 369 | |
Mark Lobodzinski | fb9f564 | 2015-05-11 17:21:15 -0500 | [diff] [blame] | 370 | disp = loader_get_dispatch(device); |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 371 | |
Mark Lobodzinski | 2318261 | 2015-05-29 09:32:35 -0500 | [diff] [blame] | 372 | return disp->BindObjectMemory(device, objType, object, mem, offset); |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 373 | } |
| 374 | |
Mark Lobodzinski | 2318261 | 2015-05-29 09:32:35 -0500 | [diff] [blame] | 375 | LOADER_EXPORT VkResult VKAPI vkQueueBindSparseBufferMemory(VkQueue queue, VkBuffer buffer, VkDeviceSize rangeOffset, VkDeviceSize rangeSize, VkDeviceMemory mem, VkDeviceSize memOffset) |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 376 | { |
| 377 | const VkLayerDispatchTable *disp; |
| 378 | |
| 379 | disp = loader_get_dispatch(queue); |
| 380 | |
Mark Lobodzinski | 2318261 | 2015-05-29 09:32:35 -0500 | [diff] [blame] | 381 | return disp->QueueBindSparseBufferMemory(queue, buffer, rangeOffset, rangeSize, mem, memOffset); |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 382 | } |
| 383 | |
Mark Lobodzinski | 2318261 | 2015-05-29 09:32:35 -0500 | [diff] [blame] | 384 | LOADER_EXPORT VkResult VKAPI vkQueueBindSparseImageMemory(VkQueue queue, VkImage image, const VkImageMemoryBindInfo* pBindInfo, VkDeviceMemory mem, VkDeviceSize memOffset) |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 385 | { |
| 386 | const VkLayerDispatchTable *disp; |
| 387 | |
| 388 | disp = loader_get_dispatch(queue); |
| 389 | |
Mark Lobodzinski | 2318261 | 2015-05-29 09:32:35 -0500 | [diff] [blame] | 390 | return disp->QueueBindSparseImageMemory(queue, image, pBindInfo, mem, memOffset); |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 391 | } |
| 392 | |
| 393 | LOADER_EXPORT VkResult VKAPI vkCreateFence(VkDevice device, const VkFenceCreateInfo* pCreateInfo, VkFence* pFence) |
| 394 | { |
| 395 | const VkLayerDispatchTable *disp; |
| 396 | |
| 397 | disp = loader_get_dispatch(device); |
| 398 | |
| 399 | return disp->CreateFence(device, pCreateInfo, pFence); |
| 400 | } |
| 401 | |
| 402 | LOADER_EXPORT VkResult VKAPI vkResetFences(VkDevice device, uint32_t fenceCount, VkFence* pFences) |
| 403 | { |
| 404 | const VkLayerDispatchTable *disp; |
| 405 | |
| 406 | disp = loader_get_dispatch(device); |
| 407 | |
| 408 | return disp->ResetFences(device, fenceCount, pFences); |
| 409 | } |
| 410 | |
| 411 | LOADER_EXPORT VkResult VKAPI vkGetFenceStatus(VkDevice device, VkFence fence) |
| 412 | { |
| 413 | const VkLayerDispatchTable *disp; |
| 414 | |
| 415 | disp = loader_get_dispatch(device); |
| 416 | |
| 417 | return disp->GetFenceStatus(device, fence); |
| 418 | } |
| 419 | |
| 420 | LOADER_EXPORT VkResult VKAPI vkWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences, bool32_t waitAll, uint64_t timeout) |
| 421 | { |
| 422 | const VkLayerDispatchTable *disp; |
| 423 | |
| 424 | disp = loader_get_dispatch(device); |
| 425 | |
| 426 | return disp->WaitForFences(device, fenceCount, pFences, waitAll, timeout); |
| 427 | } |
| 428 | |
| 429 | LOADER_EXPORT VkResult VKAPI vkCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo, VkSemaphore* pSemaphore) |
| 430 | { |
| 431 | const VkLayerDispatchTable *disp; |
| 432 | |
| 433 | disp = loader_get_dispatch(device); |
| 434 | |
| 435 | return disp->CreateSemaphore(device, pCreateInfo, pSemaphore); |
| 436 | } |
| 437 | |
| 438 | LOADER_EXPORT VkResult VKAPI vkQueueSignalSemaphore(VkQueue queue, VkSemaphore semaphore) |
| 439 | { |
| 440 | const VkLayerDispatchTable *disp; |
| 441 | |
| 442 | disp = loader_get_dispatch(queue); |
| 443 | |
| 444 | return disp->QueueSignalSemaphore(queue, semaphore); |
| 445 | } |
| 446 | |
| 447 | LOADER_EXPORT VkResult VKAPI vkQueueWaitSemaphore(VkQueue queue, VkSemaphore semaphore) |
| 448 | { |
| 449 | const VkLayerDispatchTable *disp; |
| 450 | |
| 451 | disp = loader_get_dispatch(queue); |
| 452 | |
| 453 | return disp->QueueWaitSemaphore(queue, semaphore); |
| 454 | } |
| 455 | |
| 456 | LOADER_EXPORT VkResult VKAPI vkCreateEvent(VkDevice device, const VkEventCreateInfo* pCreateInfo, VkEvent* pEvent) |
| 457 | { |
| 458 | const VkLayerDispatchTable *disp; |
| 459 | |
| 460 | disp = loader_get_dispatch(device); |
| 461 | |
| 462 | return disp->CreateEvent(device, pCreateInfo, pEvent); |
| 463 | } |
| 464 | |
| 465 | LOADER_EXPORT VkResult VKAPI vkGetEventStatus(VkDevice device, VkEvent event) |
| 466 | { |
| 467 | const VkLayerDispatchTable *disp; |
| 468 | |
| 469 | disp = loader_get_dispatch(device); |
| 470 | |
| 471 | return disp->GetEventStatus(device, event); |
| 472 | } |
| 473 | |
| 474 | LOADER_EXPORT VkResult VKAPI vkSetEvent(VkDevice device, VkEvent event) |
| 475 | { |
| 476 | const VkLayerDispatchTable *disp; |
| 477 | |
| 478 | disp = loader_get_dispatch(device); |
| 479 | |
| 480 | return disp->SetEvent(device, event); |
| 481 | } |
| 482 | |
| 483 | LOADER_EXPORT VkResult VKAPI vkResetEvent(VkDevice device, VkEvent event) |
| 484 | { |
| 485 | const VkLayerDispatchTable *disp; |
| 486 | |
| 487 | disp = loader_get_dispatch(device); |
| 488 | |
| 489 | return disp->ResetEvent(device, event); |
| 490 | } |
| 491 | |
| 492 | LOADER_EXPORT VkResult VKAPI vkCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, VkQueryPool* pQueryPool) |
| 493 | { |
| 494 | const VkLayerDispatchTable *disp; |
| 495 | |
| 496 | disp = loader_get_dispatch(device); |
| 497 | |
| 498 | return disp->CreateQueryPool(device, pCreateInfo, pQueryPool); |
| 499 | } |
| 500 | |
| 501 | LOADER_EXPORT VkResult VKAPI vkGetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount, size_t* pDataSize, void* pData, VkQueryResultFlags flags) |
| 502 | { |
| 503 | const VkLayerDispatchTable *disp; |
| 504 | |
| 505 | disp = loader_get_dispatch(device); |
| 506 | |
| 507 | return disp->GetQueryPoolResults(device, queryPool, startQuery, queryCount, pDataSize, pData, flags); |
| 508 | } |
| 509 | |
| 510 | LOADER_EXPORT VkResult VKAPI vkGetFormatInfo(VkDevice device, VkFormat format, VkFormatInfoType infoType, size_t* pDataSize, void* pData) |
| 511 | { |
| 512 | const VkLayerDispatchTable *disp; |
| 513 | |
| 514 | disp = loader_get_dispatch(device); |
| 515 | |
| 516 | return disp->GetFormatInfo(device, format, infoType, pDataSize, pData); |
| 517 | } |
| 518 | |
| 519 | LOADER_EXPORT VkResult VKAPI vkCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateInfo, VkBuffer* pBuffer) |
| 520 | { |
| 521 | const VkLayerDispatchTable *disp; |
| 522 | |
| 523 | disp = loader_get_dispatch(device); |
| 524 | |
| 525 | return disp->CreateBuffer(device, pCreateInfo, pBuffer); |
| 526 | } |
| 527 | |
| 528 | LOADER_EXPORT VkResult VKAPI vkCreateBufferView(VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, VkBufferView* pView) |
| 529 | { |
| 530 | const VkLayerDispatchTable *disp; |
| 531 | |
| 532 | disp = loader_get_dispatch(device); |
| 533 | |
| 534 | return disp->CreateBufferView(device, pCreateInfo, pView); |
| 535 | } |
| 536 | |
| 537 | LOADER_EXPORT VkResult VKAPI vkCreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo, VkImage* pImage) |
| 538 | { |
| 539 | const VkLayerDispatchTable *disp; |
| 540 | |
| 541 | disp = loader_get_dispatch(device); |
| 542 | |
| 543 | return disp->CreateImage(device, pCreateInfo, pImage); |
| 544 | } |
| 545 | |
| 546 | LOADER_EXPORT VkResult VKAPI vkGetImageSubresourceInfo(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceInfoType infoType, size_t* pDataSize, void* pData) |
| 547 | { |
| 548 | const VkLayerDispatchTable *disp; |
| 549 | |
| 550 | disp = loader_get_dispatch(device); |
| 551 | |
| 552 | return disp->GetImageSubresourceInfo(device, image, pSubresource, infoType, pDataSize, pData); |
| 553 | } |
| 554 | |
| 555 | LOADER_EXPORT VkResult VKAPI vkCreateImageView(VkDevice device, const VkImageViewCreateInfo* pCreateInfo, VkImageView* pView) |
| 556 | { |
| 557 | const VkLayerDispatchTable *disp; |
| 558 | |
| 559 | disp = loader_get_dispatch(device); |
| 560 | |
| 561 | return disp->CreateImageView(device, pCreateInfo, pView); |
| 562 | } |
| 563 | |
| 564 | LOADER_EXPORT VkResult VKAPI vkCreateColorAttachmentView(VkDevice device, const VkColorAttachmentViewCreateInfo* pCreateInfo, VkColorAttachmentView* pView) |
| 565 | { |
| 566 | const VkLayerDispatchTable *disp; |
| 567 | |
| 568 | disp = loader_get_dispatch(device); |
| 569 | |
| 570 | return disp->CreateColorAttachmentView(device, pCreateInfo, pView); |
| 571 | } |
| 572 | |
| 573 | LOADER_EXPORT VkResult VKAPI vkCreateDepthStencilView(VkDevice device, const VkDepthStencilViewCreateInfo* pCreateInfo, VkDepthStencilView* pView) |
| 574 | { |
| 575 | const VkLayerDispatchTable *disp; |
| 576 | |
| 577 | disp = loader_get_dispatch(device); |
| 578 | |
| 579 | return disp->CreateDepthStencilView(device, pCreateInfo, pView); |
| 580 | } |
| 581 | |
| 582 | LOADER_EXPORT VkResult VKAPI vkCreateShader(VkDevice device, const VkShaderCreateInfo* pCreateInfo, VkShader* pShader) |
| 583 | { |
| 584 | const VkLayerDispatchTable *disp; |
| 585 | |
| 586 | disp = loader_get_dispatch(device); |
| 587 | |
| 588 | return disp->CreateShader(device, pCreateInfo, pShader); |
| 589 | } |
| 590 | |
| 591 | LOADER_EXPORT VkResult VKAPI vkCreateGraphicsPipeline(VkDevice device, const VkGraphicsPipelineCreateInfo* pCreateInfo, VkPipeline* pPipeline) |
| 592 | { |
| 593 | const VkLayerDispatchTable *disp; |
| 594 | |
| 595 | disp = loader_get_dispatch(device); |
| 596 | |
| 597 | return disp->CreateGraphicsPipeline(device, pCreateInfo, pPipeline); |
| 598 | } |
| 599 | |
| 600 | LOADER_EXPORT VkResult VKAPI vkCreateGraphicsPipelineDerivative(VkDevice device, const VkGraphicsPipelineCreateInfo* pCreateInfo, VkPipeline basePipeline, VkPipeline* pPipeline) |
| 601 | { |
| 602 | const VkLayerDispatchTable *disp; |
| 603 | |
| 604 | disp = loader_get_dispatch(device); |
| 605 | |
| 606 | return disp->CreateGraphicsPipelineDerivative(device, pCreateInfo, basePipeline, pPipeline); |
| 607 | } |
| 608 | |
| 609 | LOADER_EXPORT VkResult VKAPI vkCreateComputePipeline(VkDevice device, const VkComputePipelineCreateInfo* pCreateInfo, VkPipeline* pPipeline) |
| 610 | { |
| 611 | const VkLayerDispatchTable *disp; |
| 612 | |
| 613 | disp = loader_get_dispatch(device); |
| 614 | |
| 615 | return disp->CreateComputePipeline(device, pCreateInfo, pPipeline); |
| 616 | } |
| 617 | |
| 618 | LOADER_EXPORT VkResult VKAPI vkStorePipeline(VkDevice device, VkPipeline pipeline, size_t* pDataSize, void* pData) |
| 619 | { |
| 620 | const VkLayerDispatchTable *disp; |
| 621 | |
| 622 | disp = loader_get_dispatch(device); |
| 623 | |
| 624 | return disp->StorePipeline(device, pipeline, pDataSize, pData); |
| 625 | } |
| 626 | |
| 627 | LOADER_EXPORT VkResult VKAPI vkLoadPipeline(VkDevice device, size_t dataSize, const void* pData, VkPipeline* pPipeline) |
| 628 | { |
| 629 | const VkLayerDispatchTable *disp; |
| 630 | |
| 631 | disp = loader_get_dispatch(device); |
| 632 | |
| 633 | return disp->LoadPipeline(device, dataSize, pData, pPipeline); |
| 634 | } |
| 635 | |
| 636 | LOADER_EXPORT VkResult VKAPI vkLoadPipelineDerivative(VkDevice device, size_t dataSize, const void* pData, VkPipeline basePipeline, VkPipeline* pPipeline) |
| 637 | { |
| 638 | const VkLayerDispatchTable *disp; |
| 639 | |
| 640 | disp = loader_get_dispatch(device); |
| 641 | |
| 642 | return disp->LoadPipelineDerivative(device, dataSize, pData, basePipeline, pPipeline); |
| 643 | } |
| 644 | |
| 645 | LOADER_EXPORT VkResult VKAPI vkCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, VkPipelineLayout* pPipelineLayout) |
| 646 | { |
| 647 | const VkLayerDispatchTable *disp; |
| 648 | |
| 649 | disp = loader_get_dispatch(device); |
| 650 | |
| 651 | return disp->CreatePipelineLayout(device, pCreateInfo, pPipelineLayout); |
| 652 | } |
| 653 | |
| 654 | LOADER_EXPORT VkResult VKAPI vkCreateSampler(VkDevice device, const VkSamplerCreateInfo* pCreateInfo, VkSampler* pSampler) |
| 655 | { |
| 656 | const VkLayerDispatchTable *disp; |
| 657 | |
| 658 | disp = loader_get_dispatch(device); |
| 659 | |
| 660 | return disp->CreateSampler(device, pCreateInfo, pSampler); |
| 661 | } |
| 662 | |
| 663 | LOADER_EXPORT VkResult VKAPI vkCreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayout* pSetLayout) |
| 664 | { |
| 665 | const VkLayerDispatchTable *disp; |
| 666 | |
| 667 | disp = loader_get_dispatch(device); |
| 668 | |
| 669 | return disp->CreateDescriptorSetLayout(device, pCreateInfo, pSetLayout); |
| 670 | } |
| 671 | |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 672 | LOADER_EXPORT VkResult VKAPI vkCreateDescriptorPool(VkDevice device, VkDescriptorPoolUsage poolUsage, uint32_t maxSets, const VkDescriptorPoolCreateInfo* pCreateInfo, VkDescriptorPool* pDescriptorPool) |
| 673 | { |
| 674 | const VkLayerDispatchTable *disp; |
| 675 | |
| 676 | disp = loader_get_dispatch(device); |
| 677 | |
| 678 | return disp->CreateDescriptorPool(device, poolUsage, maxSets, pCreateInfo, pDescriptorPool); |
| 679 | } |
| 680 | |
| 681 | LOADER_EXPORT VkResult VKAPI vkResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool) |
| 682 | { |
| 683 | const VkLayerDispatchTable *disp; |
| 684 | |
| 685 | disp = loader_get_dispatch(device); |
| 686 | |
| 687 | return disp->ResetDescriptorPool(device, descriptorPool); |
| 688 | } |
| 689 | |
| 690 | LOADER_EXPORT VkResult VKAPI vkAllocDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorSetUsage setUsage, uint32_t count, const VkDescriptorSetLayout* pSetLayouts, VkDescriptorSet* pDescriptorSets, uint32_t* pCount) |
| 691 | { |
| 692 | const VkLayerDispatchTable *disp; |
| 693 | |
| 694 | disp = loader_get_dispatch(device); |
| 695 | |
| 696 | return disp->AllocDescriptorSets(device, descriptorPool, setUsage, count, pSetLayouts, pDescriptorSets, pCount); |
| 697 | } |
| 698 | |
| 699 | LOADER_EXPORT void VKAPI vkClearDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t count, const VkDescriptorSet* pDescriptorSets) |
| 700 | { |
| 701 | const VkLayerDispatchTable *disp; |
| 702 | |
| 703 | disp = loader_get_dispatch(device); |
| 704 | |
| 705 | disp->ClearDescriptorSets(device, descriptorPool, count, pDescriptorSets); |
| 706 | } |
| 707 | |
Chia-I Wu | 8cd8ecd | 2015-05-25 16:27:55 +0800 | [diff] [blame] | 708 | LOADER_EXPORT VkResult VKAPI vkUpdateDescriptorSets(VkDevice device, uint32_t writeCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t copyCount, const VkCopyDescriptorSet* pDescriptorCopies) |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 709 | { |
| 710 | const VkLayerDispatchTable *disp; |
| 711 | |
| 712 | disp = loader_get_dispatch(device); |
| 713 | |
Chia-I Wu | 8cd8ecd | 2015-05-25 16:27:55 +0800 | [diff] [blame] | 714 | return disp->UpdateDescriptorSets(device, writeCount, pDescriptorWrites, copyCount, pDescriptorCopies); |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 715 | } |
| 716 | |
| 717 | LOADER_EXPORT VkResult VKAPI vkCreateDynamicViewportState(VkDevice device, const VkDynamicVpStateCreateInfo* pCreateInfo, VkDynamicVpState* pState) |
| 718 | { |
| 719 | const VkLayerDispatchTable *disp; |
| 720 | |
| 721 | disp = loader_get_dispatch(device); |
| 722 | |
| 723 | return disp->CreateDynamicViewportState(device, pCreateInfo, pState); |
| 724 | } |
| 725 | |
| 726 | LOADER_EXPORT VkResult VKAPI vkCreateDynamicRasterState(VkDevice device, const VkDynamicRsStateCreateInfo* pCreateInfo, VkDynamicRsState* pState) |
| 727 | { |
| 728 | const VkLayerDispatchTable *disp; |
| 729 | |
| 730 | disp = loader_get_dispatch(device); |
| 731 | |
| 732 | return disp->CreateDynamicRasterState(device, pCreateInfo, pState); |
| 733 | } |
| 734 | |
| 735 | LOADER_EXPORT VkResult VKAPI vkCreateDynamicColorBlendState(VkDevice device, const VkDynamicCbStateCreateInfo* pCreateInfo, VkDynamicCbState* pState) |
| 736 | { |
| 737 | const VkLayerDispatchTable *disp; |
| 738 | |
| 739 | disp = loader_get_dispatch(device); |
| 740 | |
| 741 | return disp->CreateDynamicColorBlendState(device, pCreateInfo, pState); |
| 742 | } |
| 743 | |
| 744 | LOADER_EXPORT VkResult VKAPI vkCreateDynamicDepthStencilState(VkDevice device, const VkDynamicDsStateCreateInfo* pCreateInfo, VkDynamicDsState* pState) |
| 745 | { |
| 746 | const VkLayerDispatchTable *disp; |
| 747 | |
| 748 | disp = loader_get_dispatch(device); |
| 749 | |
| 750 | return disp->CreateDynamicDepthStencilState(device, pCreateInfo, pState); |
| 751 | } |
| 752 | |
| 753 | LOADER_EXPORT VkResult VKAPI vkCreateCommandBuffer(VkDevice device, const VkCmdBufferCreateInfo* pCreateInfo, VkCmdBuffer* pCmdBuffer) |
| 754 | { |
| 755 | const VkLayerDispatchTable *disp; |
| 756 | VkResult res; |
| 757 | |
| 758 | disp = loader_get_dispatch(device); |
| 759 | |
| 760 | res = disp->CreateCommandBuffer(device, pCreateInfo, pCmdBuffer); |
| 761 | if (res == VK_SUCCESS) { |
| 762 | loader_init_dispatch(*pCmdBuffer, disp); |
| 763 | } |
| 764 | |
| 765 | return res; |
| 766 | } |
| 767 | |
| 768 | LOADER_EXPORT VkResult VKAPI vkBeginCommandBuffer(VkCmdBuffer cmdBuffer, const VkCmdBufferBeginInfo* pBeginInfo) |
| 769 | { |
| 770 | const VkLayerDispatchTable *disp; |
| 771 | |
| 772 | disp = loader_get_dispatch(cmdBuffer); |
| 773 | |
| 774 | return disp->BeginCommandBuffer(cmdBuffer, pBeginInfo); |
| 775 | } |
| 776 | |
| 777 | LOADER_EXPORT VkResult VKAPI vkEndCommandBuffer(VkCmdBuffer cmdBuffer) |
| 778 | { |
| 779 | const VkLayerDispatchTable *disp; |
| 780 | |
| 781 | disp = loader_get_dispatch(cmdBuffer); |
| 782 | |
| 783 | return disp->EndCommandBuffer(cmdBuffer); |
| 784 | } |
| 785 | |
| 786 | LOADER_EXPORT VkResult VKAPI vkResetCommandBuffer(VkCmdBuffer cmdBuffer) |
| 787 | { |
| 788 | const VkLayerDispatchTable *disp; |
| 789 | |
| 790 | disp = loader_get_dispatch(cmdBuffer); |
| 791 | |
| 792 | return disp->ResetCommandBuffer(cmdBuffer); |
| 793 | } |
| 794 | |
| 795 | LOADER_EXPORT void VKAPI vkCmdBindPipeline(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) |
| 796 | { |
| 797 | const VkLayerDispatchTable *disp; |
| 798 | |
| 799 | disp = loader_get_dispatch(cmdBuffer); |
| 800 | |
| 801 | disp->CmdBindPipeline(cmdBuffer, pipelineBindPoint, pipeline); |
| 802 | } |
| 803 | |
| 804 | LOADER_EXPORT void VKAPI vkCmdBindDynamicStateObject(VkCmdBuffer cmdBuffer, VkStateBindPoint stateBindPoint, VkDynamicStateObject state) |
| 805 | { |
| 806 | const VkLayerDispatchTable *disp; |
| 807 | |
| 808 | disp = loader_get_dispatch(cmdBuffer); |
| 809 | |
| 810 | disp->CmdBindDynamicStateObject(cmdBuffer, stateBindPoint, state); |
| 811 | } |
| 812 | |
| 813 | LOADER_EXPORT void VKAPI vkCmdBindDescriptorSets(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, uint32_t firstSet, uint32_t setCount, const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets) |
| 814 | { |
| 815 | const VkLayerDispatchTable *disp; |
| 816 | |
| 817 | disp = loader_get_dispatch(cmdBuffer); |
| 818 | |
| 819 | disp->CmdBindDescriptorSets(cmdBuffer, pipelineBindPoint, firstSet, setCount, pDescriptorSets, dynamicOffsetCount, pDynamicOffsets); |
| 820 | } |
| 821 | |
| 822 | LOADER_EXPORT void VKAPI vkCmdBindVertexBuffers(VkCmdBuffer cmdBuffer, uint32_t startBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets) |
| 823 | { |
| 824 | const VkLayerDispatchTable *disp; |
| 825 | |
| 826 | disp = loader_get_dispatch(cmdBuffer); |
| 827 | |
| 828 | disp->CmdBindVertexBuffers(cmdBuffer, startBinding, bindingCount, pBuffers, pOffsets); |
| 829 | } |
| 830 | |
| 831 | LOADER_EXPORT void VKAPI vkCmdBindIndexBuffer(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType) |
| 832 | { |
| 833 | const VkLayerDispatchTable *disp; |
| 834 | |
| 835 | disp = loader_get_dispatch(cmdBuffer); |
| 836 | |
| 837 | disp->CmdBindIndexBuffer(cmdBuffer, buffer, offset, indexType); |
| 838 | } |
| 839 | |
| 840 | LOADER_EXPORT void VKAPI vkCmdDraw(VkCmdBuffer cmdBuffer, uint32_t firstVertex, uint32_t vertexCount, uint32_t firstInstance, uint32_t instanceCount) |
| 841 | { |
| 842 | const VkLayerDispatchTable *disp; |
| 843 | |
| 844 | disp = loader_get_dispatch(cmdBuffer); |
| 845 | |
| 846 | disp->CmdDraw(cmdBuffer, firstVertex, vertexCount, firstInstance, instanceCount); |
| 847 | } |
| 848 | |
| 849 | LOADER_EXPORT void VKAPI vkCmdDrawIndexed(VkCmdBuffer cmdBuffer, uint32_t firstIndex, uint32_t indexCount, int32_t vertexOffset, uint32_t firstInstance, uint32_t instanceCount) |
| 850 | { |
| 851 | const VkLayerDispatchTable *disp; |
| 852 | |
| 853 | disp = loader_get_dispatch(cmdBuffer); |
| 854 | |
| 855 | disp->CmdDrawIndexed(cmdBuffer, firstIndex, indexCount, vertexOffset, firstInstance, instanceCount); |
| 856 | } |
| 857 | |
| 858 | LOADER_EXPORT void VKAPI vkCmdDrawIndirect(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride) |
| 859 | { |
| 860 | const VkLayerDispatchTable *disp; |
| 861 | |
| 862 | disp = loader_get_dispatch(cmdBuffer); |
| 863 | |
| 864 | disp->CmdDrawIndirect(cmdBuffer, buffer, offset, count, stride); |
| 865 | } |
| 866 | |
| 867 | LOADER_EXPORT void VKAPI vkCmdDrawIndexedIndirect(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride) |
| 868 | { |
| 869 | const VkLayerDispatchTable *disp; |
| 870 | |
| 871 | disp = loader_get_dispatch(cmdBuffer); |
| 872 | |
| 873 | disp->CmdDrawIndexedIndirect(cmdBuffer, buffer, offset, count, stride); |
| 874 | } |
| 875 | |
| 876 | LOADER_EXPORT void VKAPI vkCmdDispatch(VkCmdBuffer cmdBuffer, uint32_t x, uint32_t y, uint32_t z) |
| 877 | { |
| 878 | const VkLayerDispatchTable *disp; |
| 879 | |
| 880 | disp = loader_get_dispatch(cmdBuffer); |
| 881 | |
| 882 | disp->CmdDispatch(cmdBuffer, x, y, z); |
| 883 | } |
| 884 | |
| 885 | LOADER_EXPORT void VKAPI vkCmdDispatchIndirect(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset) |
| 886 | { |
| 887 | const VkLayerDispatchTable *disp; |
| 888 | |
| 889 | disp = loader_get_dispatch(cmdBuffer); |
| 890 | |
| 891 | disp->CmdDispatchIndirect(cmdBuffer, buffer, offset); |
| 892 | } |
| 893 | |
| 894 | LOADER_EXPORT void VKAPI vkCmdCopyBuffer(VkCmdBuffer cmdBuffer, VkBuffer srcBuffer, VkBuffer destBuffer, uint32_t regionCount, const VkBufferCopy* pRegions) |
| 895 | { |
| 896 | const VkLayerDispatchTable *disp; |
| 897 | |
| 898 | disp = loader_get_dispatch(cmdBuffer); |
| 899 | |
| 900 | disp->CmdCopyBuffer(cmdBuffer, srcBuffer, destBuffer, regionCount, pRegions); |
| 901 | } |
| 902 | |
| 903 | LOADER_EXPORT void VKAPI vkCmdCopyImage(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageCopy* pRegions) |
| 904 | { |
| 905 | const VkLayerDispatchTable *disp; |
| 906 | |
| 907 | disp = loader_get_dispatch(cmdBuffer); |
| 908 | |
| 909 | disp->CmdCopyImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions); |
| 910 | } |
| 911 | |
Mark Lobodzinski | 20f6859 | 2015-05-22 14:43:25 -0500 | [diff] [blame] | 912 | 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 | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 913 | { |
| 914 | const VkLayerDispatchTable *disp; |
| 915 | |
| 916 | disp = loader_get_dispatch(cmdBuffer); |
| 917 | |
Mark Lobodzinski | 20f6859 | 2015-05-22 14:43:25 -0500 | [diff] [blame] | 918 | disp->CmdBlitImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions, filter); |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 919 | } |
| 920 | |
| 921 | LOADER_EXPORT void VKAPI vkCmdCopyBufferToImage(VkCmdBuffer cmdBuffer, VkBuffer srcBuffer, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions) |
| 922 | { |
| 923 | const VkLayerDispatchTable *disp; |
| 924 | |
| 925 | disp = loader_get_dispatch(cmdBuffer); |
| 926 | |
| 927 | disp->CmdCopyBufferToImage(cmdBuffer, srcBuffer, destImage, destImageLayout, regionCount, pRegions); |
| 928 | } |
| 929 | |
| 930 | LOADER_EXPORT void VKAPI vkCmdCopyImageToBuffer(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer destBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions) |
| 931 | { |
| 932 | const VkLayerDispatchTable *disp; |
| 933 | |
| 934 | disp = loader_get_dispatch(cmdBuffer); |
| 935 | |
| 936 | disp->CmdCopyImageToBuffer(cmdBuffer, srcImage, srcImageLayout, destBuffer, regionCount, pRegions); |
| 937 | } |
| 938 | |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 939 | LOADER_EXPORT void VKAPI vkCmdUpdateBuffer(VkCmdBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize dataSize, const uint32_t* pData) |
| 940 | { |
| 941 | const VkLayerDispatchTable *disp; |
| 942 | |
| 943 | disp = loader_get_dispatch(cmdBuffer); |
| 944 | |
| 945 | disp->CmdUpdateBuffer(cmdBuffer, destBuffer, destOffset, dataSize, pData); |
| 946 | } |
| 947 | |
| 948 | LOADER_EXPORT void VKAPI vkCmdFillBuffer(VkCmdBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize fillSize, uint32_t data) |
| 949 | { |
| 950 | const VkLayerDispatchTable *disp; |
| 951 | |
| 952 | disp = loader_get_dispatch(cmdBuffer); |
| 953 | |
| 954 | disp->CmdFillBuffer(cmdBuffer, destBuffer, destOffset, fillSize, data); |
| 955 | } |
| 956 | |
| 957 | LOADER_EXPORT void VKAPI vkCmdClearColorImage(VkCmdBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColor* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) |
| 958 | { |
| 959 | const VkLayerDispatchTable *disp; |
| 960 | |
| 961 | disp = loader_get_dispatch(cmdBuffer); |
| 962 | |
| 963 | disp->CmdClearColorImage(cmdBuffer, image, imageLayout, pColor, rangeCount, pRanges); |
| 964 | } |
| 965 | |
| 966 | LOADER_EXPORT void VKAPI vkCmdClearDepthStencil(VkCmdBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, float depth, uint32_t stencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) |
| 967 | { |
| 968 | const VkLayerDispatchTable *disp; |
| 969 | |
| 970 | disp = loader_get_dispatch(cmdBuffer); |
| 971 | |
| 972 | disp->CmdClearDepthStencil(cmdBuffer, image, imageLayout, depth, stencil, rangeCount, pRanges); |
| 973 | } |
| 974 | |
| 975 | LOADER_EXPORT void VKAPI vkCmdResolveImage(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageResolve* pRegions) |
| 976 | { |
| 977 | const VkLayerDispatchTable *disp; |
| 978 | |
| 979 | disp = loader_get_dispatch(cmdBuffer); |
| 980 | |
| 981 | disp->CmdResolveImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions); |
| 982 | } |
| 983 | |
| 984 | LOADER_EXPORT void VKAPI vkCmdSetEvent(VkCmdBuffer cmdBuffer, VkEvent event, VkPipeEvent pipeEvent) |
| 985 | { |
| 986 | const VkLayerDispatchTable *disp; |
| 987 | |
| 988 | disp = loader_get_dispatch(cmdBuffer); |
| 989 | |
| 990 | disp->CmdSetEvent(cmdBuffer, event, pipeEvent); |
| 991 | } |
| 992 | |
| 993 | LOADER_EXPORT void VKAPI vkCmdResetEvent(VkCmdBuffer cmdBuffer, VkEvent event, VkPipeEvent pipeEvent) |
| 994 | { |
| 995 | const VkLayerDispatchTable *disp; |
| 996 | |
| 997 | disp = loader_get_dispatch(cmdBuffer); |
| 998 | |
| 999 | disp->CmdResetEvent(cmdBuffer, event, pipeEvent); |
| 1000 | } |
| 1001 | |
| 1002 | LOADER_EXPORT void VKAPI vkCmdWaitEvents(VkCmdBuffer cmdBuffer, VkWaitEvent waitEvent, uint32_t eventCount, const VkEvent* pEvents, uint32_t memBarrierCount, const void** ppMemBarriers) |
| 1003 | { |
| 1004 | const VkLayerDispatchTable *disp; |
| 1005 | |
| 1006 | disp = loader_get_dispatch(cmdBuffer); |
| 1007 | |
| 1008 | disp->CmdWaitEvents(cmdBuffer, waitEvent, eventCount, pEvents, memBarrierCount, ppMemBarriers); |
| 1009 | } |
| 1010 | |
| 1011 | LOADER_EXPORT void VKAPI vkCmdPipelineBarrier(VkCmdBuffer cmdBuffer, VkWaitEvent waitEvent, uint32_t pipeEventCount, const VkPipeEvent* pPipeEvents, uint32_t memBarrierCount, const void** ppMemBarriers) |
| 1012 | { |
| 1013 | const VkLayerDispatchTable *disp; |
| 1014 | |
| 1015 | disp = loader_get_dispatch(cmdBuffer); |
| 1016 | |
| 1017 | disp->CmdPipelineBarrier(cmdBuffer, waitEvent, pipeEventCount, pPipeEvents, memBarrierCount, ppMemBarriers); |
| 1018 | } |
| 1019 | |
| 1020 | LOADER_EXPORT void VKAPI vkCmdBeginQuery(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot, VkFlags flags) |
| 1021 | { |
| 1022 | const VkLayerDispatchTable *disp; |
| 1023 | |
| 1024 | disp = loader_get_dispatch(cmdBuffer); |
| 1025 | |
| 1026 | disp->CmdBeginQuery(cmdBuffer, queryPool, slot, flags); |
| 1027 | } |
| 1028 | |
| 1029 | LOADER_EXPORT void VKAPI vkCmdEndQuery(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot) |
| 1030 | { |
| 1031 | const VkLayerDispatchTable *disp; |
| 1032 | |
| 1033 | disp = loader_get_dispatch(cmdBuffer); |
| 1034 | |
| 1035 | disp->CmdEndQuery(cmdBuffer, queryPool, slot); |
| 1036 | } |
| 1037 | |
| 1038 | LOADER_EXPORT void VKAPI vkCmdResetQueryPool(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount) |
| 1039 | { |
| 1040 | const VkLayerDispatchTable *disp; |
| 1041 | |
| 1042 | disp = loader_get_dispatch(cmdBuffer); |
| 1043 | |
| 1044 | disp->CmdResetQueryPool(cmdBuffer, queryPool, startQuery, queryCount); |
| 1045 | } |
| 1046 | |
| 1047 | LOADER_EXPORT void VKAPI vkCmdWriteTimestamp(VkCmdBuffer cmdBuffer, VkTimestampType timestampType, VkBuffer destBuffer, VkDeviceSize destOffset) |
| 1048 | { |
| 1049 | const VkLayerDispatchTable *disp; |
| 1050 | |
| 1051 | disp = loader_get_dispatch(cmdBuffer); |
| 1052 | |
| 1053 | disp->CmdWriteTimestamp(cmdBuffer, timestampType, destBuffer, destOffset); |
| 1054 | } |
| 1055 | |
| 1056 | LOADER_EXPORT void VKAPI vkCmdCopyQueryPoolResults(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize destStride, VkFlags flags) |
| 1057 | { |
| 1058 | const VkLayerDispatchTable *disp; |
| 1059 | |
| 1060 | disp = loader_get_dispatch(cmdBuffer); |
| 1061 | |
| 1062 | disp->CmdCopyQueryPoolResults(cmdBuffer, queryPool, startQuery, queryCount, destBuffer, destOffset, destStride, flags); |
| 1063 | } |
| 1064 | |
| 1065 | LOADER_EXPORT void VKAPI vkCmdInitAtomicCounters(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, uint32_t startCounter, uint32_t counterCount, const uint32_t* pData) |
| 1066 | { |
| 1067 | const VkLayerDispatchTable *disp; |
| 1068 | |
| 1069 | disp = loader_get_dispatch(cmdBuffer); |
| 1070 | |
| 1071 | disp->CmdInitAtomicCounters(cmdBuffer, pipelineBindPoint, startCounter, counterCount, pData); |
| 1072 | } |
| 1073 | |
| 1074 | LOADER_EXPORT void VKAPI vkCmdLoadAtomicCounters(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, uint32_t startCounter, uint32_t counterCount, VkBuffer srcBuffer, VkDeviceSize srcOffset) |
| 1075 | { |
| 1076 | const VkLayerDispatchTable *disp; |
| 1077 | |
| 1078 | disp = loader_get_dispatch(cmdBuffer); |
| 1079 | |
| 1080 | disp->CmdLoadAtomicCounters(cmdBuffer, pipelineBindPoint, startCounter, counterCount, srcBuffer, srcOffset); |
| 1081 | } |
| 1082 | |
| 1083 | LOADER_EXPORT void VKAPI vkCmdSaveAtomicCounters(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, uint32_t startCounter, uint32_t counterCount, VkBuffer destBuffer, VkDeviceSize destOffset) |
| 1084 | { |
| 1085 | const VkLayerDispatchTable *disp; |
| 1086 | |
| 1087 | disp = loader_get_dispatch(cmdBuffer); |
| 1088 | |
| 1089 | disp->CmdSaveAtomicCounters(cmdBuffer, pipelineBindPoint, startCounter, counterCount, destBuffer, destOffset); |
| 1090 | } |
| 1091 | |
| 1092 | LOADER_EXPORT VkResult VKAPI vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, VkFramebuffer* pFramebuffer) |
| 1093 | { |
| 1094 | const VkLayerDispatchTable *disp; |
| 1095 | |
| 1096 | disp = loader_get_dispatch(device); |
| 1097 | |
| 1098 | return disp->CreateFramebuffer(device, pCreateInfo, pFramebuffer); |
| 1099 | } |
| 1100 | |
| 1101 | LOADER_EXPORT VkResult VKAPI vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, VkRenderPass* pRenderPass) |
| 1102 | { |
| 1103 | const VkLayerDispatchTable *disp; |
| 1104 | |
| 1105 | disp = loader_get_dispatch(device); |
| 1106 | |
| 1107 | return disp->CreateRenderPass(device, pCreateInfo, pRenderPass); |
| 1108 | } |
| 1109 | |
| 1110 | LOADER_EXPORT void VKAPI vkCmdBeginRenderPass(VkCmdBuffer cmdBuffer, const VkRenderPassBegin* pRenderPassBegin) |
| 1111 | { |
| 1112 | const VkLayerDispatchTable *disp; |
| 1113 | |
| 1114 | disp = loader_get_dispatch(cmdBuffer); |
| 1115 | |
| 1116 | disp->CmdBeginRenderPass(cmdBuffer, pRenderPassBegin); |
| 1117 | } |
| 1118 | |
| 1119 | LOADER_EXPORT void VKAPI vkCmdEndRenderPass(VkCmdBuffer cmdBuffer, VkRenderPass renderPass) |
| 1120 | { |
| 1121 | const VkLayerDispatchTable *disp; |
| 1122 | |
| 1123 | disp = loader_get_dispatch(cmdBuffer); |
| 1124 | |
| 1125 | disp->CmdEndRenderPass(cmdBuffer, renderPass); |
| 1126 | } |