pub struct Application {
config: AppConfig,
instance: Instance,
adapter: Adapter,
device: Device,
queue: Queue,
stage: Stage,
}Expand description
Root wgpu context.
Owns the Instance, Adapter, Device, and Queue. Construct with
Application::new (async, await with a runtime such as pollster).
Headless only in M0.4 — surface attachment lands in M0.5.
Fields§
§config: AppConfig§instance: Instance§adapter: Adapter§device: Device§queue: Queue§stage: StageImplementations§
Source§impl Application
impl Application
Sourcepub fn from_wgpu(
instance: Instance,
adapter: Adapter,
device: Device,
queue: Queue,
config: AppConfig,
) -> Self
pub fn from_wgpu( instance: Instance, adapter: Adapter, device: Device, queue: Queue, config: AppConfig, ) -> Self
Adopt a pre-existing wgpu context (e.g. from eframe).
All four wgpu resources are cloned into the Application; wgpu types
are Arc-backed so this is cheap. Use this instead of Application::new
when integrating with an embedding host that owns the device.
Sourcepub async fn new(config: AppConfig) -> Result<Self, Error>
pub async fn new(config: AppConfig) -> Result<Self, Error>
Construct a new Application.
§Errors
Error::AdapterUnavailableif no compatible GPU adapter is found.Error::DeviceRequestif device creation fails.
Sourcepub fn adapter_info(&self) -> AdapterInfo
pub fn adapter_info(&self) -> AdapterInfo
Adapter info (name, backend, device type, driver).
Auto Trait Implementations§
impl Freeze for Application
impl !RefUnwindSafe for Application
impl Send for Application
impl Sync for Application
impl Unpin for Application
impl UnsafeUnpin for Application
impl !UnwindSafe for Application
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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