pub struct WGPU { /* private fields */ }Expand description
A wrapper for a WGPU instance, surface, adapter, device, queue, and surface configuration.
Implementations§
Source§impl WGPU
impl WGPU
Sourcepub fn with_resources(
instance: Arc<Instance>,
adapter: Arc<Adapter>,
device: Arc<Device>,
queue: Arc<Queue>,
) -> Self
pub fn with_resources( instance: Arc<Instance>, adapter: Arc<Adapter>, device: Arc<Device>, queue: Arc<Queue>, ) -> Self
Create a WGPU structure with already-created GPU resources.
Sourcepub async fn new(
instance: Arc<Instance>,
surface: Option<&Surface<'static>>,
) -> Result<Self, Box<dyn Error>>
pub async fn new( instance: Arc<Instance>, surface: Option<&Surface<'static>>, ) -> Result<Self, Box<dyn Error>>
Create a WGPU structure by initializing WGPU for display onto the given surface.
Sourcepub fn is_gl(&self) -> bool
pub fn is_gl(&self) -> bool
Returns true if this GPU interface is using a GL backend, important to work around some bugs
pub fn is_web(&self) -> bool
Sourcepub fn supports_storage(&self) -> bool
pub fn supports_storage(&self) -> bool
Whether this GPU supports storage buffers
Sourcepub fn instance(&self) -> &Instance
pub fn instance(&self) -> &Instance
Returns this GPU wrapper’s wgpu::Instance.
Sourcepub fn adapter(&self) -> &Adapter
pub fn adapter(&self) -> &Adapter
Returns this GPU wrapper’s wgpu::Adapter.
Sourcepub fn device(&self) -> &Device
pub fn device(&self) -> &Device
Returns this GPU wrapper’s wgpu::Device.
Sourcepub fn queue(&self) -> &Queue
pub fn queue(&self) -> &Queue
Returns this GPU wrapper’s wgpu::Queue.
Auto Trait Implementations§
impl Freeze for WGPU
impl !RefUnwindSafe for WGPU
impl Send for WGPU
impl Sync for WGPU
impl Unpin for WGPU
impl !UnwindSafe for WGPU
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.