Skip to content

Commit f514d5c

Browse files
authored
Don't try to create a uniform buffer for light probes if there are no views. (#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`.
1 parent 054134f commit f514d5c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • crates/bevy_pbr/src/light_probe

crates/bevy_pbr/src/light_probe/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,11 @@ fn upload_light_probes(
411411
render_device: Res<RenderDevice>,
412412
render_queue: Res<RenderQueue>,
413413
) {
414+
// If there are no views, bail.
415+
if views.is_empty() {
416+
return;
417+
}
418+
414419
// Initialize the uniform buffer writer.
415420
let mut writer = light_probes_buffer
416421
.get_writer(views.iter().len(), &render_device, &render_queue)

0 commit comments

Comments
 (0)