2023-01-13 19:19:58 +11:00
|
|
|
//! Vulkan shader runtime errors.
|
2023-02-10 10:11:34 +11:00
|
|
|
use gpu_allocator::AllocationError;
|
2023-01-13 17:19:41 +11:00
|
|
|
use librashader_preprocess::PreprocessError;
|
|
|
|
use librashader_presets::ParsePresetError;
|
|
|
|
use librashader_reflect::error::{ShaderCompileError, ShaderReflectError};
|
|
|
|
use librashader_runtime::image::ImageError;
|
|
|
|
use thiserror::Error;
|
2022-12-06 17:01:21 +11:00
|
|
|
|
2023-01-13 19:19:58 +11:00
|
|
|
/// Cumulative error type for Vulkan filter chains.
|
2023-01-13 17:19:41 +11:00
|
|
|
#[derive(Error, Debug)]
|
|
|
|
pub enum FilterChainError {
|
|
|
|
#[error("SPIRV reflection error")]
|
|
|
|
SpirvCrossReflectError(#[from] spirv_cross::ErrorCode),
|
|
|
|
#[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("vulkan error")]
|
|
|
|
VulkanResult(#[from] ash::vk::Result),
|
2023-01-14 08:10:54 +11:00
|
|
|
#[error("could not find a valid vulkan memory type")]
|
|
|
|
VulkanMemoryError(u32),
|
2023-02-10 10:11:34 +11:00
|
|
|
#[error("could not allocate gpu memory")]
|
|
|
|
AllocationError(#[from] AllocationError),
|
|
|
|
#[error("allocation is already freed")]
|
|
|
|
AllocationDoesNotExist,
|
2023-01-13 17:19:41 +11:00
|
|
|
}
|
|
|
|
|
2023-01-13 19:19:58 +11:00
|
|
|
/// Result type for Vulkan filter chains.
|
2023-01-13 17:19:41 +11:00
|
|
|
pub type Result<T> = std::result::Result<T, FilterChainError>;
|