Unstruct
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.
Extends
Section titled “Extends”BaseData.TgpuNamable
Type Parameters
Section titled “Type Parameters”• TProps extends Record<string, BaseData> = any
Unstruct(
props): { [K in string | number | symbol]: InferRecord<TProps>[K] }
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.
Parameters
Section titled “Parameters”{ [K in string | number | symbol]: InferRecord<TProps>[K] }
Returns
Section titled “Returns”{ [K in string | number | symbol]: InferRecord<TProps>[K] }
Defined in
Section titled “Defined in”packages/typegpu/src/data/dataTypes.ts:72
Unstruct(): { [K in string | number | symbol]: InferRecord<TProps>[K] }
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.
Returns
Section titled “Returns”{ [K in string | number | symbol]: InferRecord<TProps>[K] }
Defined in
Section titled “Defined in”packages/typegpu/src/data/dataTypes.ts:73
Properties
Section titled “Properties”[$gpuRepr]
Section titled “[$gpuRepr]”
readonly[$gpuRepr]: { [K in string | number | symbol]: InferGPURecord<TProps>[K] }
Defined in
Section titled “Defined in”packages/typegpu/src/data/dataTypes.ts:79
[$internal]
Section titled “[$internal]”
readonly[$internal]:true|Record<string,any>
Inherited from
Section titled “Inherited from”Defined in
Section titled “Defined in”packages/typegpu/src/data/wgslTypes.ts:41
[$invalidSchemaReason]
Section titled “[$invalidSchemaReason]”
readonly[$invalidSchemaReason]:"Unstructs are not host-shareable, use structs instead"
Defined in
Section titled “Defined in”packages/typegpu/src/data/dataTypes.ts:87
[$memIdent]
Section titled “[$memIdent]”
readonly[$memIdent]:Unstruct<{ [K in string | number | symbol]: MemIdentityRecord<TProps>[K] }>
Defined in
Section titled “Defined in”packages/typegpu/src/data/dataTypes.ts:80
[$repr]
Section titled “[$repr]”
readonly[$repr]: { [K in string | number | symbol]: InferRecord<TProps>[K] }
Overrides
Section titled “Overrides”Defined in
Section titled “Defined in”packages/typegpu/src/data/dataTypes.ts:78
[$reprPartial]
Section titled “[$reprPartial]”
readonly[$reprPartial]:undefined| { [K in string | number | symbol]: Partial<InferPartialRecord<TProps>>[K] }
Defined in
Section titled “Defined in”packages/typegpu/src/data/dataTypes.ts:81
[$validVertexSchema]
Section titled “[$validVertexSchema]”
readonly[$validVertexSchema]: { [K in string | number | symbol]: IsValidVertexSchema<TProps[K]> }[keyofTProps] extendstrue?true:false
Defined in
Section titled “Defined in”packages/typegpu/src/data/dataTypes.ts:84
propTypes
Section titled “propTypes”
readonlypropTypes:TProps
Defined in
Section titled “Defined in”packages/typegpu/src/data/dataTypes.ts:75
readonlytype:"unstruct"
Overrides
Section titled “Overrides”Defined in
Section titled “Defined in”packages/typegpu/src/data/dataTypes.ts:74
Methods
Section titled “Methods”$name()
Section titled “$name()”$name(
label):this
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”TgpuNamable.$name