-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Merged by Bors] - Fix window size change panic #2858
[Merged by Bors] - Fix window size change panic #2858
Conversation
Long-term this should probably be implemented using the window creation / resizing / etc events but that was a rabbit hole I didn't want to go down for now. |
Tested on linux/vulkan, works as expected 👍 |
One thing I didn't test yet but accidentally did earlier was moving a window between screens that are using different scale factors. I think it should work but I need to test. |
It works too. :) |
Just tested on Windows and Linux. Looks good to me! |
bors r+ |
# Objective Using fullscreen or trying to resize a window caused a panic. Fix that. ## Solution - Don't wholesale overwrite the ExtractedWindows resource when extracting windows - This could cause an accumulation of unused windows that are holding onto swap chain frames? - Check the if width and/or height changed since the last frame - If the size changed, recreate the swap chain - Ensure dimensions are >= 1 to avoid panics due to any dimension being 0
Pull request successfully merged into pipelined-rendering. Build succeeded: |
The fix originally got introduced in [#2858](https://github.com/bevyengine/bevy/pull/2858/files#diff-0f34eeda7ac2fe1f9e9b27de92d9290e0b360ffa6f032770aff22b5fef4eaa63R137-R143) but got lost in the upgrade to wgpu 0.11 at #2933
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leavl
Objective
Using fullscreen or trying to resize a window caused a panic. Fix that.
Solution