wasm_webgpu icon indicating copy to clipboard operation
wasm_webgpu copied to clipboard

Relation to emscripten's native header support ?

Open goodartistscopy opened this issue 1 year ago • 1 comments

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 ?

goodartistscopy avatar May 17 '24 20:05 goodartistscopy

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

juj avatar May 18 '24 06:05 juj

I, at least, am still a little confused, as Dawn describes itself this way:

Dawn is an open-source and cross-platform implementation of the WebGPU standard. More precisely it implements webgpu.h that is a one-to-one mapping with the WebGPU IDL.

If both are one-to-one mappings, is it just naming conventions that differ?

SirNate0 avatar Oct 01 '25 13:10 SirNate0

The naming conventions differ, but also the internal implementations of the bindings are separate.

In emdawnwebgpu, the web-facing bindings match 1:1 with the native Dawn API.

In this repository, the web-facing bindings model the JavaScript WebGPU API IDL from https://www.w3.org/TR/webgpu/#idl-index.

juj avatar Oct 01 '25 14:10 juj