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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broad phase static/inactive tree dedicated refinement #7

Closed
RossNordby opened this issue Oct 22, 2017 · 1 comment
Closed

Broad phase static/inactive tree dedicated refinement #7

RossNordby opened this issue Oct 22, 2017 · 1 comment

Comments

@RossNordby
Copy link
Member

Currently, the static/inactive tree of the broad phase uses the exact same level of aggressiveness as the active tree. That's extremely wasteful, given that static and inactive objects generally do not move at all.

Further, the static tree's jobs are not handled in parallel with the active tree's. That pointlessly creates sync overhead.

To improve this:

  1. Make the multithreaded refinement context create jobs for use in an external scheduler. Do not internally dispatch them.
  2. Build a dedicated static/inactive refinement that takes advantage of the unique assumptions. This most likely involves explicit refits on add/remove/move, followed by low effort periodic refinements. The fact that we probably won't have more than one static refinement per frame is totally fine since it should run in the same dispatch as the active tree's refinement.

There may be value in some form of batched refit. API isn't immediately obvious, but if if you changed a thousand bodies, they'll each be doing a lot of duplicate work near the top of the tree. On the other hand, the worst case might cost a handful of microseconds, so further optimization effort could be silly.

@RossNordby
Copy link
Member Author

Done in 2.5 betas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant