diff --git a/Cargo.toml b/Cargo.toml index ac2fd94..231348f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,6 +25,7 @@ build = "build/build.rs" # in this range, not just the start and the end, to be sure it's compatible. version = ">=0.35, <=0.37" default-features = false +features = ["linked"] [build-dependencies] anyhow = "1.0" diff --git a/src/lib.rs b/src/lib.rs index f0fc048..e328907 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,19 +1,5 @@ -use ash::{vk, Entry}; +use ash::Entry; -extern "system" { - fn vkGetInstanceProcAddr( - instance: vk::Instance, - p_name: *const std::os::raw::c_char, - ) -> vk::PFN_vkVoidFunction; -} - -/// Fetches the function pointer to `vkGetInstanceProcAddr` which is statically linked. pub fn load() -> Entry { - let static_fn = vk::StaticFn { - get_instance_proc_addr: vkGetInstanceProcAddr, - }; - #[allow(unsafe_code)] - unsafe { - Entry::from_static_fn(static_fn) - } + Entry::linked() }