From 8b6450a9ce6fd7411fec71a8f944b4eb3698dfaf Mon Sep 17 00:00:00 2001 From: teoxoy <28601907+teoxoy@users.noreply.github.com> Date: Thu, 15 Aug 2024 09:59:56 +0100 Subject: [PATCH] handle all variants of `gpu_descriptor::AllocationError` explicitly --- wgpu-hal/src/vulkan/device.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wgpu-hal/src/vulkan/device.rs b/wgpu-hal/src/vulkan/device.rs index dfb1ca2f52..baf3726c75 100644 --- a/wgpu-hal/src/vulkan/device.rs +++ b/wgpu-hal/src/vulkan/device.rs @@ -2496,7 +2496,9 @@ impl From for crate::DeviceError { } impl From 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, + } } }