Closed jon-chuang closed 1 year ago
You can use this WASM module to do GLSL compilation to SPIR-V (for Chrome and Firefox only) at runtime: https://www.npmjs.com/package/@webgpu/glslang
Note the ingestion format will eventually change from SPIR-V to a text format similar to SPIR-V.
WebGPU currently supports basic compute shaders without any hardware extensions (such as subgroup operations). It should be very roughly the same feature set as compute shaders on Vulkan, OpenGL ES 3.1, or Direct3D 11 without any extensions/optional features.
Is the right thing to do to generate SPIR-V bytecode for vs/fs/cs from GLSL via glslang and then manually copy as a string into the C++ source?
Also, as an unrelated question, how well-supported is GPGPU on WebGPU atm? Is this not well supported due to restriction on SPIR-V opcodes?