mirror of
https://github.com/KhronosGroup/Vulkan-Utility-Libraries.git
synced 2025-05-15 01:08:39 +00:00
parent
881049b977
commit
d7418625d9
4 changed files with 29 additions and 10 deletions
|
@ -10,20 +10,29 @@
|
|||
#include <vulkan/utility/vk_dispatch_table.h>
|
||||
|
||||
// Only exists so that local_vkGetDeviceProcAddr can return a 'real' function pointer
|
||||
inline void empty_func() {}
|
||||
inline VKAPI_ATTR void empty_func() {}
|
||||
|
||||
inline PFN_vkVoidFunction local_vkGetInstanceProcAddr(VkInstance instance, const char *pName) {
|
||||
if (instance == VK_NULL_HANDLE) return NULL;
|
||||
inline VKAPI_ATTR PFN_vkVoidFunction local_vkGetInstanceProcAddr(VkInstance instance, const char *pName) {
|
||||
if (instance == VK_NULL_HANDLE) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (strcmp(pName, "vkGetInstanceProcAddr")) return reinterpret_cast<PFN_vkVoidFunction>(&local_vkGetInstanceProcAddr);
|
||||
if (strcmp(pName, "vkGetInstanceProcAddr")) {
|
||||
return reinterpret_cast<PFN_vkVoidFunction>(&local_vkGetInstanceProcAddr);
|
||||
}
|
||||
|
||||
return reinterpret_cast<PFN_vkVoidFunction>(&empty_func);
|
||||
}
|
||||
|
||||
inline PFN_vkVoidFunction local_vkGetDeviceProcAddr(VkDevice device, const char *pName) {
|
||||
if (device == VK_NULL_HANDLE) return NULL;
|
||||
inline VKAPI_ATTR PFN_vkVoidFunction local_vkGetDeviceProcAddr(VkDevice device, const char *pName) {
|
||||
if (device == VK_NULL_HANDLE) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (strcmp(pName, "vkGetDeviceProcAddr")) {
|
||||
return reinterpret_cast<PFN_vkVoidFunction>(&local_vkGetDeviceProcAddr);
|
||||
}
|
||||
|
||||
if (strcmp(pName, "vkGetDeviceProcAddr")) return reinterpret_cast<PFN_vkVoidFunction>(&local_vkGetDeviceProcAddr);
|
||||
return reinterpret_cast<PFN_vkVoidFunction>(&empty_func);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue