Skip to content

WgslStruct

Struct schema constructed via d.struct function.

Responsible for handling reading and writing struct values between binary and JS representation. Takes into account the byteAlignment requirement of its members.

TProps extends Record<string, BaseData> = Record<string, BaseData>

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

Struct schema constructed via d.struct function.

Responsible for handling reading and writing struct values between binary and JS representation. Takes into account the byteAlignment requirement of its members.

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

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

packages/typegpu/src/data/wgslTypes.ts:1150

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

Struct schema constructed via d.struct function.

Responsible for handling reading and writing struct values between binary and JS representation. Takes into account the byteAlignment requirement of its members.

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

packages/typegpu/src/data/wgslTypes.ts:1151

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

packages/typegpu/src/data/wgslTypes.ts:1155


readonly [$internal]: object

isAbstruct: boolean

BaseData.[$internal]

packages/typegpu/src/data/wgslTypes.ts:1144


readonly **[{K & string}’ — `> }[keyof TProps], undefined>

packages/typegpu/src/data/wgslTypes.ts:1158


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

packages/typegpu/src/data/wgslTypes.ts:1156


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

BaseData.[$repr]

packages/typegpu/src/data/wgslTypes.ts:1154


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

packages/typegpu/src/data/wgslTypes.ts:1157


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

packages/typegpu/src/data/wgslTypes.ts:1167


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

packages/typegpu/src/data/wgslTypes.ts:1172


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

packages/typegpu/src/data/wgslTypes.ts:1177


readonly propTypes: TProps

packages/typegpu/src/data/wgslTypes.ts:1148


readonly type: "struct"

BaseData.type

packages/typegpu/src/data/wgslTypes.ts:1147

$name(label): this

string

this

TgpuNamable.$name

packages/typegpu/src/shared/meta.ts:97


toString(): string

string

BaseData.toString

packages/typegpu/src/data/wgslTypes.ts:43