어트리뷰트
이름 9개
@로 쓰는 속성입니다. 진입점의 스테이지, 커널 함수의 워크그룹 크기, 속성 타입의 데코레이터 형태를 적습니다.
시그니처와 이름 아래 문장, 컴파일러 메시지는 커밋 af54ddad5의 컴파일러가 쓴 영어 원문입니다.
@vertex- Marks the pipeline's vertex-stage entry point, on the function declaration:
@vertex export function vs(…) { … }. @fragment- Marks the pipeline's fragment-stage entry point, on the function declaration:
@fragment export function fs(…) { … }. @compute- Marks a compute-stage entry point with its workgroup size, one to three extents, on the function declaration:
@compute([64]) export function main(…) { … }. @workgroup_size- Optionally states the workgroup size of each loop that does not reduce in a kernel function, an exported function that takes an array with no size or a 2D storage texture, as one extent:
@workgroup_size([128]) export function scale(xs: array<f32>) { … }. @builtin- The decorated form of
builtin<N>, a WebGPU builtin value:i: builtin<"vertex_index">for@builtin("vertex_index") i: u32. @location- The decorated form of
location<I, T>, a numeric shader IO location:uv: location<0, vec2>for@location(0) uv: vec2. @interpolate- The decorated form of the
interpolateoption,location<0, u32, { interpolate: "flat" }>, or a type and a sampling as{ interpolate: ["linear", "centroid"] }. @invariant- The decorated form of the
invariantoption,builtin<"position", { invariant: true }>: WGSL's promise that this position is computed the same way in two pipelines, so a depth pre-pass matches the shading pass. @blend_src- The decorated form of the
blend_srcoption,location<0, vec4, { blend_src: 0 }>beside{ blend_src: 1 }: which of the two colours a dual-source blend mixes this fragment output is.
이름, 선언과 설명은 고정된 커밋의 컴파일러 언어 서비스에서 가져옵니다. 내장 함수의 출력 표기와 스테이지 규칙은 컴파일러 코드에서 읽습니다. 항목의 묶음과 이 페이지의 보충 설명은 사이트에서 작성했습니다.