No error handling for wgpu errors
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 161
Description
## Bevy version
Irrelevant, c56bbcb3b037916ffa64d4b753fb8636756ea9be
## System information
```ignore
AdapterInfo { name: "AMD Radeon RX 6900 XT (RADV NAVI21)", vendor: 4098, device: 29631, device_type: DiscreteGpu, driver: "radv", driver_info: "Mesa 22.3.3", backend: Vulkan }
```
## What you did
Artificially creating an validation error in WGPU by loading a texture which is larger then 16.384 in one dimension, which results in
```
thread 'Compute Task Pool (7)' panicked at 'wgpu error: Validation Error
Caused by:
In Device::create_texture
Dimension X value 33000 exceeds the limit of 16384
```
But this might also happen for other, more "random" errors like out of memory, or rendering device loss.
## What went wrong
Sometimes, the application correctly closes, but it can also happen that the main thread freezes, and one thread is running without sleep.
But I would expect, to at least always close the application.
## Additional information
In wgpu, there is already a way to catch all sorts of errors with https://docs.rs/wgpu/latest/wgpu/struct.Device.html#method.on_uncaptured_error, and the easiest fix would be to either add a custom error handling, which might recover, or gracefully shut down, or just exits.
Or we add an panic handler, which calls exit() and forcefully exits the application.
Contributor guide
Assessment
This issue has not been assessed yet.