EntryIo
On this page

EntryIo

Interface in Reflection

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.

import type { EntryIo } from 'typeshade'

The signature, the description and the examples come from the compiler's own source at commit 26de7be8.

Syntax

interface EntryIo {
readonly inputs: readonly EntryIoField[];
readonly outputs: readonly EntryIoField[];
}

Description

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. Both sides are flattened. A struct parameter or struct return contributes its fields, one row each with its own location, because WGSL lets an entry spell the same varyings either as loose parameters or as one struct, and a consumer comparing two stages must not care which form each side used. A void return contributes nothing.

outputs is a list, so a fragment entry that writes several attachments (@location(0) a colour and @location(1) an entity id) is expressible here, where EntryInfo.output’s single type key cannot represent it.

The fields are read through the same attribute readers the GLSL backend uses for its in and out declarations, so the published interface and the emitted one cannot disagree.

Instance properties

inputsread only readonly EntryIoField[]
outputsread only readonly EntryIoField[]

Source

src/core/reflect.ts, line 535, at commit 26de7be8

Edit this page Report a problem