Accelerating Terminal rendering with D3D12 mesh shaders #21696

Closed
opened 2026-01-31 07:52:17 +00:00 by claunia · 9 comments
Owner

Originally created by @Andarwinux on GitHub (May 11, 2024).

Description of the new feature/enhancement

Accelerating Terminal rendering with D3D12 mesh shaders

Proposed technical implementation details (optional)

https://gpuopen.com/learn/mesh_shaders/mesh_shaders-font_and_vector_art_rendering_with_mesh_shaders/

Originally created by @Andarwinux on GitHub (May 11, 2024). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement Accelerating Terminal rendering with D3D12 mesh shaders <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> # Proposed technical implementation details (optional) https://gpuopen.com/learn/mesh_shaders/mesh_shaders-font_and_vector_art_rendering_with_mesh_shaders/ <!-- A clear and concise description of what you want to happen. -->
claunia added the Issue-FeatureNeeds-TriageNeeds-Tag-FixNeeds-Attention labels 2026-01-31 07:52:17 +00:00
Author
Owner

@github-actions[bot] commented on GitHub (May 11, 2024):

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@github-actions[bot] commented on GitHub (May 11, 2024): Hi I'm an AI powered bot that finds similar issues based off the issue title. Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you! ### Closed similar issues: - [Graphics Improvement: Update to DXGI 1.6 (#6437)](https://github.com/microsoft/terminal/issues/6437), similarity score: 0.77 > Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Author
Owner

@lhecker commented on GitHub (May 13, 2024):

I'm aware about this technique but my understanding is that it's significantly slower than using a glyph atlas. The reason games use mesh shaders (or the more venerable, but patented Slug library) is because games require text to be drawn in a size according to their distance to the camera. Do you disagree? Are mesh shaders actually faster for our use case?

@lhecker commented on GitHub (May 13, 2024): I'm aware about this technique but my understanding is that it's significantly slower than using a glyph atlas. The reason games use mesh shaders (or the more venerable, but patented [Slug library](https://sluglibrary.com/)) is because games require text to be drawn in a size according to their distance to the camera. Do you disagree? Are mesh shaders actually faster for our use case?
Author
Owner

@Andarwinux commented on GitHub (May 13, 2024):

I don't know anything about the low-level details of this 😅, you certainly know more about it than I do. But I was extremely impressed with the original WebGL demo of this, zooming and panning without any stuttering. Windows Terminal only achieves the same smoothness when scrolling vertically via trackpad.

@Andarwinux commented on GitHub (May 13, 2024): I don't know anything about the low-level details of this 😅, you certainly know more about it than I do. But I was extremely impressed with the original [WebGL demo](https://wdobbie.com/pdf/) of this, zooming and panning without any stuttering. Windows Terminal only achieves the same smoothness when scrolling vertically via trackpad.
Author
Owner

@lhecker commented on GitHub (May 13, 2024):

Wow yeah that demo is definitely really cool, especially when using Alt+Mouse. The author does note though:

This technique is harder on the GPU than atlas textures but avoids the need to use the CPU to render at runtime when a required glyph size is missing.

Since we mostly scroll text if anything, and don't really zoom or scale a lot, I think atlases may still have the best performance.

Windows Terminal only achieves the same smoothness when scrolling vertically via trackpad.

Do you mean to say that zooming is slow/stuttery for you? If so, I'm assuming this is when you use the newer AtlasEngine text renderer, right?

@lhecker commented on GitHub (May 13, 2024): Wow yeah that demo is definitely _really_ cool, especially when using Alt+Mouse. The author does note though: > This technique is harder on the GPU than atlas textures but avoids the need to use the CPU to render at runtime when a required glyph size is missing. Since we mostly scroll text if anything, and don't really zoom or scale a lot, I think atlases may still have the best performance. > Windows Terminal only achieves the same smoothness when scrolling vertically via trackpad. Do you mean to say that zooming is slow/stuttery for you? If so, I'm assuming this is when you use the newer AtlasEngine text renderer, right?
Author
Owner

@Andarwinux commented on GitHub (May 13, 2024):

Do you mean to say that zooming is slow/stuttery for you? If so, I'm assuming this is when you use the newer AtlasEngine text renderer, right?

The AtlasEngine option disappeared in WT Canary, I guess Direct3D11 is the AtlasEngine. Yes, I'm using it, and if I switch to Direct2D, the stuttering improves, but there is still a slight stutter.

@Andarwinux commented on GitHub (May 13, 2024): > Do you mean to say that zooming is slow/stuttery for you? If so, I'm assuming this is when you use the newer AtlasEngine text renderer, right? The AtlasEngine option disappeared in WT Canary, I guess Direct3D11 is the AtlasEngine. Yes, I'm using it, and if I switch to Direct2D, the stuttering improves, but there is still a slight stutter.
Author
Owner

@lhecker commented on GitHub (May 13, 2024):

I'll be closing this issue for now. The good news is that I do have future improvements in mind when it comes to text rendering: In particular, I'm hoping to one day implement a "tiled deferred shading" renderer with a compute shader. The reason I didn't chose this approach for the current AtlasEngine is because this app needs to work reasonably well on some particularly bad hardware. Older Intel iGPUs don't have good support for compute shaders, but I'm worried that this is most of our users.

Yes, I'm using it, and if I switch to Direct2D, the stuttering improves, but there is still a slight stutter.

Do you by any chance use an Intel GPU?

@lhecker commented on GitHub (May 13, 2024): I'll be closing this issue for now. The good news is that I do have future improvements in mind when it comes to text rendering: In particular, I'm hoping to one day implement a "tiled deferred shading" renderer with a compute shader. The reason I didn't chose this approach for the current AtlasEngine is because this app needs to work reasonably well on some particularly bad hardware. Older Intel iGPUs don't have good support for compute shaders, but I'm worried that this is most of our users. > Yes, I'm using it, and if I switch to Direct2D, the stuttering improves, but there is still a slight stutter. Do you by any chance use an Intel GPU?
Author
Owner

@Andarwinux commented on GitHub (May 13, 2024):

Do you by any chance use an Intel GPU?

I'm using RTX3080. Intel UHD750 is laggy running anything on 4K monitors.

@Andarwinux commented on GitHub (May 13, 2024): > Do you by any chance use an Intel GPU? I'm using RTX3080. Intel UHD750 is laggy running anything on 4K monitors.
Author
Owner

@lhecker commented on GitHub (May 13, 2024):

Do you use G-SYNC? If so, what happens if you disable that?

@lhecker commented on GitHub (May 13, 2024): Do you use G-SYNC? If so, what happens if you disable that?
Author
Owner

@Andarwinux commented on GitHub (May 14, 2024):

Do you use G-SYNC? If so, what happens if you disable that?

I disabled GSYNC, enabled it on only makes it worse.

@Andarwinux commented on GitHub (May 14, 2024): > Do you use G-SYNC? If so, what happens if you disable that? I disabled GSYNC, enabled it on only makes it worse.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21696