Desktop: Fix rendering getting stuck on stale WGPU surfaces (#4966)

Reconfigure WGPU surface and request redraw on Outdated

Co-authored-by: Carlos Ferrabone <[email protected]>
Co-authored-by: Timon <[email protected]>
This commit is contained in:
authored and GitHub committed 2026-12-06 13:42:47 +00:00
1 parent 436c943196
commit d5fdb12320
1 file changed
+5 -2
+5 -2
View File
@@ -234,7 +234,11 @@ impl RenderState {
WgpuCurrentSurfaceTexture::Suboptimal(t) => (t, true),
WgpuCurrentSurfaceTexture::Occluded => return Ok(()),
WgpuCurrentSurfaceTexture::Lost => return Err(RenderError::SurfaceLost),
WgpuCurrentSurfaceTexture::Outdated => return Err(RenderError::SurfaceOutdated),
WgpuCurrentSurfaceTexture::Outdated => {
self.surface.configure(&self.executor.context().device, &self.config);
window.request_redraw();
return Ok(());
}
WgpuCurrentSurfaceTexture::Timeout => return Err(RenderError::SurfaceTimeout),
WgpuCurrentSurfaceTexture::Validation => return Err(RenderError::SurfaceValidation),
};
@@ -327,7 +331,6 @@ impl RenderState {
pub(crate) enum RenderError {
OutdatedUITextureError,
SurfaceLost,
SurfaceOutdated,
SurfaceTimeout,
SurfaceValidation,
}