import { UniformLayout, ParamDef, System, Literal, PylinkaProject } from '@pylinka/graph'; import { C as CompiledParticlesOptions, a as CompiledParticlesHandle } from '../emitter-DCgFspU4.js'; export { b as CompiledStats, S as SystemClock } from '../emitter-DCgFspU4.js'; export { C as CompiledAtlasOptions, r as resolveSprite, s as softDisc } from '../mask-DvK7Ulmr.js'; import { K as KnobStore } from '../knobs-CVFP2Gxg.js'; import '../atlas-D83bp0cn.js'; /** * Value-table staging for the compiled backends (REQUIREMENTS.md §12.2, §13.3). * The compiler's UniformLayout maps every inline literal and knob to a vec4 * slot; this table is the CPU staging copy flushed to the GPU each frame. Knob * slots re-read the KnobStore every frame (alloc-free); node-value slots * re-read the graph only on init/apply (a value scrub in the editor swaps the * project object, never recompiles). */ /** Parse '#rrggbbaa' (lowercase, 8 digits — the Literal color format) into out. */ declare function writeHexColor(hex: string, out: Float32Array, offset: number): void; /** Write one Literal into a vec4 slot (padding with zeroes). */ declare function writeLiteral(lit: Literal, out: Float32Array, offset: number): void; /** CPU staging for the §13.3 value table `V: array`. */ declare class ValueTable { /** 4 floats per slot — upload this whole array every frame (§13.11 step 4) */ readonly data: Float32Array; private readonly nodeSlots; private readonly knobSlots; constructor(layout: UniformLayout, params: ParamDef[]); /** Re-read inline node values from the graph (init / apply — may allocate). */ refreshNodeValues(system: System): void; /** Pull current knob values into their slots (every frame — alloc-free). */ refreshKnobs(knobs: KnobStore): void; } /** TS mirror of the §13.4 pcg for advancing baseSeed on the CPU. */ declare function pcg(v: number): number; /** * @pylinka/core/gpu — one call, best available compiled backend. * * `createCompiledParticles` compiles the project graph to real GPU code and * runs it: WebGPU compute kernels where available, the compiled WebGL2 * transform-feedback path everywhere else. Same handle either way. * * @example * ```ts * import { createCompiledParticles } from '@pylinka/core/gpu'; * const fx = await createCompiledParticles(canvas, project); // picks webgpu|webgl2 * console.log(fx.backendName); * ``` */ type CompiledBackend = 'auto' | 'webgpu' | 'webgl2'; interface CreateCompiledOptions extends CompiledParticlesOptions { /** 'auto' (default): webgpu when the browser has it, else webgl2. */ backend?: CompiledBackend; } /** * Run a project on a compiled backend. * * With no `systemName`, this builds EVERY enabled system and wires the * sub-emitter links the project declares — see the note on the interpreted * `createParticles`. Name a system to get just that one. */ declare function createCompiledParticles(canvas: HTMLCanvasElement, project: PylinkaProject, opts?: CreateCompiledOptions): Promise; export { type CompiledBackend, CompiledParticlesHandle, CompiledParticlesOptions, type CreateCompiledOptions, ValueTable, createCompiledParticles, pcg, writeHexColor, writeLiteral };