emitModule()
함수, 출력 분류
Emit a ModuleDecl as a complete WGSL module string, ready for device.createShaderModule.
import { emitModule } from 'typeshade'
시그니처, 설명, 예제는 커밋 26de7be8의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.
구문
const emitModule: (m: ModuleDecl, opts?: EmitOptions) => string매개변수
mModuleDeclopts선택 사항EmitOptions
반환값
string
설명
Runs validation, the capability check, the lowering passes and
the optimizer, then assembles the enable directives, structs, bindings, constants and
functions.
opts is an optional EmitOptions: plugins for emit-time transforms such as the
production ones on the typeshade/emit-prod subpath, and parens to choose how
many parentheses the expressions carry.
대상별 지원
| 대상 | 지원 | 비고 |
|---|---|---|
| WGSL (WebGPU) | 지원 | Writes WGSL for WebGPU. |
| GLSL ES 3.00 (WebGL2) | 해당 없음 | |
| CPU 오라클 | 해당 없음 |
관련 가이드
함께 보기
소스
src/core/backends/wgsl.ts, 573행, 커밋 26de7be8 기준