import { GpuComputeNode, GpuFragmentParams } from '../../gpu/contract'; import { SimBindContext, SimSize, SimSlot, SimTick } from '../../gpu/scaffolds/feedbackSim'; /** The TypeGPU root, via the contract (direct `typegpu` imports are restricted to src/gpu/). */ export type FeedbackRoot = NonNullable['root']; /** A 2D-dispatched TGSL kernel over the state grid. */ export type FeedbackKernel = (cx: number, cy: number) => void; /** What the bind-group builders get: the scaffold's context plus the params uniform's buffer. */ export type FeedbackBindContext = SimBindContext & { paramsBuffer: unknown; }; export interface FeedbackSimConfig { /** State + display resolution per axis (square — both current consumers' shape). */ size: number; format: 'rgba16float' | 'rgba32float'; /** Extra texture pairs swapping in lockstep with the state (TimeTrail's prev-live copy). */ extraSlots?: Record; /** Orientation-independent extra textures. */ textures?: Record; /** Prop whose value scales `dt`. */ speedProp?: string; maxDeltaTime?: number; /** The shader's per-frame params struct — the noun owns its uniform. */ paramsSchema: unknown; /** Build one orientation's bind groups (called twice, late, by the scaffold). */ bindGroups: (ctx: FeedbackBindContext, read: SimSlot, write: SimSlot) => TGroups; /** Build orientation-independent bind groups (called once, late). */ staticGroups?: (ctx: FeedbackBindContext) => unknown; /** * The state-advance kernel — ONE kernel per step, compile-time variant selected in the build * callback. Splitting a step into several kernels is a different simulation (and different * WGSL); a shader that needs a multi-dispatch step should not ride this noun's default frame. */ step: FeedbackKernel; /** Idle-gate policy: true → skip the frame entirely (the scaffold then skips the swap too). */ skip?: (t: SimTick) => boolean; /** The per-frame params derivation — the one runtime surface. Written before the dispatch. */ values: (t: SimTick) => TParams; /** Extra `outputs` entries beyond the scaffold's childTexture/display. */ outputs?: Record; } /** * The feedback-simulation noun. Spread it into a definition: `...feedbackSim((params, root) => ({...}))`. * * Requires a child (these are all child-consuming echo/decoder effects): bails to `null` (fragment * passthrough) without one, without a device, or when the scaffold cannot allocate. */ export declare function feedbackSim(build: (params: GpuFragmentParams, root: FeedbackRoot) => FeedbackSimConfig): { compute: GpuComputeNode; }; //# sourceMappingURL=feedback.d.ts.map