Skip to content

Commit 22d605c

Browse files
authored
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
1 parent 9d59e52 commit 22d605c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

crates/bevy_render/src/render_asset.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,6 @@ impl RenderAssetBytesPerFrame {
442442

443443
// check if any bytes remain available for writing this frame
444444
fn exhausted(&self) -> bool {
445-
self.available == 0
445+
self.max_bytes.is_some() && self.available == 0
446446
}
447447
}

0 commit comments

Comments
 (0)