Skip to content

arrayOf

arrayOf<TElement>(elementType, elementCount): WgslArray<TElement>

Defined in: packages/typegpu/src/data/array.ts:21

Creates an array schema that can be used to construct gpu buffers. Describes arrays with fixed-size length, storing elements of the same type.

TElement extends AnyWgslData

TElement

The type of elements in the array.

number

The number of elements in the array.

WgslArray<TElement>

const LENGTH = 3;
const array = d.arrayOf(d.u32, LENGTH);