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> = any

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:1327

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:1328

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

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


readonly [$internal]: object

isAbstruct: boolean

BaseData.[$internal]

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


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

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


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

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


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

BaseData.[$repr]

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


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

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


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

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


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

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


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

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


readonly propTypes: TProps

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


readonly type: "struct"

BaseData.type

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

$name(label): this

string

this

TgpuNamable.$name

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