LearnWebGPU-Code icon indicating copy to clipboard operation
LearnWebGPU-Code copied to clipboard

Step095-emscripten Webassembly Issue

Open john12-sys opened this issue 1 year ago • 1 comments

Hello,

I downloaded the code from the following GitHub repository: LearnWebGPU-Code (step095-emscripten). After building the WebGPU project in WebAssembly, I encountered an error screen while browsing to http://localhost:8000/App.html.

Could anyone please help me with the above? WebAssemblyIssue

john12-sys avatar Aug 06 '24 09:08 john12-sys

Emscripten requires wgpuCreateInstance takes a nullptr for the instance descriptor pointer.

https://github.com/emscripten-core/emscripten/blob/main/system/lib/webgpu/webgpu.cpp#L23-L26

You can either

wgpuCreateInstance(nullptr);

// or

auto instance = reinterpret_cast<WGPUInstance>(1);

adamdusty avatar Aug 10 '24 22:08 adamdusty