Architecture Overview
Iced’s rendering architecture is built on trait-based abstractions that decouple the widget layer from the actual drawing operations:Available Renderers
wgpu (GPU-Accelerated)
Thewgpu renderer is the default GPU-accelerated backend that provides high performance on modern graphics hardware.
Backends Supported:
- Vulkan (Linux, Windows, Android)
- Metal (macOS, iOS)
- DirectX 12 (Windows)
- DirectX 11 (Windows)
- OpenGL (Linux, Windows, macOS - legacy)
- WebGPU (Web)
- Hardware-accelerated rendering
- Triangle meshes for custom geometry
- Custom shaders via the
Primitivetrait - MSAA antialiasing (2x, 4x, 8x, 16x)
- Image and SVG support
- GPU-accelerated text rendering via glyphon
tiny-skia (Software Rendering)
Thetiny-skia renderer is a CPU-based software renderer that provides portability and consistency across platforms.
Features:
- Pure CPU rendering (no GPU required)
- Consistent output across all platforms
- Lower memory footprint
- Works in environments without GPU access
- Image and SVG support
- No custom shader support
- No mesh rendering
- Lower performance for complex scenes
Fallback Renderer
Iced supports a fallback renderer strategy that automatically chooses the best available renderer at runtime:- Attempts to initialize
wgpufirst - Falls back to
tiny-skiaif GPU initialization fails - Provides seamless degradation for compatibility
fallback::Renderer and fallback::Compositor types:
Backend Selection
You can control which backend to use via environment variables:Renderer Traits
The core renderer traits that backends must implement:Core Renderer Trait
Text Renderer Trait
Image Renderer Trait
Geometry Renderer Trait
Choosing a Renderer
Use wgpu when:- You need high performance
- Your application has complex animations
- You want to use custom shaders
- GPU is available on target platforms
- You’re building games or data visualizations
- You need guaranteed software rendering
- Running in headless environments
- GPU is not available or unreliable
- You need consistent rendering output
- Memory footprint is a concern
- You want maximum compatibility
- You’re distributing to unknown environments
- You want automatic graceful degradation
- Both features can be included in your binary
Headless Rendering
Both renderers support headless (offscreen) rendering for testing and server-side rendering:Next Steps
- Learn about Custom Renderers to create your own backend
- Explore Performance optimization techniques
- Check out Debugging tools for renderer development
