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