New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation of spirv-opt
to WASM
#5029
Comments
The only reason it was limited to assembly and disassembly is that nobody put the work in to do it. |
Hi @dneto0, thank you for the answer! Could you provide us some pointers as to how to proceed with separating the optimizer module and how to compile it? We don't have much experience with CMake, so any hints would be very valuable. |
I can answer this question, as I'm doing a similar thing. The diff I have:
No cmake needed to be built, we must just build a different target (the emmake command) and link the built static library to the interface. Additionally, in |
Thanks. Yesterday I was looking at making a separate node package for the optimizer because it is so large. |
Also, the optimizer has a more complicated interface, where you can schedule specific passes, or entire recipes at a time. So I was working my way through providing that API. |
I have a WIP PR that adds a separate WASM package for the spir-v optimizer. And the PR doesn't work. Something is being messed up earlier in the flow I think. I'd welcome feedback if I've messed up WASM-bindings or other emscripten things. I'm a total newbie in it. |
Oh wow, thank you so much @dneto0 ❤️ I was able to compile the WASM module with what @farmaazon provided above and the final WASM opt file is relatively small - 2Mb? I'm wondering if it contains all the passes though. Just out of curiosity, do you have any approximate timeline for your module? I'm asking only to plan how / when I could integrate it to what we are building 😄 |
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:The text was updated successfully, but these errors were encountered: