Skip to content

Unstruct

Defined in: packages/typegpu/src/data/dataTypes.ts:70

Struct schema constructed via d.unstruct function.

Useful for defining vertex buffers, as the standard layout restrictions do not apply. Members are not aligned in respect to their byteAlignment, unless they are explicitly decorated with the custom align attribute via d.align function.

TProps extends Record<string, BaseData> = any

Unstruct(props): { [K in string | number | symbol]: InferRecord<TProps>[K] }

Defined in: packages/typegpu/src/data/dataTypes.ts:74

Struct schema constructed via d.unstruct function.

Useful for defining vertex buffers, as the standard layout restrictions do not apply. Members are not aligned in respect to their byteAlignment, unless they are explicitly decorated with the custom align attribute via d.align function.

{ [K in string | number | symbol]: InferRecord<TProps>[K] }

{ [K in string | number | symbol]: InferRecord<TProps>[K] }

readonly [$gpuRepr]: { [K in string | number | symbol]: InferGPURecord<TProps>[K] }

Defined in: packages/typegpu/src/data/dataTypes.ts:80


readonly [$internal]: true

Defined in: packages/typegpu/src/data/wgslTypes.ts:32

BaseData.[$internal]


readonly [$invalidSchemaReason]: "Unstructs are not host-shareable, use structs instead"

Defined in: packages/typegpu/src/data/dataTypes.ts:88


readonly [$memIdent]: Unstruct<{ [K in string | number | symbol]: MemIdentityRecord<TProps>[K] }>

Defined in: packages/typegpu/src/data/dataTypes.ts:81


readonly [$repr]: { [K in string | number | symbol]: InferRecord<TProps>[K] }

Defined in: packages/typegpu/src/data/dataTypes.ts:79

BaseData.[$repr]


readonly [$reprPartial]: undefined | { [K in string | number | symbol]: Partial<InferPartialRecord<TProps>>[K] }

Defined in: packages/typegpu/src/data/dataTypes.ts:82


readonly [$validVertexSchema]: { [K in string | number | symbol]: IsValidVertexSchema<TProps[K]> }[keyof TProps] extends true ? true : false

Defined in: packages/typegpu/src/data/dataTypes.ts:85


readonly propTypes: TProps

Defined in: packages/typegpu/src/data/dataTypes.ts:76


readonly type: "unstruct"

Defined in: packages/typegpu/src/data/dataTypes.ts:75

BaseData.type

$name(label): this

Defined in: packages/typegpu/src/shared/meta.ts:83

string

this

TgpuNamable.$name