fix(refboard): prevent WebGL OOM on large scenes

- Skip thumbnail generation when scene has >50 items (extract.canvas
  on full viewport with many textures causes GPU OOM and context loss)
- Add WebGL context lost/restored handlers — auto-reload scene on recovery
- Reduce texture memory budget from 512MB to 256MB for GPU headroom
This commit is contained in:
Hiren Kangad
2026-03-10 10:45:14 +05:30
parent a2eea8f22f
commit 451ec339a5
3 changed files with 31 additions and 3 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ interface TextureEntry {
*/
export class TextureManager {
private cache = new Map<string, TextureEntry>();
private budget = 512 * 1024 * 1024; // 512 MB
private budget = 256 * 1024 * 1024; // 256 MB — keeps headroom for GPU ops
private currentUsage = 0;
/** Build the URL for a given asset. */