Commit Graph
17 Commits
Author SHA1 Message Date
Cameron McloughlinandJohn Tur db4ebffff8 wgpu: Fix surface validation error (#51935)
Release Notes:

- N/A or Added/Fixed/Improved ...

---------

Co-authored-by: John Tur <john-tur@outlook.com>
2026-03-20 06:32:49 +00:00
AxXxB 7859ef8b26 gpui_wgpu: Release surface resources during destroy (#51561)
## Summary

Implements the fix proposed by @israelrios in
https://github.com/zed-industries/zed/issues/50269#issuecomment-4049006746.

The issue comment narrowed the hang down to X11 window teardown:

- when the Settings window is closed on X11, the UI thread can stall
while `WgpuRenderer` is dropped during final `X11WindowState` teardown
- at that point, the X11 window has already been destroyed
- the proposed fix is to make `WgpuRenderer::destroy()` release
surface-bound GPU resources eagerly so the native window is destroyed
only after the `wgpu::Surface` and related resources are gone

This PR applies that change in `crates/gpui_wgpu/src/wgpu_renderer.rs`
by calling `self.resources.take()` inside `destroy()`.

## Validation

I confirmed this fix locally on Linux Mint 21.3 Cinnamon by applying it
to the `v0.227.1` build:

- opening and closing Settings no longer causes the main window to hang

## References

- Refs #50269
- Original analysis and fix proposal by @israelrios:
https://github.com/zed-industries/zed/issues/50269#issuecomment-4049006746

Release Notes:

- Fixed a Linux/X11 issue where closing the Settings window could cause
Zed to hang.
2026-03-19 08:24:40 +00:00
John Tur 63479d19aa Update to wgpu v29 (#51889)
This release includes the OpenGL fixes which were sent upstream.

Release Notes:

- N/A
2026-03-19 07:57:57 +01:00
Conrad Irwin b45eed4cf1 Linux: Handle device lost with wgpu (#50898)
Release Notes:

- Linux: Handle GPU device loss gracefully
2026-03-05 22:59:48 -07:00
John TurandConrad Irwin 844028e341 Fix handling of surface.configure on Linux (#50640)
Closes #50574

Release Notes:

- Fixed Zed not being responsive on some Linux configurations

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2026-03-03 21:47:57 +00:00
Conrad Irwin cf28be8109 Add error handling to keep Zed running in the face of transient wgpu errors (#50539)
Release Notes:

- linux: Reduce crashes in the face of transient GPU errors
2026-03-02 16:04:40 -07:00
Conrad IrwinandJohn Tur 029d07a8d5 wGPU: Select more specifically (#50528)
This uses the compositor hints if available to pick the best GPU. If
none is
available, it tries each GPU in turn, and the first that actually works
is chosen

Release Notes:

- Linux: Select a more appropriate GPU

---------

Co-authored-by: John Tur <john-tur@outlook.com>
2026-03-02 13:30:40 -07:00
Conrad Irwin 5eb2b4a9a8 Clamp window size on wgpu (#50329)
Fixes ZED-59P

Release Notes:

- Linux: Fix panic when requested window size was larger than supported
by your GPU
2026-02-27 20:59:28 +00:00
Conrad Irwin 5f14a1f2c2 Avoid panicking in wgpu rendering during resize (#50169)
Fixes Zed-5AW
Fixes Zed-5AP

Claude believes this is the right fix, but would love someone who knows
more about graphics than me to take a look: @reflectronic / @zortax?

The panic is:
```
wgpu error: Validation Error

Caused by:
  In Texture::create_view
    Texture with 'path_intermediate' label is invalid
gpui::platform::wgpu::wgpu_renderer::WgpuRenderer::create_path_intermediate (wgpu_renderer.rs:742)
gpui::platform::wgpu::wgpu_renderer::WgpuRenderer::update_drawable_size (wgpu_renderer.rs:784)
gpui::platform::linux::x11::window::X11WindowStatePtr::set_bounds (window.rs:1169)
gpui::platform::linux::x11::client::X11Client::handle_event (client.rs:902)
```

or:
```
wgpu error: Validation Error

Caused by:
  In Texture::create_view
    Texture with 'path_intermediate' label is invalid

gpui::platform::wgpu::wgpu_renderer::WgpuRenderer::create_path_intermediate (wgpu_renderer.rs:742)
gpui::platform::wgpu::wgpu_renderer::WgpuRenderer::new (wgpu_renderer.rs:274)
gpui::platform::linux::x11::window::X11WindowState::new::{{closure}} (window.rs:698)
gpui::platform::linux::x11::window::X11WindowState::new (window.rs:488)
gpui::platform::linux::x11::window::X11Window::new (window.rs:814)
gpui::platform::linux::x11::client::X11Client::open_window (client.rs:1514)
gpui::platform::linux::platform::<T>::open_window (platform.rs:289)
gpui::window::Window::new (window.rs:1119)
gpui::app::App::open_window::{{closure}} (app.rs:1025)
gpui::app::App::update (app.rs:835)
gpui::app::App::open_window (app.rs:1022)
```

I haven't seen a Wayland equivalent (not sure if that's because it
doesn't happen on Wayalnd or because I havent' seen it yet)

Release Notes:

- Linux: Fixed a panic in the new WPGU renderer during resize
2026-02-27 13:53:32 -07:00
John TurandConrad Irwin b56758c4c9 Dynamically detect surface size limits on WGPU (#50340)
Fallout from https://github.com/zed-industries/zed/pull/50270

Release Notes:

- N/A

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2026-02-27 20:46:18 +00:00
Conrad Irwin 791aed5304 Reduce wgpu memory usage during resize (#50030)
Closes #49435

Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- [ ] Done a self-review taking into account security and performance
aspects
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- Linux: Reduced GPU memory usage during resize
2026-02-27 13:24:53 -07:00
John Tur 5954074aee Improve GPU selection on Linux (#50274)
Follow-up to https://github.com/zed-industries/zed/pull/50270

Release Notes:

- N/A
2026-02-27 07:59:06 +00:00
John Tur 06960d4ff8 Relax device limits for WGPU (#50270)
Plus some minor cleanup.

Release Notes:

- Fixed GPU acceleration not working on certain Linux devices.
2026-02-27 01:31:20 -05:00
Lukas WirthandJohn Tur f3f6d62664 GPUI on the web (#50228)
Implements a basic web platform for the wasm32-unknown-unknown target
for gpui

Release Notes:

- N/A *or* Added/Fixed/Improved ...

---------

Co-authored-by: John Tur <john-tur@outlook.com>
2026-02-26 18:36:50 +01:00
Conrad Irwin 1f944f89ba Clamp textures on Linux too (#50025)
Port of #10314 to the wgpu renderer

Closes #ISSUE

Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- [ ] Done a self-review taking into account security and performance
aspects
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- Fixed a panic when rendering an image larger than the GPU could
support.
2026-02-24 22:01:21 +00:00
Conrad IrwinandZed Zippy 47c72e4a8a Defer wgpu context creation until we have a surface (#49926)
Fixes ZED-54X

Release Notes:

- Linux: wait to request a graphics context until we have a window so we
can (ideally) pick a better context or (less ideally) fail more
gracefully.

---------

Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-02-24 06:27:31 +00:00
Piotr OsiewiczandEric Holk dc4bba93ef gpui: Extract gpui_platform out of gpui (#49277)
#2874 on steroids

Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- [ ] Done a self-review taking into account security and performance
aspects
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A

---------

Co-authored-by: Eric Holk <eric@zed.dev>
2026-02-19 18:57:49 +01:00