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.
Type Parameters
Section titled “Type Parameters”• TElement extends AnyData
Parameters
Section titled “Parameters”elementType
Section titled “elementType”TElement
The type of elements in the array.
number
The number of elements in the array.
Returns
Section titled “Returns”Disarray
<TElement
>
Examples
Section titled “Examples”const disarray = d.disarrayOf(d.vec3f, 3); // packed array of vec3f
const disarray = d.disarrayOf(d.align(16, d.vec3f), 3);