vulkan
vulkan copied to clipboard
SetDefaultGetInstanceProcAddr doesn't work on MacOS
Using SetDefaultGetInstanceProcAddr on MacOS just causes the error vulkan: error loading default getProcAddr. This is because:
- First, this function calls
setDefaultProcAddrhttps://github.com/vulkan-go/vulkan/blob/956e3850d8f9d2e617caf5a60622c638ff729c2b/init.go#L22 - In
setDefaultProcAddr, it callsgetDefaultProcAddrhttps://github.com/vulkan-go/vulkan/blob/956e3850d8f9d2e617caf5a60622c638ff729c2b/vk_wrapper_desktop.c#L14 - In
getDefaultProcAddr, for MacOS, it just returnsNULLhttps://github.com/vulkan-go/vulkan/blob/956e3850d8f9d2e617caf5a60622c638ff729c2b/vk_default_loader.c#L35-L37 - In
SetDefaultGetInstanceProcAddr, it checks forisProcAddrSethttps://github.com/vulkan-go/vulkan/blob/956e3850d8f9d2e617caf5a60622c638ff729c2b/init.go#L23-L25 - In
isProcAddrSet, it checks if it is equal toNULLhttps://github.com/vulkan-go/vulkan/blob/956e3850d8f9d2e617caf5a60622c638ff729c2b/vk_wrapper_desktop.c#L18
Therefore, on MacOS, isProcAddrSet will always return false. Why is it like this? Is there a way to get around this error? If you ignore it, you just get an error about proc addr not being set in Init.