pub enum RenderError {
Show 16 variants
AdapterNotFound,
DeviceError(String),
SurfaceCreation(String),
ShaderFileRead {
path: String,
source: Error,
},
GlslParse {
name: String,
details: String,
},
WgslParse {
name: String,
details: String,
},
ShaderValidation {
name: String,
details: String,
},
WgslGeneration {
name: String,
details: String,
},
NoActiveShader(String),
ImageLoad {
path: String,
source: ImageError,
},
InvalidTextureData {
expected: usize,
actual: usize,
},
CubemapGeometry(String),
CubemapFaceNotFound(String),
Surface(SurfaceError),
ScreenshotMap(String),
ScreenshotImageAssembly,
}Expand description
Top-level error type for the GPU rendering engine.
Covers the main failure categories that callers may want to distinguish:
- GPU initialisation (adapter, device, surface)
- Shader compilation and reload
- Image / texture loading
- GPU surface / presentation
- Screenshot capture
Variants§
AdapterNotFound
A suitable wgpu GPU adapter could not be found for the given surface.
DeviceError(String)
The wgpu device could not be created or the device was lost.
SurfaceCreation(String)
The wgpu surface could not be created for the window.
ShaderFileRead
The shader source file could not be read from disk.
Fields
GlslParse
The GLSL source could not be parsed (transpilation step 1).
WgslParse
The intermediate WGSL source could not be parsed.
ShaderValidation
The shader module failed naga validation.
WgslGeneration
WGSL generation (from the naga IR) failed.
NoActiveShader(String)
A shader reload was requested but no shader is currently active, or a shader compilation error occurred during reload.
ImageLoad
An image file could not be opened or decoded.
Fields
source: ImageErrorUnderlying image error.
InvalidTextureData
The supplied raw RGBA byte slice has an unexpected length.
Fields
CubemapGeometry(String)
A cubemap face image is not square or all faces are not the same size.
CubemapFaceNotFound(String)
A required cubemap face file could not be found on disk.
Surface(SurfaceError)
Surface::get_current_texture() failed (timeout, outdated, lost, …).
ScreenshotMap(String)
The GPU buffer could not be mapped back to CPU memory, or a render step during screenshot capture failed.
ScreenshotImageAssembly
The pixel data could not be assembled into a final RgbaImage.
Trait Implementations§
Source§impl Debug for RenderError
impl Debug for RenderError
Source§impl Display for RenderError
impl Display for RenderError
Source§impl Error for RenderError
impl Error for RenderError
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
Source§impl From<CreateSurfaceError> for RenderError
impl From<CreateSurfaceError> for RenderError
Source§fn from(e: CreateSurfaceError) -> Self
fn from(e: CreateSurfaceError) -> Self
Source§impl From<RequestDeviceError> for RenderError
impl From<RequestDeviceError> for RenderError
Source§fn from(e: RequestDeviceError) -> Self
fn from(e: RequestDeviceError) -> Self
Source§impl From<SurfaceError> for RenderError
impl From<SurfaceError> for RenderError
Source§fn from(source: SurfaceError) -> Self
fn from(source: SurfaceError) -> Self
Auto Trait Implementations§
impl Freeze for RenderError
impl !RefUnwindSafe for RenderError
impl Send for RenderError
impl Sync for RenderError
impl Unpin for RenderError
impl UnsafeUnpin for RenderError
impl !UnwindSafe for RenderError
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> 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<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