EntryIoField
On this page

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 only string

The field’s own identifier: a parameter’s name, a flattened struct field’s name, or _ret for a bare non-struct return value (the name the GLSL backend gives that output).

emittedread only string

The field’s name in the emitted text (Rule 11.10).

typeread only string

The DSL type key (the string typeKey returns), the same spelling StructLayout.fields[].type and VertexAttr.type use.

locationoptionalread only number

The location, written (location<n, T>) or given by the compiler (Rule 6.6, change 0135). Absent on a @builtin field and on an unattributed one of a module built in code; the two are told apart by whether builtin is set.

builtinoptionalread only string

The 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 that position was excluded because it is a builtin.

See also

Source

src/core/reflect/entry-types.ts, line 40, at commit af54ddad5

Edit this page Report a problem