TS8099
이 페이지에서

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.

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

예제

example.shade.ts
"use typeshade"
@fragment
export function main(@location(0) uv: vec2): vec4 {
let g = 0.
do {
g += 0.5
} while (g < 1.)
return vec4(g, g, g, 1.)
}

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

TS8099 error, 6행: do…while is not supported: the IR has one loop shape, a top-tested "for", and a do…while runs its body before the first test. Write "while (c) { … }" with the body's first pass unrolled above it, or a counted "for".

고치는 법

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

example.shade.ts
"use typeshade"
@fragment
export function main(@location(0) uv: vec2): vec4 {
let g = 0.5
while (g < 1.) {
g += 0.5
}
return vec4(g, g, g, 1.)
}

이 코드가 적용하는 규칙

규칙 6.1 테스트
A resource must be written declare const x: uniform<T>, declare const x: storage<T>, declare const x: storage<T, "read_write">, or declare const x: <texture or sampler type>.
규칙 6.2 테스트
A storage binding’s access mode is its second type argument: storage<T> is var<storage, read> and storage<T, "read_write"> is var<storage, read_write>.
규칙 7.7 테스트
discard must be written as a bare statement, the identifier alone (discard), and may stand in a fragment entry and in a helper no vertex or compute entry can reach.
규칙 8.3 테스트
A builtin WGSL confines by stage may be used in an entry of a permitted stage, and in a helper that no entry of an excluded stage can reach.
규칙 8.6 테스트
An entry point must not be called from another function, and neither may a kernel function (Rule 8.22).
규칙 8.17 테스트
A local function (a const that holds an arrow function or a function expression, or a function declaration, written inside a function’s body) is a function of the module named after the body that declares it (surface §14), and it may read and write the variables of the functions around it, as a TypeScript closure does.
규칙 8.18 테스트
A function whose parameter has a function type, written out (f: (x: f32) => f32) or through a type alias of one, takes a function: a function declared at the top of the file or of a namespace, a method, a static method, a constructor, a field that holds a function (Rule 8.16) and a local function (Rule 8.17).

함께 보기

SD0109
a fragment-only builtin is reachable from a vertex or compute entry

소스

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

이 페이지 편집 문제 보고