import type { TriangleBVHResult } from './triangle-bvh.js'; export interface DeviationDispatchInput { /** Storage-usage GPU buffer holding interleaved point vertices. * Must be the same buffer used as the splat pipeline's vertex * buffer for this chunk; the compute shader reads positions * directly from it (no copy). */ positionsBuffer: GPUBuffer; /** Output buffer — one f32 per point. Must allow STORAGE. */ deviationsBuffer: GPUBuffer; /** Number of points to process. */ pointCount: number; /** Optional clip range in metres. 0 / negative → no clip. */ maxRange: number; } export declare class DeviationPipeline { private device; private pipeline; private bindGroupLayout; private bvhNodesBuffer; private trianglesBuffer; private bvhTriangleCount; private bvhNodeCount; private bvhBounds; /** * One uniform buffer per `dispatch()` call within a compute batch. They * MUST be distinct: every chunk's dispatch is recorded into one encoder and * submitted once, but `queue.writeBuffer` runs on the queue BEFORE that * single submit — so a single shared buffer would hold only the LAST * chunk's params when every pass executes. Freed by `releaseTransientParams` * after `onSubmittedWorkDone()`. */ private transientParamsBuffers; constructor(device: GPUDevice); /** * Upload the per-triangle BVH to the GPU. Replaces any previous * upload; safe to call repeatedly when the mesh set changes (load, * federation update, isolation toggle). */ uploadBvh(bvh: TriangleBVHResult): void; hasBvh(): boolean; getBvhStats(): { nodeCount: number; triangleCount: number; bounds: TriangleBVHResult['bounds'] | null; }; /** * Run the compute pass for one point chunk. Encoder-based so the * caller can dispatch many chunks back-to-back in one submit. * * Returns false when there's no BVH uploaded yet — caller should * skip the chunk in that case. */ dispatch(encoder: GPUCommandEncoder, input: DeviationDispatchInput): boolean; private disposeBvh; /** * Destroy the per-dispatch uniform buffers from the last compute batch. * Call after `queue.onSubmittedWorkDone()` so the GPU is finished reading * them. Safe to call repeatedly. */ releaseTransientParams(): void; destroy(): void; } //# sourceMappingURL=deviation-pipeline.d.ts.map