TS8025
On this page

TS8025

Front-end code BUILTIN_STAGE

A @builtin(...) id used as the input or output of the wrong stage, for example frag_depth on a vertex return or front_facing on a vertex parameter.

The registry has no documentation comment for this constant, so the line above is written by this site from the messages the compiler raises it with.

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(i: builtin<"vertex_index">): 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(p: builtin<"position">): 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.

See also

Source

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

Edit this page Report a problem