librashader_runtime_gl/
error.rs

1//! OpenGL shader runtime errors.
2
3use librashader_preprocess::PreprocessError;
4use librashader_presets::ParsePresetError;
5use librashader_reflect::error::{ShaderCompileError, ShaderReflectError};
6use librashader_runtime::image::ImageError;
7use thiserror::Error;
8
9/// Cumulative error type for OpenGL filter chains.
10#[derive(Error, Debug)]
11#[non_exhaustive]
12pub enum FilterChainError {
13    #[error("fbo initialization error {0:x}")]
14    FramebufferInit(u32),
15    #[error("SPIRV reflection error")]
16    SpirvCrossReflectError(#[from] spirv_cross2::SpirvCrossError),
17    #[error("shader preset parse error")]
18    ShaderPresetError(#[from] ParsePresetError),
19    #[error("shader preprocess error")]
20    ShaderPreprocessError(#[from] PreprocessError),
21    #[error("shader compile error")]
22    ShaderCompileError(#[from] ShaderCompileError),
23    #[error("shader reflect error")]
24    ShaderReflectError(#[from] ShaderReflectError),
25    #[error("lut loading error")]
26    LutLoadError(#[from] ImageError),
27    #[error("opengl was not initialized")]
28    GLLoadError,
29    #[error("opengl could not link program")]
30    GLLinkError,
31    #[error("opengl could not compile program")]
32    GlCompileError,
33    #[error("opengl could not create samplers")]
34    GlSamplerError,
35    #[error("opengl could not create samplers")]
36    GlProgramError,
37    #[error("an invalid framebuffer was provided to frame")]
38    GlInvalidFramebuffer,
39    #[error("opengl error: {0}")]
40    GlError(String),
41    #[error("unreachable")]
42    Infallible(#[from] std::convert::Infallible),
43}
44
45/// Result type for OpenGL filter chains.
46pub type Result<T> = std::result::Result<T, FilterChainError>;