FieldSpec
인터페이스, 레이아웃 분류
One struct field or entry-point parameter carrying a stage attribute.
import type { FieldSpec } from 'typeshade'
시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.
구문
interface FieldSpec<T extends ShaderType = ShaderType> { readonly type: T; readonly attr: string; readonly location?: number; readonly builtin?: string; readonly interpolate?: string;}설명
One struct field or entry-point parameter carrying a stage attribute. It is the return
type of builtin and location, and the value type of both an ioStruct
field map and an fn entry-point parameter record, so a stage-attributed parameter
and an IO-struct field are written the same way.
attr is the attribute as WGSL text. location, builtin and interpolate are the
structured form the backends read, for capability checks, for the vertex-attribute table
reflect produces, and for the GLSL flat qualifier. A field carries either a
builtin attribute or a location attribute, never both. Build one with builtin(name, type)
or location(n, type, interpolate?).
인스턴스 속성
type읽기 전용TThe field’s shader type.
attr읽기 전용stringThe attribute as WGSL text. The structured fields below are what the backends read.
location선택 사항읽기 전용numberThe
@location(n)slot, when the field is location-attributed.builtin선택 사항읽기 전용stringThe
@builtin(name)id, when the field is builtin-attributed.interpolate선택 사항읽기 전용stringThe
@interpolate(mode)mode, when one was given.
함께 보기
소스
src/core/sot.ts, 100행, 커밋 c66579bf 기준