27 lines
952 B
Rust
27 lines
952 B
Rust
//! Error types for the renderer crate.
|
|
|
|
use thiserror::Error;
|
|
|
|
#[derive(Debug, Error)]
|
|
/// Enumerates all possible errors that can occur during rendering operations.
|
|
pub enum RendererError {
|
|
/// The Vulkan library could not be loaded from the system.
|
|
#[error("Failed to load Vulkan library")]
|
|
LoadFailed(#[from] ash::LoadingError),
|
|
/// A raw Vulkan result indicated a failure.
|
|
#[error("Vulkan error")]
|
|
VulkanError(#[from] ash::vk::Result),
|
|
/// No GPU was found that meets the engine's requirements.
|
|
#[error("No suitable GPU found")]
|
|
NoSuitableGpu,
|
|
/// An error occurred during GPU memory allocation.
|
|
#[error("GPU allocation error")]
|
|
AllocationError(#[from] gpu_allocator::AllocationError),
|
|
/// An I/O error occurred (e.g. reading a shader).
|
|
#[error("I/O error")]
|
|
IoError(#[from] std::io::Error),
|
|
/// An invalid string was encountered.
|
|
#[error("Invalid string")]
|
|
InvalidString,
|
|
}
|