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.
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] }
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.
Parameters
Section titled “Parameters”{ [K in string | number | symbol]: InferRecord<TProps>[K] }
Returns
Section titled “Returns”{ [K in string | number | symbol]: InferRecord<TProps>[K] }
Properties
Section titled “Properties”[$gpuRepr]
Section titled “[$gpuRepr]”
readonly
[$gpuRepr]: { [K in string | number | symbol]: InferGPURecord<TProps>[K] }
Defined in: packages/typegpu/src/data/dataTypes.ts:80
[$internal]
Section titled “[$internal]”
readonly
[$internal]:true
Defined in: packages/typegpu/src/data/wgslTypes.ts:32
Inherited from
Section titled “Inherited from”[$invalidSchemaReason]
Section titled “[$invalidSchemaReason]”
readonly
[$invalidSchemaReason]:"Unstructs are not host-shareable, use structs instead"
Defined in: packages/typegpu/src/data/dataTypes.ts:88
[$memIdent]
Section titled “[$memIdent]”
readonly
[$memIdent]:Unstruct
<{ [K in string | number | symbol]: MemIdentityRecord<TProps>[K] }>
Defined in: packages/typegpu/src/data/dataTypes.ts:81
[$repr]
Section titled “[$repr]”
readonly
[$repr]: { [K in string | number | symbol]: InferRecord<TProps>[K] }
Defined in: packages/typegpu/src/data/dataTypes.ts:79
Overrides
Section titled “Overrides”[$reprPartial]
Section titled “[$reprPartial]”
readonly
[$reprPartial]:undefined
| { [K in string | number | symbol]: Partial<InferPartialRecord<TProps>>[K] }
Defined in: packages/typegpu/src/data/dataTypes.ts:82
[$validVertexSchema]
Section titled “[$validVertexSchema]”
readonly
[$validVertexSchema]: { [K in string | number | symbol]: IsValidVertexSchema<TProps[K]> }[keyofTProps
] extendstrue
?true
:false
Defined in: packages/typegpu/src/data/dataTypes.ts:85
propTypes
Section titled “propTypes”
readonly
propTypes:TProps
Defined in: packages/typegpu/src/data/dataTypes.ts:76
readonly
type:"unstruct"
Defined in: packages/typegpu/src/data/dataTypes.ts:75
Overrides
Section titled “Overrides”Methods
Section titled “Methods”$name()
Section titled “$name()”$name(
label
):this
Defined in: packages/typegpu/src/shared/meta.ts:83
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”TgpuNamable.$name