Skip to content

Commit

Permalink
blade: Update to e142a3a to fix crash (#17510)
Browse files Browse the repository at this point in the history
Closes #17005

Like #17319, but based on
kvark/blade#144.

This should be cherry-picked into preview if possible 🙂 

Release Notes:

- Linux: Fixed crash when closing windows on Wayland.
  • Loading branch information
apricotbucket28 authored and notpeter committed Sep 6, 2024
1 parent 9981f36 commit 08d8ab1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 11 deletions.
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ members = [
# Tooling
#

"tooling/xtask"
"tooling/xtask",
]
default-members = ["crates/zed"]

Expand Down Expand Up @@ -322,9 +322,9 @@ async-watch = "0.3.1"
async_zip = { version = "0.0.17", features = ["deflate", "deflate64"] }
base64 = "0.22"
bitflags = "2.6.0"
blade-graphics = { git = "https://github.com/kvark/blade", rev = "fee06c42f658b36dd9ac85444a9ee2a481383695" }
blade-macros = { git = "https://github.com/kvark/blade", rev = "fee06c42f658b36dd9ac85444a9ee2a481383695" }
blade-util = { git = "https://github.com/kvark/blade", rev = "fee06c42f658b36dd9ac85444a9ee2a481383695" }
blade-graphics = { git = "https://github.com/kvark/blade", rev = "e142a3a5e678eb6a13e642ad8401b1f3aa38e969" }
blade-macros = { git = "https://github.com/kvark/blade", rev = "e142a3a5e678eb6a13e642ad8401b1f3aa38e969" }
blade-util = { git = "https://github.com/kvark/blade", rev = "e142a3a5e678eb6a13e642ad8401b1f3aa38e969" }
cargo_metadata = "0.18"
cargo_toml = "0.20"
chrono = { version = "0.4", features = ["serde"] }
Expand Down
14 changes: 14 additions & 0 deletions crates/gpui/src/platform/blade/blade_renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,17 @@ impl BladePipelines {
}),
}
}

fn destroy(&mut self, gpu: &gpu::Context) {
gpu.destroy_render_pipeline(&mut self.quads);
gpu.destroy_render_pipeline(&mut self.shadows);
gpu.destroy_render_pipeline(&mut self.path_rasterization);
gpu.destroy_render_pipeline(&mut self.paths);
gpu.destroy_render_pipeline(&mut self.underlines);
gpu.destroy_render_pipeline(&mut self.mono_sprites);
gpu.destroy_render_pipeline(&mut self.poly_sprites);
gpu.destroy_render_pipeline(&mut self.surfaces);
}
}

pub struct BladeSurfaceConfig {
Expand Down Expand Up @@ -437,6 +448,7 @@ impl BladeRenderer {
self.wait_for_gpu();
self.surface_config.transparent = transparent;
let surface_info = self.gpu.resize(self.surface_config);
self.pipelines.destroy(&self.gpu);
self.pipelines = BladePipelines::new(&self.gpu, surface_info);
self.alpha_mode = surface_info.alpha;
}
Expand Down Expand Up @@ -537,8 +549,10 @@ impl BladeRenderer {
pub fn destroy(&mut self) {
self.wait_for_gpu();
self.atlas.destroy();
self.gpu.destroy_sampler(self.atlas_sampler);
self.instance_belt.destroy(&self.gpu);
self.gpu.destroy_command_encoder(&mut self.command_encoder);
self.pipelines.destroy(&self.gpu);
}

pub fn draw(&mut self, scene: &Scene) {
Expand Down

0 comments on commit 08d8ab1

Please sign in to comment.