pub struct Capacities {
pub vertices: u32,
pub indices: u32,
pub meshes: u32,
pub instances: u32,
pub materials: u32,
pub lights: u32,
pub probes: u32,
}Expand description
How much of each pool a scene reserves, in objects.
Every one of these is device-local memory taken at start-up and never
grown, which is the decision crate::mesh_pool argues in full: every bind
group in the renderer names those buffers, so growing one would mean
rewriting every descriptor mid-life. A caller sizes them for the scene it
means to build; a scene that outgrows one is refused rather than resized.
Default is what the engine’s own demo scene has always used.
Fields§
§vertices: u32Vertices the geometry pool holds, across every resident mesh.
indices: u32Indices the geometry pool holds. Four per vertex is the usual ratio for indexed triangle soup, rounded up.
meshes: u32Entries the mesh table holds.
Distinct meshes, not instances of them: an object count sizes
instances, and a mesh id names one entry here
however many instances carry it. A DAG occupies one entry per level,
because each level is a vertex range of its own.
instances: u32Instances the instance pool holds, per frame in flight.
Sized against topic 03’s exit criterion — “sandbox scene: 10k+ instanced meshes” — rather than against what is resident today.
Raising this is not linear in memory. Topic 25’s
hysteresis state is one word per instance per resident group per
DrawGen, and there is a generator for the
camera, one per shadow cascade and one per shadow light slot.
The one capacity here that a description cannot be measured against,
because objects are placed while the renderer runs rather than at build:
filling it is
InstancePoolError::PoolFull
from ForwardRenderer::add_instance, which is where a caller finds out
it is this number that wants raising.
materials: u32Rows the material table holds.
Distinct materials, not instances of them — a material id names one row however many instances carry it, which is the property that makes the table worth having.
lights: u32Rows the light list holds — the sun and every
Light a caller sets.
Overflowing this is refused rather than counted, because a light missing from the list is missing from every froxel and no counter in the frame would say so.
probes: u32Rows the irradiance probe table holds.
One per probe of SceneDesc::probes, which is a
description-measurable number like materials and is
refused at build rather than at runtime.
Zero is a scene with no probes, which is what the engine’s own
demo has: the table still holds one cleared row, because a buffer of
no bytes is not a buffer, and reading that row adds exactly nothing. The
default is deliberately not larger — a probe grid is authored, and
reserving device memory for one nobody wrote is memory taken from every
existing caller for a feature they have not used.