Quit Application on any `RenderError`s by default (#24131)
# Objective
- Fixes #23183
- The issue describes strobing that happens on OOM’s (that used to just
crash the application). I’ve also seen strobing happen on validation
errors while some examples were in a broken state very recently. I
believe it’s cause OOM’s and Validations are ignored, which just leads
for rendering to resume and hit those same issues again. The looping is
somehow causing the flashing. To protect against this strobing, I think
the default render error policy needs to be changed.
## Solution
- Instead of ignoring any errors and continuing to render, this PR
changes the default error policy to quit the application upon any error.
OOM and Validation error induced strobing will not happen cause the app
should just quit. I’m not aware of strobing that could happen on
DeviceLost / Internal errors, but I’m leaning towards safety here. You
can correct me (within reason) if there are some obvious errors we
should handle with a different error policy, but I think this is a
better starting point than `Ignore` for all.
- Note: At times, even with this code, I’ve seen the app flash to a
magenta/pink color before exiting (not a strobing pink that would happen
if the app ignored validation errors, just a single abrupt switch before
app exit), so I’m wondering if it’s better to throw a `panic!` rather
than try to quit gracefully.
## Testing
- Fortunately, the `pccm` example and `light_probe_blending` examples
are still broken on `main`.
- `cargo r --example light_probe_blending --features free_camera,https`
correctly closes the app upon Validation error
- `cargo run --example pccm --features="free_camera https”` does the
same.
<details>
<summary>Example console logs</summary>
```
cargo r --example light_probe_blending --features free_camera,https
Compiling bevy v0.19.0-dev (/Users/kchen/CodingProjects/bevy)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 11.24s
Running `target/debug/examples/light_probe_blending`
2026-05-05T01:04:33.028208Z INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "macOS 26.4.1", kernel: "25.4.0", cpu: "Apple M4", core_count: "10", memory: "16.0 GiB" }
2026-05-05T01:04:33.031189Z WARN bevy_asset::io::web: WebAssetPlugin is potentially insecure! Make sure to verify asset URLs are safe to load before loading them. If you promise you know what you're doing, you can silence this warning by setting silence_startup_warning: true in the WebAssetPlugin construction.
2026-05-05T01:04:33.448175Z INFO bevy_render::renderer: AdapterInfo { name: "Apple M4", vendor: 0, device: 0, device_type: IntegratedGpu, device_pci_bus_id: "", driver: "", driver_info: "", backend: Metal, subgroup_min_size: 4, subgroup_max_size: 64, transient_saves_memory: true }
2026-05-05T01:04:34.315115Z INFO bevy_pbr::cluster: GPU clustering is supported on this device.
2026-05-05T01:04:34.315226Z INFO bevy_render::batching::gpu_preprocessing: GPU preprocessing is fully supported on this device.
2026-05-05T01:04:34.611394Z INFO bevy_winit::system: Creating new window Bevy Light Probe Blending Example (65v0)
2026-05-05T01:04:37.312262Z ERROR bevy_render::error_handler: Caught rendering error: Validation Error
Caused by:
In Device::create_bind_group, label = 'mesh_view_bind_group_binding_array'
Number of bindings in bind group descriptor (3) does not match the number of bindings defined in the bind group layout (0)
2026-05-05T01:04:37.900677Z ERROR bevy_render::error_handler: Quitting the application due to Validation RenderError
2026-05-05T01:04:37.964583Z WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?
2026-05-05T01:04:37.964628Z WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?
...
```
</details>
There is some `WARN bevy_ecs::world::command_queue: CommandQueue has
un-applied commands being dropped. Did you forget to call
SystemState::apply?` spam (like at least 20+ lines of it) after quitting
the application; if anyone knows if that could be prevented somehow, I’m
keen to learn.
---------
Co-authored-by: atlv <email@atlasdostal.com> K
Kevin Chen committed
4bd3708d523b6ec00e40c798c7f4e77dbd1c1788
Parent: 6c0eb84
Committed by GitHub <noreply@github.com>
on 5/6/2026, 10:45:29 PM