Skip to content

disarrayOf

disarrayOf<TElement>(elementType, count): Disarray<TElement>

Defined in: packages/typegpu/src/data/disarray.ts:36

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

Elements in the schema are not aligned in respect to their byteAlignment, unless they are explicitly decorated with the custom align attribute via d.align function.

TElement extends AnyData

TElement

The type of elements in the array.

number

The number of elements in the array.

Disarray<TElement>

const disarray = d.disarrayOf(d.vec3f, 3); // packed array of vec3f
const disarray = d.disarrayOf(d.align(16, d.vec3f), 3);