2023-11-30 16:52:49 +11:00
|
|
|
//! Vulkan shader runtime errors.
|
|
|
|
use librashader_preprocess::PreprocessError;
|
|
|
|
use librashader_presets::ParsePresetError;
|
|
|
|
use librashader_reflect::error::{ShaderCompileError, ShaderReflectError};
|
|
|
|
use librashader_runtime::image::ImageError;
|
|
|
|
use std::convert::Infallible;
|
|
|
|
use thiserror::Error;
|
|
|
|
|
2023-12-16 22:28:41 +11:00
|
|
|
/// Cumulative error type for WGPU filter chains.
|
2023-11-30 16:52:49 +11:00
|
|
|
#[derive(Error, Debug)]
|
|
|
|
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),
|
|
|
|
}
|
|
|
|
|
|
|
|
impl From<Infallible> for FilterChainError {
|
|
|
|
fn from(_value: Infallible) -> Self {
|
|
|
|
panic!("uninhabited error")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Result type for Vulkan filter chains.
|
|
|
|
pub type Result<T> = std::result::Result<T, FilterChainError>;
|