mirror of
https://github.com/bevyengine/bevy
synced 2024-11-26 06:30:19 +00:00
asset throttling: don't be exhausted if there is no limit (#13112)
# Objective - Since #12622 example `compute_shader_game_of_life` crashes ``` thread 'Compute Task Pool (2)' panicked at examples/shader/compute_shader_game_of_life.rs:137:65: called `Option::unwrap()` on a `None` value note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace Encountered a panic in system `compute_shader_game_of_life::prepare_bind_group`! thread '<unnamed>' panicked at examples/shader/compute_shader_game_of_life.rs:254:34: Requested resource compute_shader_game_of_life::GameOfLifeImageBindGroups does not exist in the `World`. Did you forget to add it using `app.insert_resource` / `app.init_resource`? Resources are also implicitly added via `app.add_event`, and can be added by plugins. Encountered a panic in system `bevy_render::renderer::render_system`! ``` ## Solution - `exhausted()` now checks that there is a limit
This commit is contained in:
parent
9d59e52bb0
commit
22d605c8df
1 changed files with 1 additions and 1 deletions
|
@ -442,6 +442,6 @@ impl RenderAssetBytesPerFrame {
|
||||||
|
|
||||||
// check if any bytes remain available for writing this frame
|
// check if any bytes remain available for writing this frame
|
||||||
fn exhausted(&self) -> bool {
|
fn exhausted(&self) -> bool {
|
||||||
self.available == 0
|
self.max_bytes.is_some() && self.available == 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue