charles-lunarg / vk-bootstrap

Vulkan Bootstrapping Iibrary
MIT License
821 stars 82 forks source link

Cleanup internal class VulkanFunctions #226

Closed charles-lunarg closed 1 year ago

charles-lunarg commented 1 year ago

Removes the subclassing of VulkanLibrary, bringing its logic into the VulkanFunctions class. This resolves a weird linking issue which was causing hot-reloading of shared libraries that statically linked vk-bootstrap to fail to unload correctly, preventing reloading. The commit also consolidates the logic in load_vulkan_funcs() into a single function rather than having it be split in three, which only made the code harder to reason about.

Also made vk-bootstrap look for libMoltenVK.dylib on apple platforms, in case the application only has the MoltenVK shared library but not the loader (and the user didn't manually load GetInstanceProcAddr from MoltenVK then give it to vk-bootstrap).

ADillon1 commented 1 year ago

This worked on my end @charles-lunarg!