bevyengine / bevyengine/bevy

No error handling for wgpu errors

Open
#7,217 0 comments 4 reactions 0 assignees View on GitHub
A-Diagnostics A-Rendering C-Bug
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.