isWgslStruct
isWgslStruct(
schema):schema is WgslStruct<Record<string, BaseData>>
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.
Parameters
Section titled “Parameters”schema
Section titled “schema”unknown
Returns
Section titled “Returns”schema is WgslStruct<Record<string, BaseData>>
Example
Section titled “Example”isWgslStruct(d.struct({ a: d.u32 })) // trueisWgslStruct(d.unstruct({ a: d.u32 })) // falseisWgslStruct(d.vec3f) // false