-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
Correctly flush dirty bodies - physics. #41096
Conversation
Just tested in the mini project where I first came across these issues, and not only are the crashes fixed, but performance when adding/removing bodies is noticeably smoother. I was skeptical of the original changes because of the number of bugs, but I think this is great progress. |
CC @madmiraal |
Personally, I think applying another big change on top of another big change (#40252) that already failed to resolve the crashing issues caused by the original big change #39726 that itself did not actually resolve #30027 (despite repeated assertions it only provides a moderate performance improvement as shown here) is the wrong approach. Not only is it not guaranteed to resolve the crashing issues caused by #39726 (#40311 and #40840 are simple examples, so I wouldn't be surprised if there are others) but it makes backporting fixes (even simple fixes such as #41040 and #42061) difficult and error prone. As stated in the Best practices for engine contributors changes should address specific problems using dedicated solutions. Since #39726 causes crashing issues, only provides a marginal performance improvement and didn't resolve #30027, I think the better approach is to revert #39726 (and #40252 that failed to fix it) as I have proposed in #41082. |
Thanks to the opened issues, I was able to fix the bugs (introduced by #39726 and not fully solved by #40252) with this PR. If you can prove that this PR still doesn't solve the issues: #40311 #40840 (or any new regression) I'll be glad to keep working on it, otherwise I don't see why this should not be merged. Regarding the |
Not relevant for the Could be redone for |
The lazy changes, implemented by this PR: #39726, was not flushing the dirty bodies when needed - causing different crashes.
This PR make sure to flush the dirty bodies, when is necessary do so, and not just during the physics step.
Note, the perf of this PR is not changed and is in line with the one measured here: #41082 (comment)
Fixes: #40311
Fixes: #40840
Superseed: #41067