Skip to content

Cap raster resolution to GPU MAX_TEXTURE_SIZE#89

Merged
mucow24 merged 1 commit into
mainfrom
claude/dazzling-torvalds-25e9c4
Apr 30, 2026
Merged

Cap raster resolution to GPU MAX_TEXTURE_SIZE#89
mucow24 merged 1 commit into
mainfrom
claude/dazzling-torvalds-25e9c4

Conversation

@mucow24
Copy link
Copy Markdown
Owner

@mucow24 mucow24 commented Apr 30, 2026

Summary

  • At extreme zoom (~13× and up on a 16384 GPU at DPR 1.5), Pixi's text textures and filter render targets exceeded gl.MAX_TEXTURE_SIZE. The failed allocation composited a black/garbage rect over the affected region — visually like a near-plane camera clipping through high-z items, with lower layers (canvas surface, shapes) only visible where no text would have covered them.
  • New helper clampRasterResolution(requested, itemDim, maxTextureSize) in rasterCaps.ts (with cached GL probe getMaxTextureSize()).
  • pixiText.resolution, ClampingBlurFilter.resolution, and DropShadowFilter.resolution are clamped against the cap. Past the threshold, glyphs/filters go soft instead of disappearing.
  • The image-adjustment path already had a flat Math.min(2, …) cap with the same root cause in its comment ("clipping shows up as rectangular edges on filtered output") — left unchanged here, but the new helper would generalize it.

Test plan

  • npm run preflight (lint, typecheck, unit, e2e) — all green
  • Local manual: zoom past 1300% on a multi-text doc, canvas no longer goes black
  • Verify on a doc with blurRadius > 0 items at extreme zoom
  • Verify on a doc with drop-shadowed shapes at extreme zoom

🤖 Generated with Claude Code

At extreme zoom, Pixi text textures and filter render targets could
exceed gl.MAX_TEXTURE_SIZE. The failed allocation rendered a black rect
over the affected region, looking like a camera near-plane clipping
through the canvas. Clamp the requested resolution against
MAX_TEXTURE_SIZE so high-z items go soft instead of disappearing.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@mucow24 mucow24 merged commit 3b829a9 into main Apr 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant