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 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 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).

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 declared @location(n). Absent on a @builtin field and on an unattributed one; 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.ts, line 502, at commit 26de7be8

Edit this page Report a problem