Crate vello_hybrid

Crate vello_hybrid 

Source
Expand description

§Vello Hybrid

A hybrid CPU/GPU renderer for 2D vector graphics.

This crate provides a rendering API that combines CPU and GPU operations for efficient vector graphics processing. The hybrid approach balances flexibility and performance by:

  • Using the CPU for path processing and initial geometry setup
  • Leveraging the GPU for fast rendering and compositing
  • Minimizing data transfer between CPU and GPU

§Key Features

  • Efficient path rendering with CPU-side processing
  • GPU-accelerated compositing and blending
  • Support for both windowed and headless rendering

§Feature Flags

  • wgpu (enabled by default): Enables the GPU rendering backend via wgpu and includes the required sparse shaders.
  • wgpu_default (enabled by default): Enables wgpu with its default hardware backends (such as Vulkan, Metal, and DX12).
  • webgl: Enables the WebGL rendering backend for browser support, using GLSL shaders for compatibility.

If you need to customize the set of enabled wgpu features, disable this crate’s default features then enable its wgpu feature. You can then depend on wgpu directly, setting the specific features you require. Don’t forget to also disable wgpu’s default features.

§Architecture

The renderer is split into several key components:

  • Scene: Manages the render context and path processing on the CPU
  • Renderer or WebGlRenderer: Handles GPU resource management and executes draw operations
  • Scheduler: Manages and schedules draw operations on the renderer.

See the individual module documentation for more details on usage and implementation.

Re-exports§

pub use util::DimensionConstraints;

Modules§

util
Simple helpers for managing wgpu state and surfaces.

Structs§

AtlasConfig
Configuration for multiple atlas support.
Config
Configuration for the GPU renderer.
GpuStrip
Represents a GPU strip for rendering.
Pixmap
A pixmap of premultiplied RGBA8 values backed by u8.
RenderSettings
Settings to apply to the render context.
RenderSize
Dimensions of the rendering target.
RenderTargetConfig
Options for the renderer
Renderer
Vello Hybrid’s Renderer.
Scene
A render context for hybrid CPU/GPU rendering.

Enums§

AllocationStrategy
Strategy for allocating images across multiple atlases.
RenderError
Errors that can occur during rendering.

Traits§

AtlasWriter
Trait for types that can write image data directly to the atlas texture.