mirror of
https://github.com/KhronosGroup/Vulkan-Utility-Libraries.git
synced 2025-05-31 08:57:57 +00:00

Fixes the vk_layer_dispatch_table.h header file so that they can be used in other projects. The contents of this header and vk_dispatch_table_helper.h have been moved into a new header vul_dispatch_table.h. The structs VulDeviceDispatchTable and VulInstanceDispatchTable struct contain function pointers for the device and instance, respectively. The functions vul_init_device_dispatch_table and vul_init_instance_dispatch_table fill out the aforementioned structs, making the task of setting up the disptach table in a layer much simpler.
31 lines
878 B
C
31 lines
878 B
C
// Copyright 2023 The Khronos Group Inc.
|
|
// Copyright 2023 Valve Corporation
|
|
// Copyright 2023 LunarG, Inc.
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
#include <vulkan/utility/vul_dispatch_table.h>
|
|
|
|
PFN_vkVoidFunction local_vkGetInstanceProcAddr(VkInstance instance, const char *pName) {
|
|
(void)instance;
|
|
(void)pName;
|
|
return NULL;
|
|
}
|
|
|
|
PFN_vkVoidFunction local_vkGetDeviceProcAddr(VkDevice device, const char *pName) {
|
|
(void)device;
|
|
(void)pName;
|
|
return NULL;
|
|
}
|
|
|
|
void foobar() {
|
|
VulDeviceDispatchTable device_dispatch_table;
|
|
VulInstanceDispatchTable instance_dispatch_table;
|
|
|
|
VkInstance instance = VK_NULL_HANDLE;
|
|
|
|
vulInitInstanceDispatchTable(instance, &instance_dispatch_table, local_vkGetInstanceProcAddr);
|
|
|
|
VkDevice device = VK_NULL_HANDLE;
|
|
|
|
vulInitDeviceDispatchTable(device, &device_dispatch_table, local_vkGetDeviceProcAddr);
|
|
}
|