import type { Effect } from "vgpu"; import type { ShaderName } from "./registry.js"; import type { Stage } from "./stage.js"; import type { ResolvedUniforms } from "./types.js"; /** * The state a compute shader carries between frames. * * A generative shader is a pure function of its uniforms; a compute shader is * not — it owns storage buffers, steps its `@compute` entry points before the * draw, and hands the fragment stage the result. One of these lives beside * the effect in the renderer, and everything here is invisible to callers: * the same `` they would write for a gradient. * * Dispatches submit their own command buffers, which land on the queue ahead * of the frame that draws — the ordering the picture needs, with no fences. */ export interface Simulation { /** * Advance the state and rebind whatever the fragment stage reads. * * `deltaTime` 0 redraws the current state without moving it, which is what * a paused canvas wants when a slider changes. */ step(deltaTime: number, u: ResolvedUniforms, effect: Effect): void; /** Reallocate whatever tracks the canvas. State the buffers held is reset. */ resize(width: number, height: number): void; destroy(): void; } /** The simulation a compute shader needs, or nothing for the other kinds. */ export declare function createSimulation(stage: Stage, name: ShaderName, width: number, height: number, initial: ResolvedUniforms): Simulation | undefined; //# sourceMappingURL=simulation.d.ts.map