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 26de7be8.
Syntax
interface EntryIoField { readonly name: 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).typeread onlystringThe DSL type key (the string
typeKeyreturns), the same spellingStructLayout.fields[].typeandVertexAttr.typeuse.locationoptionalread onlynumberThe declared
@location(n). Absent on a@builtinfield and on an unattributed one; 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.ts, line 502, at commit 26de7be8