WASM: Allow clients to enable pthreads.

Filament does not yet fully support threads with WASM, but this is a
baby step in that direction.

To enable experimental pthreads support, enable the WEBGL_PTHREADS CMake
option. This will enable pthreads support in `gltfio` and `utils`, which
is known to work, but not when served with GitHub Pages.

The web server must emit COOP, COEP and CORP headers, so our build
instructions now recommend the use of `emrun` for local testing.

This also changes our demos so that they do not use unpkg, which
does not work when using `emrun`, due to cross-origin restrictions.
This commit is contained in:
Philip Rideout
2022-08-12 12:51:12 -07:00
parent 430f060db2
commit bfe8a8aa18
14 changed files with 83 additions and 11 deletions

View File

@@ -303,6 +303,8 @@ public:
return mParallelSplitCount;
}
size_t getThreadCount() const { return mThreadCount; }
private:
// this is just to avoid using std::default_random_engine, since we're in a public header.
class default_random_engine {