KhronosGroup / KhronosGroup/SPIRV-Tools
Compilation of `spirv-opt` to WASM
Open
component:wasm
- Dominant language
- C++
- Stars
- 1.4k
- Forks
- 709
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 28
Description
Hi! Is it possible to compile `spirv-opt` to WASM? I was able to run `./source/wasm/build.sh`, but according to docs, "The resulting SpirvTools WebAssembly module only exports methods to assemble and disassemble SPIR-V modules". My use case is that we are generating shaders at runtime and we want to be sure they are properly optimized before feeding them to WebGL, so we want to replicate this workflow in WASM:
```
glslc --target-env=opengl -fshader-stage=... -o ${FILE}.spv ${FILE}
spirv-opt -Os -o ${FILE}.spv.opt ${FILE}.spv
spirv-cross --output ${FILE}.opt ${FILE}.spv.opt
```
Contributor guide
Assessment
This issue has not been assessed yet.