Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continually merge texture atlas pages #4252

merged 9 commits into from Nov 3, 2022


Copy link

@Tyriar Tyriar commented Nov 3, 2022

When atlas pages are created beyond a certain threshold determined by the webgl maximum texture units, the 4 largest and most used atlas pages are merged (eg. 512x512 -> 1024x1024). This continues to happen up to a maximum of 4096x4096 (16mb). The merging happens in a microtask so the current render cycle finishes as changing the texture would result in corrupted rendering. Atlas pages 1024x1024 and above are all immutable intentionally to avoid uploading large texture more than once.

The canvas rendering works with merged atlas pages but no maximum page count is enforced so if the atlas is only used by a canvas rendering, no merging occurs.

Fixes #4243
Fixes #4245 - webgl texture capacity will typically hit before this happens which is very hard to actually hit even in the demo
Fixes #4246

Here's an example of a 2048x2048 texture atlas page after running the CJK test button.


There's also another CJK test button which helps stress test the renderer:


@Tyriar Tyriar added this to the 5.1.0 milestone Nov 3, 2022
@Tyriar Tyriar self-assigned this Nov 3, 2022
@Tyriar Tyriar merged commit 862e83d into xtermjs:master Nov 3, 2022
8 checks passed
@Tyriar Tyriar deleted the 4243_merge branch November 3, 2022 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
1 participant