Closed tanzle-aames closed 3 years ago
This is in Emscripten's WebGPU code:
I think the browser API has changed, so this will need a fix in Emscripten (the first hurdle being finding up-to-date JS docs).
I am experiencing the same thing. I think the API has changed related to swap chains. I am not sure where to find up-to-date JS docs, but I found this code example. https://austin-eng.com/webgpu-samples/samples/helloTriangle
and this youtube video https://youtu.be/yTkGXYlIjEw
It should be fixed with this Emscripten PR:
https://github.com/emscripten-core/emscripten/pull/14951
But you can change the basics by editing library_webgpu.js
, search for wgpuDeviceCreateSwapChain
then:
Change the getContext()
line to:
var ctx = canvas.getContext('webgpu');
Change the configureSwapChain
line to:
var swapChain = ctx["configure"](desc);
And finally change the return statement to:
return WebGPU.mgrSwapChain.create(ctx);
That's enough to run this simple demo in both older Chrome (removing the warnings) and the latest Chrome Canary.
Nice workaround. Gotta love bleeding edge.
Closing this - Emscripten latest is now updated (run emsdk update tot
to get it) and the code here brought up-to-date with both it and the latest Dawn.
This may not be the best place to report this. The only thing that changed was Chrome Canary daily build today.
This is the browser code that throws:
Native Windows build works fine. libdawn has not changed. So, this is caused by some interaction between hello-webgpu, libdawn, and Chrome.
Thanks in advance.