document wasm setup with wasmBinary
- Dominant language
- C++
- Stars
- 7.5k
- Forks
- 1.1k
- Avg merge
- 47m
- Merged PRs (30d)
- 1
Description
Currently, it is necessary to find examples which use the wasm version of draco to learn how to use it. Many examples refer back to https://github.com/google/draco/blob/master/javascript/time_draco_decode.html which appears to be only place in this repo where there is some documentation in a comment on:
- a config object with a wasmBinary property for DracoDecoderModule()
- how the property value has to be an ArrayBuffer (containing the binary wasm data)
Strictly speaking the wasmBinary configuration option is an emscripten feature and is part of the emscripten documentation. But since draco distributes the wasm file widely, it would be very beneficial to document briefly its use with the config object's wasmBinary property.
Documentation could be added to
https://codelabs.developers.google.com/codelabs/draco-3d/index.html#4
which uses the wasm wrapper but then does not seem to use the wasm file.
https://github.com/google/draco#wasm-and-javascript-decoders could be perhaps expanded.
Below was fixed by #968:
> Relatedly,
>
> https://github.com/google/draco/blob/master/javascript/time_draco_decode.html
>
> sets up a config object for wasm in
>
> https://github.com/google/draco/blob/master/javascript/time_draco_decode.html#L42
>
> but then seemingly does not use it when the Module is created in
>
> https://github.com/google/draco/blob/master/javascript/time_draco_decode.html#L54
>
> Perhaps this is somehow intended but appears to be an oversight at first glance.
Finally,
Module['wasmBinaryFile'] is deprecated according to
https://groups.google.com/g/emscripten-discuss/c/66zg2GQO2vg?pli=1
It could likely be removed from the example.
Contributor guide
Assessment
This issue has not been assessed yet.