From b7c119a071ca15d01bdb3a2eb8a908801f9b23d7 Mon Sep 17 00:00:00 2001 From: Jason Lin Date: Thu, 24 Nov 2022 17:51:58 +1100 Subject: [PATCH] Cap webgl maxAtlasPages to 32 --- addons/xterm-addon-webgl/src/GlyphRenderer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/xterm-addon-webgl/src/GlyphRenderer.ts b/addons/xterm-addon-webgl/src/GlyphRenderer.ts index ce71f7b6..faa00c52 100644 --- a/addons/xterm-addon-webgl/src/GlyphRenderer.ts +++ b/addons/xterm-addon-webgl/src/GlyphRenderer.ts @@ -119,7 +119,7 @@ export class GlyphRenderer extends Disposable { if (TextureAtlas.maxAtlasPages === undefined) { // Typically 8 or 16 - TextureAtlas.maxAtlasPages = throwIfFalsy(gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS) as number | null); + TextureAtlas.maxAtlasPages = Math.min(32, throwIfFalsy(gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS) as number | null)); // Almost all clients will support >= 4096 TextureAtlas.maxTextureSize = throwIfFalsy(gl.getParameter(gl.MAX_TEXTURE_SIZE) as number | null); }