mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
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 ![image](https://github.com/bevyengine/bevy/assets/45868716/9295d958-8c3f-469c-a7e0-d1e90db4dfb7)
This commit is contained in:
parent
c8d8ea6d4f
commit
1c2f687202
1 changed files with 5 additions and 1 deletions
|
@ -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 a new issue