SD0044
Core code
f64 in an interpolated @location IO field
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:
"use typeshade"
@fragmentexport function main(d: location<0, f64>): vec4 { return vec4(f32(d), 0., 0., 1.)} TS8038 error, line 4: Parameter "d" carries f64: an emulated double is a pair of f32 words, and a @location varying interpolates each word on its own, which is not the interpolation of the double. Narrow it with f32(x), or compute the double in the stage that needs it — a uniform or storage binding carries an f64 and every stage can read one.
How to fix it
The registry's hint: interpolating hi/lo pairs is numerically wrong — narrow first (f32(x), or toF32(x) in the fn() EDSL), or read the double where it is needed: a uniform or storage binding carries an f64 and every stage can read one
See also
-
TS8038F64_ENTRY_IO - An emulated double (
f64or avec64) on an entry's IO boundary: a@locationparameter, a@locationfield of an IO struct or an entry's return. A double is a pair off32words after lowering, and a varying interpolates each word on its own. Narrow withf32(x), or read the double in the stage that needs it, since a uniform or a storage binding carries anf64.
Source
Where the compiler raises this code at commit af54ddad5, one line per file:
-
src/core/passes/fp64-lower.ts:157(3 sites)