handle all variants of gpu_descriptor::AllocationError explicitly

This commit is contained in:
teoxoy authored and Teodor Tanasoaia committed 2024-08-15 13:56:05 +01:00
1 parent 7103520bd3
commit 8b6450a9ce
1 file changed
+4 -2
+4 -2
View File
@@ -2496,7 +2496,9 @@ impl From<gpu_alloc::MapError> for crate::DeviceError {
}
impl From<gpu_descriptor::AllocationError> for crate::DeviceError {
fn from(error: gpu_descriptor::AllocationError) -> Self {
log::error!("descriptor allocation: {:?}", error);
Self::OutOfMemory
use gpu_descriptor::AllocationError as Ae;
match error {
Ae::OutOfDeviceMemory | Ae::OutOfHostMemory | Ae::Fragmentation => Self::OutOfMemory,
}
}
}