Merge pull request #4274 from JasonXJ/cap-atlas-pages

Cap webgl maxAtlasPages to 32
This commit is contained in:
Daniel Imms
2022-11-26 07:24:47 -08:00
committed by GitHub
@@ -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);
}