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.
Type Parameters
Section titled “Type Parameters”• TElement extends AnyWgslData
Parameters
Section titled “Parameters”elementType
Section titled “elementType”TElement
The type of elements in the array.
elementCount
Section titled “elementCount”number
The number of elements in the array.
Returns
Section titled “Returns”WgslArray
<TElement
>
Example
Section titled “Example”const LENGTH = 3;const array = d.arrayOf(d.u32, LENGTH);