gpui_linux/gpui_linux.rs
1#![cfg(any(target_os = "linux", target_os = "freebsd"))]
2mod linux;
3
4pub use linux::{current_platform, linux_platform};
5
6/// The debug GPU override as a `GpuPreference`, for the headless entry point that has no platform
7/// instance to ask.
8///
9/// `ZED_DEVICE_ID` is read here, in the platform, so neither the renderer nor `gpui_platform` knows
10/// the variable. A windowed application reaches the same value through `set_gpu_preference`; the
11/// headless renderer has no platform, so `gpui::current_headless_renderer` calls this instead.
12pub use linux::gpu_preference_from_env;
13
14/// The producer's half of the imported-texture path where wgpu is the renderer, which on Linux is the default one.
15/// Re-exported here for the same reason gpui_macos re-exports Metal's: this is the crate an
16/// application already reaches the platform through, so it does not have to know that the renderer
17/// lives in a crate of its own.
18#[cfg(any(feature = "wayland", feature = "x11"))]
19pub use gpui_wgpu::ImportedTextureExt;
20
21/// The headless renderer, so `gpui::current_headless_renderer` can build one on this platform the way
22/// it builds Metal's on macOS. The Linux platform owns no renderer of its own; wgpu is the renderer a
23/// window uses here, so a headless context renders through the same code.
24#[cfg(all(
25 feature = "gpui_wgpu",
26 any(feature = "bench-support", feature = "test-support")
27))]
28pub use gpui_wgpu::WgpuHeadlessRenderer;
29
30/// The Linux surface transport, re-exported so an application reaches it through the platform crate
31/// it already depends on rather than through the engine.
32#[cfg(target_os = "linux")]
33pub use gpui_engine::{DmaBufHandle, DmaBufPlane, SurfaceFormat, SurfaceFormatKind};