#[cfg(feature = "format-fbx")]
pub use crate::model::FbxError;
#[cfg(feature = "format-obj")]
pub use crate::model::ObjError;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum ModelError {
#[error("Could not load texture {path:?}: {inner:?}")]
CouldNotLoadTexture {
path: String,
inner: image::error::ImageError,
},
#[error("Model has no valid vertex buffer")]
InvalidModelVertexBuffer,
#[cfg(feature = "format-obj")]
#[error("Could not load OBJ model: {0:?}")]
Obj(ObjError),
#[cfg(feature = "format-fbx")]
#[error("Could not load FBX model: {0:?}")]
Fbx(FbxError),
}
#[derive(Error, Debug)]
pub enum GuiError {
#[error("Could not load texture {path:?}: {inner:?}")]
CouldNotLoadTexture {
path: String,
inner: image::error::ImageError,
},
#[error("Could not create texture: {inner:?}")]
CouldNotCreateTexture {
inner: vulkano::image::ImageCreationError,
},
#[error("Could not read font file {file:?}: {inner:?}")]
CouldNotReadFontFile {
inner: std::io::Error,
file: String,
},
#[error("Could not load font")]
CouldNotLoadFont,
}
#[derive(Error, Debug)]
pub enum InitError {
#[error("Could not load surface capabilities: {0:?}")]
CouldNotLoadSurfaceCapabilities(vulkano::swapchain::CapabilitiesError),
#[error("The selected surface has no support for alpha blending")]
NoCompositeAlpha,
#[error("Could not initialize the swapchain: {0:?}")]
CouldNotInitSwapchain(vulkano::swapchain::SwapchainCreationError),
#[error("Could not create swapchain images: {0:?}")]
CouldNotBuildSwapchainImages(vulkano::framebuffer::FramebufferCreationError),
#[error("Could not recreate the swapchain: {0:?}")]
CouldNotRecreateSwapchain(vulkano::swapchain::SwapchainCreationError),
#[error("Could not acquire the next swapchain image: {0:?}")]
CouldNotAcquireSwapchainImage(vulkano::swapchain::AcquireError),
#[error("Could not create a device")]
CouldNotCreateDevice(vulkano::device::DeviceCreationError),
#[error("Could not find a physical device")]
CouldNotFindPhysicalDevice,
#[error("Could not find a valid graphics queue")]
CouldNotFindValidGraphicsQueue,
#[error("Could not init Vulkano: {0:?}")]
CouldNotInitVulkano(vulkano::instance::InstanceCreationError),
#[error("Could not create a window: {0:?}")]
CouldNotCreateWindow(vulkano_win::CreationError),
}