You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now the Vulkan library is loaded in the loader module. Depending on the operating system the path to the library is different.
When trying to add support for MoltenVK, this became a problem because MoltenVK is a static library that must be linked at compile-time. PR #301 tweaks the loader module to have a totally different behavior on OSX.
However it would be great to not rely on any platform-specific behavior, in case the user wants to use a custom way of accessing Vulkan. Therefore I suggest adding Instance::with_loading_function:
implInstance{pubunsafefnwith_loading_function(f:*constc_void, ... other params ...) -> Result<Instance, ...>{
...}}
The function f passed to with_loading_function must be the implementation vkGetInstanceProcAddr, and will be used by vulkano to load everything.
The Instance::new function would be modified to use Instance::with_loading_function under the hood.
With this change Instance::new would try to work transparently on all major platforms, but the user could choose a custom implementation/behavior.
The text was updated successfully, but these errors were encountered:
Unfortunately what I didn't think about is that getting the list of layers and extensions also requires loading the function pointers.
Therefore we will need some sort of intermediate object I think.
Example:
let vk_library = unsafe{LoadedLibrary::from_function(...)};let layers = vk_library.layers_supported_by_core();let instance = Instance::with_library(vk_library).unwrap();
Right now the Vulkan library is loaded in the
loader
module. Depending on the operating system the path to the library is different.When trying to add support for MoltenVK, this became a problem because MoltenVK is a static library that must be linked at compile-time. PR #301 tweaks the
loader
module to have a totally different behavior on OSX.However it would be great to not rely on any platform-specific behavior, in case the user wants to use a custom way of accessing Vulkan. Therefore I suggest adding
Instance::with_loading_function
:The function
f
passed towith_loading_function
must be the implementationvkGetInstanceProcAddr
, and will be used by vulkano to load everything.The
Instance::new
function would be modified to useInstance::with_loading_function
under the hood.With this change
Instance::new
would try to work transparently on all major platforms, but the user could choose a custom implementation/behavior.The text was updated successfully, but these errors were encountered: