TS8024
프런트엔드 코드 BUILTIN_NAME
@builtin("...") names an id outside WGSL's builtin vocabulary (WgslBuiltinName in core/sot.ts).
레지스트리 설명과 컴파일러 메시지는 컴파일러 원문이라 한국어 페이지에서도 영어로 둡니다.
예제
"use typeshade"
@fragmentexport function main(@builtin("frag_coord") p: vec4): vec4 { return vec4(p.xy / 512., 0., 1.)}빌드할 때 고정된 컴파일러로 이 프로그램을 컴파일하면 다음 진단이 나옵니다.
TS8024 error, 4행: Unknown builtin "frag_coord". Supported names: vertex_index, instance_index, position, front_facing, frag_depth, sample_index, sample_mask, primitive_index, local_invocation_id, local_invocation_index, global_invocation_id, workgroup_id, num_workgroups, subgroup_invocation_id, subgroup_size, clip_distances.
고치는 법
같은 프로그램을 고친 모습입니다. 진단 없이 컴파일됩니다.
"use typeshade"
@fragmentexport function main(@builtin("position") p: vec4): vec4 { return vec4(p.xy / 512., 0., 1.)}이 코드가 적용하는 규칙
- 규칙 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.
함께 보기
소스
커밋 c66579bf에서 컴파일러가 이 코드를 내는 곳입니다. 파일마다 한 줄씩 적었습니다.