docs: update vello hybrid readme and lib.rs to include feature-flags (#1359)
Resolves #1355
I added the feature flags for Vello Hybrid in the README and also in its
`lib.rs`, which weren't there
I had to add a new features flag section since it already has a features
section, but I didn't want to mix it up
I also added the note from the `Cargo.toml` about the default vs wgpu
configuration, which seemed like a useful detail.
This is my first time contributing here, so let me know if the
formatting looks off or if you'd rather I merge the two feature sections
---------
Co-authored-by: Osezele Oghedegbe <zele@Emperor-Pro.ipnxng.net>
Co-authored-by: Daniel McNab <36049421+DJMcNab@users.noreply.github.com>
diff --git a/sparse_strips/vello_hybrid/README.md b/sparse_strips/vello_hybrid/README.md
index 82e38df..137ba3e 100644
--- a/sparse_strips/vello_hybrid/README.md
+++ b/sparse_strips/vello_hybrid/README.md
@@ -14,13 +14,25 @@
This crate implements a hybrid CPU/GPU renderer for Vello. It offloads fine rasterization and other GPU-suited tasks while keeping core path processing on the CPU, making it a balanced solution for a variety of hardware.
## Features
+
- Hybrid rendering approach with CPU-based tiling and GPU-accelerated fine rasterization
- Efficient path processing with sparse strip representation
- Designed for performance across different hardware capabilities
## Usage
+
This crate serves as an optimized hybrid rendering engine, leveraging both CPU and GPU where appropriate.
+## 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.
+
## Minimum supported Rust Version (MSRV)
This version of Vello Hybrid has been verified to compile with **Rust 1.88** and later.
diff --git a/sparse_strips/vello_hybrid/src/lib.rs b/sparse_strips/vello_hybrid/src/lib.rs
index 1865cc4..395a463 100644
--- a/sparse_strips/vello_hybrid/src/lib.rs
+++ b/sparse_strips/vello_hybrid/src/lib.rs
@@ -19,6 +19,17 @@
//! - 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: