-
-
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
Don't resize when viewport 0x0 #545
Conversation
I feel like we should fix this in the rendering pipeline side (i.e. in |
Its a tough call. I agree that doing it in bevy_wgpu is nice because it scopes the problem, but it also means that render state is then out of sync with window state. This hack seems fine because it makes "bevy's view of the world" consistent. @Dispersia I'm down to merge this, but can we add a comment to the code that explains the hack and links to the wgpu issue? |
I feel like gfx-rs/wgpu-rs#531 or gfx-rs/wgpu-rs#316 are perhaps more relevant; that is I don't think gfx-rs/wgpu-rs#352 is actually persuant to this issue, as that is about any resizing on vulkan, not this issue which is resizing to a zero-dimensioned window. |
Sounds good, I will make that change instead. Seems strange since we can try to manipulate the view in a different state, but this is a weird issue in the first place |
I think this should be closed in favor of #1409. |
This is a hack to prevent wgpu from crashing bevy when size set to a width or height of 0. Wgpu currently crashes on its swapchain under this condition, winit sends a resize event (of 0x0) on minimize, and if the user click and drag resizes to 0 width or 0 height it crashes as well.
You will not get an event of a 0 width or 0 height resize, so if you want to check for minimized you would need to check window flags on the winit window (I don't think you should check 0x0 for minimized regardless)
This should be removed when gfx-rs/wgpu-rs#316 is fixed
Fixes #170