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
					
				| @ -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 New Issue
	
	Block a user
	 Patrick Walton
						Patrick Walton