Raw compute

The raw compute tier: records (struct), storage buffers of them (buffer), and your own compute passes over them (kernel). For anything the simulation words do not cover. The engine still owns the bind groups, workgroup sizes, bounds checks and dispatch.

import {buffer, kernel, struct} from 'shaders/std'

Types

TypeWhat it is
BufferHandleA storage buffer a sibling kernel can read and write.
BufferInputinterface BufferInput extends InputNode { readonly kind: 'buffer' readonly type: StructType readonly count: ScalarArg readonly max: number }
KernelInputinterface KernelInput extends InputNode { readonly kind: 'kernel' readonly body: string /** The buffer (by its inputs name) to run once per element of, or a fixed grid size. */ readonly over: string | readonly number, number readonly iterations: number readonly when: 'frame' | 'init' }
StructFieldTypeThe field types a struct may hold.
StructTypeA record type, by name, for buffers and kernels.

Words

Keep reading