@playcanvas/splat-transform
Version:
Library and CLI tool for 3D Gaussian splat format conversion and transformation
18 lines (17 loc) • 886 B
TypeScript
/**
* Single-workgroup exclusive prefix-sum of the project shader's
* per-splat `coverage[]` into `emitOffset[]`. Also writes the total
* pair count into `totalPairs[0]` so downstream kernels and the radix
* sort can size their dispatches without a CPU round trip.
*
* Layout: 256 threads, each processes `SCAN_PER_THREAD` elements
* serially (chosen so that 256 × SCAN_PER_THREAD ≥ chunkCap). Phase 1
* computes a per-thread partial sum; phase 2 has thread 0 scan the 256
* partials in shared memory (negligible vs the 800-element block work);
* phase 3 each thread re-walks its block writing the exclusive prefix.
*
* @param scanPerThread - Per-thread element budget; must satisfy `256 * scanPerThread >= chunkCap`.
* @returns WGSL source for the prefix-sum compute shader.
*/
declare const prefixSumWgsl: (scanPerThread: number) => string;
export { prefixSumWgsl };