kova_native_render/lib.rs
1//! GPU renderer for Kova Native.
2//!
3//! The renderer is built around a single "uber" pipeline: every primitive —
4//! rounded rectangles with independent corner radii, borders, linear
5//! gradients, drop shadows, inset shadows, glyphs, images, frosted-glass
6//! backdrops — is an instance of a unit quad evaluated analytically in the
7//! fragment shader. Primitives therefore batch regardless of type, and a
8//! typical frame with thousands of elements is **one draw call**. Effects
9//! that need the pixels drawn so far (backdrop blur) split the frame into
10//! segments.
11//!
12//! Glyphs and images live in growable texture-array atlases, so atlas growth
13//! never breaks batches either.
14//!
15//! [`Scene::push_layer`]/[`Scene::pop_layer`] render a group of primitives
16//! offscreen and composite it through a [`LayerMask`] (SVG/image coverage or
17//! an alpha gradient). [`register_shader`] adds custom WGSL fragment shaders
18//! drawn with [`Scene::push_custom`].
19
20mod atlas;
21mod renderer;
22mod scene;
23pub mod shaders;
24
25pub use atlas::{ATLAS_SIZE, Atlas, AtlasImage, AtlasKey, AtlasKind, AtlasTile};
26pub use renderer::{GpuContext, Renderer, SurfaceOptions, WindowSurface};
27pub use scene::{ContentMask, DrawState, Effect, LayerMask, Quad, Scene, SceneStats, Shadow};
28pub use shaders::{ShaderId, register_shader};
29pub use wgpu;
30
31#[cfg(test)]
32mod tests;