-
Notifications
You must be signed in to change notification settings - Fork 51
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
Fix Ogre2 assertions during ray queries #415
Conversation
Ray queries (performed every time the mouse moves) had a negative performance impact caused by gazebosim/gz-rendering#415 This commit prevents repetead calls to IgnRenderer::ScreenToScene to perform unnecessary performance degradation since calling ClosestPoint(true) the first time during the frame is enough Code will not compile until PR gazebosim/gz-rendering#415 is merged Signed-off-by: Matias N. Goldberg <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/github/workspace/include/ignition/rendering/base/BaseRayQuery.hh:146: Using C-style cast. Use static_cast<bool>(...) instead [readability/casting] [4]
/github/workspace/ogre/src/OgreRayQuery.cc:63: Using C-style cast. Use static_cast<bool>(...) instead [readability/casting] [4]
Hi please read the post above. I need guidance on which solution you want to fix this false positive from codecheck |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/github/workspace/include/ignition/rendering/base/BaseRayQuery.hh:146: Using C-style cast. Use static_cast<bool>(...) instead [readability/casting] [4] /github/workspace/ogre/src/OgreRayQuery.cc:63: Using C-style cast. Use static_cast<bool>(...) instead [readability/casting] [4]
Hi please read the post above. I need guidance on which solution you want to fix this false positive from codecheck
I would say that adding // NOLINT
will fix this false positives
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, we just need to make sure the linters are happy before merging.
I haven't got the time yet to fix it, but I haven't forgotten about this PR. Sorry it's taking so long. |
This change negatively affects performance as we now force a scene update with each query. Users can specify ClosestPoint(false) if they need to call this function multiple times without modifying anything or if they know the scene is up to date Signed-off-by: Matias N. Goldberg <[email protected]>
Fix build errors from rebasing with main Signed-off-by: Matias N. Goldberg <[email protected]>
58a7cc4
to
1a39e42
Compare
Signed-off-by: Matias N. Goldberg <[email protected]>
OK I've rebased and updated the PR to latest main. Now we're waiting on the CI. Crossing fingers it works out 🤞 |
Codecov Report
@@ Coverage Diff @@
## main #415 +/- ##
=======================================
Coverage 53.46% 53.47%
=======================================
Files 199 199
Lines 19743 19745 +2
=======================================
+ Hits 10556 10558 +2
Misses 9187 9187
Continue to review full report at Codecov.
|
Summary
This bug had been annoying me for months for which I silenced those asserts.
But given that I need to implement
SCENE_STATIC
to get global illumination going, it is dangerous to ignore those asserts so I had to fix this.ign-rendering would assert (inside a debug build of Ogre2) every time the mouse hovers the GUI.
This PR changes both API and ABI. Technically speaking what ign-rendering was doing was wrong but it didn't seem to matter too much (if at all); which is why I don't care to break API/ABI without backporting.
If this fix makes it into Fortress then great, otherwise it's not a big deal. Ideally ogre2 fork should include this fix we added to 2.3 and that I just backported to 2.2; but again no rush.
codecheck
Complains:
It seems it doesn't like the argument getting commented out:
However doing so will cause
unused argument
warning during build.It may be possible to silence both using an UNUSED() macro if it doesn't exist already:
Commit msg
This change negatively affects performance as we now force a scene
update with each query.
Users can specify ClosestPoint(false) if they need to call this function
multiple times without modifying anything or if they know the scene is
up to date
Signed-off-by: Matias N. Goldberg [email protected]
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge