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: InstanceThe wgpu instance
adapter: AdapterThe 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: DeviceThe 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: QueueThe 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>(
on_result: F,
required_features: Features,
backends: Option<Backends>,
window: Arc<dyn Window>,
) -> Receiver<Result<(GpuResources, Surface<'static>), GpuResourceError>>
pub fn request<F>( on_result: F, required_features: Features, backends: Option<Backends>, window: Arc<dyn Window>, ) -> Receiver<Result<(GpuResources, 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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more