Skip to content

Commit

Permalink
Improved text batching (#14848)
Browse files Browse the repository at this point in the history
# Objective

The UI text rendering is really slow because it extracts each glyph as a
separate ui node even though all the glyphs in a text section have the
same texture, color and clipping rects.

## Solution

Store the glyphs in a seperate contiguous array, queue one transparent
ui item per text section which has indices into the glyph array.

## Testing

```cargo run --example many_glyphs --release```

Runs at about 22fps on main and 95fps with this PR on my computer.

I'll do some proper comparisons once I work out why tracy 11 is refusing to run.

---------

Co-authored-by: Kristoffer Søholm <k.soeholm@gmail.com>
  • Loading branch information
ickshonpe and kristoff3r authored Oct 8, 2024
1 parent 2d1b493 commit 675f8ad
Showing 1 changed file with 386 additions and 226 deletions.
Loading

0 comments on commit 675f8ad

Please sign in to comment.