Closed 4bb4 closed 3 years ago
My PR only updated wgpu-rs not imgui-rs, that hasn't released at the time. Reopening
Ohhh, I am sorry :/ Silly me ...
Sorry, I didn't realize this PR was already in flight when I did #46. Could you refile your issue as an issue and I'll try to address this.
Hi @4bb4
The same panic just happened to me today, and I am writing this short summary hoping it might be useful to you (or anyone else).
Inside my winit loop I do the standard handling of events, including handling ResizeEvent()
by letting imgui_winit_support::WinitPlatform
handle the events first and then processing them on my side, creating a new swapchain if necessary.
HOWEVER, some time ago I was experiencing crashes due to wgpu::SwapChainError::Outdated
errors, and to solve those I added some code that would re-create the swapchain on-the-fly if this error appeared. This however means that now the WinitPlatform is not able to tell imgui about the new sizes. Now there is a size mismatch between what imgui thinks is the framebuffer and the actual size of the framebuffer, and this is what causes the Invalid ScissorRect parameters
error. This was not a hard error before wgpu 0.7, I think it was just simply ignored.
To solve this problem, I have to just ignore the SwapChainError::Outdated
error: if that happens I just skip rendering altogether for one frame.
@francesco-cattoglio thanks so much for letting me know! I'll try out that solution.
I tried to investigate and arrived at this example https://github.com/benmkw/implot-rs/commit/17abc3c8e6e0918cb0c5068be197542bb2937165#diff-e6ddd2ce7261a8499a67a68c28586ca5722e6410972f3651a8d26805d9e94e43R16
If you uncomment that line and expand the two dropdowns, it crashes.
@benmkw,
If you uncomment that line and expand the two dropdowns, it crashes.
Was this with @francesco-cattoglio's fixes applied already or without?
I did not see if/ how those apply to this crash/ could not see a similar code path, I looked at the scissor rect code in imgui-wgpu-rs and suspected an off by one error but did not find one yet :D So my next best bet is that the queue which we get from imnodes might have an issue but this also seems rather unlikely.
Alright, thanks for letting me know and minimising the crash. That'll help me when I get around to investigating.
Hi there,
I use
imgui-wgpu-rs
over at https://github.com/4bb4/implot-rs, and after the recent upgrade ofimgui-rs
to 0.7, I'd like to also use the WGPU with it. I hence tried out bumping the versions inimgui-wgpu-rs
and things seem to work somewhat (the code builds, anyway). Let me know what you think.One thing I did encounter in my example code that uses WGPU (https://github.com/4bb4/implot-rs/tree/13-upgrade-to-imgui-rs-0.7/implot-examples/implot-wgpu-demo) is that once I point things to
wgpu
0.7 and the version ofimgui-wgpu-rs
that is the source of this PR, things run, but once I scroll around a bit in a window, I get a panic:I'm not expecting anyone to fix my problems for me, but I thought this might be a problem not specific to my example but rather with just bumping versions like I do in this PR. I can provide a full stack trace or try other stuff as well if desired.