Skip to main content

render_parallel

Function render_parallel 

Source
pub fn render_parallel<F, B>(
    backend: &B,
    config: &NativeRenderConfig,
    scene_fn: F,
) -> Result<Vec<PathBuf>, RasterError>
where B: RasterizerBackend + Send + Sync, F: Fn(u32) -> Scene + Send + Sync,
Expand description

Render all frames in parallel using Rayon, then write PNGs.

Frames are rendered concurrently across all available CPU cores. Requires backend to implement Send + Sync.

§Performance

On a machine with N cores, this is roughly N× faster than sequential for the rasterization step. PNG file I/O is still sequential to preserve order.