2023-01-13 03:19:58 -05:00
|
|
|
//! OpenGL shader runtime errors.
|
|
|
|
|
2022-11-21 17:44:38 -05:00
|
|
|
use gl::types::GLenum;
|
|
|
|
use librashader_preprocess::PreprocessError;
|
|
|
|
use librashader_presets::ParsePresetError;
|
|
|
|
use librashader_reflect::error::{ShaderCompileError, ShaderReflectError};
|
2022-12-21 21:39:31 -05:00
|
|
|
use librashader_runtime::image::ImageError;
|
2022-11-21 17:44:38 -05:00
|
|
|
use thiserror::Error;
|
|
|
|
|
2023-01-13 03:19:58 -05:00
|
|
|
/// Cumulative error type for OpenGL filter chains.
|
2022-11-21 17:44:38 -05:00
|
|
|
#[derive(Error, Debug)]
|
|
|
|
pub enum FilterChainError {
|
|
|
|
#[error("fbo initialization error")]
|
|
|
|
FramebufferInit(GLenum),
|
|
|
|
#[error("SPIRV reflection error")]
|
2024-09-04 20:49:20 -04:00
|
|
|
SpirvCrossReflectError(#[from] spirv_cross2::SpirvCrossError),
|
2022-11-21 17:44:38 -05:00
|
|
|
#[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")]
|
2022-11-30 01:38:05 -05:00
|
|
|
LutLoadError(#[from] ImageError),
|
2022-12-03 19:07:15 -05:00
|
|
|
#[error("opengl was not initialized")]
|
2022-12-21 21:39:31 -05:00
|
|
|
GLLoadError,
|
2023-01-11 18:25:31 -05:00
|
|
|
#[error("opengl could not link program")]
|
|
|
|
GLLinkError,
|
2023-01-13 16:10:54 -05:00
|
|
|
#[error("opengl could not compile program")]
|
2023-01-15 03:06:09 -05:00
|
|
|
GlCompileError,
|
2022-11-21 17:44:38 -05:00
|
|
|
}
|
|
|
|
|
2023-01-13 03:19:58 -05:00
|
|
|
/// Result type for OpenGL filter chains.
|
2022-11-30 01:38:05 -05:00
|
|
|
pub type Result<T> = std::result::Result<T, FilterChainError>;
|