Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallel reality tabs #760

Open
wants to merge 299 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@modulesio
Copy link
Member

modulesio commented Jan 24, 2019

This PR implements the last step of parallelizing all user windows (reality tabs). This means they render at the same time in their own context before being composited into the display/headset/what have you. Previously this was done synchronously, one window at a time, switching GL contexts to the correct one.

There are some major wins with the new approach; it's not so much the parallelization (though that is a win), but the avoidance of GL context switching and use of completely separate contexts for user code.

This means, among other things, we can run (and GC!) our render loop/compositor at the same time as user code (a small parallelization), and we don't have to switch GL contexts or suffer a flush in the main code path -- a major performance win.

Another huge improvement is that we no longer need to run any custom threading code (we just piggy-back on node's worker_threads), so we don't need to re-prototype any native types like Buffer. This is an additional optimization opportunity for V8.

Not to mention, this makes the codebase simpler.

Overall user code should see no change here, other than that everything becomes faster for free, especially -- but not only -- when using reality tabs in XR. 馃 馃寛

@modulesio

This comment has been minimized.

Copy link
Member Author

modulesio commented Jan 24, 2019

Note this is currently based on window-renderloop, not master.

@modulesio modulesio force-pushed the user-parallel branch from 8c8ba92 to 3389f3c Jan 25, 2019

@modulesio modulesio force-pushed the window-renderloop branch from 58daaee to f7e3485 Jan 26, 2019

@modulesio modulesio force-pushed the user-parallel branch from 3389f3c to 392014d Jan 26, 2019

@modulesio modulesio force-pushed the window-renderloop branch from 95d1014 to 85b1f36 Jan 27, 2019

@modulesio modulesio force-pushed the user-parallel branch from 392014d to 9d75317 Jan 27, 2019

@modulesio modulesio changed the base branch from window-renderloop to master Jan 29, 2019

@modulesio modulesio force-pushed the user-parallel branch from 0eb78f8 to 17b1258 Feb 4, 2019

@modulesio modulesio force-pushed the user-parallel branch 2 times, most recently from 7566c9b to 5deadb3 Feb 12, 2019

@modulesio

This comment has been minimized.

Copy link
Member Author

modulesio commented Feb 15, 2019

This should be building now.

@modulesio modulesio force-pushed the user-parallel branch from ad5ff71 to f045f21 Feb 16, 2019

@modulesio modulesio force-pushed the user-parallel branch 7 times, most recently from afe2d2f to 2d9ea63 Mar 7, 2019

@chrislatorres

This comment has been minimized.

Copy link
Member

chrislatorres commented Mar 14, 2019

Tested each example as reality tab on new user-parallel mpk:


Works as a reality tab:

paint_ml
tutorial
exobot
minimap "works", but don't see anything?
radar
microphone 

Blank as a reality tab, no errors or hard crash:

hello_ml
meshing_ml
planes_ml
graffiti_ml
hands_ml
bow_ml
pathfinding_ml
imagetracking_ml

Crashes with the following error:

FATAL ERROR: v8::HandleScope::CreateHandle() Cannot create a handle without a HandleScope

avatar_ml
shooter_ml , when pull trigger

@modulesio modulesio force-pushed the user-parallel branch from 74f5382 to 36db706 Mar 24, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.