Packs one view's LightUniforms block into staging at floatBase.
Every float of the block is written — the unused w slots and the dead tail
of the arrays included — so the uploaded bytes are a function of this
frame's SceneLights alone, never of what a previous frame or view left in
the reused staging array (clearSceneLights' transcript-determinism
argument, restated one buffer later).
The three vec3-meaning arrays are re-strided from SceneLights' packed
three-floats-per-light to the block's vec4 slots; punctualParams copies
straight through. SceneLights zeroes its own dead tails per collection, so
the re-stride can copy all MAX_PUNCTUAL_LIGHTS entries without
consulting the count.
The eye is three scalars rather than a Vector3 for setCameraPosition's
recorded reason: the renderer reads them straight out of the camera's world
matrix translation column and has nothing to allocate on the way.
Branch-free on purpose: point-versus-spot is already resolved in the packed
SceneLights arrays (writePunctualLight), and a packer that re-decided it
would be a second place for the light model to drift.
Packs one view's
LightUniformsblock intostagingatfloatBase.Every float of the block is written — the unused
wslots and the dead tail of the arrays included — so the uploaded bytes are a function of this frame'sSceneLightsalone, never of what a previous frame or view left in the reused staging array (clearSceneLights' transcript-determinism argument, restated one buffer later).The three
vec3-meaning arrays are re-strided fromSceneLights' packed three-floats-per-light to the block'svec4slots;punctualParamscopies straight through.SceneLightszeroes its own dead tails per collection, so the re-stride can copy allMAX_PUNCTUAL_LIGHTSentries without consulting the count.The eye is three scalars rather than a
Vector3forsetCameraPosition's recorded reason: the renderer reads them straight out of the camera's world matrix translation column and has nothing to allocate on the way.Branch-free on purpose: point-versus-spot is already resolved in the packed
SceneLightsarrays (writePunctualLight), and a packer that re-decided it would be a second place for the light model to drift.