Regenerate the swapchain if the frame is outdated

This commit is contained in:
João Capucho 2021-06-04 20:37:39 +01:00
parent f574015c39
commit 36c28af46d
No known key found for this signature in database
GPG Key ID: 1AD5CE7CCAEBDA21

View File

@ -857,7 +857,8 @@ impl Renderer {
return Ok(None);
},
Err(err @ wgpu::SwapChainError::Outdated) => {
warn!("{}. This will probably be resolved on the next frame", err);
warn!("{}. Recreating the swapchain", err);
self.swap_chain = self.device.create_swap_chain(&self.surface, &self.sc_desc);
return Ok(None);
},
Err(err @ wgpu::SwapChainError::OutOfMemory) => return Err(err.into()),