juj / wasm_webgpu

System headers for interfacing WebGPU from C programs compiled via Emscripten to WebAssembly
BSD 3-Clause "New" or "Revised" License
331 stars 26 forks source link

Relation to emscripten's native header support ? #45

Closed goodartistscopy closed 2 months ago

goodartistscopy commented 6 months ago

Sorry if it's a stupid question, but I could not figure out how/if this project is related to emscripten's builtin support for WebGPU. It looks to me that it's a solution to a similar problem.

What are the advantages/differences of this project compared to the "webgpu.h" implementation provided by emscripten ?

juj commented 6 months ago

This library implements the WebGPU browser API 1:1 as it appears in the IDL: https://www.w3.org/TR/webgpu/#idl-index whereas the one in Emscripten implements an API that mirrors the Dawn API. Whichever you prefer is probably a matter of style.

Other design goals (that I think the Emscripten one didn't at least initially focus on) are mentioned in https://github.com/juj/wasm_webgpu?tab=readme-ov-file#features-and-design