pub struct VulkanoContext { /* private fields */ }
Expand description
A utility struct to create, access and hold alive Vulkano device, instance and queues.
Vulkano context is used in the creation of your graphics or compute pipelines, images and
in the creation of VulkanoWindowRenderer
through
VulkanoWindows
.
§Examples
use vulkano_util::context::{VulkanoConfig, VulkanoContext};
fn test() {
let context = VulkanoContext::new(VulkanoConfig::default());
// Then create event loop, windows, pipelines, etc.
}
Implementations§
Source§impl VulkanoContext
impl VulkanoContext
Sourcepub fn new(config: VulkanoConfig) -> Self
pub fn new(config: VulkanoConfig) -> Self
Sourcepub fn device_name(&self) -> &str
pub fn device_name(&self) -> &str
Returns the name of the device.
Sourcepub fn device_type(&self) -> PhysicalDeviceType
pub fn device_type(&self) -> PhysicalDeviceType
Returns the type of the device.
Sourcepub fn max_memory(&self) -> u32
pub fn max_memory(&self) -> u32
Returns the maximum memory allocation of the device.
Sourcepub fn graphics_queue(&self) -> &Arc<Queue>
pub fn graphics_queue(&self) -> &Arc<Queue>
Returns the graphics queue.
Sourcepub fn compute_queue(&self) -> &Arc<Queue>
pub fn compute_queue(&self) -> &Arc<Queue>
Returns the compute queue.
Depending on your device, this might be the same as the graphics queue.
Sourcepub fn transfer_queue(&self) -> Option<&Arc<Queue>>
pub fn transfer_queue(&self) -> Option<&Arc<Queue>>
Returns the transfer queue, if the device has a queue family that is dedicated for transfers (does not support graphics or compute).
Sourcepub fn memory_allocator(&self) -> &Arc<StandardMemoryAllocator>
pub fn memory_allocator(&self) -> &Arc<StandardMemoryAllocator>
Returns the memory allocator.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VulkanoContext
impl !RefUnwindSafe for VulkanoContext
impl Send for VulkanoContext
impl Sync for VulkanoContext
impl Unpin for VulkanoContext
impl !UnwindSafe for VulkanoContext
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.