bevyengine / bevyengine/bevy

Current UiStack based extraction potentially leads to poor batching

Open
#7,345 4 comments 0 reactions 0 assignees View on GitHub
A-Rendering A-UI C-Performance S-Needs-Design
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
4d 8m
Merged PRs (30d)
147

Description

## Bevy version
a3baf2ae869611a84cf1bc062c498ea08128cbd9

## What you did
`cargo run --profile stress-test --features trace_tracy --example many_buttons`

## What went wrong
Issuing 24,000+ draw calls when it could be issuing 3.

The construction of `UiStack` forces siblings of a similar depth in the hierarchy to be non-adjacent if any of them have children. This also forces their descendants to not be adjacent, which is breaking large scale batching.

https://github.com/bevyengine/bevy/blob/a3baf2ae869611a84cf1bc062c498ea08128cbd9/crates/bevy_ui/src/stack.rs#L93-L102

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.