浏览代码

Update meshopt_decoder module to latest (#24491)

This brings up meshopt_decoder modules to the latest versions, which
mostly constitutes a few internal Wasm changes that get reflected in the
different Wasm blobs, and support for Web Workers.

Note that with this change, GLTFLoader will start using decodeGltfBufferAsync
path but by default that still uses the same flow (so no change!).
However, this allows the application to call

	MeshoptDecoder.useWorkers(4);

... to activate asynchronous geometry decoding. It's expected that the
better default is to not use WebWorkers, but using them can be
beneficial for very large files or very latency-sensitive applications.

Some size/perf stats:

old decoder (0.14 from before this change):
- .js 21414 bytes
- .js.gz 5745 bytes

new decoder:
- .js 24850 bytes (+16%)
- .js.gz 6442 bytes (+12%)
- 3-4% faster decoding in Chrome
- support for Web Workers (which is where most of the size impact comes from!)

new decoder with worker support stripped (not part of this PR!):
- .js 22715 bytes (+6%)
- .js.gz 5831 bytes (+1%)
- 3-4% faster decoding in Chrome

I'm currently expecting that the extra ~700 bytes of download cost is
Not A Big Deal, and that size-conscious applications use webpack which
may or may not be able to strip Web Worker support out if that is not
used...
Arseny Kapoulkine 2 年之前
父节点
当前提交
3e7149ad24
共有 2 个文件被更改,包括 2 次插入6 次删除
  1. 1 3
      examples/js/libs/meshopt_decoder.js
  2. 1 3
      examples/jsm/libs/meshopt_decoder.module.js

文件差异内容过多而无法显示
+ 1 - 3
examples/js/libs/meshopt_decoder.js


文件差异内容过多而无法显示
+ 1 - 3
examples/jsm/libs/meshopt_decoder.module.js


部分文件因为文件数量过多而无法显示