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

Panic on resize in iced_glow-0.2.0 and wgpu-0.7.1 #1111

Closed
DusterTheFirst opened this issue Nov 6, 2021 · 3 comments
Closed

Panic on resize in iced_glow-0.2.0 and wgpu-0.7.1 #1111

DusterTheFirst opened this issue Nov 6, 2021 · 3 comments
Labels
bug Something isn't working rendering wgpu

Comments

@DusterTheFirst
Copy link

DusterTheFirst commented Nov 6, 2021

The glow and wgpu back-ends will both panic when resizing my application vertically. Interestingly I have not noticed this happening when resizing horizontally or when expanding vertically, only when the resizing shrinks the window vertically . Since the issue persists across both back-ends, this leads me to believe that this could be a problem with the plotters-iced crate sending bad data to the iced back-ends. If this issue is not one with iced, I will raise the issue to the plotters-iced crate. I wanted to make sure that it is not a problem with iced itself before I raise the issue to plotters-iced.

Here is the code in question: https://github.com/DusterTheFirst/mission-control/tree/5fd737c99b5a55b9803ecc862428e233f6a3446a/crates/ground-station

I also want to thank the whole team for all of the work they have done on this crate to get it to how it is today. It has been one of the crates that has given me the best UI creation experience.

EDIT (6 hours later): I have refactored the layout of my iced code for reasons non-related to this issue, but it seems to have removed this panic from occurring. The previous layout was an attempt at a grid layout with one row with 5 columns in it, each column containing 5 other elements to create a faux grid which you can see here:

https://github.com/DusterTheFirst/mission-control/blob/5fd737c99b5a55b9803ecc862428e233f6a3446a/crates/ground-station/src/main.rs#L185-L279

My new layout no longer tries to mimic a grid as it was too restrictive for my liking and no longer encounters a panic when shrinking the window. The code for the changed layout can be seen here:

https://github.com/DusterTheFirst/mission-control/blob/ec9bf6d44903f4eaa59ddc0590af8ada01eb050b/crates/ground-station/src/main.rs#L178-L281

Continuing from before the edit

Glow panic

8mb.video-hi0-y3bPuqju.mp4
thread 'main' panicked at 'attempt to subtract with overflow', C:\Users\<username>\.cargo\registry\src\git.luolix.top-1ecc6299db9ec823\iced_glow-0.2.0\src\triangle.rs:195:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Wgpu panic

8mb.video-BIG-WlJlwpS2.mp4
wgpu error: Validation Error

Caused by:
    In a RenderPass
      note: encoder = `iced_wgpu encoder`
    In a set_scissor_rect command
    Invalid ScissorRect parameters


thread 'main' panicked at 'Handling wgpu errors as fatal by default', C:\Users\<username>\.cargo\registry\src\git.luolix.top-1ecc6299db9ec823\wgpu-0.7.1\src\backend\direct.rs:1896:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@SeanTater
Copy link

I experience the same error, using wgpu on Arch Linux with Intel + Vulkan, using the Todo example, with Iced 0.3.0 and the Todo taken from the commit tagged 0.3.0.

@rdrpenguin04
Copy link

Same error, with the Hello example in the Application docs: https://docs.rs/iced/0.3.0/iced/trait.Application.html

@hecrj
Copy link
Member

hecrj commented Jan 22, 2022

I think this should be fixed in master by #818.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working rendering wgpu
Projects
None yet
Development

No branches or pull requests

4 participants