librashader/librashader-runtime-wgpu/src/error.rs

28 lines
998 B
Rust
Raw Normal View History

2024-02-07 10:42:32 +11:00
//! wgpu shader runtime errors.
2023-11-30 16:52:49 +11:00
use librashader_preprocess::PreprocessError;
use librashader_presets::ParsePresetError;
use librashader_reflect::error::{ShaderCompileError, ShaderReflectError};
use librashader_runtime::image::ImageError;
use thiserror::Error;
2024-02-07 10:42:32 +11:00
/// Cumulative error type for wgpu filter chains.
2023-11-30 16:52:49 +11:00
#[derive(Error, Debug)]
2024-08-21 14:37:35 +10:00
#[non_exhaustive]
2023-11-30 16:52:49 +11:00
pub enum FilterChainError {
#[error("shader preset parse error")]
ShaderPresetError(#[from] ParsePresetError),
#[error("shader preprocess error")]
ShaderPreprocessError(#[from] PreprocessError),
#[error("shader compile error")]
ShaderCompileError(#[from] ShaderCompileError),
#[error("shader reflect error")]
ShaderReflectError(#[from] ShaderReflectError),
#[error("lut loading error")]
LutLoadError(#[from] ImageError),
#[error("unreachable")]
Infallible(#[from] std::convert::Infallible),
2023-11-30 16:52:49 +11:00
}
2024-02-07 10:42:32 +11:00
/// Result type for wgpu filter chains.
2023-11-30 16:52:49 +11:00
pub type Result<T> = std::result::Result<T, FilterChainError>;