mirror of
https://github.com/storytold/photocraft.git
synced 2026-10-28 18:22:06 +01:00
The GPU canvas built a full-resolution, mipmapped texture set covering the whole declared canvas (DocTextures::new) with only per-texture side limits, so a document's size alone decided how much GPU memory was committed: a 300000x300000 canvas asks for hundreds of gigabytes. canvas_texture_bytes prices the set in closed form (every tile and mip level) and DocTextures::new refuses one over canvas_budget (a quarter of RAM, at least MIN_GPU_BUDGET) without creating anything. refresh reports "over-budget" and ensure_gpu then draws the document on the reduced CPU canvas, so a supported large document still displays. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>