gfx-rs / wgpu

A cross-platform, safe, pure-Rust graphics API.
https://wgpu.rs
Apache License 2.0
12.31k stars 906 forks source link

wgpu does not map all OutOfMemory errors to wgpu::Error::OutOfMemory #5718

Open sagudev opened 4 months ago

sagudev commented 4 months ago

Here https://github.com/gfx-rs/wgpu/blob/18b758e3889bdd6ffa769085de15e2b96a0c1eb5/wgpu/src/backend/wgpu_core.rs#L286 only wgc::device::DeviceError::OutOfMemory error is mapped to wgpu::Error::OutOfMemory, while https://docs.rs/wgpu/latest/wgpu/?search=OutOfMemory lists more way OutOfMemory variants.

ErichDonGubler commented 3 months ago

The problem statement here is pretty vague. It's unclear what action items should result from this. Is there a concrete test case or application in which you've found this results in issues? I don't doubt there are issues, but we should try to make this as easy for contributors to act upon as we can.

sagudev commented 3 months ago

The problem statement here is pretty vague. It's unclear what action items should result from this. Is there a concrete test case or application in which you've found this results in issues? I don't doubt there are issues, but we should try to make this as easy for contributors to act upon as we can.

I noticed this in when using similar error mapping code in servo, but it didn't catch all OOM errors. IIRC create_texture returned such error.