import { TgpuRoot, TgpuBindGroup } from 'typegpu'; import { CompositionIR } from './composer'; import { TextureManager, RenderTexture } from './textures'; import { ComputeDispatcher } from './compute'; export interface PassManagerOptions { /** Injected TextureManager (textures.ts). */ textureManager: TextureManager; /** Injected compute dispatcher (compute.ts). */ dispatcher: ComputeDispatcher; /** Canvas colour format for the final pass target. Default the preferred canvas format. */ canvasFormat?: GPUTextureFormat; /** RTT target format. Default `rgba16float`. */ rttFormat?: GPUTextureFormat; /** * Device sampled-texture-per-stage ceiling (assert + log, never throw). Defaults to the * live `maxSampledTexturesPerShaderStage` limit, falling back to 16 — the WebGPU core * MINIMUM — when the device doesn't report one. */ maxSampledTextures?: number; /** Vertex entry for the fullscreen pass. Default `common.fullScreenTriangle`. */ fullScreenTriangle?: unknown; } export interface PassManager { /** * Build the executable passes for a composition: allocate RTT textures, create pipelines, * build per-pass bind groups. `uniformBindGroup` is the store's group-0 bind group; * `mediaResources` maps shader-owned media/compute texture keys → their bound resource. */ setComposition(ir: CompositionIR, uniformBindGroup: TgpuBindGroup | undefined, size: { width: number; height: number; }, mediaResources?: Record): void; /** Execute the current composition: compute → RTT passes → final pass to `canvasView`. */ render(canvasView: unknown, frameParams: unknown, afterCompute?: () => void): void; /** * Re-execute only the RTT passes (no compute, no final pass). `resize` recreates every RTT * texture zero-initialized, and `render` runs compute FIRST — so a compute step that reads a * child RTT (Glass frosted blur, kit/blur consumers) would read black for one frame after a * resize. The renderer calls this right after `resize` to repopulate the textures before the * next full frame samples them. */ repaintRtt(): void; /** * Resize all RTT textures to the new backing-buffer size. Returns true if any texture was * actually destroyed + recreated — the caller uses that to decide whether the warm-up * `repaintRtt` is needed at all. */ resize(width: number, height: number): boolean; /** Live RTT texture count (feeds performanceTracker.textureCount). */ readonly textureCount: number; /** Passes-per-frame (RTT + final) — feeds performanceTracker.drawCalls. */ readonly passCount: number; /** Destroy all RTT textures + drop pass state. */ dispose(): void; } export declare function createPassManager(root: TgpuRoot, options: PassManagerOptions): PassManager; //# sourceMappingURL=passManager.d.ts.map