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

30 lines
1.1 KiB
Rust
Raw Normal View History

2024-02-10 00:04:16 -05:00
//! Metal shader runtime errors.
use librashader_preprocess::PreprocessError;
use librashader_presets::ParsePresetError;
use librashader_reflect::error::{ShaderCompileError, ShaderReflectError};
use librashader_runtime::image::ImageError;
use thiserror::Error;
use librashader_common::{FilterMode, WrapMode};
/// Cumulative error type for Metal filter chains.
#[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),
#[error("sampler create error")]
SamplerError(WrapMode, FilterMode, FilterMode),
#[error("buffer creation error")]
BufferError
}
/// Result type for Metal filter chains.
pub type Result<T> = std::result::Result<T, FilterChainError>;