pub struct MultiDispatcher(/* private fields */);Expand description
MultiDispatcher Dispatcher implementation which stores vulkan commands on the heap using smart pointers This adds a small overhead:
- Smart Vulkan handles must store an additional pointer
- Creating/dropping smart Vulkan Handles has the additional cost of cloning/dropping a std::sync::Arc
If you only use at most one vulkan instance and one device at any given time, you should use DynamicDispatcher instead
When the
loadedfeature is enabled and the dispatcher is loaded with MultiDispatcher::new_loaded, The vulkan library will be unloaded as soon as all dispatchers are dropped
Trait Implementations§
Source§impl Clone for MultiDispatcher
impl Clone for MultiDispatcher
Source§fn clone(&self) -> MultiDispatcher
fn clone(&self) -> MultiDispatcher
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Dispatcher for MultiDispatcher
impl Dispatcher for MultiDispatcher
Source§fn get_command_dispatcher(&self) -> &CommandsDispatcher
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
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
fn clone_with_instance(&self, instance: &Instance) -> Self
fn clone_with_device(&self, device: &Device) -> Self
Source§unsafe fn new_loaded() -> Result<Self, LoadingError>
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
Auto Trait Implementations§
impl Freeze for MultiDispatcher
impl !RefUnwindSafe for MultiDispatcher
impl Send for MultiDispatcher
impl Sync for MultiDispatcher
impl Unpin for MultiDispatcher
impl !UnwindSafe for MultiDispatcher
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more