From 295e2a3837047f13ba6e781bcdd34525c91bafb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Kozlovsk=C3=BD?= <100806068+MatejKozlovsky@users.noreply.github.com> Date: Thu, 15 Oct 2026 01:38:36 +0200 Subject: [PATCH] GPU: stop drawing a frame once the device has failed --- crates/gpu/src/walk.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/gpu/src/walk.rs b/crates/gpu/src/walk.rs index e9541229..b1209070 100644 --- a/crates/gpu/src/walk.rs +++ b/crates/gpu/src/walk.rs @@ -73,6 +73,9 @@ fn draw_comp<'a>(e: &mut Enc, r: &Renderer<'a>, ctx: &EvalCtx<'a>, canvas: &mut let levels = r.pipe().levels; let mut i = 0; while i < visible.len() { + // A device that ran out of memory (or was lost) on an earlier layer fails every later + // one: give the frame back to the CPU now instead of drawing the rest of the comp. + e.g.check_health().ok()?; if visible[i].is_3d() { let mut j = i; while j < visible.len() && visible[j].is_3d() {