Skip to content

Commit

Permalink
Don't try to create a uniform buffer for light probes if there are no…
Browse files Browse the repository at this point in the history
… views. (bevyengine#11751)

Don't try to create a uniform buffer for light probes if there are no
views.

Fixes the panic on examples that have no views, such as
`touch_input_events`.
  • Loading branch information
pcwalton authored Feb 7, 2024
1 parent 054134f commit f514d5c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/bevy_pbr/src/light_probe/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,11 @@ fn upload_light_probes(
render_device: Res<RenderDevice>,
render_queue: Res<RenderQueue>,
) {
// If there are no views, bail.
if views.is_empty() {
return;
}

// Initialize the uniform buffer writer.
let mut writer = light_probes_buffer
.get_writer(views.iter().len(), &render_device, &render_queue)
Expand Down

0 comments on commit f514d5c

Please sign in to comment.