Struct DynamicDispatcher

Source
pub struct DynamicDispatcher(/* private fields */);
Expand description

Dynamic dispatcher Dispatcher implementation loading commands in static memory. This is a cost-free abstraction assuming you follow the safety rule below. Cloning this object is free (the object has size 0 and the clone function is empty) and it never makes any heap allocation. Use this dispatcher if you can.

§Safety

Using a dynamic dispatcher means that at any point, only at most one vulkan instance and at most one vulkan device exists. This is the case for most Vulkan program but if you cannot guarantee it, use MultiDispatcher instead

Implementations§

Source§

impl DynamicDispatcher

Source

pub unsafe fn unload()

Unloads the loaded library

§Safety:
  • Only call this function if the dispatcher was loaded with Dispatcher::new_loaded.
  • Only call this function after all vulkan handles have been freed/destroyed
  • You cannot call any vulkan command before creating a new dispatcher.
  • There should be a call to Dispatcher::new_loaded between two consecutive calls to Self::unload

Trait Implementations§

Source§

impl Clone for DynamicDispatcher

Source§

fn clone(&self) -> DynamicDispatcher

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Dispatcher for DynamicDispatcher

Source§

fn get_command_dispatcher(&self) -> &CommandsDispatcher

Return the associated vk::CommandsDispatcher with this Dispatcher You can then use the command table to call any command that has been loaded or load new commands
Source§

unsafe fn new(get_instance_proc_addr: GetInstanceProcAddrSignature) -> Self

Create a new dispatcher given the get_instance_proc_addr entry point this will load basic (non-instance and non-device dependent) commands Read more
Source§

fn clone_with_instance(&self, instance: &Instance) -> Self

Source§

fn clone_with_device(&self, device: &Device) -> Self

Source§

unsafe fn new_loaded() -> Result<Self, LoadingError>

Create a loads the Vulkan library, retrieve the entry point from it and initialize the dispatcher using it* This will return an error if the vulkan library or its entry point cannot be found Library unloading depends on the implementation, for MultiDispatcher it happends as soon as all dispatcher are dropped. While for DynamicDispatcher one should call DynamicDispatcher::unload() SAFETY: Read more
Source§

unsafe fn new_loaded_and_lib() -> Result<(Self, Library), LoadingError>

Internal function used to load a library and return the dispatcher along with a library object which ensures the llibrary is kept loaded while the object is alive Read more
Source§

impl Copy for DynamicDispatcher

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.
Source§

impl<T> Alias<T> for T