[PR #13816] AtlasEngine: Improve RDP performance #29780

Open
opened 2026-01-31 09:36:51 +00:00 by claunia · 0 comments
Owner

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

State: closed
Merged: Yes


Direct2D is able to detect remote connections and will switch to sending
draw commands across RDP instead of rendering the data on the server.
This reduces the amount of data that needs to be transmitted as well
as the CPU load of the server, if it has no GPU installed.
This commit changes AtlasEngine to render with just Direct2D if a software or
remote device was chosen by D3D11CreateDevice. Selecting the DXGI adapter the
window is on explicitly in the future would allow us to be more precise here.

This new rendering mode doesn't implement some of the more fancy features just
yet, like inverted cursors or coloring a single wide glyph in multiple colors.
It reuses most existing facilities and uses the existing tile hash map to cache
DirectWrite text layouts to improve performance. Unfortunately this does incur
a fairly high memory overhead of approximately 25MB for a 120x30 viewport.

Additional drive-by changes include:

  • Treat the given font size exactly as its given without rounding
    Apparently we don't really need to round the font size to whole pixels
  • Stop updating the const buffer on every frame
  • Support window resizing if debugGeneralPerformance is enabled

Closes #13079

Validation Steps Performed

  • Tested fairly exhaustively over RDP
**Original Pull Request:** https://github.com/microsoft/terminal/pull/13816 **State:** closed **Merged:** Yes --- Direct2D is able to detect remote connections and will switch to sending draw commands across RDP instead of rendering the data on the server. This reduces the amount of data that needs to be transmitted as well as the CPU load of the server, if it has no GPU installed. This commit changes `AtlasEngine` to render with just Direct2D if a software or remote device was chosen by `D3D11CreateDevice`. Selecting the DXGI adapter the window is on explicitly in the future would allow us to be more precise here. This new rendering mode doesn't implement some of the more fancy features just yet, like inverted cursors or coloring a single wide glyph in multiple colors. It reuses most existing facilities and uses the existing tile hash map to cache DirectWrite text layouts to improve performance. Unfortunately this does incur a fairly high memory overhead of approximately 25MB for a 120x30 viewport. Additional drive-by changes include: * Treat the given font size exactly as its given without rounding Apparently we don't really need to round the font size to whole pixels * Stop updating the const buffer on every frame * Support window resizing if `debugGeneralPerformance` is enabled Closes #13079 ## Validation Steps Performed * Tested fairly exhaustively over RDP ✅
claunia added the pull-request label 2026-01-31 09:36:51 +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#29780