Skip extract UiImage When its texture is default (#14122)
# Objective - After #14017 , I noticed that the drawcall increased 10x in the `many_buttons`, causing the `UIPassNode `to increase from 1.5ms to 6ms. This is because our UI batching is very fragile. ## Solution - skip extract UiImage when its texture is default ## Performance many_buttons UiPassNode 
This commit is contained in:
		
							parent
							
								
									c8d8ea6d4f
								
							
						
					
					
						commit
						1c2f687202
					
				| @ -8,6 +8,7 @@ use bevy_core_pipeline::core_3d::graph::{Core3d, Node3d}; | ||||
| use bevy_core_pipeline::{core_2d::Camera2d, core_3d::Camera3d}; | ||||
| use bevy_hierarchy::Parent; | ||||
| use bevy_render::render_phase::ViewSortedRenderPhases; | ||||
| use bevy_render::texture::TRANSPARENT_IMAGE_HANDLE; | ||||
| use bevy_render::{ | ||||
|     render_phase::{PhaseItem, PhaseItemExtraIndex}, | ||||
|     texture::GpuImage, | ||||
| @ -334,7 +335,10 @@ pub fn extract_uinode_images( | ||||
|         }; | ||||
| 
 | ||||
|         // Skip invisible images
 | ||||
|         if !view_visibility.get() || image.color.is_fully_transparent() { | ||||
|         if !view_visibility.get() | ||||
|             || image.color.is_fully_transparent() | ||||
|             || image.texture.id() == TRANSPARENT_IMAGE_HANDLE.id() | ||||
|         { | ||||
|             continue; | ||||
|         } | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 re0312
						re0312