TS8038
이 페이지에서

TS8038

프런트엔드 코드 F64_ENTRY_IO

An emulated double (f64, a vec64) on an entry's IO boundary — a @location parameter, a @location field of an IO struct, or an entry's return.

레지스트리 설명과 컴파일러 메시지는 컴파일러 원문이라 한국어 페이지에서도 영어로 둡니다.

발생 조건

An emulated double (f64, a vec64) on an entry's IO boundary — a @location parameter, a @location field of an IO struct, or an entry's return. A double is a pair of f32 words after lowering, and a varying interpolates each word on its own, which is not the interpolation of the double they encode; a vec64 attribute would need two slots. Its own code rather than the UNSUPPORTED bucket because the remedy is specific and an author can look it up: narrow with f32(x), or read the double in the stage that needs it, since a uniform or a storage binding carries an f64 and every stage can see one. There is deliberately no author-facing way to split a double into its two f32 words — they are the emulation's business (§39).

예제

example.shade.ts
"use typeshade"
@fragment
export function main(@location(0) uv: vec2<f64>): vec4 {
return vec4(f32(uv.x), f32(uv.y), 0., 1.)
}

빌드할 때 고정된 컴파일러로 이 프로그램을 컴파일하면 다음 진단이 나옵니다.

TS8038 error, 4행: Parameter "uv" carries vec2f64: 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.

고치는 법

같은 프로그램을 고친 모습입니다. 진단 없이 컴파일됩니다.

example.shade.ts
"use typeshade"
@fragment
export function main(@location(0) uv: vec2): vec4 {
return vec4(uv.x, uv.y, 0., 1.)
}

이 코드가 적용하는 규칙

규칙 2.3 테스트
A value sometimes has to cross between a representation the compiler chose and one the target has: an f64 and the two f32 halves that carry it across an interface of f32.
규칙 12.6 테스트
A requirement the front end can check must be checked at the front end, in the author’s words, and not left to Tint or a driver.

함께 보기

SD0044
f64 in an interpolated @location IO field
TS8099 UNSUPPORTED
UNSUPPORTED (TS8099) is the one deliberate exception to "sequential": it is the catch-all for a diagnostic whose site does not yet deserve its own code, so it stays parked past the sequential range instead of at its head.

소스

커밋 c66579bf에서 컴파일러가 이 코드를 내는 곳입니다. 파일마다 한 줄씩 적었습니다.

이 페이지 편집 문제 보고