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`.
This commit is contained in:
Patrick Walton 2024-02-06 23:17:34 -08:00 committed by GitHub
parent 054134fba2
commit f514d5cc15
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)