Skip to main content

truce_gpu/
lib.rs

1//! GPU rendering backend for truce plugins.
2//!
3//! Uses wgpu (Metal/DX12 backends per the workspace's feature pin) with
4//! lyon tessellation and a fontdue glyph atlas. Implements
5//! `truce_gui::RenderBackend` so widgets render identically to the CPU
6//! path.
7//!
8//! Platform windowing is provided by baseview.
9
10/// Crate-wide debug-print macro for GPU init / render hot-reload paths.
11/// Compiles to nothing unless the `hot-debug` feature is enabled.
12/// Defined at crate root so any module under `truce_gpu::*` can reach
13/// it without re-importing.
14#[macro_export]
15macro_rules! hot_debug {
16    ($($arg:tt)*) => {
17        #[cfg(feature = "hot-debug")]
18        eprintln!($($arg)*);
19    };
20}
21
22mod backend;
23// `editor` is the baseview-driven host (macOS/Windows/Linux). iOS
24// hosts the editor via `truce-gui::editor_ios` inside a UIView
25// attached to the AUv3 view controller, so the baseview-backed
26// editor doesn't compile on iOS.
27#[cfg(not(target_os = "ios"))]
28pub mod editor;
29pub mod platform;
30
31pub use backend::WgpuBackend;
32#[cfg(not(target_os = "ios"))]
33pub use editor::GpuEditor;