Closed pierricgimmig closed 8 months ago
Re: error: no member named 'code' in 'wgpu::ShaderModuleWGSLDescriptor'
, I suspect you're not using the latest version of Emscripten. I use version 3.1.46.
upgrading to 3.1.47 fixes compilation, however, the web app is a black rectangle, and I get this in the console:
Uncaught RuntimeError: Aborted(TODO: wgpuCreateInstance unimplemented)
at abort (app.js:1511:11)
at _wgpuCreateInstance (app.js:6086:7)
at app.wasm:0x2f99
at app.wasm:0x2144
at app.wasm:0x2d94
at app.js:1556:22
at callMain (app.js:7111:15)
at doRun (app.js:7168:23)
at app.js:7179:7
https://github.com/emscripten-core/emscripten/pull/19762 fixed this issue. I wonder if you should remove the build-web folder and try again.
Thnaks for the suggestion, I removed the build-web folder, tried again, and got:
app.js:6572 Failed to create WebGPU Context Provider
But this was because I hadn't enabled WebGpu in Chrome.
Running google-chrome-unstable --enable-unsafe-webgpu --use-vulkan=true --test-type --enable-features=Vulkan
finally gave me that red triangle I was looking for :-)
Woohoo!
Can you summarize all the steps you made to the original instructions so that others can benefit from you experience on Linux?
Sure! Here's what I did on Ubuntu 22.04:
sudo apt install google-chrome-unstable
for WebGpu supportemcmake cmake -B build-web && cmake --build build-web -j4
npx http-server
(you might have to install npm)google-chrome-unstable --enable-unsafe-webgpu --use-vulkan=true --test-type --enable-features=Vulkan
http://127.0.0.1:8080/build-web/app.html
in the unstable browserFaced with this problem too on Linux.
Thank you @pierricgimmig for documenting your steps. Hopefully it will help others in the future.
Running
emcmake cmake -B build-web && cmake --build build-web -j4
on Ubuntu 22.04 gives: