Struct ash::EntryCustom[][src]

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

Holds a custom type L to load symbols from (usually a handle to a dlopened library), the vkGetInstanceProcAddr loader function from this library (in vk::StaticFn), and Vulkan’s “entry point” functions (resolved with NULL instance) as listed in vkGetInstanceProcAddr’s description.

Implementations

Vulkan core 1.0

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

let entry = unsafe { 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 => {},
}

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

Safety

In order for the created Instance to be valid for the duration of its usage, the Entry this was called on must be dropped later than the resulting Instance.

Vulkan core 1.1

👎 Deprecated:

This function is unavailable and therefore panics on Vulkan 1.0, please use try_enumerate_instance_version instead

Vulkan core 1.2

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};
let entry = unsafe { Entry::new() }?;
let app_info = vk::ApplicationInfo {
    api_version: vk::make_api_version(0, 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)? };

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.