TS8024
Front-end code BUILTIN_NAME
A @builtin("...") with a malformed name argument, or with an id outside WGSL's builtin vocabulary.
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
"use typeshade"
@fragmentexport function main(p: builtin<"frag_coord", vec4>): vec4 { return vec4(p.xy / 512., 0., 1.)}Compiled at build time against the pinned compiler, this program gets:
TS8024 error, line 4: Unknown builtin "frag_coord". Supported names: vertex_index, instance_index, position, front_facing, frag_depth, sample_index, sample_mask, primitive_index, local_invocation_id, local_invocation_index, global_invocation_id, workgroup_id, num_workgroups, subgroup_invocation_id, subgroup_size, subgroup_id, num_subgroups, clip_distances.
How to fix it
The same program, corrected. It compiles with no diagnostic.
"use typeshade"
@fragmentexport function main(p: builtin<"position">): vec4 { return vec4(p.xy / 512., 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: