Closed aagrawal05 closed 4 months ago
This branch uses a version of WebGPU-distribution that is getting a bit old, where webgpu.hpp was written for emscripten v3.1.45
. You can either use that old version, or update the distribution by replacing webgpu/webgpu.cmake
with a newer version (that one is based on emscripten v3.1.61
and may work in newer versions as well).
I am currently going through the whole guide to update multiple things, among which including support for emscripten in the main guide instead of maintaining a specific version of the branches. It has not reached step095 yet but let me know if you need me to focus on it!
Hey, works great with the new updated webgpu.cmake
. Some very minor changes with naming like requiredFeatureCount
instead of requiredFeaturesCount
. I was able to get it running very quickly by resolving the compiler issues so likely no urgent changes needed to update it right away. Maybe a short disclaimer in the step095 readme, but this issue may be sufficient for that. Thanks!
Some tough-to-spot changes which I had to find (and which may speed up updating this section in future) was in the current webgpu.hpp
where nullptr
is not a valid input for the createInstance function. However the new Emscripten interface now requires it so you need to pass nullptr
instead of InstanceDescriptor
to show its not implemented with an assert.
So I had to write with the vanilla wgpuCreateInstance(nullptr)
instead of createInstance(InstanceDescriptor{})
—should be a relatively simple fix in webgpu.hpp
when updating later.
Also the depth slice was added to the color attachment API so had to find the enum and update by adding this line—perhaps could be added to the webgpu.hpp
as well in the default construction.
renderPassColorAttachment.depthSlice = WGPU_DEPTH_SLICE_UNDEFINED;
Hi, fresh build on M1 has this log:
[output after commands]
emcmake cmake -B build/web -DWEBGPU_BACKEND=EMSCRIPTEN
cmake --build build/web
The example builds perfectly on native. The issue (from the log) seems to be local to the webgpu.hpp header. Is there some sort of version mismatch or other error?