Skip to content

isWgslStruct

isWgslStruct<T>(schema): schema is T

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

Checks whether passed in value is a struct schema, as opposed to, e.g., an unstruct schema.

Struct schemas can be used to describe uniform and storage buffers, whereas unstruct schemas cannot.

T extends WgslStruct<any>

unknown

schema is T

isWgslStruct(d.struct({ a: d.u32 })) // true
isWgslStruct(d.unstruct({ a: d.u32 })) // false
isWgslStruct(d.vec3f) // false