pub enum WgpuBackendError {
NoAdapter,
CreateSurface(String),
Init(String),
RequestDevice(String),
Surface(SurfaceError),
}Expand description
Errors that can occur while initializing or presenting through wgpu.
§Examples
use cotis_wgpu::WgpuBackendError;
assert_eq!(
WgpuBackendError::NoAdapter.to_string(),
"no compatible wgpu adapter found"
);
assert_eq!(
WgpuBackendError::Init("window closed".into()).to_string(),
"failed to initialize renderer: window closed"
);Variants§
NoAdapter
No compatible GPU adapter was found during GPU device initialization.
Occurs when wgpu cannot enumerate a suitable adapter for the current platform.
CreateSurface(String)
Failed to create the window surface from the winit window handle.
Returned by crate::surface::SurfaceState::new when create_surface_unsafe fails.
Init(String)
Failed to initialize the winit event loop or create the window.
Also returned when the window is closed before bootstrap completes.
RequestDevice(String)
Failed to request a logical device and queue from the adapter.
Occurs when wgpu request_device fails during startup.
Surface(SurfaceError)
The swapchain surface reported an error while acquiring or presenting a frame.
crate::surface::SurfaceState::acquire_frame retries once on
wgpu::SurfaceError::Lost or wgpu::SurfaceError::Outdated after reconfiguring.
Trait Implementations§
Source§impl Debug for WgpuBackendError
impl Debug for WgpuBackendError
Source§impl Display for WgpuBackendError
impl Display for WgpuBackendError
Source§impl Error for WgpuBackendError
impl Error for WgpuBackendError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<EventLoopError> for WgpuBackendError
impl From<EventLoopError> for WgpuBackendError
Source§fn from(value: EventLoopError) -> Self
fn from(value: EventLoopError) -> Self
Auto Trait Implementations§
impl Freeze for WgpuBackendError
impl RefUnwindSafe for WgpuBackendError
impl Send for WgpuBackendError
impl Sync for WgpuBackendError
impl Unpin for WgpuBackendError
impl UnsafeUnpin for WgpuBackendError
impl UnwindSafe for WgpuBackendError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<H, TailTarget, Source, Idx> Embed<RenderTList<H, TailTarget>, There<Idx>> for Sourcewhere
TailTarget: IsRenderList,
Source: Embed<TailTarget, Idx>,
impl<H, TailTarget, Source, Idx> Embed<RenderTList<H, TailTarget>, There<Idx>> for Sourcewhere
TailTarget: IsRenderList,
Source: Embed<TailTarget, Idx>,
Source§fn embed(self) -> RenderTList<H, TailTarget>
fn embed(self) -> RenderTList<H, TailTarget>
self into Target.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