emitModuleAt()
함수, 출력 분류
Emit a ModuleDecl as WGSL at an explicit optimization level.
import { emitModuleAt } from 'typeshade'
시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.
구문
const emitModuleAt: (m: ModuleDecl, level: OptLevel) => string매개변수
mModuleDecllevelOptLevel
반환값
string
설명
emitModuleAt(m, 'O2')
produces the same string as emitModule(m); 'O0' skips the optimizer and writes the
lowered module as authored; 'O1' runs only the passes that cannot change a computed
value. Useful for debug builds and for comparing emitted size across levels. See
OptLevel.
대상별 지원
| 대상 | 지원 | 비고 |
|---|---|---|
| WGSL (WebGPU) | 지원 | Writes WGSL for WebGPU. |
| GLSL ES 3.00 (WebGL2) | 해당 없음 | |
| CPU 오라클 | 해당 없음 |
함께 보기
소스
src/core/backends/wgsl.ts, 596행, 커밋 c66579bf 기준