Skip to main content

Module scatter_descriptors

Module scatter_descriptors 

Source
Expand description

CPU → GPU std430 packing for the scatter passes (CEL-73).

Three buffers per the plan’s locked contracts:

  • ScatterParamsGpu — one 112-byte params block per layer, shared by ScatterPlace.slang and ScatterCompact.slang.
  • aux (pack_scatter_aux) — one 16-byte {path_lo, path_hi, face, pad} entry per realize-batch chunk, parallel to the ChunkGpu batch (the descriptor lacks the quadtree path the stable lattice key needs).
  • vis (pack_scatter_vis) — one 8-byte {slot, depth} uint2 per visible instance, the compact pass’s gather list.

Layouts are locked by tests like chunk_descriptors::chunk_params_layout.

Structs§

ScatterAuxGpu
One realize-batch chunk’s scatter aux entry (std430, 16 bytes): the chunk’s quadtree path split into two words + its face. Parallel to the ChunkGpu batch (same index), which already carries slot/level/frame/bary.
ScatterParamsGpu
Per-layer scatter parameters, byte-identical to struct ScatterParams in ScatterPlace.slang / ScatterCompact.slang (binding 2 / 0).

Functions§

pack_scatter_aux
Pack the aux buffer for a realize batch (parallel to pack_chunks order).
pack_scatter_params
Pack one ScatterParamsGpu into bytes for its per-layer buffer.
pack_scatter_vis
Pack the compact pass’s visible list: one uint slot per drawn instance (same order as the instance buffer / visible_slots).