This is a big one.
Bug: #76
selfisekai/gram:wgpu-cherry into main This is a big one.
Bug: #76
Cherry-picked from 2d4628280ad125f08c3abaec5815db1701154b3d Co-authored-by: LN Liberda <lauren@selfisekai.rocks>
Subpixel text rendering is now implemented on Windows and Linux. Comparison screenshots: |Before|After| | ------------- | ------------- | | <img width="400" src="https://github.com/user-attachments/assets/9d720d2c-2ec4-4adf-a83f-7c2d81d30025" /> | <img width="400" src="https://github.com/user-attachments/assets/8fd7dc2a-8ca0-4f71-86cd-55460f568f7a" /> | Release Notes: - Added support for subpixel (ClearType-style) text rendering. This improves the legibility of text on standard DPI displays. Subpixel rendering is enabled by default on Windows and Linux and can be configured using the `text_rendering_mode` setting. --------- Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com> Cherry-picked from 47d2694dcceae02ff9ffd5d7d174389dde6a7bf3 Co-authored-by: LN Liberda <lauren@selfisekai.rocks>
This was removed by me when cherry-picking 2d4628280ad125f08c3abaec5815db1701154b3d (switch to wgpu), before cherry-picking 47d2694dcceae02ff9ffd5d7d174389dde6a7bf3 (subpixel text rendering). Co-authored-by: Leonard Seibold <leo@zrtx.de>
Wow, great work! I am travelling during the weekend and probably won’t be able to test this before monday, but I will check it out as soon as I can!
I only have access to a Mac here, but at least on Mac compiling and running works without issues.
Unfortunately both of the Linux systems I have here are unable to run this branch.. but I think the problem is more to do with them than the WGPU code.
The first one is an MNT Pocket Reform which doesn't seem to implement some Vulkan extension needed by WGPU, but it was crashing on the blade renderer as well so I might just have to forget about running gram on the Pocket for now. The second one is an Intel Macbook Pro from 2014 which crashes on startup:
2026年03月15日T19:25:46+01:00 INFO [gram] ========== starting gram version 1.0.0, sha 3016e75 ==========
MESA-INTEL: warning: Haswell Vulkan support is incomplete
2026年03月15日T19:25:46+01:00 INFO [gpui::platform::wgpu::wgpu_context] Selected GPU adapter: "Mesa Intel(R) Iris(R) Graphics 5100 (HSW GT3)" (Gl)
2026年03月15日T19:25:46+01:00 INFO [crashes] spawning crash handler process
2026年03月15日T19:25:46+01:00 INFO [gpui::platform::linux::platform] activate is not implemented on Linux, ignoring the call
2026年03月15日T19:25:46+01:00 INFO [crashes] connected to crash handler process after 100ms
2026年03月15日T19:25:46+01:00 INFO [crashes] crash handler registered
2026年03月15日T19:25:46+01:00 WARN [wgpu_hal::gles::egl] Re-initializing Gles context due to Wayland window
2026年03月15日T19:25:46+01:00 ERROR [crashes] thread 'main' panicked at /home/krig/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wgpu-hal-28.0.0/src/gles/egl.rs:308:14:
called `Result::unwrap()` on an `Err` value: BadDisplay...
2026年03月15日T19:25:46+01:00 ERROR [crashes] triggering a crash to generate a minidump...
[1] + 13387 suspended (signal) /usr/libexec/gram-editor
This one may be fixed in wgpu trunk, so I will see if I can rebuild against that.
These issues are probably more to do with my obscure hardware and less with the patch, so I think I will merge this branch regardless, but yeah will see if I can build against trunk first and if that works I'll make a second patch to update the dependency.
It looks like the issue is a lack of support for Vulkan on my devices, which is fine! They are weird, I know.
However, I would have hoped to at least be able to run with the llvmpipe software renderer.. If I set LIBGL_ALWAYS_SOFTWARE=1 I get this:
2026年03月15日T21:16:30+01:00 ERROR [wgpu::backend::wgpu_core] Handling wgpu errors as fatal by default
2026年03月15日T21:16:30+01:00 ERROR [crashes] thread 'main' panicked at /home/krig/.cargo/git/checkouts/wgpu-045f9a3b3e40a5c0/62c2f5d/wgpu/src/backend/wgpu_core.rs:1081:30:
wgpu error: Validation Error
Caused by:
In Device::create_shader_module, label = 'gpui_shaders'
Shader 'gpui_shaders' parsing error: local declaration cannot be called
┌─ wgsl:1067:17
│
1067 │ let color = gradient_color(background, input.position.xy, bounds,
│ ^^^^^^^^^^^^^^ local declaration cannot be called
...
2026年03月15日T21:16:30+01:00 ERROR [crashes] triggering a crash to generate a minidump...
Anyway, no need to worry about these issues, but I would be interested in whether you have any ideas for how I might be able to get gram running with WGPU on for example the MNT Pocket Reform.
The first one is an MNT Pocket Reform which doesn't seem to implement some Vulkan extension needed by WGPU,
Are you using the older NXP (Freescale) i.MX M8 Plus version, or the newer Rockchip RK3588 version?
@selfisekai wrote in #103 (comment):
The first one is an MNT Pocket Reform which doesn't seem to implement some Vulkan extension needed by WGPU,
Are you using the older NXP (Freescale) i.MX M8 Plus version, or the newer Rockchip RK3588 version?
I have a RK3588
mesa panvk is even certified for Vulkan 1.4 compliance on that GPU, so it should work. Maybe you have to install a Vulkan driver separately? (Alpine seems to have it as mesa-vulkan-panfrost)
@selfisekai wrote in #103 (comment):
mesa panvk is even certified for Vulkan 1.4 compliance on that GPU, so it should work. Maybe you have to install a Vulkan driver separately? (Alpine seems to have it as
mesa-vulkan-panfrost)
Hmm yes, that could be the case, maybe I just haven't got the correct driver installed..
I also found someone with the exact same GPU as my old macbook pro who did get Zed to work with an updated wgpu, so it should be possible to get that to work in the future. But I think I would prefer merging this using wgpu 0.28 and updating once they make a new release there.
This is the error I get on the MNT Pocket Reform when I run Gram:
Failed to create WGPU device: Limit 'max_texture_dimension_3d' value 2048 is better than allowed 512. See docs/linux.md for troubleshooting steps.
Running vkcube works and prints
Selected WSI platform: wayland
Selected GPU 0: Mali-G610 MC4, type: IntegratedGpu
Gram.log contains this:
2026年03月15日T19:18:44+01:00 INFO [gram] ========== starting gram version 1.0.0, sha 2ce5a0f ==========
2026年03月15日T19:18:44+01:00 INFO [gpui::platform::wgpu::wgpu_context] Selected GPU adapter: "Mali-G610 MC4" (Vulkan)
2026年03月15日T19:18:44+01:00 WARN [wgpu_core::instance] Missing downlevel flags: DownlevelFlags(SURFACE_VIEW_FORMATS)
The underlying API or device in use does not support enough features to be a fully compliant implementation of WebGPU. A subset of the features can still be used. If you are running this program on native and not in a browser and wish to limit the features you use to the supported subset, call Adapter::downlevel_properties or Device::downlevel_properties to get a listing of the features the current platform supports.
2026年03月15日T19:18:44+01:00 WARN [wgpu_core::instance] DownlevelCapabilities {
flags: DownlevelFlags(
COMPUTE_SHADERS | FRAGMENT_WRITABLE_STORAGE | INDIRECT_EXECUTION | BASE_VERTEX | READ_ONLY_DEPTH_STENCIL | NON_POWER_OF_TWO_MIPMAPPED_TEXTURES | CUBE_ARRAY_TEXTURES | COMPARISON_SAMPLERS | INDEPENDENT_BLEND | VERTEX_STORAGE | ANISOTROPIC_FILTERING | FRAGMENT_STORAGE | MULTISAMPLED_SHADING | DEPTH_TEXTURE_AND_BUFFER_COPIES | WEBGPU_TEXTURE_FORMAT_SUPPORT | BUFFER_BINDINGS_NOT_16_BYTE_ALIGNED | UNRESTRICTED_INDEX_BUFFER | FULL_DRAW_INDEX_UINT32 | DEPTH_BIAS_CLAMP | VIEW_FORMATS | UNRESTRICTED_EXTERNAL_TEXTURE_COPIES | NONBLOCKING_QUERY_RESOLVE | SHADER_F16_IN_F32,
),
limits: DownlevelLimits,
shader_model: Sm5,
}
I created a branch to see if I can get it running on the Pocket and will stop spamming this PR :)
Good news! I actually have this branch working on the MNT Pocket now :) The editor crashes when I try to fullscreen, but it does that on the main branch as well. Now that I have it building and working on both Mac and Linux I'm going to merge this and then merge my fixes on top.
Thank you!
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?