1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum AllocationError {
5 #[error("Out of memory")]
6 OutOfMemory,
7 #[error("Failed to map memory: {0}")]
8 FailedToMap(String),
9 #[error("No compatible memory type available")]
10 NoCompatibleMemoryTypeFound,
11 #[error("Invalid AllocationCreateDesc")]
12 InvalidAllocationCreateDesc,
13 #[error("Invalid AllocatorCreateDesc {0}")]
14 InvalidAllocatorCreateDesc(String),
15 #[error("Internal error: {0}")]
16 Internal(String),
17 #[error("Initial `BARRIER_LAYOUT` needs at least `Device10`")]
18 BarrierLayoutNeedsDevice10,
19 #[error("Castable formats require enhanced barriers")]
20 CastableFormatsRequiresEnhancedBarriers,
21 #[error("Castable formats require at least `Device12`")]
22 CastableFormatsRequiresAtLeastDevice12,
23}
24
25pub type Result<V, E = AllocationError> = ::std::result::Result<V, E>;