EntryInfo
이 페이지에서

EntryInfo

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

One @vertex, @fragment or @compute entry point: its stage, its parameter and return types as DSL type keys (the strings typeKey returns), and, for a @compute entry only, its workgroup size, which defaults to 64 when the entry declares none, matching the WGSL backend's own default.

import type { EntryInfo } from 'typeshade'

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

구문

interface EntryInfo {
readonly name: string;
readonly stage: 'vertex' | 'fragment' | 'compute';
readonly workgroupSize?: number;
readonly workgroupShape?: WorkgroupShape;
readonly inputs: readonly string[];
readonly output: string;
readonly portable?: true;
readonly io: EntryIo;
}

설명

semanticDiff fingerprints a module’s public interface with this shape: two modules whose entries differ here have a different pipeline contract even if every other byte of emitted source matches.

인스턴스 속성

name읽기 전용 string
stage읽기 전용 'vertex' | 'fragment' | 'compute'
workgroupSize선택 사항읽기 전용 number

The x workgroup extent of a compute entry. A host sizing a dispatch reads EntryInfo.workgroupShape, which also carries y and z.

workgroupShape선택 사항읽기 전용 WorkgroupShape

The [x, y, z] workgroup extents of a compute entry, WGSL’s @workgroup_size(x, y, z) with a missing extent as 1: a dispatch of n invocations along an axis needs ceil(n / extent) workgroups on it.

inputs읽기 전용 readonly string[]
output읽기 전용 string
portable선택 사항읽기 전용 true

Present, as true, when the entry is declared a portable kernel; absent otherwise, never false. It tells a host which dispatch shape the kernel needs: on a backend with no compute stage a portable kernel emits as fragment-shader GPGPU and is dispatched as a fullscreen draw into an R32UI target instead of a compute dispatch. An entry without it runs on WebGPU only.

io읽기 전용 EntryIo

The entry’s location and builtin interface, in structured form. inputs and output are type keys, which is what semanticDiff fingerprints with; io is the view beside them that a host validating a stage pair reads for the @location numbers. Always present. See EntryIo for how struct parameters and returns flatten.

함께 보기

소스

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

이 페이지 편집 문제 보고