From 7b482622d333c5b679017e171f403ab501f1350f Mon Sep 17 00:00:00 2001 From: teoxoy <28601907+teoxoy@users.noreply.github.com> Date: Wed, 2 Apr 2025 16:34:32 +0200 Subject: [PATCH] allow sampler creation to return OOMs This is to preserve the current behavior as tested by the `SAMPLER_CREATION_FAILURE` test. This is not spec compliant but it's unclear what we should do instead. I opened https://github.com/gpuweb/gpuweb/issues/5142 to figure out what we should do. --- wgpu-core/src/device/resource.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wgpu-core/src/device/resource.rs b/wgpu-core/src/device/resource.rs index 75deda2d9b..2a5e665ac5 100644 --- a/wgpu-core/src/device/resource.rs +++ b/wgpu-core/src/device/resource.rs @@ -1633,7 +1633,7 @@ impl Device { }; let raw = unsafe { self.raw().create_sampler(&hal_desc) } - .map_err(|e| self.handle_hal_error(e))?; + .map_err(|e| self.handle_hal_error_with_nonfatal_oom(e))?; let sampler = Sampler { raw: ManuallyDrop::new(raw),