EntryIoField
Interface in Reflection
One field of an entry point's stage interface: a @location(n) varying, vertex attribute or fragment draw buffer, or a @builtin(name) slot.
import type { EntryIoField } from 'typeshade'
The signature, the description and the examples come from the compiler's own source at commit af54ddad5.
Syntax
interface EntryIoField { readonly name: string; readonly emitted: string; readonly type: string; readonly location?: number; readonly builtin?: string;}Description
Where the entry spelled it as a member
of a struct parameter or struct return, the field is reported flattened out of that struct;
see EntryIo.
Instance properties
nameread onlystringThe field’s own identifier: a parameter’s name, a flattened struct field’s name, or
_retfor a bare non-struct return value (the name the GLSL backend gives that output).emittedread onlystringThe field’s name in the emitted text (Rule 11.10).
typeread onlystringThe DSL type key (the string
typeKeyreturns), the same spellingStructLayout.fields[].typeandVertexAttr.typeuse.locationoptionalread onlynumberThe location, written (
location<n, T>) or given by the compiler (Rule 6.6, change 0135). Absent on a@builtinfield and on an unattributed one of a module built in code; the two are told apart by whetherbuiltinis set.builtinoptionalread onlystringThe declared
@builtin(name), in WGSL’s own vocabulary (position,vertex_index, …). Builtins are reported alongside locations. A consumer that compares varyings and leaves builtins out (they are not varyings) filters on this field, and can then report thatpositionwas excluded because it is a builtin.
See also
Source
src/core/reflect/entry-types.ts, line 40, at commit af54ddad5