-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PaintCallbackInfo::viewport_in_pixels now guarantees to stay in bounds (
#3604) * Fixes rerun-io/rerun#4297 * tested against a very hasty and incomplete port of egui/trunk, found [here](https://github.com/rerun-io/rerun/tree/andreas/experimental-egui-trunk) In rare cases in can happen that the viewport returned by `PaintCallbackInfo` is outside the bounds of the screen. for at least [wgpu/webgpu in particular](https://www.w3.org/TR/webgpu/#dom-gpurenderpassencoder-setviewport) this is invalid usage, other backends might be affected as well. Since this happened due to a float rounding error (in one repro case I had I got (width==1126.5625) + (offset=715.4376) = 1842.0001 for a resolution of 1842) I decided to do away with fractional values on the viewport alltogether. They _technically_ make sense since a viewport is only specifying the NDC to pixel coordinate conversion, but practically this may lead to surprising sub-sampling issues. --------- Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
- Loading branch information
Showing
3 changed files
with
62 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters