Expand description
GPU renderer for Kova Native.
The renderer is built around a single “uber” pipeline: every primitive — rounded rectangles with independent corner radii, borders, linear gradients, drop shadows, inset shadows, glyphs, images, frosted-glass backdrops — is an instance of a unit quad evaluated analytically in the fragment shader. Primitives therefore batch regardless of type, and a typical frame with thousands of elements is one draw call. Effects that need the pixels drawn so far (backdrop blur) split the frame into segments.
Glyphs and images live in growable texture-array atlases, so atlas growth never breaks batches either.
Scene::push_layer/Scene::pop_layer render a group of primitives
offscreen and composite it through a LayerMask (SVG/image coverage or
an alpha gradient). register_shader adds custom WGSL fragment shaders
drawn with Scene::push_custom.
Re-exports§
pub use shaders::ShaderId;pub use shaders::register_shader;pub use wgpu;
Modules§
- shaders
- Registration of custom WGSL fragment shaders.
Structs§
- Atlas
- CPU side of the atlases: allocation, key lookup and pending uploads.
- Atlas
Image - Pixel data to insert into the atlas.
- Atlas
Tile - Location of an image inside the atlas.
- Content
Mask - Clip region (device pixels), optionally with rounded corners.
- Draw
State - Transform, clip and group opacity applied to a primitive.
- GpuContext
- The GPU instance, adapter, device and queue shared by all windows.
- Quad
- A rounded rectangle with fill and border.
- Renderer
- Renders
Scenes. One renderer (and one set of atlases) is shared by all windows of an application. - Scene
- An ordered list of primitives in painter’s order.
- Scene
Stats - Statistics about a built scene.
- Shadow
- A box shadow (CSS semantics:
bluris the blur radius,spreadgrows the shadow shape). - Surface
Options - Presentation configuration of a window surface.
- Window
Surface - A window’s swapchain.
Enums§
- Atlas
Key - What is stored in the atlas.
- Atlas
Kind - Effect
- Effects that split the scene into multiple render passes.
- Layer
Mask - How a layer opened with
Scene::push_layeris composited onto what lies below it.
Constants§
- ATLAS_
SIZE - Edge length of every atlas layer, in texels.