Skip to main content

per_slot_bytes

Function per_slot_bytes 

Source
pub fn per_slot_bytes(res: u32, tile_res: u32) -> i64
Expand description

VRAM one resident chunk slot reserves across ALL the GPU pools: geometry verts_per_chunk(res) × 48 B (pos_tex rgba32f 16 + verts_tex 2×rgba16f 16 + verts_buf float4 16), the colour + normal detail atlases (tile_res² × 8 B), and the CPU-surface colour + height + normal storage buffers (tile_res² × 12 B — allocated unconditionally by ChunkGpu::ensure). The VRAM budget divides by this; forgetting the surface buffers (the old accounting) made the real allocation ~2× the configured budget at large tile_res.