Skip to content

Extracted UI layout - #25289

Open
ickshonpe wants to merge 96 commits into
bevyengine:mainfrom
ickshonpe:extracted-ui-layout
Open

Extracted UI layout#25289
ickshonpe wants to merge 96 commits into
bevyengine:mainfrom
ickshonpe:extracted-ui-layout

Conversation

@ickshonpe

@ickshonpe ickshonpe commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Objective

Extract the UI layout geometry once per node, not for each different UI content component.

Solution

Got carried away with this, possibly too much to review. To get the full benefits from the extraction system changes required rewriting the prepare systems as well. That became a massive mess and tidying it up needed even more changes.

New extract_layout module.
Has a system extract_ui_layout. On changes it extracts all the common UI layout properties to ExtractedUiNodeLayouts.
Other extraction systems now only extract content and style components. They can't resolve any responsive coords or geometry as they don't have access to the layout, that has to be done in prepare now.
The text layout extraction is quite clumsy and does a lot of allocations. The gradients rendering as well.
The UI debug overlay is just outlines, so it is now queued as a single phase item.

There are gratuitous changes to batching and image handling in prepare_uinodes. I don't know how wise they are exactly, but performance is significantly better. Possibly redundant with bindless though.

Still need to fix:

  • TextSection' TextColor`s don't work, they are just white.

Testing

cargo run --example many_buttons --release --features="debug,trace_tracy"

yellow this PR, main red.

frames:
frames

queue_uinodes:
queue_uinodes

prepare_uinodes:
prepare_uinodes

ickshonpe added 30 commits July 29, 2026 10:13
Added rough geometry extraction impl.
added debug system
Shadow geometry is now resolved in prepare_shadows.
…the gradient geometry is resolved in prepare, not extraction.
@ickshonpe ickshonpe added A-Rendering Drawing game state to the screen A-UI Graphical user interfaces, styles, layouts, and widgets D-Complex Quite challenging from either a design or technical perspective. Ask for help! labels Aug 4, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in UI Aug 4, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in Rendering Aug 4, 2026
@ickshonpe ickshonpe added the C-Performance A change motivated by improving speed, memory usage or compile times label Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen A-UI Graphical user interfaces, styles, layouts, and widgets C-Performance A change motivated by improving speed, memory usage or compile times D-Complex Quite challenging from either a design or technical perspective. Ask for help!

Projects

Status: Needs SME Triage
Status: Needs SME Triage

Development

Successfully merging this pull request may close these issues.

1 participant