BabylonNative
BabylonNative copied to clipboard
Investigate web workers / web assembly
Make sure web workers work automatically in all the JS engines that we support.
One way to test is:
- [ ] Try a glTF with Draco and see if it works (will test both web workers and web assembly) (draco compression will fallback if these things are not available, so make sure it is actually being used)
should be done in conjunction of https://github.com/BabylonJS/BabylonNative/issues/219 In order to load draco.js script from js script.
Win32/Chakra, this test is false: https://github.com/BabylonJS/Babylon.js/blob/5fb3378450f974fbb0d105c8e48f49b55fc9ce7f/src/Meshes/Compression/dracoCompression.ts#L305
Is this under feature under development? Our project has several web workers and we're working out how we can port them to BN.
Not currently, no. We do intend on adding this though.
Ok awesome. We'll update this issue if we can contribute this code. Any gotchas we should look out for while implementing this? We'll basically spin up a std::thread and put an instance of the javascript engine in it and then use a mutex to push messages back and forward.
I'm not exactly sure how to implement yet. A simple std::thread
might be right or maybe it should be using a threadpool. As for message passing, a concurrent queue is more efficient. I suspect it will be useful to use arcana.cpp to do some of this, which, for example, has a concurrent queue implementation.