blob: 2cdd7ea5f20b5175578367bf426a055638b0ae78 [file] [log] [blame]
Jon Ashburn55585ed2016-05-11 16:57:26 -06001/*
2 * Copyright (c) 2015-2016 Valve Corporation
3 * Copyright (c) 2015-2016 LunarG, Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 * Author: Jon Ashburn <jon@lunarg.com>
18 */
19
20#include <stdio.h>
21#include <stdlib.h>
22#include <string.h>
23#include <assert.h>
24#include "vk_loader_platform.h"
25#include "vulkan/vk_layer.h"
26#include "vk_dispatch_table_helper.h"
27#include "vk_layer_extension_utils.h"
28#include "vk_layer_utils.h"
29#include "wrap_objects.h"
30
31namespace wrap_objects {
32
33static const VkLayerProperties global_layer = {
34 "VK_LAYER_LUNARG_wrap_objects", VK_LAYER_API_VERSION, 1, "LunarG Test Layer",
35};
36
37//TODO Add wrapping of Vkdevice, Vkqueue, VkcommandBuffer
38
39VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(const VkInstanceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkInstance* pInstance)
40{
41 VkLayerInstanceCreateInfo *chain_info = get_chain_info(pCreateInfo, VK_LAYER_LINK_INFO);
42 PFN_vkGetInstanceProcAddr fpGetInstanceProcAddr = chain_info->u.pLayerInfo->pfnNextGetInstanceProcAddr;
43 PFN_vkCreateInstance fpCreateInstance = (PFN_vkCreateInstance) fpGetInstanceProcAddr(NULL, "vkCreateInstance");
44 if (fpCreateInstance == NULL) {
45 return VK_ERROR_INITIALIZATION_FAILED;
46 }
47 // Advance the link info for the next element on the chain
48 chain_info->u.pLayerInfo = chain_info->u.pLayerInfo->pNext;
49 VkResult result = fpCreateInstance(pCreateInfo, pAllocator, pInstance);
50 if (result != VK_SUCCESS) {
51 return result;
52 }
53 auto inst = new wrapped_inst_obj;
54 if (!inst)
55 return VK_ERROR_OUT_OF_HOST_MEMORY;
56 memset(inst, 0, sizeof(*inst));
57 inst->obj = (*pInstance);
58 *pInstance = reinterpret_cast<VkInstance> (inst);
59 // store the loader callback for initializing created dispatchable objects
60 chain_info = get_chain_info(pCreateInfo, VK_LOADER_DATA_CALLBACK);
61 if (chain_info) {
62 inst->pfn_inst_init = chain_info->u.pfnSetInstanceLoaderData;
63 result = inst->pfn_inst_init(inst->obj, reinterpret_cast<void *> (inst));
64 if (VK_SUCCESS != result)
65 return result;
66 } else {
67 inst->pfn_inst_init = NULL;
68 inst->loader_disp = *(reinterpret_cast<VkLayerInstanceDispatchTable **> (*pInstance));
69 }
70 layer_init_instance_dispatch_table(*pInstance, &inst->layer_disp, fpGetInstanceProcAddr);
71
72 create_instance_register_extensions(pCreateInfo, *pInstance, inst);
73
74 return result;
75}
76
77
78VKAPI_ATTR void VKAPI_CALL vkDestroyInstance(VkInstance instance, const VkAllocationCallbacks* pAllocator)
79{
80 wrapped_inst_obj *inst;
81 auto vk_inst = unwrap_instance(instance, &inst);
82 VkLayerInstanceDispatchTable *pDisp = &inst->layer_disp;
83 pDisp->DestroyInstance(vk_inst, pAllocator);
84 if (inst->ptr_phys_devs)
85 delete[] inst->ptr_phys_devs;
86 delete inst;
87}
88
89VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDevices(VkInstance instance, uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices)
90{
91 wrapped_inst_obj *inst;
92 auto vk_inst = unwrap_instance(instance, &inst);
93 VkResult result = inst->layer_disp.EnumeratePhysicalDevices(vk_inst, pPhysicalDeviceCount, pPhysicalDevices);
94
95 if (VK_SUCCESS != result)
96 return result;
97
98 if (pPhysicalDevices != NULL) {
99 assert(pPhysicalDeviceCount);
100 auto phys_devs = new wrapped_phys_dev_obj[*pPhysicalDeviceCount];
101 if (!phys_devs)
102 return VK_ERROR_OUT_OF_HOST_MEMORY;
103 if (inst->ptr_phys_devs)
104 delete[] inst->ptr_phys_devs;
105 inst->ptr_phys_devs = phys_devs;
106 for (int i = 0; i < *pPhysicalDeviceCount; i++) {
107 if (inst->pfn_inst_init == NULL) {
108 phys_devs[i].loader_disp = *(reinterpret_cast<VkLayerInstanceDispatchTable **> (pPhysicalDevices[i]));
109 } else {
110 result = inst->pfn_inst_init(vk_inst, reinterpret_cast<void *> (&phys_devs[i]));
111 if (VK_SUCCESS != result)
112 return result;
113
114 }
115 phys_devs[i].obj = reinterpret_cast<void *> (pPhysicalDevices[i]);
116 phys_devs[i].inst = inst;
117 pPhysicalDevices[i] = reinterpret_cast<VkPhysicalDevice> (&phys_devs[i]);
118 }
119 }
120 return result;
121}
122
123VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures)
124{
125 wrapped_phys_dev_obj *phys_dev;
126 auto vk_phys_dev = unwrap_phys_dev(physicalDevice, &phys_dev);
127 phys_dev->inst->layer_disp.GetPhysicalDeviceFeatures(vk_phys_dev, pFeatures);
128}
129
130VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties)
131{
132 wrapped_phys_dev_obj *phys_dev;
133 auto vk_phys_dev = unwrap_phys_dev(physicalDevice, &phys_dev);
134 phys_dev->inst->layer_disp.GetPhysicalDeviceFormatProperties(vk_phys_dev, format, pFormatProperties);
135}
136
137VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties)
138{
139 wrapped_phys_dev_obj *phys_dev;
140 auto vk_phys_dev = unwrap_phys_dev(physicalDevice, &phys_dev);
141 VkResult result = phys_dev->inst->layer_disp.GetPhysicalDeviceImageFormatProperties(vk_phys_dev, format, type, tiling, usage, flags, pImageFormatProperties);
142 return result;
143}
144
145VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties)
146{
147 wrapped_phys_dev_obj *phys_dev;
148 auto vk_phys_dev = unwrap_phys_dev(physicalDevice, &phys_dev);
149 phys_dev->inst->layer_disp.GetPhysicalDeviceProperties(vk_phys_dev, pProperties);
150}
151
152VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties* pQueueFamilyProperties)
153{
154 wrapped_phys_dev_obj *phys_dev;
155 auto vk_phys_dev = unwrap_phys_dev(physicalDevice, &phys_dev);
156 phys_dev->inst->layer_disp.GetPhysicalDeviceQueueFamilyProperties(vk_phys_dev, pQueueFamilyPropertyCount, pQueueFamilyProperties);
157}
158
159VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties)
160{
161 wrapped_phys_dev_obj *phys_dev;
162 auto vk_phys_dev = unwrap_phys_dev(physicalDevice, &phys_dev);
163 phys_dev->inst->layer_disp.GetPhysicalDeviceMemoryProperties(vk_phys_dev, pMemoryProperties);
164}
165
166VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDevice* pDevice)
167{
168 wrapped_phys_dev_obj *phys_dev;
169 auto vk_phys_dev = unwrap_phys_dev(physicalDevice, &phys_dev);
170 VkLayerDeviceCreateInfo *chain_info = get_chain_info(pCreateInfo, VK_LAYER_LINK_INFO);
171 PFN_vkGetInstanceProcAddr fpGetInstanceProcAddr = chain_info->u.pLayerInfo->pfnNextGetInstanceProcAddr;
172 PFN_vkGetDeviceProcAddr fpGetDeviceProcAddr = chain_info->u.pLayerInfo->pfnNextGetDeviceProcAddr;
173 PFN_vkCreateDevice fpCreateDevice = (PFN_vkCreateDevice) fpGetInstanceProcAddr(NULL, "vkCreateDevice");
174 if (fpCreateDevice == NULL) {
175 return VK_ERROR_INITIALIZATION_FAILED;
176 }
177 // Advance the link info for the next element on the chain
178 chain_info->u.pLayerInfo = chain_info->u.pLayerInfo->pNext;
179 VkResult result = fpCreateDevice(vk_phys_dev, pCreateInfo, pAllocator, pDevice);
180 if (result != VK_SUCCESS) {
181 return result;
182 }
183 initDeviceTable(*pDevice, fpGetDeviceProcAddr);
184
185 create_device_register_extensions(pCreateInfo, *pDevice);
186
187#if 0 // TODO add once device is wrapped
188 // store the loader callback for initializing created dispatchable objects
189 chain_info = get_chain_info(pCreateInfo, VK_LOADER_DATA_CALLBACK);
190 if (chain_info) {
191 dev->pfn_dev_init = chain_info->u.pfnSetDeviceLoaderData;
192 } else {
193 dev->pfn_dev_init = NULL;
194 }
195#endif
196 return result;
197}
198
199
200VKAPI_ATTR void VKAPI_CALL vkDestroyDevice(VkDevice device, const VkAllocationCallbacks* pAllocator)
201{
202 dispatch_key key = get_dispatch_key(device);
203 VkLayerDispatchTable *pDisp = device_dispatch_table(device);
204 pDisp->DestroyDevice(device, pAllocator);
205 deviceExtMap.erase(pDisp);
206 destroy_device_dispatch_table(key);
207}
208
209VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties)
210{
211 wrapped_phys_dev_obj *phys_dev;
212 auto vk_phys_dev = unwrap_phys_dev(physicalDevice, &phys_dev);
213
214 if (pLayerName && !strcmp(pLayerName, global_layer.layerName))
215 return util_GetExtensionProperties(0, nullptr, pPropertyCount, pProperties);
216
217 return phys_dev->inst->layer_disp.EnumerateDeviceExtensionProperties(vk_phys_dev, pLayerName, pPropertyCount, pProperties);
218}
219
220VKAPI_ATTR void VKAPI_CALL vkGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue* pQueue)
221{
222 device_dispatch_table(device)->GetDeviceQueue(device, queueFamilyIndex, queueIndex, pQueue);
223}
224
225VKAPI_ATTR VkResult VKAPI_CALL vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence)
226{
227 VkResult result = device_dispatch_table(queue)->QueueSubmit(queue, submitCount, pSubmits, fence);
228 return result;
229}
230
231
232VKAPI_ATTR VkResult VKAPI_CALL vkQueueWaitIdle(VkQueue queue)
233{
234 VkResult result = device_dispatch_table(queue)->QueueWaitIdle(queue);
235 return result;
236}
237
238
239VKAPI_ATTR VkResult VKAPI_CALL vkDeviceWaitIdle(VkDevice device)
240{
241 VkResult result = device_dispatch_table(device)->DeviceWaitIdle(device);
242 return result;
243}
244
245
246VKAPI_ATTR VkResult VKAPI_CALL vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo, const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory)
247{
248 VkResult result = device_dispatch_table(device)->AllocateMemory(device, pAllocateInfo, pAllocator, pMemory);
249 return result;
250}
251
252
253VKAPI_ATTR void VKAPI_CALL vkFreeMemory(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks* pAllocator)
254{
255 device_dispatch_table(device)->FreeMemory(device, memory, pAllocator);
256}
257
258
259VKAPI_ATTR VkResult VKAPI_CALL vkMapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void** ppData)
260{
261 VkResult result = device_dispatch_table(device)->MapMemory(device, memory, offset, size, flags, ppData);
262 return result;
263}
264
265VKAPI_ATTR void VKAPI_CALL vkUnmapMemory(VkDevice device, VkDeviceMemory memory)
266{
267 device_dispatch_table(device)->UnmapMemory(device, memory);
268}
269
270
271VKAPI_ATTR VkResult VKAPI_CALL vkFlushMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges)
272{
273 VkResult result = device_dispatch_table(device)->FlushMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges);
274 return result;
275}
276
277
278
279VKAPI_ATTR VkResult VKAPI_CALL vkInvalidateMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges)
280{
281 VkResult result = device_dispatch_table(device)->InvalidateMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges);
282 return result;
283}
284
285
286VKAPI_ATTR void VKAPI_CALL vkGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes)
287{
288 device_dispatch_table(device)->GetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes);
289}
290
291
292VKAPI_ATTR VkResult VKAPI_CALL vkBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset)
293{
294 VkResult result = device_dispatch_table(device)->BindBufferMemory(device, buffer, memory, memoryOffset);
295 return result;
296}
297
298
299VKAPI_ATTR VkResult VKAPI_CALL vkBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset)
300{
301 VkResult result = device_dispatch_table(device)->BindImageMemory(device, image, memory, memoryOffset);
302 return result;
303}
304
305VKAPI_ATTR void VKAPI_CALL vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements)
306{
307 device_dispatch_table(device)->GetBufferMemoryRequirements(device, buffer, pMemoryRequirements);
308}
309
310
311VKAPI_ATTR void VKAPI_CALL vkGetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements)
312{
313 device_dispatch_table(device)->GetImageMemoryRequirements(device, image, pMemoryRequirements);
314}
315
316
317VKAPI_ATTR void VKAPI_CALL vkGetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements* pSparseMemoryRequirements)
318{
319 device_dispatch_table(device)->GetImageSparseMemoryRequirements(device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements);
320}
321
322
323VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t* pPropertyCount, VkSparseImageFormatProperties* pProperties)
324{
325 wrapped_phys_dev_obj *phys_dev;
326 auto vk_phys_dev = unwrap_phys_dev(physicalDevice, &phys_dev);
327 phys_dev->inst->layer_disp.GetPhysicalDeviceSparseImageFormatProperties(vk_phys_dev, format, type, samples, usage, tiling, pPropertyCount, pProperties);
328}
329
330
331VKAPI_ATTR VkResult VKAPI_CALL vkQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence)
332{
333 VkResult result = device_dispatch_table(queue)->QueueBindSparse(queue, bindInfoCount, pBindInfo, fence);
334 return result;
335}
336
337
338VKAPI_ATTR VkResult VKAPI_CALL vkCreateFence(VkDevice device, const VkFenceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence)
339{
340 VkResult result = device_dispatch_table(device)->CreateFence(device, pCreateInfo, pAllocator, pFence);
341 return result;
342}
343
344
345VKAPI_ATTR void VKAPI_CALL vkDestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks* pAllocator)
346{
347 device_dispatch_table(device)->DestroyFence(device, fence, pAllocator);
348}
349
350
351VKAPI_ATTR VkResult VKAPI_CALL vkResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences)
352{
353 VkResult result = device_dispatch_table(device)->ResetFences(device, fenceCount, pFences);
354 return result;
355}
356
357VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceStatus(VkDevice device, VkFence fence)
358{
359 VkResult result = device_dispatch_table(device)->GetFenceStatus(device, fence);
360 return result;
361}
362
363
364VKAPI_ATTR VkResult VKAPI_CALL vkWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout)
365{
366 VkResult result = device_dispatch_table(device)->WaitForFences(device, fenceCount, pFences, waitAll, timeout);
367 return result;
368}
369
370
371VKAPI_ATTR VkResult VKAPI_CALL vkCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSemaphore* pSemaphore)
372{
373 VkResult result = device_dispatch_table(device)->CreateSemaphore(device, pCreateInfo, pAllocator, pSemaphore);
374 return result;
375}
376
377
378VKAPI_ATTR void VKAPI_CALL vkDestroySemaphore(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks* pAllocator)
379{
380 device_dispatch_table(device)->DestroySemaphore(device, semaphore, pAllocator);
381}
382
383
384VKAPI_ATTR VkResult VKAPI_CALL vkCreateEvent(VkDevice device, const VkEventCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkEvent* pEvent)
385{
386 VkResult result = device_dispatch_table(device)->CreateEvent(device, pCreateInfo, pAllocator, pEvent);
387 return result;
388}
389
390
391VKAPI_ATTR void VKAPI_CALL vkDestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks* pAllocator)
392{
393 device_dispatch_table(device)->DestroyEvent(device, event, pAllocator);
394}
395
396
397VKAPI_ATTR VkResult VKAPI_CALL vkGetEventStatus(VkDevice device, VkEvent event)
398{
399 VkResult result = device_dispatch_table(device)->GetEventStatus(device, event);
400 return result;
401}
402
403
404VKAPI_ATTR VkResult VKAPI_CALL vkSetEvent(VkDevice device, VkEvent event)
405{
406 VkResult result = device_dispatch_table(device)->SetEvent(device, event);
407 return result;
408}
409
410
411VKAPI_ATTR VkResult VKAPI_CALL vkResetEvent(VkDevice device, VkEvent event)
412{
413 VkResult result = device_dispatch_table(device)->ResetEvent(device, event);
414 return result;
415}
416
417
418VKAPI_ATTR VkResult VKAPI_CALL vkCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkQueryPool* pQueryPool)
419{
420 VkResult result = device_dispatch_table(device)->CreateQueryPool(device, pCreateInfo, pAllocator, pQueryPool);
421 return result;
422}
423
424VKAPI_ATTR void VKAPI_CALL vkDestroyQueryPool(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks* pAllocator)
425{
426 device_dispatch_table(device)->DestroyQueryPool(device, queryPool, pAllocator);
427}
428
429
430VKAPI_ATTR VkResult VKAPI_CALL vkGetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void* pData, VkDeviceSize stride, VkQueryResultFlags flags)
431{
432 VkResult result = device_dispatch_table(device)->GetQueryPoolResults(device, queryPool, firstQuery, queryCount, dataSize, pData, stride, flags);
433 return result;
434}
435
436
437VKAPI_ATTR VkResult VKAPI_CALL vkCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer)
438{
439 VkResult result = device_dispatch_table(device)->CreateBuffer(device, pCreateInfo, pAllocator, pBuffer);
440 return result;
441}
442
443
444VKAPI_ATTR void VKAPI_CALL vkDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator)
445{
446 device_dispatch_table(device)->DestroyBuffer(device, buffer, pAllocator);
447}
448
449
450VKAPI_ATTR VkResult VKAPI_CALL vkCreateBufferView(VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBufferView* pView)
451{
452 VkResult result = device_dispatch_table(device)->CreateBufferView(device, pCreateInfo, pAllocator, pView);
453 return result;
454}
455
456
457VKAPI_ATTR void VKAPI_CALL vkDestroyBufferView(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks* pAllocator)
458{
459 device_dispatch_table(device)->DestroyBufferView(device, bufferView, pAllocator);
460}
461
462VKAPI_ATTR VkResult VKAPI_CALL vkCreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImage* pImage)
463{
464 VkResult result = device_dispatch_table(device)->CreateImage(device, pCreateInfo, pAllocator, pImage);
465 return result;
466}
467
468
469VKAPI_ATTR void VKAPI_CALL vkDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator)
470{
471 device_dispatch_table(device)->DestroyImage(device, image, pAllocator);
472}
473
474
475VKAPI_ATTR void VKAPI_CALL vkGetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout)
476{
477 device_dispatch_table(device)->GetImageSubresourceLayout(device, image, pSubresource, pLayout);
478}
479
480VKAPI_ATTR VkResult VKAPI_CALL vkCreateImageView(VkDevice device, const VkImageViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImageView* pView)
481{
482 VkResult result = device_dispatch_table(device)->CreateImageView(device, pCreateInfo, pAllocator, pView);
483 return result;
484}
485
486VKAPI_ATTR void VKAPI_CALL vkDestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator)
487{
488 device_dispatch_table(device)->DestroyImageView(device, imageView, pAllocator);
489}
490
491VKAPI_ATTR VkResult VKAPI_CALL vkCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule)
492{
493 VkResult result = device_dispatch_table(device)->CreateShaderModule(device, pCreateInfo, pAllocator, pShaderModule);
494 return result;
495}
496
497
498VKAPI_ATTR void VKAPI_CALL vkDestroyShaderModule(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks* pAllocator)
499{
500 device_dispatch_table(device)->DestroyShaderModule(device, shaderModule, pAllocator);
501}
502
503
504VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineCache* pPipelineCache)
505{
506 VkResult result = device_dispatch_table(device)->CreatePipelineCache(device, pCreateInfo, pAllocator, pPipelineCache);
507 return result;
508}
509
510VKAPI_ATTR void VKAPI_CALL vkDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks* pAllocator)
511{
512 device_dispatch_table(device)->DestroyPipelineCache(device, pipelineCache, pAllocator);
513}
514
515
516VKAPI_ATTR VkResult VKAPI_CALL vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData)
517{
518 VkResult result = device_dispatch_table(device)->GetPipelineCacheData(device, pipelineCache, pDataSize, pData);
519 return result;
520}
521
522
523VKAPI_ATTR VkResult VKAPI_CALL vkMergePipelineCaches(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches)
524{
525 VkResult result = device_dispatch_table(device)->MergePipelineCaches(device, dstCache, srcCacheCount, pSrcCaches);
526 return result;
527}
528
529
530VKAPI_ATTR VkResult VKAPI_CALL vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines)
531{
532 VkResult result = device_dispatch_table(device)->CreateGraphicsPipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines);
533 return result;
534}
535
536
537VKAPI_ATTR VkResult VKAPI_CALL vkCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines)
538{
539 VkResult result = device_dispatch_table(device)->CreateComputePipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines);
540 return result;
541}
542
543
544VKAPI_ATTR void VKAPI_CALL vkDestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* pAllocator)
545{
546 device_dispatch_table(device)->DestroyPipeline(device, pipeline, pAllocator);
547}
548
549
550VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineLayout* pPipelineLayout)
551{
552 VkResult result = device_dispatch_table(device)->CreatePipelineLayout(device, pCreateInfo, pAllocator, pPipelineLayout);
553 return result;
554}
555
556
557VKAPI_ATTR void VKAPI_CALL vkDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks* pAllocator)
558{
559 device_dispatch_table(device)->DestroyPipelineLayout(device, pipelineLayout, pAllocator);
560}
561
562
563VKAPI_ATTR VkResult VKAPI_CALL vkCreateSampler(VkDevice device, const VkSamplerCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSampler* pSampler)
564{
565 VkResult result = device_dispatch_table(device)->CreateSampler(device, pCreateInfo, pAllocator, pSampler);
566 return result;
567}
568
569
570VKAPI_ATTR void VKAPI_CALL vkDestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks* pAllocator)
571{
572 device_dispatch_table(device)->DestroySampler(device, sampler, pAllocator);
573}
574
575
576VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorSetLayout* pSetLayout)
577{
578 VkResult result = device_dispatch_table(device)->CreateDescriptorSetLayout(device, pCreateInfo, pAllocator, pSetLayout);
579 return result;
580}
581
582
583VKAPI_ATTR void VKAPI_CALL vkDestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks* pAllocator)
584{
585 device_dispatch_table(device)->DestroyDescriptorSetLayout(device, descriptorSetLayout, pAllocator);
586}
587
588
589VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorPool* pDescriptorPool)
590{
591 VkResult result = device_dispatch_table(device)->CreateDescriptorPool(device, pCreateInfo, pAllocator, pDescriptorPool);
592 return result;
593}
594
595VKAPI_ATTR void VKAPI_CALL vkDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks* pAllocator)
596{
597 device_dispatch_table(device)->DestroyDescriptorPool(device, descriptorPool, pAllocator);
598}
599
600
601VKAPI_ATTR VkResult VKAPI_CALL vkResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags)
602{
603 VkResult result = device_dispatch_table(device)->ResetDescriptorPool(device, descriptorPool, flags);
604 return result;
605}
606
607
608VKAPI_ATTR VkResult VKAPI_CALL vkAllocateDescriptorSets(VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets)
609{
610 VkResult result = device_dispatch_table(device)->AllocateDescriptorSets(device, pAllocateInfo, pDescriptorSets);
611 return result;
612}
613
614
615VKAPI_ATTR VkResult VKAPI_CALL vkFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets)
616{
617 VkResult result = device_dispatch_table(device)->FreeDescriptorSets(device, descriptorPool, descriptorSetCount, pDescriptorSets);
618 return result;
619}
620
621
622VKAPI_ATTR void VKAPI_CALL vkUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet* pDescriptorCopies)
623{
624 device_dispatch_table(device)->UpdateDescriptorSets(device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, pDescriptorCopies);
625}
626
627VKAPI_ATTR VkResult VKAPI_CALL vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFramebuffer* pFramebuffer)
628{
629 VkResult result = device_dispatch_table(device)->CreateFramebuffer(device, pCreateInfo, pAllocator, pFramebuffer);
630 return result;
631}
632
633
634VKAPI_ATTR void VKAPI_CALL vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* pAllocator)
635{
636 device_dispatch_table(device)->DestroyFramebuffer(device, framebuffer, pAllocator);
637}
638
639
640VKAPI_ATTR VkResult VKAPI_CALL vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass)
641{
642 VkResult result = device_dispatch_table(device)->CreateRenderPass(device, pCreateInfo, pAllocator, pRenderPass);
643 return result;
644}
645
646VKAPI_ATTR void VKAPI_CALL vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator)
647{
648 device_dispatch_table(device)->DestroyRenderPass(device, renderPass, pAllocator);
649}
650
651
652VKAPI_ATTR void VKAPI_CALL vkGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity)
653{
654 device_dispatch_table(device)->GetRenderAreaGranularity(device, renderPass, pGranularity);
655}
656
657
658VKAPI_ATTR VkResult VKAPI_CALL vkCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool)
659{
660 VkResult result = device_dispatch_table(device)->CreateCommandPool(device, pCreateInfo, pAllocator, pCommandPool);
661 return result;
662}
663
664
665VKAPI_ATTR void VKAPI_CALL vkDestroyCommandPool(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks* pAllocator)
666{
667 device_dispatch_table(device)->DestroyCommandPool(device, commandPool, pAllocator);
668}
669
670VKAPI_ATTR VkResult VKAPI_CALL vkResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags)
671{
672 VkResult result = device_dispatch_table(device)->ResetCommandPool(device, commandPool, flags);
673 return result;
674}
675
676VKAPI_ATTR VkResult VKAPI_CALL vkAllocateCommandBuffers(VkDevice device, const VkCommandBufferAllocateInfo* pAllocateInfo, VkCommandBuffer* pCommandBuffers)
677{
678 VkResult result = device_dispatch_table(device)->AllocateCommandBuffers(device, pAllocateInfo, pCommandBuffers);
679 return result;
680}
681
682VKAPI_ATTR void VKAPI_CALL vkFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers)
683{
684 device_dispatch_table(device)->FreeCommandBuffers(device, commandPool, commandBufferCount, pCommandBuffers);
685}
686
687
688VKAPI_ATTR VkResult VKAPI_CALL vkBeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo* pBeginInfo)
689{
690 VkResult result = device_dispatch_table(commandBuffer)->BeginCommandBuffer(commandBuffer, pBeginInfo);
691 return result;
692}
693
694
695VKAPI_ATTR VkResult VKAPI_CALL vkEndCommandBuffer(VkCommandBuffer commandBuffer)
696{
697 VkResult result = device_dispatch_table(commandBuffer)->EndCommandBuffer(commandBuffer);
698 return result;
699}
700
701
702VKAPI_ATTR VkResult VKAPI_CALL vkResetCommandBuffer(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags)
703{
704 VkResult result = device_dispatch_table(commandBuffer)->ResetCommandBuffer(commandBuffer, flags);
705 return result;
706}
707
708VKAPI_ATTR void VKAPI_CALL vkCmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline)
709{
710 device_dispatch_table(commandBuffer)->CmdBindPipeline(commandBuffer, pipelineBindPoint, pipeline);
711}
712
713
714VKAPI_ATTR void VKAPI_CALL vkCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport* pViewports)
715{
716 device_dispatch_table(commandBuffer)->CmdSetViewport(commandBuffer, firstViewport, viewportCount, pViewports);
717}
718
719
720VKAPI_ATTR void VKAPI_CALL vkCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D* pScissors)
721{
722 device_dispatch_table(commandBuffer)->CmdSetScissor(commandBuffer, firstScissor, scissorCount, pScissors);
723}
724
725
726VKAPI_ATTR void VKAPI_CALL vkCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth)
727{
728 device_dispatch_table(commandBuffer)->CmdSetLineWidth(commandBuffer, lineWidth);
729}
730
731
732VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor)
733{
734 device_dispatch_table(commandBuffer)->CmdSetDepthBias(commandBuffer, depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor);
735}
736
737
738VKAPI_ATTR void VKAPI_CALL vkCmdSetBlendConstants(VkCommandBuffer commandBuffer, const float blendConstants[4])
739{
740 device_dispatch_table(commandBuffer)->CmdSetBlendConstants(commandBuffer, blendConstants);
741}
742
743
744VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds)
745{
746 device_dispatch_table(commandBuffer)->CmdSetDepthBounds(commandBuffer, minDepthBounds, maxDepthBounds);
747}
748
749
750VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilCompareMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask)
751{
752 device_dispatch_table(commandBuffer)->CmdSetStencilCompareMask(commandBuffer, faceMask, compareMask);
753}
754
755
756VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilWriteMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask)
757{
758 device_dispatch_table(commandBuffer)->CmdSetStencilWriteMask(commandBuffer, faceMask, writeMask);
759}
760
761
762VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilReference(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference)
763{
764 device_dispatch_table(commandBuffer)->CmdSetStencilReference(commandBuffer, faceMask, reference);
765}
766
767
768VKAPI_ATTR void VKAPI_CALL vkCmdBindDescriptorSets(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets)
769{
770 device_dispatch_table(commandBuffer)->CmdBindDescriptorSets(commandBuffer, pipelineBindPoint, layout, firstSet, descriptorSetCount, pDescriptorSets, dynamicOffsetCount, pDynamicOffsets);
771}
772
773
774VKAPI_ATTR void VKAPI_CALL vkCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType)
775{
776 device_dispatch_table(commandBuffer)->CmdBindIndexBuffer(commandBuffer, buffer, offset, indexType);
777}
778
779
780VKAPI_ATTR void VKAPI_CALL vkCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets)
781{
782 device_dispatch_table(commandBuffer)->CmdBindVertexBuffers(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets);
783}
784
785
786VKAPI_ATTR void VKAPI_CALL vkCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance)
787{
788 device_dispatch_table(commandBuffer)->CmdDraw(commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance);
789}
790
791
792VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance)
793{
794 device_dispatch_table(commandBuffer)->CmdDrawIndexed(commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance);
795}
796
797
798VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride)
799{
800 device_dispatch_table(commandBuffer)->CmdDrawIndirect(commandBuffer, buffer, offset, drawCount, stride);
801}
802
803
804VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride)
805{
806 device_dispatch_table(commandBuffer)->CmdDrawIndexedIndirect(commandBuffer, buffer, offset, drawCount, stride);
807}
808
809
810VKAPI_ATTR void VKAPI_CALL vkCmdDispatch(VkCommandBuffer commandBuffer, uint32_t x, uint32_t y, uint32_t z)
811{
812 device_dispatch_table(commandBuffer)->CmdDispatch(commandBuffer, x, y, z);
813}
814
815
816VKAPI_ATTR void VKAPI_CALL vkCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset)
817{
818 device_dispatch_table(commandBuffer)->CmdDispatchIndirect(commandBuffer, buffer, offset);
819}
820
821
822VKAPI_ATTR void VKAPI_CALL vkCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy* pRegions)
823{
824 device_dispatch_table(commandBuffer)->CmdCopyBuffer(commandBuffer, srcBuffer, dstBuffer, regionCount, pRegions);
825}
826
827
828VKAPI_ATTR void VKAPI_CALL vkCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy* pRegions)
829{
830 device_dispatch_table(commandBuffer)->CmdCopyImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions);
831}
832
833
834VKAPI_ATTR void VKAPI_CALL vkCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageBlit* pRegions, VkFilter filter)
835{
836 device_dispatch_table(commandBuffer)->CmdBlitImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions, filter);
837}
838
839
840VKAPI_ATTR void VKAPI_CALL vkCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions)
841{
842 device_dispatch_table(commandBuffer)->CmdCopyBufferToImage(commandBuffer, srcBuffer, dstImage, dstImageLayout, regionCount, pRegions);
843}
844
845VKAPI_ATTR void VKAPI_CALL vkCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions)
846{
847 device_dispatch_table(commandBuffer)->CmdCopyImageToBuffer(commandBuffer, srcImage, srcImageLayout, dstBuffer, regionCount, pRegions);
848}
849
850
851VKAPI_ATTR void VKAPI_CALL vkCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const uint32_t* pData)
852{
853 device_dispatch_table(commandBuffer)->CmdUpdateBuffer(commandBuffer, dstBuffer, dstOffset, dataSize, pData);
854}
855
856VKAPI_ATTR void VKAPI_CALL vkCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data)
857{
858 device_dispatch_table(commandBuffer)->CmdFillBuffer(commandBuffer, dstBuffer, dstOffset, size, data);
859}
860
861
862VKAPI_ATTR void VKAPI_CALL vkCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges)
863{
864 device_dispatch_table(commandBuffer)->CmdClearColorImage(commandBuffer, image, imageLayout, pColor, rangeCount, pRanges);
865}
866
867VKAPI_ATTR void VKAPI_CALL vkCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges)
868{
869 device_dispatch_table(commandBuffer)->CmdClearDepthStencilImage(commandBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges);
870}
871
872
873VKAPI_ATTR void VKAPI_CALL vkCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkClearAttachment* pAttachments, uint32_t rectCount, const VkClearRect* pRects)
874{
875 device_dispatch_table(commandBuffer)->CmdClearAttachments(commandBuffer, attachmentCount, pAttachments, rectCount, pRects);
876}
877
878
879VKAPI_ATTR void VKAPI_CALL vkCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve* pRegions)
880{
881 device_dispatch_table(commandBuffer)->CmdResolveImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions);
882}
883
884
885VKAPI_ATTR void VKAPI_CALL vkCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask)
886{
887 device_dispatch_table(commandBuffer)->CmdSetEvent(commandBuffer, event, stageMask);
888}
889
890
891VKAPI_ATTR void VKAPI_CALL vkCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask)
892{
893 device_dispatch_table(commandBuffer)->CmdResetEvent(commandBuffer, event, stageMask);
894}
895
896
897VKAPI_ATTR void VKAPI_CALL vkCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers)
898{
899 device_dispatch_table(commandBuffer)->CmdWaitEvents(commandBuffer, eventCount, pEvents, srcStageMask, dstStageMask, memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount, pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers);
900}
901
902VKAPI_ATTR void VKAPI_CALL vkCmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers)
903{
904 device_dispatch_table(commandBuffer)->CmdPipelineBarrier(commandBuffer, srcStageMask, dstStageMask, dependencyFlags, memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount, pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers);
905}
906
907VKAPI_ATTR void VKAPI_CALL vkCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags)
908{
909 device_dispatch_table(commandBuffer)->CmdBeginQuery(commandBuffer, queryPool, query, flags);
910}
911
912VKAPI_ATTR void VKAPI_CALL vkCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query)
913{
914 device_dispatch_table(commandBuffer)->CmdEndQuery(commandBuffer, queryPool, query);
915}
916
917VKAPI_ATTR void VKAPI_CALL vkCmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount)
918{
919 device_dispatch_table(commandBuffer)->CmdResetQueryPool(commandBuffer, queryPool, firstQuery, queryCount);
920}
921
922VKAPI_ATTR void VKAPI_CALL vkCmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t query)
923{
924 device_dispatch_table(commandBuffer)->CmdWriteTimestamp(commandBuffer, pipelineStage, queryPool, query);
925}
926
927VKAPI_ATTR void VKAPI_CALL vkCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags)
928{
929 device_dispatch_table(commandBuffer)->CmdCopyQueryPoolResults(commandBuffer, queryPool, firstQuery, queryCount, dstBuffer, dstOffset, stride, flags);
930}
931
932VKAPI_ATTR void VKAPI_CALL vkCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void* pValues)
933{
934 device_dispatch_table(commandBuffer)->CmdPushConstants(commandBuffer, layout, stageFlags, offset, size, pValues);
935}
936
937VKAPI_ATTR void VKAPI_CALL vkCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkSubpassContents contents)
938{
939 device_dispatch_table(commandBuffer)->CmdBeginRenderPass(commandBuffer, pRenderPassBegin, contents);
940}
941
942VKAPI_ATTR void VKAPI_CALL vkCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents)
943{
944 device_dispatch_table(commandBuffer)->CmdNextSubpass(commandBuffer, contents);
945}
946
947VKAPI_ATTR void VKAPI_CALL vkCmdEndRenderPass(VkCommandBuffer commandBuffer)
948{
949 device_dispatch_table(commandBuffer)->CmdEndRenderPass(commandBuffer);
950}
951
952VKAPI_ATTR void VKAPI_CALL vkCmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers)
953{
954 device_dispatch_table(commandBuffer)->CmdExecuteCommands(commandBuffer, commandBufferCount, pCommandBuffers);
955}
956
957VKAPI_ATTR void VKAPI_CALL vkDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks* pAllocator)
958{
959 wrapped_inst_obj *inst;
960 auto vk_inst = unwrap_instance(instance, &inst);
961 inst->layer_disp.DestroySurfaceKHR(vk_inst, surface, pAllocator);
962}
963
964VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, VkSurfaceKHR surface, VkBool32* pSupported)
965{
966 wrapped_phys_dev_obj *phys_dev;
967 auto vk_phys_dev = unwrap_phys_dev(physicalDevice, &phys_dev);
968 VkResult result = phys_dev->inst->layer_disp.GetPhysicalDeviceSurfaceSupportKHR(vk_phys_dev, queueFamilyIndex, surface, pSupported);
969 return result;
970}
971
972
973VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR* pSurfaceCapabilities)
974{
975 wrapped_phys_dev_obj *phys_dev;
976 auto vk_phys_dev = unwrap_phys_dev(physicalDevice, &phys_dev);
977 VkResult result = phys_dev->inst->layer_disp.GetPhysicalDeviceSurfaceCapabilitiesKHR(vk_phys_dev, surface, pSurfaceCapabilities);
978 return result;
979}
980
981VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pSurfaceFormatCount, VkSurfaceFormatKHR* pSurfaceFormats)
982{
983 wrapped_phys_dev_obj *phys_dev;
984 auto vk_phys_dev = unwrap_phys_dev(physicalDevice, &phys_dev);
985 VkResult result = phys_dev->inst->layer_disp.GetPhysicalDeviceSurfaceFormatsKHR(vk_phys_dev, surface, pSurfaceFormatCount, pSurfaceFormats);
986 return result;
987}
988
989
990VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes)
991{
992 wrapped_phys_dev_obj *phys_dev;
993 auto vk_phys_dev = unwrap_phys_dev(physicalDevice, &phys_dev);
994 VkResult result = phys_dev->inst->layer_disp.GetPhysicalDeviceSurfacePresentModesKHR(vk_phys_dev, surface, pPresentModeCount, pPresentModes);
995 return result;
996}
997
998VKAPI_ATTR VkResult VKAPI_CALL vkCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchain)
999{
1000 VkResult result = device_dispatch_table(device)->CreateSwapchainKHR(device, pCreateInfo, pAllocator, pSwapchain);
1001 return result;
1002}
1003
1004VKAPI_ATTR void VKAPI_CALL vkDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks* pAllocator)
1005{
1006 device_dispatch_table(device)->DestroySwapchainKHR(device, swapchain, pAllocator);
1007}
1008
1009VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pSwapchainImageCount, VkImage* pSwapchainImages)
1010{
1011 VkResult result = device_dispatch_table(device)->GetSwapchainImagesKHR(device, swapchain, pSwapchainImageCount, pSwapchainImages);
1012 return result;
1013}
1014
1015VKAPI_ATTR VkResult VKAPI_CALL vkAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t* pImageIndex)
1016{
1017 VkResult result = device_dispatch_table(device)->AcquireNextImageKHR(device, swapchain, timeout, semaphore, fence, pImageIndex);
1018 return result;
1019}
1020
1021VKAPI_ATTR VkResult VKAPI_CALL vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR* pPresentInfo)
1022{
1023 VkResult result = device_dispatch_table(queue)->QueuePresentKHR(queue, pPresentInfo);
1024 return result;
1025}
1026
1027#ifdef VK_USE_PLATFORM_WIN32_KHR
1028
1029VKAPI_ATTR VkResult VKAPI_CALL
1030vkCreateWin32SurfaceKHR(VkInstance instance, const VkWin32SurfaceCreateInfoKHR *pCreateInfo,
1031 const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) {
1032 VkResult result;
1033 wrapped_inst_obj *inst;
1034 auto vk_inst = unwrap_instance(instance, &inst);
1035 result = inst->layer_disp.CreateWin32SurfaceKHR(vk_inst, pCreateInfo, pAllocator, pSurface);
1036 return result;
1037}
1038
1039VKAPI_ATTR VkBool32 VKAPI_CALL
1040vkGetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex) {
1041 VkBool32 result;
1042 wrapped_phys_dev_obj *phys_dev;
1043 auto vk_phys_dev = unwrap_phys_dev(physicalDevice, &phys_dev);
1044 result = phys_dev->inst->layer_disp.GetPhysicalDeviceWin32PresentationSupportKHR(vk_phys_dev, queueFamilyIndex);
1045 return result;
1046}
1047#endif // VK_USE_PLATFORM_WIN32_KHR
1048
1049#ifdef VK_USE_PLATFORM_XCB_KHR
1050
1051VKAPI_ATTR VkResult VKAPI_CALL vkCreateXcbSurfaceKHR(VkInstance instance, const VkXcbSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface)
1052{
1053 wrapped_inst_obj *inst;
1054 auto vk_inst = unwrap_instance(instance, &inst);
1055 VkResult result = inst->layer_disp.CreateXcbSurfaceKHR(vk_inst, pCreateInfo, pAllocator, pSurface);
1056 return result;
1057}
1058
1059VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXcbPresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id)
1060{
1061 wrapped_phys_dev_obj *phys_dev;
1062 auto vk_phys_dev = unwrap_phys_dev(physicalDevice, &phys_dev);
1063 VkBool32 result = phys_dev->inst->layer_disp.GetPhysicalDeviceXcbPresentationSupportKHR(vk_phys_dev, queueFamilyIndex, connection, visual_id);
1064 return result;
1065}
1066#endif // VK_USE_PLATFORM_XCB_KHR
1067
1068
1069#ifdef VK_USE_PLATFORM_XLIB_KHR
1070
1071VKAPI_ATTR VkResult VKAPI_CALL vkCreateXlibSurfaceKHR(VkInstance instance, const VkXlibSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface)
1072{
1073 wrapped_inst_obj *inst;
1074 auto vk_inst = unwrap_instance(instance, &inst);
1075 VkResult result = inst->layer_disp.CreateXlibSurfaceKHR(vk_inst, pCreateInfo, pAllocator, pSurface);
1076 return result;
1077}
1078
1079VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXlibPresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, Display* dpy, VisualID visualID)
1080{
1081 wrapped_phys_dev_obj *phys_dev;
1082 auto vk_phys_dev = unwrap_phys_dev(physicalDevice, &phys_dev);
1083 VkBool32 result = phys_dev->inst->layer_disp.GetPhysicalDeviceXlibPresentationSupportKHR(vk_phys_dev, queueFamilyIndex, dpy, visualID);
1084 return result;
1085}
1086#endif // VK_USE_PLATFORM_XLIB_KHR
1087
1088#ifdef VK_USE_PLATFORM_WAYLAND_KHR
1089
1090VKAPI_ATTR VkResult VKAPI_CALL vkCreateWaylandSurfaceKHR(VkInstance instance, const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface)
1091{
1092 wrapped_inst_obj *inst;
1093 auto vk_inst = unwrap_instance(instance, &inst);
1094 VkResult result = inst->layer_disp.CreateWaylandSurfaceKHR(vk_inst, pCreateInfo, pAllocator, pSurface);
1095 return result;
1096}
1097
1098VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWaylandPresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, struct wl_display* display)
1099{
1100 wrapped_phys_dev_obj *phys_dev;
1101 auto vk_phys_dev = unwrap_phys_dev(physicalDevice, &phys_dev);
1102 VkBool32 result = inst->layer_disp.GetPhysicalDeviceWaylandPresentationSupportKHR(vk_phys_dev, queueFamilyIndex, display);
1103 return result;
1104}
1105#endif // VK_USE_PLATFORM_WAYLAND_KHR
1106
1107
1108#ifdef VK_USE_PLATFORM_MIR_KHR
1109
1110
1111VKAPI_ATTR VkResult VKAPI_CALL vkCreateMirSurfaceKHR(VkInstance instance, const VkMirSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface)
1112{
1113 wrapped_inst_obj *inst;
1114 auto vk_inst = unwrap_instance(instance, &inst);
1115 VkResult result = inst->layer_disp.CreateMirSurfaceKHR(vk_inst, pCreateInfo, pAllocator, pSurface);
1116 return result;
1117}
1118
1119VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceMirPresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, MirConnection* connection)
1120{
1121 wrapped_phys_dev_obj *phys_dev;
1122 auto vk_phys_dev = unwrap_phys_dev(physicalDevice, &phys_dev);
1123 VkBool32 result = inst->layer_disp.GetPhysicalDeviceMirPresentationSupportKHR(vk_phys_dev, queueFamilyIndex, connection);
1124 return result;
1125}
1126#endif // VK_USE_PLATFORM_MIR_KHR
1127
1128VKAPI_ATTR VkResult VKAPI_CALL
1129vkCreateDebugReportCallbackEXT(VkInstance instance, const VkDebugReportCallbackCreateInfoEXT *pCreateInfo,
1130 const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackEXT *pMsgCallback) {
1131 wrapped_inst_obj *inst;
1132 auto vk_inst = unwrap_instance(instance, &inst);
1133
1134 VkResult res = inst->layer_disp.CreateDebugReportCallbackEXT(vk_inst, pCreateInfo, pAllocator, pMsgCallback);
1135 return res;
1136}
1137
1138VKAPI_ATTR void VKAPI_CALL
1139vkDestroyDebugReportCallbackEXT(VkInstance instance,
1140 VkDebugReportCallbackEXT msgCallback,
1141 const VkAllocationCallbacks *pAllocator) {
1142 wrapped_inst_obj *inst;
1143 auto vk_inst = unwrap_instance(instance, &inst);
1144 inst->layer_disp.DestroyDebugReportCallbackEXT(vk_inst, msgCallback, pAllocator);
1145}
1146
1147VKAPI_ATTR void VKAPI_CALL
1148vkDebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objType, uint64_t object,
1149 size_t location, int32_t msgCode, const char *pLayerPrefix, const char *pMsg) {
1150 wrapped_inst_obj *inst;
1151 auto vk_inst = unwrap_instance(instance, &inst);
1152 inst->layer_disp.DebugReportMessageEXT(vk_inst, flags, objType, object, location, msgCode, pLayerPrefix,
1153 pMsg);
1154}
1155
1156static inline PFN_vkVoidFunction layer_intercept_proc(const char *name)
1157{
1158 if (!name || name[0] != 'v' || name[1] != 'k')
1159 return NULL;
1160
1161 name += 2;
1162 if (!strcmp(name, "CreateInstance"))
1163 return (PFN_vkVoidFunction) vkCreateInstance;
1164 if (!strcmp(name, "DestroyInstance"))
1165 return (PFN_vkVoidFunction) vkDestroyInstance;
1166 if (!strcmp(name, "EnumeratePhysicalDevices"))
1167 return (PFN_vkVoidFunction) vkEnumeratePhysicalDevices;
1168 if (!strcmp(name, "GetPhysicalDeviceFeatures"))
1169 return (PFN_vkVoidFunction) vkGetPhysicalDeviceFeatures;
1170 if (!strcmp(name, "GetPhysicalDeviceFormatProperties"))
1171 return (PFN_vkVoidFunction) vkGetPhysicalDeviceFormatProperties;
1172 if (!strcmp(name, "GetPhysicalDeviceImageFormatProperties"))
1173 return (PFN_vkVoidFunction) vkGetPhysicalDeviceImageFormatProperties;
1174 if (!strcmp(name, "GetPhysicalDeviceProperties"))
1175 return (PFN_vkVoidFunction) vkGetPhysicalDeviceProperties;
1176 if (!strcmp(name, "GetPhysicalDeviceQueueFamilyProperties"))
1177 return (PFN_vkVoidFunction) vkGetPhysicalDeviceQueueFamilyProperties;
1178 if (!strcmp(name, "GetPhysicalDeviceMemoryProperties"))
1179 return (PFN_vkVoidFunction) vkGetPhysicalDeviceMemoryProperties;
1180 if (!strcmp(name, "CreateDevice"))
1181 return (PFN_vkVoidFunction) vkCreateDevice;
1182 if (!strcmp(name, "DestroyDevice"))
1183 return (PFN_vkVoidFunction) vkDestroyDevice;
1184 if (!strcmp(name, "GetDeviceQueue"))
1185 return (PFN_vkVoidFunction) vkGetDeviceQueue;
1186 if (!strcmp(name, "QueueSubmit"))
1187 return (PFN_vkVoidFunction) vkQueueSubmit;
1188 if (!strcmp(name, "QueueWaitIdle"))
1189 return (PFN_vkVoidFunction) vkQueueWaitIdle;
1190 if (!strcmp(name, "DeviceWaitIdle"))
1191 return (PFN_vkVoidFunction) vkDeviceWaitIdle;
1192 if (!strcmp(name, "AllocateMemory"))
1193 return (PFN_vkVoidFunction) vkAllocateMemory;
1194 if (!strcmp(name, "FreeMemory"))
1195 return (PFN_vkVoidFunction) vkFreeMemory;
1196 if (!strcmp(name, "MapMemory"))
1197 return (PFN_vkVoidFunction) vkMapMemory;
1198 if (!strcmp(name, "UnmapMemory"))
1199 return (PFN_vkVoidFunction) vkUnmapMemory;
1200 if (!strcmp(name, "FlushMappedMemoryRanges"))
1201 return (PFN_vkVoidFunction) vkFlushMappedMemoryRanges;
1202 if (!strcmp(name, "InvalidateMappedMemoryRanges"))
1203 return (PFN_vkVoidFunction) vkInvalidateMappedMemoryRanges;
1204 if (!strcmp(name, "GetDeviceMemoryCommitment"))
1205 return (PFN_vkVoidFunction) vkGetDeviceMemoryCommitment;
1206 if (!strcmp(name, "BindBufferMemory"))
1207 return (PFN_vkVoidFunction) vkBindBufferMemory;
1208 if (!strcmp(name, "BindImageMemory"))
1209 return (PFN_vkVoidFunction) vkBindImageMemory;
1210 if (!strcmp(name, "GetBufferMemoryRequirements"))
1211 return (PFN_vkVoidFunction) vkGetBufferMemoryRequirements;
1212 if (!strcmp(name, "GetImageMemoryRequirements"))
1213 return (PFN_vkVoidFunction) vkGetImageMemoryRequirements;
1214 if (!strcmp(name, "GetImageSparseMemoryRequirements"))
1215 return (PFN_vkVoidFunction) vkGetImageSparseMemoryRequirements;
1216 if (!strcmp(name, "GetPhysicalDeviceSparseImageFormatProperties"))
1217 return (PFN_vkVoidFunction) vkGetPhysicalDeviceSparseImageFormatProperties;
1218 if (!strcmp(name, "QueueBindSparse"))
1219 return (PFN_vkVoidFunction) vkQueueBindSparse;
1220 if (!strcmp(name, "CreateFence"))
1221 return (PFN_vkVoidFunction) vkCreateFence;
1222 if (!strcmp(name, "DestroyFence"))
1223 return (PFN_vkVoidFunction) vkDestroyFence;
1224 if (!strcmp(name, "ResetFences"))
1225 return (PFN_vkVoidFunction) vkResetFences;
1226 if (!strcmp(name, "GetFenceStatus"))
1227 return (PFN_vkVoidFunction) vkGetFenceStatus;
1228 if (!strcmp(name, "WaitForFences"))
1229 return (PFN_vkVoidFunction) vkWaitForFences;
1230 if (!strcmp(name, "CreateSemaphore"))
1231 return (PFN_vkVoidFunction) vkCreateSemaphore;
1232 if (!strcmp(name, "DestroySemaphore"))
1233 return (PFN_vkVoidFunction) vkDestroySemaphore;
1234 if (!strcmp(name, "CreateEvent"))
1235 return (PFN_vkVoidFunction) vkCreateEvent;
1236 if (!strcmp(name, "DestroyEvent"))
1237 return (PFN_vkVoidFunction) vkDestroyEvent;
1238 if (!strcmp(name, "GetEventStatus"))
1239 return (PFN_vkVoidFunction) vkGetEventStatus;
1240 if (!strcmp(name, "SetEvent"))
1241 return (PFN_vkVoidFunction) vkSetEvent;
1242 if (!strcmp(name, "ResetEvent"))
1243 return (PFN_vkVoidFunction) vkResetEvent;
1244 if (!strcmp(name, "CreateQueryPool"))
1245 return (PFN_vkVoidFunction) vkCreateQueryPool;
1246 if (!strcmp(name, "DestroyQueryPool"))
1247 return (PFN_vkVoidFunction) vkDestroyQueryPool;
1248 if (!strcmp(name, "GetQueryPoolResults"))
1249 return (PFN_vkVoidFunction) vkGetQueryPoolResults;
1250 if (!strcmp(name, "CreateBuffer"))
1251 return (PFN_vkVoidFunction) vkCreateBuffer;
1252 if (!strcmp(name, "DestroyBuffer"))
1253 return (PFN_vkVoidFunction) vkDestroyBuffer;
1254 if (!strcmp(name, "CreateBufferView"))
1255 return (PFN_vkVoidFunction) vkCreateBufferView;
1256 if (!strcmp(name, "DestroyBufferView"))
1257 return (PFN_vkVoidFunction) vkDestroyBufferView;
1258 if (!strcmp(name, "CreateImage"))
1259 return (PFN_vkVoidFunction) vkCreateImage;
1260 if (!strcmp(name, "DestroyImage"))
1261 return (PFN_vkVoidFunction) vkDestroyImage;
1262 if (!strcmp(name, "GetImageSubresourceLayout"))
1263 return (PFN_vkVoidFunction) vkGetImageSubresourceLayout;
1264 if (!strcmp(name, "CreateImageView"))
1265 return (PFN_vkVoidFunction) vkCreateImageView;
1266 if (!strcmp(name, "DestroyImageView"))
1267 return (PFN_vkVoidFunction) vkDestroyImageView;
1268 if (!strcmp(name, "CreateShaderModule"))
1269 return (PFN_vkVoidFunction) vkCreateShaderModule;
1270 if (!strcmp(name, "DestroyShaderModule"))
1271 return (PFN_vkVoidFunction) vkDestroyShaderModule;
1272 if (!strcmp(name, "CreatePipelineCache"))
1273 return (PFN_vkVoidFunction) vkCreatePipelineCache;
1274 if (!strcmp(name, "DestroyPipelineCache"))
1275 return (PFN_vkVoidFunction) vkDestroyPipelineCache;
1276 if (!strcmp(name, "GetPipelineCacheData"))
1277 return (PFN_vkVoidFunction) vkGetPipelineCacheData;
1278 if (!strcmp(name, "MergePipelineCaches"))
1279 return (PFN_vkVoidFunction) vkMergePipelineCaches;
1280 if (!strcmp(name, "CreateGraphicsPipelines"))
1281 return (PFN_vkVoidFunction) vkCreateGraphicsPipelines;
1282 if (!strcmp(name, "CreateComputePipelines"))
1283 return (PFN_vkVoidFunction) vkCreateComputePipelines;
1284 if (!strcmp(name, "DestroyPipeline"))
1285 return (PFN_vkVoidFunction) vkDestroyPipeline;
1286 if (!strcmp(name, "CreatePipelineLayout"))
1287 return (PFN_vkVoidFunction) vkCreatePipelineLayout;
1288 if (!strcmp(name, "DestroyPipelineLayout"))
1289 return (PFN_vkVoidFunction) vkDestroyPipelineLayout;
1290 if (!strcmp(name, "CreateSampler"))
1291 return (PFN_vkVoidFunction) vkCreateSampler;
1292 if (!strcmp(name, "DestroySampler"))
1293 return (PFN_vkVoidFunction) vkDestroySampler;
1294 if (!strcmp(name, "CreateDescriptorSetLayout"))
1295 return (PFN_vkVoidFunction) vkCreateDescriptorSetLayout;
1296 if (!strcmp(name, "DestroyDescriptorSetLayout"))
1297 return (PFN_vkVoidFunction) vkDestroyDescriptorSetLayout;
1298 if (!strcmp(name, "CreateDescriptorPool"))
1299 return (PFN_vkVoidFunction) vkCreateDescriptorPool;
1300 if (!strcmp(name, "DestroyDescriptorPool"))
1301 return (PFN_vkVoidFunction) vkDestroyDescriptorPool;
1302 if (!strcmp(name, "ResetDescriptorPool"))
1303 return (PFN_vkVoidFunction) vkResetDescriptorPool;
1304 if (!strcmp(name, "AllocateDescriptorSets"))
1305 return (PFN_vkVoidFunction) vkAllocateDescriptorSets;
1306 if (!strcmp(name, "FreeDescriptorSets"))
1307 return (PFN_vkVoidFunction) vkFreeDescriptorSets;
1308 if (!strcmp(name, "UpdateDescriptorSets"))
1309 return (PFN_vkVoidFunction) vkUpdateDescriptorSets;
1310 if (!strcmp(name, "CreateFramebuffer"))
1311 return (PFN_vkVoidFunction) vkCreateFramebuffer;
1312 if (!strcmp(name, "DestroyFramebuffer"))
1313 return (PFN_vkVoidFunction) vkDestroyFramebuffer;
1314 if (!strcmp(name, "CreateRenderPass"))
1315 return (PFN_vkVoidFunction) vkCreateRenderPass;
1316 if (!strcmp(name, "DestroyRenderPass"))
1317 return (PFN_vkVoidFunction) vkDestroyRenderPass;
1318 if (!strcmp(name, "GetRenderAreaGranularity"))
1319 return (PFN_vkVoidFunction) vkGetRenderAreaGranularity;
1320 if (!strcmp(name, "CreateCommandPool"))
1321 return (PFN_vkVoidFunction) vkCreateCommandPool;
1322 if (!strcmp(name, "DestroyCommandPool"))
1323 return (PFN_vkVoidFunction) vkDestroyCommandPool;
1324 if (!strcmp(name, "ResetCommandPool"))
1325 return (PFN_vkVoidFunction) vkResetCommandPool;
1326 if (!strcmp(name, "AllocateCommandBuffers"))
1327 return (PFN_vkVoidFunction) vkAllocateCommandBuffers;
1328 if (!strcmp(name, "FreeCommandBuffers"))
1329 return (PFN_vkVoidFunction) vkFreeCommandBuffers;
1330 if (!strcmp(name, "BeginCommandBuffer"))
1331 return (PFN_vkVoidFunction) vkBeginCommandBuffer;
1332 if (!strcmp(name, "EndCommandBuffer"))
1333 return (PFN_vkVoidFunction) vkEndCommandBuffer;
1334 if (!strcmp(name, "ResetCommandBuffer"))
1335 return (PFN_vkVoidFunction) vkResetCommandBuffer;
1336 if (!strcmp(name, "CmdBindPipeline"))
1337 return (PFN_vkVoidFunction) vkCmdBindPipeline;
1338 if (!strcmp(name, "CmdSetViewport"))
1339 return (PFN_vkVoidFunction) vkCmdSetViewport;
1340 if (!strcmp(name, "CmdSetScissor"))
1341 return (PFN_vkVoidFunction) vkCmdSetScissor;
1342 if (!strcmp(name, "CmdSetLineWidth"))
1343 return (PFN_vkVoidFunction) vkCmdSetLineWidth;
1344 if (!strcmp(name, "CmdSetDepthBias"))
1345 return (PFN_vkVoidFunction) vkCmdSetDepthBias;
1346 if (!strcmp(name, "CmdSetBlendConstants"))
1347 return (PFN_vkVoidFunction) vkCmdSetBlendConstants;
1348 if (!strcmp(name, "CmdSetDepthBounds"))
1349 return (PFN_vkVoidFunction) vkCmdSetDepthBounds;
1350 if (!strcmp(name, "CmdSetStencilCompareMask"))
1351 return (PFN_vkVoidFunction) vkCmdSetStencilCompareMask;
1352 if (!strcmp(name, "CmdSetStencilWriteMask"))
1353 return (PFN_vkVoidFunction) vkCmdSetStencilWriteMask;
1354 if (!strcmp(name, "CmdSetStencilReference"))
1355 return (PFN_vkVoidFunction) vkCmdSetStencilReference;
1356 if (!strcmp(name, "CmdBindDescriptorSets"))
1357 return (PFN_vkVoidFunction) vkCmdBindDescriptorSets;
1358 if (!strcmp(name, "CmdBindIndexBuffer"))
1359 return (PFN_vkVoidFunction) vkCmdBindIndexBuffer;
1360 if (!strcmp(name, "CmdBindVertexBuffers"))
1361 return (PFN_vkVoidFunction) vkCmdBindVertexBuffers;
1362 if (!strcmp(name, "CmdDraw"))
1363 return (PFN_vkVoidFunction) vkCmdDraw;
1364 if (!strcmp(name, "CmdDrawIndexed"))
1365 return (PFN_vkVoidFunction) vkCmdDrawIndexed;
1366 if (!strcmp(name, "CmdDrawIndirect"))
1367 return (PFN_vkVoidFunction) vkCmdDrawIndirect;
1368 if (!strcmp(name, "CmdDrawIndexedIndirect"))
1369 return (PFN_vkVoidFunction) vkCmdDrawIndexedIndirect;
1370 if (!strcmp(name, "CmdDispatch"))
1371 return (PFN_vkVoidFunction) vkCmdDispatch;
1372 if (!strcmp(name, "CmdDispatchIndirect"))
1373 return (PFN_vkVoidFunction) vkCmdDispatchIndirect;
1374 if (!strcmp(name, "CmdCopyBuffer"))
1375 return (PFN_vkVoidFunction) vkCmdCopyBuffer;
1376 if (!strcmp(name, "CmdCopyImage"))
1377 return (PFN_vkVoidFunction) vkCmdCopyImage;
1378 if (!strcmp(name, "CmdBlitImage"))
1379 return (PFN_vkVoidFunction) vkCmdBlitImage;
1380 if (!strcmp(name, "CmdCopyBufferToImage"))
1381 return (PFN_vkVoidFunction) vkCmdCopyBufferToImage;
1382 if (!strcmp(name, "CmdCopyImageToBuffer"))
1383 return (PFN_vkVoidFunction) vkCmdCopyImageToBuffer;
1384 if (!strcmp(name, "CmdUpdateBuffer"))
1385 return (PFN_vkVoidFunction) vkCmdUpdateBuffer;
1386 if (!strcmp(name, "CmdFillBuffer"))
1387 return (PFN_vkVoidFunction) vkCmdFillBuffer;
1388 if (!strcmp(name, "CmdClearColorImage"))
1389 return (PFN_vkVoidFunction) vkCmdClearColorImage;
1390 if (!strcmp(name, "CmdClearDepthStencilImage"))
1391 return (PFN_vkVoidFunction) vkCmdClearDepthStencilImage;
1392 if (!strcmp(name, "CmdClearAttachments"))
1393 return (PFN_vkVoidFunction) vkCmdClearAttachments;
1394 if (!strcmp(name, "CmdResolveImage"))
1395 return (PFN_vkVoidFunction) vkCmdResolveImage;
1396 if (!strcmp(name, "CmdSetEvent"))
1397 return (PFN_vkVoidFunction) vkCmdSetEvent;
1398 if (!strcmp(name, "CmdResetEvent"))
1399 return (PFN_vkVoidFunction) vkCmdResetEvent;
1400 if (!strcmp(name, "CmdWaitEvents"))
1401 return (PFN_vkVoidFunction) vkCmdWaitEvents;
1402 if (!strcmp(name, "CmdPipelineBarrier"))
1403 return (PFN_vkVoidFunction) vkCmdPipelineBarrier;
1404 if (!strcmp(name, "CmdBeginQuery"))
1405 return (PFN_vkVoidFunction) vkCmdBeginQuery;
1406 if (!strcmp(name, "CmdEndQuery"))
1407 return (PFN_vkVoidFunction) vkCmdEndQuery;
1408 if (!strcmp(name, "CmdResetQueryPool"))
1409 return (PFN_vkVoidFunction) vkCmdResetQueryPool;
1410 if (!strcmp(name, "CmdWriteTimestamp"))
1411 return (PFN_vkVoidFunction) vkCmdWriteTimestamp;
1412 if (!strcmp(name, "CmdCopyQueryPoolResults"))
1413 return (PFN_vkVoidFunction) vkCmdCopyQueryPoolResults;
1414 if (!strcmp(name, "CmdPushConstants"))
1415 return (PFN_vkVoidFunction) vkCmdPushConstants;
1416 if (!strcmp(name, "CmdBeginRenderPass"))
1417 return (PFN_vkVoidFunction) vkCmdBeginRenderPass;
1418 if (!strcmp(name, "CmdNextSubpass"))
1419 return (PFN_vkVoidFunction) vkCmdNextSubpass;
1420 if (!strcmp(name, "CmdEndRenderPass"))
1421 return (PFN_vkVoidFunction) vkCmdEndRenderPass;
1422 if (!strcmp(name, "CmdExecuteCommands"))
1423 return (PFN_vkVoidFunction) vkCmdExecuteCommands;
1424
1425 return NULL;
1426}
1427
1428static inline PFN_vkVoidFunction layer_intercept_instance_proc(const char *name)
1429{
1430 if (!name || name[0] != 'v' || name[1] != 'k')
1431 return NULL;
1432
1433 name += 2;
1434 if (!strcmp(name, "GetInstanceProcAddr"))
1435 return (PFN_vkVoidFunction)vkGetInstanceProcAddr;
1436 if (!strcmp(name, "DestroyInstance"))
1437 return (PFN_vkVoidFunction) vkDestroyInstance;
1438 if (!strcmp(name, "EnumeratePhysicalDevices"))
1439 return (PFN_vkVoidFunction) vkEnumeratePhysicalDevices;
1440 if (!strcmp(name, "GetPhysicalDeviceFeatures"))
1441 return (PFN_vkVoidFunction) vkGetPhysicalDeviceFeatures;
1442 if (!strcmp(name, "GetPhysicalDeviceFormatProperties"))
1443 return (PFN_vkVoidFunction) vkGetPhysicalDeviceFormatProperties;
1444 if (!strcmp(name, "GetPhysicalDeviceImageFormatProperties"))
1445 return (PFN_vkVoidFunction) vkGetPhysicalDeviceImageFormatProperties;
1446 if (!strcmp(name, "GetPhysicalDeviceProperties"))
1447 return (PFN_vkVoidFunction) vkGetPhysicalDeviceProperties;
1448 if (!strcmp(name, "GetPhysicalDeviceQueueFamilyProperties"))
1449 return (PFN_vkVoidFunction) vkGetPhysicalDeviceQueueFamilyProperties;
1450 if (!strcmp(name, "GetPhysicalDeviceMemoryProperties"))
1451 return (PFN_vkVoidFunction) vkGetPhysicalDeviceMemoryProperties;
1452 if (!strcmp(name, "GetPhysicalDeviceSparseImageFormatProperties"))
1453 return (PFN_vkVoidFunction) vkGetPhysicalDeviceSparseImageFormatProperties;
1454 if (!strcmp(name, "EnumerateDeviceExtensionProperties"))
1455 return (PFN_vkVoidFunction)vkEnumerateDeviceExtensionProperties;
1456 return NULL;
1457}
1458
1459VK_LAYER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetDeviceProcAddr(VkDevice device, const char* funcName)
1460{
1461 PFN_vkVoidFunction addr;
1462
1463
1464 if (!strcmp("vkGetDeviceProcAddr", funcName)) {
1465 return (PFN_vkVoidFunction) vkGetDeviceProcAddr;
1466 }
1467
1468 addr = layer_intercept_proc(funcName);
1469 if (addr)
1470 return addr;
1471 if (device == VK_NULL_HANDLE) {
1472 return NULL;
1473 }
1474
1475 if (!strcmp("vkCreateSwapchainKHR", funcName))
1476 return reinterpret_cast<PFN_vkVoidFunction>(vkCreateSwapchainKHR);
1477 if (!strcmp("vkDestroySwapchainKHR", funcName))
1478 return reinterpret_cast<PFN_vkVoidFunction>(vkDestroySwapchainKHR);
1479 if (!strcmp("vkGetSwapchainImagesKHR", funcName))
1480 return reinterpret_cast<PFN_vkVoidFunction>(vkGetSwapchainImagesKHR);
1481 if (!strcmp("vkAcquireNextImageKHR", funcName))
1482 return reinterpret_cast<PFN_vkVoidFunction>(vkAcquireNextImageKHR);
1483 if (!strcmp("vkQueuePresentKHR", funcName))
1484 return reinterpret_cast<PFN_vkVoidFunction>(vkQueuePresentKHR);
1485
1486 VkLayerDispatchTable *pDisp = device_dispatch_table(device);
1487 if (pDisp->GetDeviceProcAddr == NULL)
1488 {
1489 return NULL;
1490 }
1491
1492 return pDisp->GetDeviceProcAddr(device, funcName);
1493}
1494
1495VK_LAYER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(VkInstance instance, const char* funcName)
1496{
1497 PFN_vkVoidFunction addr;
1498
1499 if (!strcmp(funcName, "vkCreateInstance"))
1500 return (PFN_vkVoidFunction) vkCreateInstance;
1501 if (!strcmp(funcName, "vkCreateDevice"))
1502 return (PFN_vkVoidFunction) vkCreateDevice;
1503
1504 if (instance == VK_NULL_HANDLE) {
1505 return NULL;
1506 }
1507
1508 addr = layer_intercept_instance_proc(funcName);
1509 if (addr)
1510 return addr;
1511
1512 wrapped_inst_obj *inst;
1513 auto vk_inst = unwrap_instance(instance, &inst);
1514 VkLayerInstanceDispatchTable* pTable = &inst->layer_disp;
1515
1516 // EXT_debug_report
1517 if (!strcmp(funcName, "vkCreateDebugReportCallbackEXT"))
1518 return (PFN_vkVoidFunction)vkCreateDebugReportCallbackEXT;
1519 if (!strcmp(funcName, "vkDestroyDebugReportCallbackEXT"))
1520 return (PFN_vkVoidFunction)vkDestroyDebugReportCallbackEXT;
1521 if (!strcmp(funcName, "vkDebugReportMessageEXT"))
1522 return (PFN_vkVoidFunction)vkDebugReportMessageEXT;
1523
1524 //KHR_surface
1525 if (!strcmp("vkDestroySurfaceKHR", funcName))
1526 return reinterpret_cast<PFN_vkVoidFunction>(vkDestroySurfaceKHR);
1527 if (!strcmp("vkGetPhysicalDeviceSurfaceSupportKHR", funcName))
1528 return reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceSurfaceSupportKHR);
1529 if (!strcmp("vkGetPhysicalDeviceSurfaceCapabilitiesKHR", funcName))
1530 return reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceSurfaceCapabilitiesKHR);
1531 if (!strcmp("vkGetPhysicalDeviceSurfaceFormatsKHR", funcName))
1532 return reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceSurfaceFormatsKHR);
1533 if (!strcmp("vkGetPhysicalDeviceSurfacePresentModesKHR", funcName))
1534 return reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceSurfacePresentModesKHR);
1535
1536 // KHR_XXX_surface
1537#ifdef VK_USE_PLATFORM_XCB_KHR
1538 if (!strcmp("vkCreateXcbSurfaceKHR", funcName))
1539 return reinterpret_cast<PFN_vkVoidFunction>(vkCreateXcbSurfaceKHR);
1540 if (!strcmp("vkGetPhysicalDeviceXcbPresentationSupportKHR", funcName))
1541 return reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceXcbPresentationSupportKHR);
1542#endif // VK_USE_PLATFORM_XCB_KHR
1543#ifdef VK_USE_PLATFORM_XLIB_KHR
1544 if (!strcmp("vkCreateXlibSurfaceKHR", funcName))
1545 return reinterpret_cast<PFN_vkVoidFunction>(vkCreateXlibSurfaceKHR);
1546 if (!strcmp("vkGetPhysicalDeviceXlibPresentationSupportKHR", funcName))
1547 return reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceXlibPresentationSupportKHR);
1548#endif // VK_USE_PLATFORM_XLIB_KHR
1549#ifdef VK_USE_PLATFORM_MIR_KHR
1550 if (!strcmp("vkCreateMirSurfaceKHR", funcName))
1551 return reinterpret_cast<PFN_vkVoidFunction>(vkCreateMirSurfaceKHR);
1552 if (!strcmp("vkGetPhysicalDeviceMirPresentationSupportKHR", funcName))
1553 return reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceMirPresentationSupportKHR);
1554#endif // VK_USE_PLATFORM_MIR_KHR
1555#ifdef VK_USE_PLATFORM_WAYLAND_KHR
1556 if (!strcmp("vkCreateWaylandSurfaceKHR", funcName))
1557 return reinterpret_cast<PFN_vkVoidFunction>(vkCreateWaylandSurfaceKHR);
1558 if (!strcmp("vkGetPhysicalDeviceWaylandPresentationSupportKHR", funcName))
1559 return reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceWaylandPresentationSupportKHR);
1560#endif // VK_USE_PLATFORM_WAYLAND_KHR
1561#ifdef VK_USE_PLATFORM_WIN32_KHR
1562 if (!strcmp("vkCreateWin32SurfaceKHR", funcName))
1563 return reinterpret_cast<PFN_vkVoidFunction>(vkCreateWin32SurfaceKHR);
1564 if (!strcmp("vkGetPhysicalDeviceWin32PresentationSupportKHR", funcName))
1565 return reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceWin32PresentationSupportKHR);
1566#endif // VK_USE_PLATFORM_WIN32_KHR
1567
1568 if (pTable->GetInstanceProcAddr == NULL)
1569 return NULL;
1570 return pTable->GetInstanceProcAddr(instance, funcName);
1571}
1572
1573} // namespace wrap_objects
1574
1575// loader-layer interface v0, just wrappers since there is only a layer
1576VK_LAYER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(VkInstance instance, const char* funcName) {
1577 return wrap_objects::vkGetInstanceProcAddr(instance, funcName);
1578}
1579
1580VK_LAYER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetDeviceProcAddr(VkDevice device, const char* funcName) {
1581 return wrap_objects::vkGetDeviceProcAddr(device, funcName);
1582}
1583VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1584vkEnumerateInstanceExtensionProperties(const char *pLayerName, uint32_t *pCount, VkExtensionProperties *pProperties) {
1585 assert(0); // TODO return wrap_objects::EnumerateInstanceExtensionProperties(pLayerName, pCount, pProperties);
1586 return VK_SUCCESS;
1587}
1588
1589VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1590vkEnumerateInstanceLayerProperties(uint32_t *pCount, VkLayerProperties *pProperties) {
1591 assert(0); // TODO return wrap_objects::EnumerateInstanceLayerProperties(pCount, pProperties);
1592 return VK_SUCCESS;
1593}
1594
1595VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
1596vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t *pCount, VkLayerProperties *pProperties) {
1597 // the layer command handles VK_NULL_HANDLE just fine internally
1598 assert(physicalDevice == VK_NULL_HANDLE);
1599 assert(0); // TODO return wrap_objects::EnumerateDeviceLayerProperties(VK_NULL_HANDLE, pCount, pProperties);
1600 return VK_SUCCESS;
1601}
1602
1603VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice,
1604 const char *pLayerName, uint32_t *pCount,
1605 VkExtensionProperties *pProperties) {
1606 // the layer command handles VK_NULL_HANDLE just fine internally
1607 assert(physicalDevice == VK_NULL_HANDLE);
1608 return wrap_objects::vkEnumerateDeviceExtensionProperties(VK_NULL_HANDLE, pLayerName, pCount, pProperties);
1609}