Prototype text run rendering optimization in WR
Categories
(Core :: Graphics: WebRender, task)
Tracking
()
People
(Reporter: gw, Unassigned)
References
(Blocks 1 open bug)
Details
(Whiteboard: wr-planning)
We could render text runs as render task cache items, and draw into the main scene via the image shader (with dual source blending enabled as required).
This is likely to be slightly slower on GPU time, but have a number of positive flow on effects on other parts of WR (each one dependent on the last):
- Significantly reduced vertex count
- Less time / memory writing instances per-frame
- Feasible to make instances larger, embedding more information in them
- Reduce size / usage of vertex data and gpu cache textures
The first step is to prototype this in the easy (and common case), where the text runs have no weird transforms and/or raster scales. That will be enough to prove the concept, and do some initial measurements.
| Reporter | ||
Updated•5 years ago
|
Updated•5 years ago
|
| Reporter | ||
Comment 1•5 years ago
|
||
Unassigning for now, as I'm not actively working on this.
We did find out that D2D appears to apply a similar optimization, where it caches an entire text run at once, which proves out a couple of things:
- I wasn't sure that the blending with subpixel would work correctly with overlapping glyphs, but it appears that this won't be an issue.
- It also improves rendering quality of text runs with overlapping glyphs where those text runs have transparency in the font instance color.
This is something we should plan to implement in H1 2021.
Description
•