A Rust-based WGSL shader compiler and cross-transpiler that converts WGSL to GLSL, HLSL, Metal, or SPIR-V. v0.0.1 is an early release with no regular release cadence yet. Differentiators: runs in Node.js and browser via WASM, single-function API, supports SPIR-V binary and assembly output. Requires manual WASM initialization via `init()` before any compilation calls. Competing with naga and glslang, but lighter and purely WGSL→others.
npm install wgsl-wasm-transpiler-bundlerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initialize WASM and compile a trivial WGSL fragment shader to GLSL.
Always call init() (and await in browser) before any other API function.
Use await init() in both environments; it works in Node too.
Validate WGSL before passing. Use getSupportedFormats() to check format. Wrap in try/catch.
Use import { compileShader } from 'wgsl-wasm-transpiler-bundler'Ensure you are using the correct path to the WASM file and call init() with await.
Use 'spirv' for binary or 'spirv-asm' for text. Run getSupportedFormats() to see all.
No dependency data recorded yet.