Closed c1b closed 3 weeks ago
Can reproduce, investigating... but for the time being it's better to understand the WebGPU backend as experimental as long as the WebGPU API hasn't stabilized. There's still lots of changes in the WebGPU API and then it can take several months until those changes trickle into the Emscripten WebGPU shim.
Ah... right. It's this known issue in the Emscripten SDK:
https://github.com/emscripten-core/emscripten/issues/20415
...basically, the current WebGPU shim in the Emscripten SDK doesn't support the Closure compiler optimization pass.
You can work around for now by adding a .release_use_closure = false,
to the options here:
I could add that when specifically building for WebGPU, but since it's clearly a bug in the Emscripten SDK I don't know if that's a good idea (especially considering that the entire WebGPU stuff is still in flux).
The downside of not running the Closure pass is that the output .js file with the Emscripten runtime and web API shims will be larger and isn't as optimized.
Of course its you that tracked down and reported this emcc issue months ago.... I bow to your power 🙇
This works:
These all fail:
Here is the error I see in JS console in all failure cases:
I know this issue is several flags deep, but I'm confused by why this would happen. Would love a sanity check if someone can confirm that this is indeed unexpected.