Open kig opened 4 years ago
For SPIRV-cross, there's https://github.com/grovesNL/spirv_cross/tree/master/wasm
GLSL to SPIR-V:
const glslang = require('@webgpu/glslang')();
const src = fs.readFileSync('compute_shader.glsl.comp', 'utf8');
const res = glsl.compileGLSL(src, 'compute', false, '1.3');
// Uint32Array(13615) [ 0x07230203, ...
Running native code is such a bore, let's compile glslangValidator, spirv-cross, ispc and LLVM to WebAssembly.