Files
zed/crates/gpui_windows
John Tur 4a6121bb0f gpui_windows: Composite COLR layers on the CPU (#66588)
Compositing the COLR layers on the GPU allowed us to re-use the alpha
correction shader's code, but adds substantial latency to emoji
rendering and complicates the ownership of the D3D resources (and device
removed handling and so forth).

Combining layers on the CPU is faster at all reasonable glyph sizes. The
GPU path had a high fixed cost due to resource creation and latency of
GPU work submission.

| Size (px) | GPU path | CPU path |
|---:|---:|---:|
| 8 | 1235 µs | 6.0 µs |
| 16 | 1193 µs | 7.7 µs |
| 32 | 1054 µs | 13 µs |
| 48 | 1155 µs | 21 µs |
| 64 | 1203 µs | 34 µs |
| 128 | 1428 µs | 111 µs |
| 256 | 1474 µs | 807 µs |
| 384 | 2144 µs | 1707 µs |
| 512 | 4025 µs | 2916 µs

The compositing loop is written so that the compiler auto-vectorizes it.

While we're here, fix two small issues with emoji rendering:
- The glyph's raster bounds are computed from the union of each of the
layers' bounds, instead of just the base glyph's bounds.
- The glyph layers are rasterized with DWrite's recommended rendering
modes instead of a hard-coded mode.

Release Notes:

- N/A
- [GPUI] Improved the performance of emoji rendering on Windows
2026-11-05 20:43:12 +00:00
..