gpui_wgpu: Add Linux headless rendering (#64718)

## Summary

Add Linux WGPU headless rendering for GPUI tests and benchmarks without
creating a display surface or window.

- Extract a concrete `WgpuRendererCore` shared by the windowed and
headless wrappers, retaining production pipelines, atlas handling, and
frame encoding.
- Reuse an offscreen render target between same-size frames. Normal
rendering submits GPU work without screenshot readback; image capture
performs aligned readback and returns RGBA pixels.
- Reuse adapter ranking, including the `ZED_DEVICE_ID` preference.
Reject software adapters by default, with an explicit software-allowed
constructor for functional tests.
- Wire Linux platform selection through separate `bench-support` and
`test-support` features. Propagate initialization failures rather than
silently running a benchmark without a renderer.
- Preserve upstream atlas bind-group caching and window lifecycle
behavior.

This is a fresh implementation following discussion of #62341, not a
continuation of that PR. It does not include a Criterion upgrade,
hardware counters, benchmark CI, or GPU timing queries.

## Validation

After merging `origin/main` at `baee1ca6de`:

- `cargo test -p gpui_wgpu` — 38 tests passed.
- `cargo test -p gpui_wgpu --features test-support` — passed.
- `env -u DISPLAY -u WAYLAND_DISPLAY cargo test -p gpui_wgpu
headless_renderer` — passed.
- `cargo check -p gpui_platform --features bench-support` — passed.
- `cargo check -p gpui_platform --features 'test-support,wayland,x11'` —
passed.
- `cargo check -p gpui_wgpu --target wasm32-unknown-unknown` — passed.
- Formatting and diff checks passed.
- Verified the `gpui_wgpu` benchmark feature graph does not enable
`test-support`.

Windowed rendering and device recovery have compile coverage but have
not been manually exercised after the refactor. Headless timings
represent CPU rendering/submission, not display latency or
GPU-completion time.

## Suggested .rules additions

For `gpui_wgpu`: Tests requiring GPUI test contexts must be gated on
`test-support`, rather than enabling that feature unconditionally in a
dev dependency. Cargo unifies dev-dependency features into this crate's
benchmark targets.

Release Notes:

- [GPUI] Added headless renderer support for WGPU on Linux for
benchmarks and testing.
e91b82c106Anthony Eid committed on 9/25/2026, 5:49:48 PM· committed by GitHubparent9758458
14 files changedLine totals unavailable