Use lower precision vertex attributes for UI
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 161
Description
## What problem does this solve or what need does it fill?
UI pipeline uses 88 bytes per vertex:
https://github.com/bevyengine/bevy/blob/48d9d13bde2152b3701ea40605a48e5bf94e5876/crates/bevy_ui_render/src/pipeline.rs#L61-L78
And indices is always u32.
## What solution would you like?
Use lower precision vertex format such as snorm16 position, unorm16 uv, float16 or unorm8 color, and u16 indices if possible.
Things to consider:
- Whether UI can have a large number of vertices.
- These vertex attributes' uses, value ranges and whether precision is important.
## What alternative(s) have you considered?
Leave it as is.
Contributor guide
Research direction
Start in crates/bevy_ui_render/src/pipeline.rs, especially the vertex attribute and index formats linked in the issue. Read the UI rendering path to determine attribute ranges, precision requirements, and whether UI meshes can exceed u16 indices. Done means using smaller formats where safe and validating the relevant rendering tests or examples.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100