SD0014
On this page

SD0014

Core code

override (specialization constant) must be a WGSL scalar type

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

In the front end

A "use typeshade" file never reaches this check with the same mistake: the front end refuses it first, under its own code. This program, compiled at build time, gets:

example.shade.ts
"use typeshade"
declare const tint: override<vec3>
@fragment
export function main(@location(0) uv: vec2): vec4 {
return vec4(uv, 0., 1.)
}

TS8014 error, line 3: override "tint" must be f32, i32, u32 or bool, not vec3.

How to fix it

The registry's hint: overrideConst supports bool/i32/u32/f32 only — WGSL forbids vec/matrix/array/struct overrides; decompose into per-component scalar overrides

See also

TS8014 TOP_LEVEL
Something at the top level of the file the compiler cannot declare: a bare statement, or a module-level declaration of a shape it refuses.

Source

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

Edit this page Report a problem