UNPKG

typegpu

Version:

A thin layer between JS and WebGPU/WGSL that improves development experience and allows for faster iteration.

14 lines (13 loc) 694 B
import type * as wgsl from './wgslTypes.ts'; import { type BaseData } from './wgslTypes.ts'; import type { InferPatch } from '../shared/repr.ts'; export interface WriteInstruction { data: Uint8Array<ArrayBuffer>; gpuOffset: number; } /** * Converts `{idx, value}[]` sparse arrays into `Record<number, T>` format. */ export declare function convertPartialToPatch(schema: wgsl.BaseData, data: unknown): unknown; export declare function getPatchInstructions<TData extends wgsl.BaseData>(schema: TData, data: unknown, targetBuffer?: ArrayBuffer): WriteInstruction[]; export declare function patchArrayBuffer<T extends BaseData>(buffer: ArrayBuffer, schema: T, data: InferPatch<T>): void;