disarrayOf
constdisarrayOf:TgpuComptime<DisarrayConstructor>
Defined in: packages/typegpu/src/data/disarray.ts:38
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.