Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Don't panic on GPU hang (#14974)

Conrad Irwina955968de35a
diff --git a/crates/gpui/src/platform/blade/blade_renderer.rs b/crates/gpui/src/platform/blade/blade_renderer.rs
index 1830d0cd0dd..ee602618467 100644
--- a/crates/gpui/src/platform/blade/blade_renderer.rs
+++ b/crates/gpui/src/platform/blade/blade_renderer.rs
@@ -18,7 +18,7 @@ use blade_graphics as gpu;
use blade_util::{BufferBelt, BufferBeltDescriptor};
use std::{mem, sync::Arc};
-const MAX_FRAME_TIME_MS: u32 = 1000;
+const MAX_FRAME_TIME_MS: u32 = 10000;
#[cfg(target_os = "macos")]
pub type Context = ();
@@ -412,7 +412,8 @@ impl BladeRenderer {
fn wait_for_gpu(&mut self) {
if let Some(last_sp) = self.last_sync_point.take() {
if !self.gpu.wait_for(&last_sp, MAX_FRAME_TIME_MS) {
- panic!("GPU hung");
+ log::error!("GPU hung");
+ while !self.gpu.wait_for(&last_sp, MAX_FRAME_TIME_MS) {}
}
}
}