Struct ash::EntryCustom[][src]

pub struct EntryCustom<L> { /* fields omitted */ }

Function loader

Implementations

impl<L> EntryCustom<L>[src]

pub fn new_custom<Load>(lib: L, load: Load) -> Self where
    Load: FnMut(&mut L, &CStr) -> *const c_void
[src]

pub fn try_enumerate_instance_version(&self) -> VkResult<Option<u32>>[src]

https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkEnumerateInstanceVersion.html

let entry = Entry::new()?;
match entry.try_enumerate_instance_version()? {
    // Vulkan 1.1+
    Some(version) => {
        let major = vk::version_major(version);
        let minor = vk::version_minor(version);
        let patch = vk::version_patch(version);
    },
    // Vulkan 1.0
    None => {},
}

impl EntryCustom<Arc<Library>>[src]

pub unsafe fn new() -> Result<Entry, LoadingError>[src]

Load default Vulkan library for the current platform

Safety

dlopening native libraries is inherently unsafe. The safety guidelines for Library::new and Library::get apply here.

use ash::{vk, Entry, version::EntryV1_0};
let entry = Entry::new()?;
let app_info = vk::ApplicationInfo {
    api_version: vk::make_version(1, 0, 0),
    ..Default::default()
};
let create_info = vk::InstanceCreateInfo {
    p_application_info: &app_info,
    ..Default::default()
};
let instance = unsafe { entry.create_instance(&create_info, None)? };

pub unsafe fn with_library(
    path: &impl AsRef<OsStr>
) -> Result<Entry, LoadingError>
[src]

Load Vulkan library at path

Safety

dlopening native libraries is inherently unsafe. The safety guidelines for Library::new and Library::get apply here.

Trait Implementations

impl<L: Clone> Clone for EntryCustom<L>[src]

impl<L> EntryV1_0 for EntryCustom<L>[src]

impl<L> EntryV1_1 for EntryCustom<L>[src]

impl<L> EntryV1_2 for EntryCustom<L>[src]

Auto Trait Implementations

impl<L> RefUnwindSafe for EntryCustom<L> where
    L: RefUnwindSafe

impl<L> Send for EntryCustom<L> where
    L: Send

impl<L> Sync for EntryCustom<L> where
    L: Sync

impl<L> Unpin for EntryCustom<L> where
    L: Unpin

impl<L> UnwindSafe for EntryCustom<L> where
    L: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.