disarrayOf
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.
Examples
Section titled “Examples”const disarray = d.disarrayOf(d.vec3f, 3); // packed array of vec3fconst disarray = d.disarrayOf(d.align(16, d.vec3f), 3);
If `elementCount` is not specified, a partially applied function is returned.const disarray = d.disarrayOf(d.vec3f);// ^? (n: number) => Disarray<d.Vec3f>The type of elements in the array.
The number of elements in the array.
Call Signature
Section titled “Call Signature”disarrayOf<
TElement>(elementType): (elementCount) =>Disarray<TElement>
Type Parameters
Section titled “Type Parameters”• TElement extends AnyData
Parameters
Section titled “Parameters”elementType
Section titled “elementType”TElement
Returns
Section titled “Returns”Function
Parameters
Section titled “Parameters”elementCount
Section titled “elementCount”number
Returns
Section titled “Returns”Disarray<TElement>
Defined in
Section titled “Defined in”packages/typegpu/src/data/disarray.ts:46
Call Signature
Section titled “Call Signature”disarrayOf<
TElement>(elementType,elementCount):Disarray<TElement>
Type Parameters
Section titled “Type Parameters”• TElement extends AnyData
Parameters
Section titled “Parameters”elementType
Section titled “elementType”TElement
elementCount
Section titled “elementCount”number
Returns
Section titled “Returns”Disarray<TElement>