pub fn auto_loader()
    -> Result<&'static FunctionPointers<Box<Loader + Send + Sync>>, LoadingError>
{
    #[cfg(target_os = "ios")]
    #[allow(non_snake_case)]
    fn def_loader_impl() -> Result<Box<Loader + Send + Sync>, LoadingError> {
        let loader = statically_linked_vulkan_loader!();
        Ok(Box::new(loader))
    }

    #[cfg(not(target_os = "ios"))]
    fn def_loader_impl() -> Result<Box<Loader + Send + Sync>, LoadingError> {
        #[cfg(windows)]
        fn get_path() -> &'static Path {
            Path::new("vulkan-1.dll")
        }
        #[cfg(all(unix, not(target_os = "android"), not(target_os = "macos")))]
        fn get_path() -> &'static Path {
            Path::new("libvulkan.so.1")
        }
        #[cfg(target_os = "macos")]
        fn get_path() -> &'static Path {
            Path::new("libvulkan.1.dylib")
        }
        #[cfg(target_os = "android")]
        fn get_path() -> &'static Path {
            Path::new("libvulkan.so")
        }

        let loader = unsafe { DynamicLibraryLoader::new(get_path())? };

        Ok(Box::new(loader))
    }

    lazy_static! {
        static ref DEFAULT_LOADER: Result<FunctionPointers<Box<Loader + Send + Sync>>, LoadingError> = {
            def_loader_impl().map(FunctionPointers::new)
        };
    }

    match DEFAULT_LOADER.deref() {
        &Ok(ref ptr) => Ok(ptr),
        &Err(ref err) => Err(err.clone()),
    }
}
/// Returns the default `FunctionPointers` for this system.
///
/// This function tries to auto-guess where to find the Vulkan implementation, and loads it in a
/// `lazy_static!`. The content of the lazy_static is then returned, or an error if we failed to
/// load Vulkan.
Returns the default `FunctionPointers` for this system.
This function tries to auto-guess where to find the Vulkan implementation, and loads it in a
`lazy_static!`. The content of the lazy_static is then returned, or an error if we failed to
load Vulkan.
Returns the default ` FunctionPointers ` for this system . This function tries to auto - guess where to find the Vulkan implementation and loads it in a ` lazy_static! ` . The content of the lazy_static is then returned or an error if we failed to load Vulkan .
pub fn auto_loader()
    -> Result<&'static FunctionPointers<Box<Loader + Send + Sync>>, LoadingError>
{
    #[cfg(target_os = "ios")]
    #[allow(non_snake_case)]
    fn def_loader_impl() -> Result<Box<Loader + Send + Sync>, LoadingError> {
        let loader = statically_linked_vulkan_loader!();
        Ok(Box::new(loader))
    }
    #[cfg(not(target_os = "ios"))]
    fn def_loader_impl() -> Result<Box<Loader + Send + Sync>, LoadingError> {
        #[cfg(windows)]
        fn get_path() -> &'static Path {
            Path::new("vulkan-1.dll")
        }
        #[cfg(all(unix, not(target_os = "android"), not(target_os = "macos")))]
        fn get_path() -> &'static Path {
            Path::new("libvulkan.so.1")
        }
        #[cfg(target_os = "macos")]
        fn get_path() -> &'static Path {
            Path::new("libvulkan.1.dylib")
        }
        #[cfg(target_os = "android")]
        fn get_path() -> &'static Path {
            Path::new("libvulkan.so")
        }
        let loader = unsafe { DynamicLibraryLoader::new(get_path())? };
        Ok(Box::new(loader))
    }
    lazy_static! {
        static ref DEFAULT_LOADER: Result<FunctionPointers<Box<Loader + Send + Sync>>, LoadingError> = {
            def_loader_impl().map(FunctionPointers::new)
        };
    }
    match DEFAULT_LOADER.deref() {
        &Ok(ref ptr) => Ok(ptr),
        &Err(ref err) => Err(err.clone()),
    }
}
pub fn auto_loader ( ) -> Result < & ' static FunctionPointers < Box < Loader + Send + Sync > > , LoadingError > { # [ cfg ( target_os " " ) ] # [ allow ( non_snake_case ) ] fn def_loader_impl ( ) -> Result < Box < Loader + Send + Sync > , LoadingError > { let loader = statically_linked_vulkan_loader ! ( ) ; Ok ( Box :: new ( loader ) ) } # [ cfg ( not ( target_os " " ) ) ] fn def_loader_impl ( ) -> Result < Box < Loader + Send + Sync > , LoadingError > { # [ cfg ( windows ) ] fn get_path ( ) -> & ' static Path { Path :: new ( " " ) } # [ cfg ( all ( unix not ( target_os " " ) not ( target_os " " ) ) ) ] fn get_path ( ) -> & ' static Path { Path :: new ( " " ) } # [ cfg ( target_os " " ) ] fn get_path ( ) -> & ' static Path { Path :: new ( " " ) } # [ cfg ( target_os " " ) ] fn get_path ( ) -> & ' static Path { Path :: new ( " " ) } let loader = unsafe { DynamicLibraryLoader :: new ( get_path ( ) ) ? } ; Ok ( Box :: new ( loader ) ) } lazy_static ! { static ref DEFAULT_LOADER Result FunctionPointers Box Loader Send Sync LoadingError { def_loader_impl ( ) map ( FunctionPointers new ) } } match DEFAULT_LOADER . deref ( ) { & Ok ( ref ptr ) => Ok ( ptr ) , & Err ( ref err ) => Err ( err . clone ( ) ) , } }
Returns the default `FunctionPointers` for this system.
Returns the default ` FunctionPointers ` for this system .