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

Remove log spam when quickly resizing the viewer #5189

Merged
merged 2 commits into from
Feb 13, 2024

Conversation

Wumpf
Copy link
Member

@Wumpf Wumpf commented Feb 13, 2024

What

Got a good repro of this on my windows machine by using the screenshot action on a low-dpi screen (screenshot action will do a quick resize on native) while having the pose tracking example open.

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG
  • If applicable, add a new check to the release checklist!

We know egui already sets the viewport correctly, so let's not do it redundantly!
@Wumpf Wumpf added 🪳 bug Something isn't working 🔺 re_renderer affects re_renderer itself include in changelog labels Feb 13, 2024
@Wumpf Wumpf changed the title Fix logged error on quickly resizing the viewer Fix error (log only)_on quickly resizing the viewer Feb 13, 2024
@Wumpf Wumpf changed the title Fix error (log only)_on quickly resizing the viewer Fix error (log only) on quickly resizing the viewer Feb 13, 2024
@Wumpf Wumpf changed the title Fix error (log only) on quickly resizing the viewer Fix (log only) error on quickly resizing the viewer Feb 13, 2024
@@ -78,7 +78,7 @@ impl egui_wgpu::CallbackTrait for ReRendererCallback {

fn paint<'a>(
&'a self,
info: egui::PaintCallbackInfo,
_info: egui::PaintCallbackInfo,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the viewport coming from egui was somehow wrong?
Is this a bug in an egui crate?

Copy link
Member Author

@Wumpf Wumpf Feb 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we only passed on the viewport offset from egui, not the viewport size. We then assumed the size was what we had previously on the viewbuilder and set a new viewport accordingly. In rare cases it turned out that this size + the offset from egui caused us to set an invalid viewport (after egui already set a correct one).

... which come to think means that the viewbuilder got an outdated size! This is concerning but I reckon this can easily happen though when new sizes come in asynchronously; to nail this down perfectly we'd need to know when egui queries the size that leads to the final renderpass.
This PR instead just trusts egui with the viewport setting, after all egui also set up the renderpass and knows what a valid viewport is for that renderpass.

@Wumpf Wumpf requested a review from emilk February 13, 2024 17:47
@Wumpf Wumpf merged commit 06c5cfb into main Feb 13, 2024
43 of 45 checks passed
@Wumpf Wumpf deleted the andreas/fix-warning-on-resize branch February 13, 2024 22:49
Wumpf added a commit that referenced this pull request Feb 21, 2024
### What

* Fixes #4455

Got a good repro of this on my windows machine by using the screenshot
action on a low-dpi screen (screenshot action will do a quick resize on
native) while having the pose tracking example open.

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using newly built examples:
[app.rerun.io](https://app.rerun.io/pr/5189/index.html)
* Using examples from latest `main` build:
[app.rerun.io](https://app.rerun.io/pr/5189/index.html?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[app.rerun.io](https://app.rerun.io/pr/5189/index.html?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!

- [PR Build Summary](https://build.rerun.io/pr/5189)
- [Docs
preview](https://rerun.io/preview/f54be52f2819874bcec35e91db189eb369a007af/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/f54be52f2819874bcec35e91db189eb369a007af/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
@Wumpf Wumpf changed the title Fix (log only) error on quickly resizing the viewer Remove log spam when quickly resizing the viewer Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪳 bug Something isn't working include in changelog 🔺 re_renderer affects re_renderer itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when quickly resizing viewer with 3D view
2 participants