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

wgpu 0.18 warning spam when resizing window #4297

Closed
emilk opened this issue Nov 21, 2023 · 1 comment · Fixed by emilk/egui#3604
Closed

wgpu 0.18 warning spam when resizing window #4297

emilk opened this issue Nov 21, 2023 · 1 comment · Fixed by emilk/egui#3604
Assignees
Labels
🪳 bug Something isn't working egui Requires egui/eframe work
Milestone

Comments

@emilk
Copy link
Member

emilk commented Nov 21, 2023

Repo is simple: git checkout andreas/wgpu-0.18, cargo rerun, open dicom, and resize the window:

I fail to repro on main

wgpu-warnings

[2023-11-21T16:43:22Z ERROR re_renderer::error_tracker] WGPU error tick_nr=6426 description=Validation Error
    
    Caused by:
        In a RenderPass
          note: encoder = `encoder`
        In a set_viewport command
        Viewport has invalid rect Rect { x: 1660.2888, y: 208.80003, w: 711.71136, h: 294.69302 }; origin and/or size is less than or equal to 0, and/or is not contained in the render target Extent3d { width: 2372, height: 1604, depth_or_array_layers: 1 }
    
[2023-11-21T16:43:22Z ERROR wgpu_core::present] No work has been submitted for this frame

We should
A) catch this error before wgpu does
B) prevent this error from happening

@emilk emilk added 🪳 bug Something isn't working 🔺 re_renderer affects re_renderer itself labels Nov 21, 2023
@emilk emilk added this to the 0.11 milestone Nov 21, 2023
@emilk emilk changed the title wgpu warning spam when resizing window wgpu 0.18 warning spam when resizing window Nov 21, 2023
@Wumpf Wumpf self-assigned this Nov 21, 2023
@Wumpf
Copy link
Member

Wumpf commented Nov 21, 2023

this must be a set_viewport call in egui since from the looks of it we never set fractional sizes/positions for viewports

@Wumpf Wumpf added egui Requires egui/eframe work and removed 🔺 re_renderer affects re_renderer itself labels Nov 21, 2023
emilk added a commit to emilk/egui that referenced this issue Nov 22, 2023
#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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪳 bug Something isn't working egui Requires egui/eframe work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants