handle all variants of gpu_descriptor::AllocationError explicitly

This commit is contained in:
teoxoy
2024-08-15 09:59:56 +01:00
committed by Teodor Tanasoaia
parent 7103520bd3
commit 8b6450a9ce

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,
}
}
}