Reflection
26 members
What reflect() recovers from a module: bind groups, byte layouts and entry points.
The signature, the description and the examples come from the compiler's own source at commit 26de7be8.
-
BindEntryInterface - One resource slot in a reflected bind group: the shape of a single WGSL @group(G) @binding(B) var<space> name: T declaration, or of the sampler uniform or std140 block the GLSL ES 3.00 backend emits for it.
-
BindGroupInterface - The bind entries of one WGSL @group(N), sorted by binding.
-
EntryInfoInterface - One @vertex, @fragment or @compute entry point: its stage, its parameter and return types as DSL type keys (the strings typeKey returns), and, for a @compute entry only, its workgroup size, which defaults to 64 when the entry declares none, matching the WGSL backend's own default.
-
EntryIoInterface - One entry point's @location and @builtin interface: the shape a host validates a vertex/fragment pair against, builds a GPUVertexState from, or diffs as a pipeline contract.
-
EntryIoFieldInterface - One field of an entry point's stage interface: a @location(n) varying, vertex attribute or fragment draw buffer, or a @builtin(name) slot.
-
EntryReachInterface - What a set of entry points transitively reaches, as returned by reachFrom.
-
ExternRequirementInterface - One host-provided global a module expects, declared with externVar.
-
FieldLayoutInterface - One struct field's byte layout: its name, its DSL type key (the string typeKey returns), and its offset, align and size in bytes under the LayoutKind the enclosing StructLayout was computed with.
-
LayoutKindType - The byte-layout rule a struct's fields are placed under.
-
OverrideInfoInterface - A pipeline specialization constant the host supplies when it creates a pipeline.
-
PackInterface - The serialisable result of buildManifest: see there.
-
PackBindingInterface - One resource slot. name, space, group, binding, access and type are the fields packModule() has always given; the rest came with schema 1.
-
PackEntryInterface - A shader entry point. name and stage are the fields packModule() has always given.
-
packJsonFunction - packModule already stringified, pretty-printed at two spaces, the form a build step writes to disk or embeds in a generated module.
-
packModuleFunction - The compiled module's manifest: everything a host needs to create its pipelines and bind its resources, in one plain JSON object.
-
PackOptionsInterface - Everything packModule() adds on request.
-
reachFromFunction - Walk the call graph from entries and collect what they reach.
-
reflectFunction - Recover a module's pipeline metadata from its IR.
-
ReflectionInterface - The target-neutral pipeline metadata reflect recovers from a module: bind-group layout, every bound struct's byte layout, the vertex-attribute layout if any (vertex), every entry point's signature (entries), specialization constants (overrides), the capabilities a host must activate before pipeline creation, and the host-provided globals the module expects (requires).
-
ReflectOptionsInterface - Options for reflect.
-
ResourceKindType - What a bind entry is at the host API, independent of the WGSL address space or type that declared it.
-
StructLayoutInterface - A struct's complete byte layout: its total size and align plus one FieldLayout per field, in declaration order.
-
typeLayoutFunction - Size + alignment (bytes) of a host-shareable type under a layout.
-
VertexAttrInterface - One @location-attributed parameter of the module's @vertex entry point.
-
VertexLayoutInterface - The vertex-buffer layout for a module's @vertex entry: every @location input and the interleaved, tightly packed arrayStride they fill.
-
wgslLayoutFunction - Compute the byte layout of one struct under a LayoutKind: each field's offset, alignment and size, plus the struct's total size and alignment.