[PR #13816] [MERGED] AtlasEngine: Improve RDP performance #29775

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/13816
Author: @lhecker
Created: 8/23/2022
Status: Merged
Merged: 8/31/2022
Merged by: @lhecker

Base: mainHead: dev/lhecker/atlas-engine-rdp


📝 Commits (8)

  • 0cfe0ac AtlasEngine: Improve RDP performance
  • 3532e66 Address feedback
  • 5d91693 Merge remote-tracking branch 'origin/main' into dev/lhecker/atlas-engine-rdp
  • da7cdab Fix multiple bugs/issues
  • 3a0438b Address feedback
  • 90cc4b9 Fix a memory leak
  • bc12e2f Treat the given point size exactly
  • 5a731a7 Address feedback

📊 Changes

4 files changed (+781 additions, -291 deletions)

View changed files

📝 src/renderer/atlas/AtlasEngine.api.cpp (+3 -2)
📝 src/renderer/atlas/AtlasEngine.cpp (+158 -134)
📝 src/renderer/atlas/AtlasEngine.h (+54 -14)
📝 src/renderer/atlas/AtlasEngine.r.cpp (+566 -141)

📄 Description

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

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/13816 **Author:** [@lhecker](https://github.com/lhecker) **Created:** 8/23/2022 **Status:** ✅ Merged **Merged:** 8/31/2022 **Merged by:** [@lhecker](https://github.com/lhecker) **Base:** `main` ← **Head:** `dev/lhecker/atlas-engine-rdp` --- ### 📝 Commits (8) - [`0cfe0ac`](https://github.com/microsoft/terminal/commit/0cfe0ac16212b35f583984588c8130778ce67054) AtlasEngine: Improve RDP performance - [`3532e66`](https://github.com/microsoft/terminal/commit/3532e665f334f07760aedb886d604f9560312e6a) Address feedback - [`5d91693`](https://github.com/microsoft/terminal/commit/5d9169348dead9e8dea21e76fd3cc021664141fb) Merge remote-tracking branch 'origin/main' into dev/lhecker/atlas-engine-rdp - [`da7cdab`](https://github.com/microsoft/terminal/commit/da7cdabaacd4b85039dcd09c5ab94c3e5fea6960) Fix multiple bugs/issues - [`3a0438b`](https://github.com/microsoft/terminal/commit/3a0438b552549a0480f87367c05b3c2bfea089be) Address feedback - [`90cc4b9`](https://github.com/microsoft/terminal/commit/90cc4b9a3c9fdbf855bf5a4245501f8b2e89f828) Fix a memory leak - [`bc12e2f`](https://github.com/microsoft/terminal/commit/bc12e2fb77793f115d96519d8d70bb6cfb257689) Treat the given point size exactly - [`5a731a7`](https://github.com/microsoft/terminal/commit/5a731a7c3fcd6422330e345fd977ee8e1064dfe3) Address feedback ### 📊 Changes **4 files changed** (+781 additions, -291 deletions) <details> <summary>View changed files</summary> 📝 `src/renderer/atlas/AtlasEngine.api.cpp` (+3 -2) 📝 `src/renderer/atlas/AtlasEngine.cpp` (+158 -134) 📝 `src/renderer/atlas/AtlasEngine.h` (+54 -14) 📝 `src/renderer/atlas/AtlasEngine.r.cpp` (+566 -141) </details> ### 📄 Description 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 ✅ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:36:49 +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#29775