EmitFragment
인터페이스, 출력 분류
A module emitted without its stage wrapper, plus everything the host must supply or ensure for the result to compile.
import type { EmitFragment } from 'typeshade'
시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.
구문
interface EmitFragment { readonly source: string; readonly preamble: readonly string[]; readonly declares: FragmentDeclares; readonly requires: readonly string[];}설명
Produced by emitFragment (WGSL) and
emitGlslFragment (GLSL).
인스턴스 속성
source읽기 전용stringThe header-less source: declarations, helpers, and (unless excluded) entry points.
preamble읽기 전용readonly string[]Directive and precision lines the host must place ahead of
source, in order. They are returned as data so a composer can merge and de-duplicate them across fragments.declares읽기 전용FragmentDeclaresThe manifest of what
sourcedeclares.requires읽기 전용readonly string[]Symbols the fragment references but does not define: functions declared with
externFn, and variables declared withexternVar, spelled for the target. A composer can check this list against what the host actually provides. Function names come from call sites that resolve to neither a module function nor a known intrinsic. Sorted and de-duplicated.
함께 보기
소스
src/core/fragment.ts, 49행, 커밋 c66579bf 기준