Can I use the TintWASM library in the Babylon.js repository?

I noticed that a library called TintWASM has been placed in the Babylon.js repository.

This seems to convert SPIR-V to WGSL.

I have some example code of WebGPU using GLSL, and I would like to convert it to WGSL using this library.

Can I use this library in my own projects?

It will cost you a lot :wink:

Just kidding obviously. Feel free to reuse and abuse it in your own projects !!! You will also need the glslang lib to convert first from glsl to SPIRV.

We are at the moment also evaluating a move to Naga in order to improve our bundle size.

cc @syntheticmagus

2 Likes

Thank you! I’ve incorporated it into the triangle example to try it out, and it’s working in Google Chrome 94 beta, so perhaps the conversion is working.

https://cx20.github.io/webgpu-test/examples/webgpu/triangle/index.html

I don’t know if I’m using it correctly, but I tried using it like glslang and it worked.

2 Likes

Maybe you will find this helpful

2 Likes

I made a simple tool to convert from GLSL to WGSL using TintWASM.
https://jsfiddle.net/cx20/vmkaqw2b/
image

2 Likes

Woot! is this the same that you used @Evgeni_Popov?

1 Like

Yes, @cx20 is using our TWGSL module created by @syntheticmagus.

2 Likes

lovely!

2 Likes