TS8025
On this page

TS8025

Front-end code BUILTIN_STAGE

A @builtin(...) id used as the wrong stage's input or output, e.g. frag_depth on a vertex return, or front_facing on a vertex parameter.

The registry text and every compiler message on these pages are the compiler's own English.

Example

example.shade.ts
"use typeshade"
@fragment
export function main(@builtin("vertex_index") i: u32): vec4 {
return vec4(f32(i), 0., 0., 1.)
}

Compiled at build time against the pinned compiler, this program gets:

TS8025 error, line 4: Builtin "vertex_index" is not a valid fragment input; it is a vertex input.

How to fix it

The same program, corrected. It compiles with no diagnostic.

example.shade.ts
"use typeshade"
@fragment
export function main(@builtin("position") p: vec4): vec4 {
return vec4(p.x / 512., 0., 0., 1.)
}

The rule this enforces

Rule 6.6 Test
An entry point’s inputs and outputs are explicit parameters and return values; every parameter and every field of an entry I/O struct must carry @builtin("...") or @location(n), and the builtin name must be one WGSL defines for that stage and direction.

See also

Source

Where the compiler raises this code at commit 26de7be8, one line per file:

Edit this page Report a problem