[PR #13477] [MERGED] AtlasEngine: Improve glyph generation performance #29579

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/13477
Author: @lhecker
Created: 7/10/2022
Status: Merged
Merged: 7/11/2022
Merged by: @undefined

Base: mainHead: dev/lhecker/atlas-engine-glyph-perf


📝 Commits (1)

  • 3a629be AtlasEngine: Improve glyph generation performance

📊 Changes

3 files changed (+24 additions, -78 deletions)

View changed files

📝 src/renderer/atlas/AtlasEngine.cpp (+1 -5)
📝 src/renderer/atlas/AtlasEngine.h (+0 -5)
📝 src/renderer/atlas/AtlasEngine.r.cpp (+23 -68)

📄 Description

#13458 added the ability to reuse tiles from our glyph atlas texture
so that we stop running out of GPU memory for complex Unicode.
This however can result in our glyph generation being a performance issue in
edge cases, to the point that the application may feel outright unuseable.

CJK glyphs for instance can easily exceed the maximum atlas texture size
(twice the window size), but take a significant amount of CPU and GPU time to
rasterize and draw, which results in "jelly scrolling" down to ~1 FPS.
This PR improves the situation of the latter half by directly drawing
glyphs into the texture atlas without an intermediate scratchpad texture.

This reduces GPU usage by 96% on my system (33% -> 2%) which improves general
render performance by ~100% (15 -> 30 FPS). CPU usage remains the same however,
but that's not really something we can do anything about at this time.
The atlas texture is already our primary means to reduce the CPU cost after all.

Validation Steps Performed

  • Disable V-Sync for OpenConsole in NVIDIA Control Panel
  • Enable debugGlyphGenerationPerformance
  • Print the entire CJK block U+4E00..U+9FFF
  • Measure the above GPU usage and FPS improvements
    (Alternatively: Just scroll around and judge the "jellyness".)

🔄 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/13477 **Author:** [@lhecker](https://github.com/lhecker) **Created:** 7/10/2022 **Status:** ✅ Merged **Merged:** 7/11/2022 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/lhecker/atlas-engine-glyph-perf` --- ### 📝 Commits (1) - [`3a629be`](https://github.com/microsoft/terminal/commit/3a629be02200485cae1bd3a1d4c61091b29e2772) AtlasEngine: Improve glyph generation performance ### 📊 Changes **3 files changed** (+24 additions, -78 deletions) <details> <summary>View changed files</summary> 📝 `src/renderer/atlas/AtlasEngine.cpp` (+1 -5) 📝 `src/renderer/atlas/AtlasEngine.h` (+0 -5) 📝 `src/renderer/atlas/AtlasEngine.r.cpp` (+23 -68) </details> ### 📄 Description #13458 added the ability to reuse tiles from our glyph atlas texture so that we stop running out of GPU memory for complex Unicode. This however can result in our glyph generation being a performance issue in edge cases, to the point that the application may feel outright unuseable. CJK glyphs for instance can easily exceed the maximum atlas texture size (twice the window size), but take a significant amount of CPU and GPU time to rasterize and draw, which results in "jelly scrolling" down to ~1 FPS. This PR improves the situation of the latter half by directly drawing glyphs into the texture atlas without an intermediate scratchpad texture. This reduces GPU usage by 96% on my system (33% -> 2%) which improves general render performance by ~100% (15 -> 30 FPS). CPU usage remains the same however, but that's not really something we can do anything about at this time. The atlas texture is already our primary means to reduce the CPU cost after all. ## Validation Steps Performed * Disable V-Sync for OpenConsole in NVIDIA Control Panel * Enable `debugGlyphGenerationPerformance` * Print the entire CJK block U+4E00..U+9FFF * Measure the above GPU usage and FPS improvements ✅ (Alternatively: Just scroll around and judge the "jellyness".) --- <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:35:44 +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#29579