imgui_rs_vulkan_renderer/
error.rs

1use ash::vk;
2use imgui::TextureId;
3use thiserror::Error;
4
5/// Crates error type.
6#[derive(Debug, Error)]
7pub enum RendererError {
8    /// Errors coming from calls to Vulkan functions.
9    #[error("A Vulkan error occured: {0}")]
10    Vulkan(#[from] vk::Result),
11
12    #[cfg(feature = "gpu-allocator")]
13    #[error("A gpu allocator error occured: {0}")]
14    GpuAllocator(#[from] gpu_allocator::AllocationError),
15
16    /// Io errors.
17    #[error("A io error occured: {0}")]
18    Io(#[from] std::io::Error),
19
20    /// Initialization errors.
21    #[error("An error occured when initializing the renderer: {0}")]
22    Init(String),
23
24    /// Texture lookup error.
25    #[error("Bad texture ID: {}", .0.id())]
26    BadTexture(TextureId),
27
28    /// Allocator error
29    #[error("A error occured when using the allocator: {0}")]
30    Allocator(String),
31}