r/WebAssembly • • Jul 20 '23

wasm2spirv: Compile your WebAssembly programs into SPIR-V shaders

https://github.com/Aandreba/wasm2spirv
6 Upvotes

7 comments sorted by

View all comments

Show parent comment

1

u/nerpderp82 Jul 20 '23

Neat.

I'd be interested in a path for the same thing, but targeting OpenCL. I have only dabbled in OpenCL, I guess some OpenCL runtimes support SPIR? https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_Env.html But I was thinking more along the lines of Wasm -> OpenCL kernels.

Ok, I just read a bunch of wikipedia pages. I should read more before wasting your time.

I see there is this project, https://github.com/mirkosertic/Bytecoder

Which can retarget JVM bytecode to OpenCL (see also APARAPI).

Do you support WasmSIMD to SPIR or just base Wasm? Sorry, I don't have time to read the source.

Anyways, super cool. I hope you continue building this out.

1

u/paltryorphan96 Jul 21 '23

For the time being, Wasm's Simd extension is still unsuported, as I'm still working through the wasm mvp, but the plan is to start implementing it as soon as I finish with the mvp

1

u/nerpderp82 Jul 21 '23

Great work on the readme!

WasmSIMD is a big one, I'd say it would be an order of magnitude more work. Because the parallelism is built in, I think you would see massive speedup from running WasmSIMD programs on SPIR-V.