mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
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:
parent
054134fba2
commit
f514d5cc15
1 changed files with 5 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue