Splats · interface
SplatSortScratch
The arrays a sort reuses, allocated once by the caller.
Explained in Gaussian splats.
interface SplatSortScratchimport type { SplatSortScratch } from '@driftengine/splats';In depth
A sort allocates nothing, which is the whole reason this is a parameter rather than a local: the two histograms are 384 KB between them, and a capture re-sorts whenever the view turns. Doing that in a worker does not make an allocation free — it makes it somebody else's garbage.
Properties
| Name | Type | Description |
|---|---|---|
keysreadonly | Uint16Array | The depth bucket of each splat, carried from the counting pass to the scatter. |
countsreadonly | Uint32Array | The depth histogram, then the prefix sum over it. |
sizesreadonly | Uint16Array | The size bucket of each splat, overwritten by the counting pass with whether it survived. |
sizeCountsreadonly | Uint32Array | The size histogram, walked from the top to find the budget's threshold. |
bitsreadonly | Float32Array | Two views of one four-byte buffer, for reading a float's bits without allocating a view.MoreA pair rather than a |
bitsAsUintreadonly | Uint32Array |