[PR #11623] Introduce AtlasEngine - A new text rendering prototype #28673

Closed
opened 2026-01-31 09:30:00 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/11623

State: closed
Merged: Yes


This commit introduces "AtlasEngine", a new text renderer based on DxEngine.
But unlike it, DirectWrite and Direct2D are only used to rasterize glyphs.
Blending and placing these glyphs into the target view is being done using
Direct3D and a simple HLSL shader. Since this new renderer more aggressively
assumes that the text is monospace, it simplifies the implementation:
The viewport is divided into cells, and its data is stored as a simple matrix.
Modifications to this matrix involve only simple pointer arithmetic and is easy
to understand. But just like with DxEngine however, DirectWrite
related code remains extremely complex and hard to understand.

Supported features:

  • Basic text rendering with grayscale AA
  • Foreground and background colors
  • Emojis, including zero width joiners
  • Underline, dotted underline, strikethrough
  • Custom font axes and features
  • Selections
  • All cursor styles
  • Full alpha support for all colors
  • Should work with Windows 7

Unsupported features:

  • A more conservative GPU memory usage
    The backing texture atlas for glyphs is grow-only and will not shrink.
    After 256MB of memory is used up (~20k glyphs) text output
    will be broken until the renderer is restarted.
  • ClearType
  • Remaining gridlines (left, right, top, bottom, double underline)
  • Hyperlinks don't get full underlines if hovered in WT
  • Softfonts
  • Non-default line renditions

Performance:

  • Runs at up to native display refresh rate
    Unfortunately the frame rate often drops below refresh rate, due us
    fighting over the buffer lock with other parts of the application.
  • CPU consumption is up to halved compared to DxEngine
    AtlasEngine is still highly unoptimized. Glyph hashing
    consumes up to a third of the current CPU time.
  • No regressions in WT performance
    VT parsing and related buffer management takes up most of the CPU time (~85%),
    due to which the AtlasEngine can't show any further improvements.
  • ~2x improvement in raw text throughput in OpenConsole
    compared to DxEngine running at 144 FPS
  • ≥10x improvement in colored VT output in WT/OpenConsole
    compared to DxEngine running at 144 FPS
**Original Pull Request:** https://github.com/microsoft/terminal/pull/11623 **State:** closed **Merged:** Yes --- This commit introduces "AtlasEngine", a new text renderer based on DxEngine. But unlike it, DirectWrite and Direct2D are only used to rasterize glyphs. Blending and placing these glyphs into the target view is being done using Direct3D and a simple HLSL shader. Since this new renderer more aggressively assumes that the text is monospace, it simplifies the implementation: The viewport is divided into cells, and its data is stored as a simple matrix. Modifications to this matrix involve only simple pointer arithmetic and is easy to understand. But just like with DxEngine however, DirectWrite related code remains extremely complex and hard to understand. Supported features: * Basic text rendering with grayscale AA * Foreground and background colors * Emojis, including zero width joiners * Underline, dotted underline, strikethrough * Custom font axes and features * Selections * All cursor styles * Full alpha support for all colors * _Should_ work with Windows 7 Unsupported features: * A more conservative GPU memory usage The backing texture atlas for glyphs is grow-only and will not shrink. After 256MB of memory is used up (~20k glyphs) text output will be broken until the renderer is restarted. * ClearType * Remaining gridlines (left, right, top, bottom, double underline) * Hyperlinks don't get full underlines if hovered in WT * Softfonts * Non-default line renditions Performance: * Runs at up to native display refresh rate Unfortunately the frame rate often drops below refresh rate, due us fighting over the buffer lock with other parts of the application. * CPU consumption is up to halved compared to DxEngine AtlasEngine is still highly unoptimized. Glyph hashing consumes up to a third of the current CPU time. * No regressions in WT performance VT parsing and related buffer management takes up most of the CPU time (~85%), due to which the AtlasEngine can't show any further improvements. * ~2x improvement in raw text throughput in OpenConsole compared to DxEngine running at 144 FPS * ≥10x improvement in colored VT output in WT/OpenConsole compared to DxEngine running at 144 FPS
claunia added the pull-request label 2026-01-31 09:30:00 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#28673