beaufortfrancois / webgpu-cross-platform-app

WebGPU cross-platform app with CMake/Emscripten
https://developer.chrome.com/docs/web-platform/webgpu/build-app
82 stars 6 forks source link

Web build not working, no errors #6

Closed lesleyrs closed 1 month ago

lesleyrs commented 3 months ago

I'm on google chrome with webgpu enabled, the dawn build works correctly but nothing happens in the emscripten one when running a web server.

No console output and blank screen, just the emscripten html page. Did it break for everyone?

beaufortfrancois commented 3 months ago

Does it work for you when running it natively? Can you share logs maybe when running https://github.com/beaufortfrancois/webgpu-cross-platform-app/blob/main/README.md#web-build steps?

lesleyrs commented 3 months ago

Yes native works, there are no logs in console when running web build. It just has a glitchy blank canvas where the triangle is supposed to be. I'm also on latest emscripten commit e10826f9196bb0e704014af2252ef58fb4ba261b

image

configure: cmake -B build-web -DCMAKE_TOOLCHAIN_FILE=C:\Users\-\dev\c\emsdk\upstream\emscripten\cmake\Modules\Platform\Emscripten.cmake -DCMAKE_CROSSCOMPILING_EMULATOR=C:/Users/-/dev/c/emsdk/node/16.20.0_64bit/bin/node.exe -G "MinGW Makefiles"
-- Configuring done (1.0s)
-- Generating done (0.0s)
-- Build files have been written to: C:/Users/-/dev/c/webgpu-cross-platform-app/build-web
[ 50%] Building CXX object CMakeFiles/app.dir/main.cpp.o
[100%] Linking CXX executable app.html
[100%] Built target app
beaufortfrancois commented 3 months ago

I've noticed you don't use emcmake as in the following. Is there a reason for that?

# Build the app with Emscripten.
emcmake cmake -B build-web && cmake --build build-web -j4
beaufortfrancois commented 3 months ago

As I didn't build this app on Windows yet, I may be missing some obvious stuff.

lesleyrs commented 3 months ago

I've noticed you don't use emcmake as in the following. Is there a reason for that?

# Build the app with Emscripten.
emcmake cmake -B build-web && cmake --build build-web -j4

I did do that, just didn't include it in the output logs.

It is not a Windows issue though, I tried on WSL with same result. I'm pretty sure the issue lies with emscripten as using a few different versions gave different problems.

beaufortfrancois commented 3 months ago

FWIW, last time it worked for me was with Emscripten 3.1.51