Skip to main content

par_term_render/
lib.rs

1//! GPU-accelerated rendering engine for par-term terminal emulator.
2//!
3//! This crate provides the rendering pipeline for the terminal emulator,
4//! including:
5//!
6//! - Cell-based GPU rendering with glyph atlas
7//! - Sixel/iTerm2/Kitty inline graphics rendering
8//! - Custom GLSL shader post-processing (Shadertoy/Ghostty compatible)
9//! - Scrollbar rendering with mark overlays
10//! - Background image rendering
11//! - GPU utility functions
12//!
13//! # Logging Convention (ARC-004)
14//!
15//! This crate has two logging systems: `log::debug!()` / `log::trace!()` calls
16//! and the root crate's `crate::debug_info!()` / `crate::debug_log!()` macros.
17//!
18//! For **rendering hot paths** (functions called every frame during
19//! `render_split_panes`, `build_instance_buffers`, shader compilation), prefer
20//! `log::debug!()` / `log::trace!()` since these are controlled by `RUST_LOG`
21//! and have near-zero overhead when disabled. The root crate's custom debug
22//! macros (`debug_info!`) are not available in this sub-crate.
23//!
24//! For **non-hot-path diagnostics** (startup, resource loading, error paths),
25//! either system is acceptable.
26//!
27//! A future migration (deferred — see AUDIT.md ARC-004) will unify both systems
28//! under `tracing`. Until then, do NOT add new `log::debug!()` calls inside
29//! per-frame loops without guarding them behind a level check or making them
30//! conditional on `cfg!(debug_assertions)`.
31
32pub mod cell_renderer;
33pub mod custom_shader_renderer;
34pub mod error;
35pub mod gpu_utils;
36pub mod graphics_renderer;
37pub mod renderer;
38pub mod scrollbar;
39
40// Re-export main public types
41pub use cell_renderer::{Cell, CellRenderer, PaneViewport};
42pub use custom_shader_renderer::CustomShaderRenderer;
43pub use error::RenderError;
44pub use graphics_renderer::{GraphicRenderInfo, GraphicsRenderer};
45pub use renderer::{
46    DividerRenderInfo, PaneDividerSettings, PaneRenderInfo, PaneTitleInfo, Renderer,
47    RendererParams, compute_visible_separator_marks,
48};
49pub use scrollbar::Scrollbar;
50
51// Re-export shared types from dependencies for convenience
52pub use par_term_config::{ScrollbackMark, SeparatorMark};