diff options
Diffstat (limited to 'third_party/rust/gpu-allocator/src/result.rs')
-rw-r--r-- | third_party/rust/gpu-allocator/src/result.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/third_party/rust/gpu-allocator/src/result.rs b/third_party/rust/gpu-allocator/src/result.rs new file mode 100644 index 0000000000..7d5336d582 --- /dev/null +++ b/third_party/rust/gpu-allocator/src/result.rs @@ -0,0 +1,21 @@ +use thiserror::Error; + +#[derive(Error, Debug)] +pub enum AllocationError { + #[error("Out of memory")] + OutOfMemory, + #[error("Failed to map memory: {0}")] + FailedToMap(String), + #[error("No compatible memory type available")] + NoCompatibleMemoryTypeFound, + #[error("Invalid AllocationCreateDesc")] + InvalidAllocationCreateDesc, + #[error("Invalid AllocatorCreateDesc {0}")] + InvalidAllocatorCreateDesc(String), + #[error("Internal error: {0}")] + Internal(String), + #[error("Initial `BARRIER_LAYOUT` needs `Device10`")] + BarrierLayoutNeedsDevice10, +} + +pub type Result<V, E = AllocationError> = ::std::result::Result<V, E>; |