emitModule
이 페이지에서

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

매개변수

m ModuleDecl
opts선택 사항 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 기준

이 페이지 편집 문제 보고