EntryIoField
이 페이지에서

EntryIoField

인터페이스, 리플렉션 분류

One field of an entry point's stage interface: a @location(n) varying, vertex attribute or fragment draw buffer, or a @builtin(name) slot.

import type { EntryIoField } from 'typeshade'

시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.

구문

interface EntryIoField {
readonly name: string;
readonly type: string;
readonly location?: number;
readonly builtin?: string;
}

설명

Where the entry spelled it as a member of a struct parameter or struct return, the field is reported flattened out of that struct; see EntryIo.

인스턴스 속성

name읽기 전용 string

The field’s own identifier: a parameter’s name, a flattened struct field’s name, or _ret for a bare non-struct return value (the name the GLSL backend gives that output).

type읽기 전용 string

The DSL type key (the string typeKey returns), the same spelling StructLayout.fields[].type and VertexAttr.type use.

location선택 사항읽기 전용 number

The declared @location(n). Absent on a @builtin field and on an unattributed one; the two are told apart by whether builtin is set.

builtin선택 사항읽기 전용 string

The declared @builtin(name), in WGSL’s own vocabulary (position, vertex_index, …). Builtins are reported alongside locations. A consumer that compares varyings and leaves builtins out (they are not varyings) filters on this field, and can then report that position was excluded because it is a builtin.

함께 보기

소스

src/core/reflect.ts, 502행, 커밋 c66579bf 기준

이 페이지 편집 문제 보고