mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-30 04:57:54 -06:00
Review of #2158: a buffer-backed accessor is checked against its buffer, but each primitive that references it reads it again and keeps its own copy, so a 3 MB file listing 50,000 references to one 100,000-vertex accessor asked for about 80 GB. Every accessor read, with or without a bufferView, is now charged to one budget for the whole file, as is what a primitive keeps besides its reads: generated indices when `indices` is missing, the triangle list (3(k-2) for a strip or fan of k), flat-normal vertices and computed tangents. Going over it is the usual malformed-file error. The cap is a fixed 2^28 components (about 1 GiB as f32/u32), not a multiple of the buffer size: real assets share one vertex buffer across many primitives, and a 10M-triangle scan reads about 90M components. Buffer-less accessors keep their tighter 16M sub-budget.