pub struct GpuResources {
pub instance: Instance,
pub adapter: Adapter,
pub device: Device,
pub queue: Queue,
}
Expand description
The acquired GPU resources needed for rendering with wgpu.
Fields§
§instance: Instance
The wgpu instance
adapter: Adapter
The adapter that represents the GPU or a rendering backend. It provides information about
the capabilities of the hardware and is used to request a logical device (wgpu::Device
).
device: Device
The logical device that serves as an interface to the GPU. It is responsible for creating
resources such as buffers, textures, and pipelines, and manages the execution of commands.
The device
provides a connection to the physical hardware represented by the adapter
.
queue: Queue
The command queue that manages the submission of command buffers to the GPU for execution.
It is used to send rendering and computation commands to the device. The queue
ensures
that commands are executed in the correct order and manages synchronization.
Implementations§
Source§impl GpuResources
impl GpuResources
Sourcepub fn request<F: Fn(WindowId) + 'static>(
on_result: F,
required_features: Features,
window: Arc<dyn Window>,
) -> Receiver<Result<(Self, Surface<'static>), GpuResourceError>>
pub fn request<F: Fn(WindowId) + 'static>( on_result: F, required_features: Features, window: Arc<dyn Window>, ) -> Receiver<Result<(Self, Surface<'static>), GpuResourceError>>
Request GPU resources
§Parameters
on_result
: Function to notify upon completion or error.window
: The window to associate with the created surface.
Trait Implementations§
Source§impl Clone for GpuResources
impl Clone for GpuResources
Source§fn clone(&self) -> GpuResources
fn clone(&self) -> GpuResources
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for GpuResources
impl !RefUnwindSafe for GpuResources
impl Send for GpuResources
impl Sync for GpuResources
impl Unpin for GpuResources
impl !UnwindSafe for GpuResources
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.