diff --git a/crates/bevy_render/src/view/window/mod.rs b/crates/bevy_render/src/view/window/mod.rs index 78d7ad1b459f05..db1709d9657804 100644 --- a/crates/bevy_render/src/view/window/mod.rs +++ b/crates/bevy_render/src/view/window/mod.rs @@ -320,30 +320,25 @@ pub fn prepare_windows( }) }; - let not_already_configured = window_surfaces.configured_windows.insert(window.entity); - let surface = &surface_data.surface; - if not_already_configured || window.size_changed || window.present_mode_changed { - render_device.configure_surface(surface, &surface_data.configuration); - } match surface.get_current_texture() { Ok(frame) => { window.set_swapchain_texture(frame); } - #[cfg(target_os = "linux")] - Err(wgpu::SurfaceError::Outdated) if ignore_outdated() => {} Err(wgpu::SurfaceError::Outdated) => { render_device.configure_surface(surface, &surface_data.configuration); - let frame = surface - .get_current_texture() - .expect("Error reconfiguring surface"); - window.set_swapchain_texture(frame); + match surface.get_current_texture() { + Ok(frame) => window.set_swapchain_texture(frame), + #[cfg(target_os = "linux")] + Err(wgpu::SurfaceError::Outdated) if ignore_outdated() => {} + Err(err) => panic!("Error reconfiguring surface: {err}"), + } } #[cfg(target_os = "linux")] Err(wgpu::SurfaceError::Timeout) if may_erroneously_timeout() => { bevy_utils::tracing::trace!( "Couldn't get swap chain texture. This is probably a quirk \ - of your Linux GPU driver, so it can be safely ignored." + of your Linux GPU driver, so it can be safely ignored." ); } Err(err) => {