pub struct VulkanLibrary { /* private fields */ }
Expand description

A loaded library containing a valid Vulkan implementation.

Implementations§

source§

impl VulkanLibrary

source

pub fn new() -> Result<Arc<Self>, LoadingError>

Loads the default Vulkan library for this system.

source

pub fn with_loader( loader: impl Loader + 'static ) -> Result<Arc<Self>, LoadingError>

Loads a custom Vulkan library.

source

pub fn fns(&self) -> &EntryFunctions

Returns pointers to the raw global Vulkan functions of the library.

source

pub fn api_version(&self) -> Version

Returns the highest Vulkan version that is supported for instances.

source

pub fn extension_properties(&self) -> &[ExtensionProperties]

Returns the extension properties reported by the core library.

source

pub fn supported_extensions(&self) -> &InstanceExtensions

Returns the extensions that are supported by the core library.

source

pub fn layer_properties( &self ) -> Result<impl ExactSizeIterator<Item = LayerProperties>, VulkanError>

Returns the list of layers that are available when creating an instance.

On success, this function returns an iterator that produces LayerProperties objects. In order to enable a layer, you need to pass its name (returned by LayerProperties::name()) when creating the Instance.

Note: The available layers may change between successive calls to this function, so each call may return different results. It is possible that one of the layers enumerated here is no longer available when you create the Instance. This will lead to an error when calling Instance::new.

Examples
use vulkano::VulkanLibrary;

let library = VulkanLibrary::new().unwrap();

for layer in library.layer_properties().unwrap() {
    println!("Available layer: {}", layer.name());
}
source

pub fn layer_extension_properties( &self, layer: &str ) -> Result<Vec<ExtensionProperties>, VulkanError>

Returns the extension properties that are reported by the given layer.

source

pub fn supported_layer_extensions( &self, layer: &str ) -> Result<InstanceExtensions, VulkanError>

Returns the extensions that are supported by the given layer.

source

pub fn supported_extensions_with_layers<'a>( &self, layers: impl IntoIterator<Item = &'a str> ) -> Result<InstanceExtensions, VulkanError>

Returns the union of the extensions that are supported by the core library and all the given layers.

source

pub unsafe fn get_instance_proc_addr( &self, instance: Instance, name: *const c_char ) -> PFN_vkVoidFunction

Calls get_instance_proc_addr on the underlying loader.

Trait Implementations§

source§

impl Debug for VulkanLibrary

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.