import { GraphicsDevice } from 'playcanvas';
/**
 * Tile size in pixels (workgroup size for rasterize/finalize compute).
 * Must match the value baked into the WGSL shader sources.
 */
declare const TILE_SIZE = 16;
/**
 * Configuration for a `GpuSplatRasterizer`. Fixed across the lifetime of
 * a render — `numSHBands` and the per-group sizes determine GPU buffer
 * sizes and shader uniform layouts.
 */
interface SplatRasterizerOptions {
    /** Number of SH bands above DC (0–3). Determines input stride. */
    numSHBands: 0 | 1 | 2 | 3;
    /** Tiles per group axis (e.g. 8 → 128×128-pixel groups). */
    groupSizeTiles: number;
    /** Max gaussians per chunk; sizes the per-slot input + projection buffers. */
    chunkCap: number;
    /** Number of pipelined slots; the caller picks the slot per group. */
    numSlots: number;
    /** Output image width in pixels (constant per render). */
    imageWidth: number;
    /** Output image height in pixels (constant per render). */
    imageHeight: number;
    /** Near plane distance in world units. */
    near: number;
    /** Camera basis: rows are (right, down, forward) of the world→camera rotation. */
    rightX: number;
    rightY: number;
    rightZ: number;
    downX: number;
    downY: number;
    downZ: number;
    forwardX: number;
    forwardY: number;
    forwardZ: number;
    /** Camera eye position in world space. */
    eyeX: number;
    eyeY: number;
    eyeZ: number;
    /** Focal lengths in pixel units. */
    focalX: number;
    focalY: number;
    /** RGBA background, each channel in [0, 1]. */
    bgR: number;
    bgG: number;
    bgB: number;
    bgA: number;
}
/**
 * GPU-accelerated splat rasterizer mirroring `GpuVoxelization`'s shape.
 *
 * Owns three compute shaders (project, rasterize-accumulate, finalize-pack)
 * and per-slot GPU buffers. Designed to be driven by an external
 * orchestrator (`tile-stream.ts`) that handles BVH queries, sorting and
 * slot rotation.
 *
 * The caller's per-group flow is:
 *   1. `beginGroup(slot, ...)` — clears the slot's running state and sets
 *      uniforms for this group.
 *   2. `dispatchChunk(slot, chunkData, chunkSize)` once per chunk —
 *      uploads the chunk's raw splat fields, dispatches project, then
 *      rasterize-accumulate.
 *   3. `finishGroup(slot)` — dispatches finalize-pack and starts an async
 *      readback. Returns a `Promise<Uint8Array>` resolved when the GPU has
 *      finished writing this group's RGBA bytes.
 */
declare class GpuSplatRasterizer {
    private device;
    private options;
    private projectShader;
    private rasterizeShader;
    private finalizeShader;
    private projectBgFormat;
    private rasterizeBgFormat;
    private finalizeBgFormat;
    private slots;
    private clearStatePattern;
    /** Floats per gaussian in the input buffer (depends on SH band count). */
    readonly inputStride: number;
    /** Tiles per group axis. */
    readonly groupSizeTiles: number;
    /** Max gaussians per chunk. */
    readonly chunkCap: number;
    /** Number of pipelined slots. */
    readonly numSlots: number;
    /** Pixels per group axis. */
    readonly groupPixelSize: number;
    constructor(device: GraphicsDevice, options: SplatRasterizerOptions);
    /**
     * Apply the global (camera + image + background) uniforms to a slot's
     * compute instances and the per-group fields.
     *
     * @param slot - Slot index.
     * @param groupX - Group X index.
     * @param groupY - Group Y index.
     * @param groupTilesX - Number of tiles in this group along X (≤ groupSizeTiles).
     * @param groupTilesY - Number of tiles in this group along Y.
     */
    private setUniforms;
    /**
     * Begin processing on a slot. Clears running state and sets uniforms.
     *
     * @param slot - Slot index.
     * @param groupX - Group X index.
     * @param groupY - Group Y index.
     * @param groupTilesX - Tiles along X for this group.
     * @param groupTilesY - Tiles along Y for this group.
     */
    beginGroup(slot: number, groupX: number, groupY: number, groupTilesX: number, groupTilesY: number): void;
    /**
     * Upload and process one chunk of gaussians.
     *
     * Forces a queue submit at the end of the chunk's dispatches. The
     * project + rasterize computes share a single persistent uniform
     * buffer per Compute instance in PlayCanvas; without submitting
     * between chunks the next chunk's `setParameter` would overwrite the
     * uniform buffer in place, causing every queued dispatch on the same
     * Compute to read the LAST chunk's values (truncating earlier chunks
     * to the final chunk's `chunkSize`).
     *
     * @param slot - Slot index.
     * @param chunkData - Float32Array containing `chunkSize × inputStride` floats.
     * @param chunkSize - Number of gaussians in this chunk (≤ chunkCap).
     */
    dispatchChunk(slot: number, chunkData: Float32Array, chunkSize: number): void;
    /**
     * Finish processing a group. Dispatches finalize-pack and starts an
     * async readback of the group's RGBA8 pixel bytes.
     *
     * @param slot - Slot index.
     * @param groupTilesX - Tiles along X for this group.
     * @param groupTilesY - Tiles along Y for this group.
     * @returns Promise resolving to the group's RGBA byte buffer
     * (`groupTilesX·16 × groupTilesY·16 × 4` bytes).
     */
    finishGroup(slot: number, groupTilesX: number, groupTilesY: number): Promise<Uint8Array>;
    /**
     * Release all GPU resources.
     */
    destroy(): void;
}
export { GpuSplatRasterizer, type SplatRasterizerOptions, TILE_SIZE };
