Kevin Chen 4bd3708d52 Quit Application on any RenderErrors 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>
2026-05-06 22:45:29 +00:00
2026-05-02 01:57:00 +00:00
2025-02-17 09:30:04 +00:00
2026-04-23 21:18:07 +00:00
2025-10-16 22:03:06 +00:00

Bevy

License Crates.io Downloads Docs CI Discord

What is Bevy?

Bevy is a refreshingly simple data-driven game engine built in Rust. It is free and open-source forever!

WARNING

Bevy is still in the early stages of development. Important features are missing. Documentation is sparse. A new version of Bevy containing breaking changes to the API is released approximately once every 3 months. We provide migration guides, but we can't guarantee migrations will always be easy. Use only if you are willing to work in this environment.

MSRV: Bevy relies heavily on improvements in the Rust language and compiler. As a result, the Minimum Supported Rust Version (MSRV) is generally close to "the latest stable release" of Rust.

Design Goals

  • Capable: Offer a complete 2D and 3D feature set
  • Simple: Easy for newbies to pick up, but infinitely flexible for power users
  • Data Focused: Data-oriented architecture using the Entity Component System paradigm
  • Modular: Use only what you need. Replace what you don't like
  • Fast: App logic should run quickly, and when possible, in parallel
  • Productive: Changes should compile quickly ... waiting isn't fun

About

  • Features: A quick overview of Bevy's features.
  • News: A development blog that covers our progress, plans and shiny new features.

Docs

Community

Before contributing or participating in discussions with the community, you should familiarize yourself with our Code of Conduct.

  • Discord: Bevy's official discord server.
  • Reddit: Bevy's official subreddit.
  • GitHub Discussions: The best place for questions about Bevy, answered right here!
  • Bevy Assets: A collection of awesome Bevy projects, tools, plugins and learning materials.

Contributing

If you'd like to help build Bevy, check out the Contributor's Guide. For simple problems, feel free to open an issue or PR and tackle it yourself!

For more complex architecture decisions and experimental mad science, please open an RFC (Request For Comments) so we can brainstorm together effectively!

Getting Started

We recommend checking out the Quick Start Guide for a brief introduction.

Follow the Setup guide to ensure your development environment is set up correctly. Once set up, you can quickly try out the examples by cloning this repo and running the following commands:

# Switch to the correct version (latest release, default is main development branch)
git checkout latest
# Runs the "breakout" example
cargo run --example breakout

To draw a window with standard functionality enabled, use:

use bevy::prelude::*;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .run();
}

Fast Compiles

Bevy can be built just fine using default configuration on stable Rust. However for really fast iterative compiles, you should enable the "fast compiles" setup by following the instructions here.

Bevy Cargo Features

This list outlines the different cargo features supported by Bevy. These allow you to customize the Bevy feature set for your use-case.

Thanks

Bevy is the result of the hard work of many people. A huge thanks to all Bevy contributors, the many open source projects that have come before us, the Rust gamedev ecosystem, and the many libraries we build on.

A huge thanks to Bevy's generous sponsors. Bevy will always be free and open source, but it isn't free to make. Please consider sponsoring our work if you like what we're building.

This project is tested with BrowserStack.

License

Bevy is free, open source and permissively licensed! Except where noted (below and/or in individual files), all code in this repository is dual-licensed under either:

at your option. This means you can select the license you prefer! This dual-licensing approach is the de-facto standard in the Rust ecosystem and there are very good reasons to include both.

Some of the engine's code carries additional copyright notices and license terms due to their external origins. These are generally BSD-like, but exact details vary by crate: If the README of a crate contains a 'License' header (or similar), the additional copyright notices and license terms applicable to that crate will be listed. The above licensing requirement still applies to contributions to those crates, and sections of those crates will carry those license terms. The license field of each crate will also reflect this.

The assets included in this repository (for our examples) typically fall under different open licenses. These will not be included in your game (unless copied in by you), and they are not distributed in the published bevy crates. See CREDITS.md for the details of the licenses of those files.

Your contributions

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

S
Description
Languages
Rust 94.3%
WGSL 5.6%