TS8015
프런트엔드 코드 BACKEND
프런트엔드가 받아들인 모듈을 백엔드가 출력하지 못하고 거부했습니다. 메시지는 백엔드가 쓴 그대로입니다.
레지스트리에는 이 상수에 대한 문서 주석이 없습니다. 그래서 위 설명은 컴파일러가 이 코드와 함께 내는 메시지를 보고 이 사이트가 쓴 것입니다.
레지스트리 설명과 컴파일러 메시지는 컴파일러 원문이라 한국어 페이지에서도 영어로 둡니다.
예제
"use typeshade"
declare const data: storage<array<f32>, "read_write">
@compute([64])export function double(@builtin("global_invocation_id") id: vec3u): void { data[id.x] = data[id.x] * 2.}
@fragmentexport function main(@location(0) uv: vec2): vec4 { return vec4(uv, 0., 1.)}빌드할 때 고정된 컴파일러로 이 프로그램을 컴파일하면 다음 진단이 나옵니다.
TS8015 warning, 1행: Backend emit failed: backend 'glsl-es300' cannot emit this module — missing capabilities: storageBuffer, compute
고치는 법
같은 프로그램을 고친 모습입니다. 진단 없이 컴파일됩니다.
"use typeshade"
declare const data: storage<array<f32>, "read_write">
@compute([64])export function double(@builtin("global_invocation_id") id: vec3u): void { data[id.x] = data[id.x] * 2.}이 코드가 적용하는 규칙
- 규칙 6.6 테스트
- An entry point’s inputs and outputs are explicit parameters and return values; every parameter and every field of an entry I/O struct must carry
@builtin("...")or@location(n), and the builtin name must be one WGSL defines for that stage and direction. - 규칙 12.3 테스트
- Severity must follow the target’s role: a program WGSL refuses must be an error; a shortfall of GLSL ES 3.00 on a module with a render entry must be a warning that leaves
wgslin place; a compute-only module’s GLSL shortfall must be no diagnostic at all.
함께 보기
소스
커밋 c66579bf에서 컴파일러가 이 코드를 내는 곳입니다. 파일마다 한 줄씩 적었습니다.