Closed rcoreilly closed 5 years ago
figured it out -- just including vulkan/vulkan.h directly in my .m file and then I can access vkGetInstanceProcAddr directly from there -- and need to add vulkan as a link framework too. i.e., just needed to go down to the vulkan level instead of using the vulkan-go wrappers at this point.
I'm trying to integrate vulkan-go into my graphics package which has its own existing platform-specific backends, so I don't want to use GLFW. I want to be able to call e.g., vkCreateMacOSSurfaceMVK on macos to create a surface. As far as I've been able to determine, I need to do something like this:
to get the function pointer, and then I can call that.
but everything depends on that vgo_vkGetInstanceProcAddr which is in turn based on a static getInstanceProcAddress in vk_wrapper_desktop.c
would it be possible to export that somehow? or is there some way I can get access to that variable without having to reimplement my own copy of the code that gets it in the first place?
alternatively, can all the platform-specific create surface routines such as vkCreateMacOSSurfaceMVK be exported in a way that would be visible inside my cgo .m objective-C files? not sure how that would even work -- don't want to get into complicated pathing / config issues to find the cgo headers from vulkan-go.. I tried various ways of declaring them as extern vars and nothing has worked.
I might have missed something obvious here -- I'm a newbie to vulkan[-go]. Thanks!