Zed's Linux renderer gets a major overhaul, replacing the problematic Blade graphics library with WGPU to improve stability and performance.
The Zed editor team has merged a significant change to its Linux rendering pipeline, replacing the Blade graphics library with WGPU in a move that promises better stability and future compatibility. The pull request, which removes 2,030 lines of Blade code while adding 2,315 lines of WGPU implementation, addresses long-standing issues that have plagued Zed users on Linux platforms.
The Problem with Blade
Blade, the previous graphics library used for Linux rendering in Zed, had become a source of multiple issues for both end users and other applications using GPUI (the graphics library powering Zed). The maintainer of Blade has even described it as "experimental and not suitable for production" in talks, raising concerns about its long-term viability as a core dependency.
Several GitHub issues documented the problems, particularly around NVIDIA GPU support and compatibility with Smithay-based Wayland compositors. Users reported freezes and rendering failures that stemmed from Blade's architecture and maintenance status.
Why WGPU?
The decision to switch to WGPU wasn't arbitrary. WGPU has emerged as the de-facto standard in the Rust UI and graphics ecosystem, with broad adoption across major projects including the Bevy game engine and the Iced GUI framework. This widespread adoption means improvements and bug fixes benefit not just Zed, but the entire ecosystem.
WGPU offers several technical advantages:
- Multiple backend support: On Windows, it supports Vulkan, DirectX 12, and ANGLE-based backends that can fall back to OpenGL ES and DirectX 9
- Cross-platform consistency: Provides a unified API across different operating systems
- Active maintenance: As a core dependency of many production projects, it receives regular updates and community contributions
- Future-proofing: Enables potential future features like custom shaders and direct buffer access
Performance and Memory Considerations
Initial concerns about WGPU's memory usage were addressed through optimization. While an empty WGPU window initially consumed around 100MB compared to Blade's 10MB, the actual Zed implementation showed comparable or better memory usage once rendering content was added.
Performance benchmarks revealed a ~20% CPU time improvement with the new implementation, though GPU time remained similar. The team implemented several optimizations including:
- Using a single buffer for all frames instead of recreating buffers
- Pre-creating global bind groups
- Deduplicating identical bind group layouts
- Simplifying MSAA sample count handling
Compatibility Trade-offs
Some users expressed concerns about WGPU potentially having worse compatibility than native renderers. However, the team noted that WGPU's ANGLE backend provides broader device support than the previous Blade implementation, particularly on Windows where it can support older GPUs through DirectX 9 and OpenGL ES compatibility.
For macOS, the team decided to keep the existing Metal renderer rather than switching to WGPU, citing better performance and wider compatibility with existing hardware.
The Migration Process
The implementation involved porting the Blade renderer's functionality to WGPU while maintaining the same rendering behavior. This approach minimized visual differences while addressing the underlying stability issues. The team also simplified the codebase by removing Blade-specific logic and consolidating rendering paths.
Impact on the Ecosystem
This change has implications beyond just Zed. GPUI, the graphics library used by Zed, will now have a more stable and maintainable Linux backend. This benefits other applications using GPUI and aligns with the broader Rust graphics ecosystem's direction.
The move also opens possibilities for future enhancements, such as embedding Zed into other WGPU applications or enabling custom shader support for advanced rendering effects.
What This Means for Users
For Linux users, particularly those on NVIDIA hardware or using Wayland compositors, this change should resolve many of the stability issues that previously required workarounds or prevented Zed from working entirely. The improved maintenance status of WGPU means these fixes will continue to receive updates and improvements from the broader community.
Windows and macOS users won't see changes to their native renderers, which the team believes still offer better performance than WGPU for those platforms.
The successful merge of this pull request represents a significant step in Zed's evolution, prioritizing stability and maintainability over short-term performance gains while setting the stage for future graphics innovations.

Comments
Please log in or register to join the discussion