Skip to content

Commit 987f7de

Browse files
code review feedback (sans the generated code changes)
1 parent eb2c76a commit 987f7de

File tree

26 files changed

+132
-138
lines changed

26 files changed

+132
-138
lines changed

Cargo.lock

Lines changed: 26 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ members = [
1717
"sparse_strips/vello_common",
1818
"sparse_strips/vello_cpu",
1919
"sparse_strips/vello_hybrid",
20-
"sparse_strips/vello_hybrid_shaders",
20+
"sparse_strips/vello_sparse_shaders",
2121
"sparse_strips/vello_hybrid/examples/native_webgl",
2222
"sparse_strips/vello_hybrid/examples/scenes",
23-
"sparse_strips/vello_hybrid/examples/webgl",
23+
"sparse_strips/vello_hybrid/examples/wgpu_webgl",
2424
"sparse_strips/vello_hybrid/examples/winit",
2525
"sparse_strips/vello_toy",
2626
"sparse_strips/vello_dev_macros",
@@ -115,7 +115,7 @@ vello_api = { path = "sparse_strips/vello_api", default-features = false }
115115
vello_common = { version = "0.0.1", path = "sparse_strips/vello_common", default-features = false }
116116
vello_cpu = { path = "sparse_strips/vello_cpu" }
117117
vello_hybrid = { path = "sparse_strips/vello_hybrid" }
118-
vello_hybrid_shaders = { path = "sparse_strips/vello_hybrid_shaders" }
118+
vello_sparse_shaders = { path = "sparse_strips/vello_sparse_shaders" }
119119
vello_hybrid_scenes = { path = "sparse_strips/vello_hybrid/examples/scenes" }
120120
vello_dev_macros = { path = "sparse_strips/vello_dev_macros" }
121121

sparse_strips/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ This directory contains the core crates for the Vello rendering. Each crate serv
2222
- **`vello_common`** – Provides shared data structures and utilities for rendering.
2323
- **`vello_cpu`** – Implements a CPU-based renderer optimized for multithreading and SIMD.
2424
- **`vello_hybrid`** – A hybrid CPU/GPU renderer, balancing workload between CPU and GPU.
25-
- **`vello_hybrid_shaders`** – Provide compilation of wgsl to glsl to support the WebGL `vello_hybrid` backend.
25+
- **`vello_sparse_shaders`** – Provide compilation of wgsl to glsl to support the WebGL `vello_hybrid` backend.
2626

2727
## Development Status
2828

sparse_strips/vello_hybrid/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ bytemuck = { workspace = true, features = ["derive"] }
1919
thiserror = { workspace = true }
2020
vello_common = { workspace = true, features = ["std"] }
2121
wgpu = { workspace = true, optional = true }
22-
vello_hybrid_shaders = { workspace = true, optional = true }
22+
vello_sparse_shaders = { workspace = true, optional = true }
2323

2424

2525
[target.'cfg(target_arch = "wasm32")'.dependencies]
@@ -49,4 +49,4 @@ roxmltree = "0.20.0"
4949
[features]
5050
default = ["wgpu"]
5151
wgpu = ["dep:wgpu"]
52-
webgl = ["dep:js-sys", "dep:web-sys", "dep:vello_hybrid_shaders"]
52+
webgl = ["dep:js-sys", "dep:web-sys", "dep:vello_sparse_shaders"]

sparse_strips/vello_hybrid/examples/native_webgl/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Uses Vello Hybrid with a native WebGL2 backend in the browser. This example does
44

55
## Development
66

7-
Run with `cargo run_wasm -p native_webgl`.
7+
Run with `cargo run_wasm -p native_webgl --release`.
88

99
## Testing
1010

sparse_strips/vello_hybrid/examples/scenes/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ pub fn get_example_scenes(svg_paths: Option<Vec<&str>>) -> Box<[AnyScene]> {
6565

6666
scenes.push(AnyScene::new(text::TextScene::new("Hello, Vello!")));
6767
scenes.push(AnyScene::new(simple::SimpleScene::new()));
68+
scenes.push(AnyScene::new(clip::ClipScene::new()));
6869

6970
scenes.into_boxed_slice()
7071
}

sparse_strips/vello_hybrid/examples/webgl/Cargo.toml renamed to sparse_strips/vello_hybrid/examples/wgpu_webgl/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "webgl"
2+
name = "wgpu_webgl"
33
version.workspace = true
44
description = "An example showing Vello Hybrid using WebGL2."
55
edition.workspace = true

sparse_strips/vello_hybrid/examples/webgl/README.md renamed to sparse_strips/vello_hybrid/examples/wgpu_webgl/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
## WebGL Demo
22

3-
Uses Vello Hybrid with a WebGL2 backend in the browser.
3+
Uses Vello Hybrid with a `wgpu` powered WebGL2 backend in the browser.
44

55
## Development
66

7-
Run with `cargo run_wasm -p webgl`.
7+
Run with `cargo run_wasm -p wgpu_webgl --release`.
88

99
## Testing
1010

sparse_strips/vello_hybrid/examples/webgl/src/main.rs renamed to sparse_strips/vello_hybrid/examples/wgpu_webgl/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
fn main() {
1212
#[cfg(target_arch = "wasm32")]
1313
{
14-
use webgl::run_interactive;
14+
use wgpu_webgl::run_interactive;
1515

1616
console_error_panic_hook::set_once();
1717
console_log::init_with_level(log::Level::Debug).unwrap();

sparse_strips/vello_hybrid/examples/webgl/tests/webgl.rs renamed to sparse_strips/vello_hybrid/examples/wgpu_webgl/tests/webgl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
mod wasm {
88
use vello_common::peniko::{color::palette, kurbo::BezPath};
99
use wasm_bindgen_test::*;
10-
use webgl::render_scene;
10+
use wgpu_webgl::render_scene;
1111

1212
wasm_bindgen_test_configure!(run_in_browser);
1313

sparse_strips/vello_hybrid/src/lib.rs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,37 +24,26 @@
2424
//! The renderer is split into several key components:
2525
//!
2626
//! - `Scene`: Manages the render context and path processing on the CPU
27-
//! - `Renderer`: Handles GPU resource management and executes draw operations
27+
//! - `Renderer` or `WebGlRenderer`: Handles GPU resource management and executes draw operations
2828
//! - `Scheduler`: Manages and schedules draw operations on the renderer.
2929
//!
30-
//! ## Renderer Backends
31-
//!
32-
//! - `render_wgpu` contains the default renderer backend, leveraging `wgpu`.
33-
//! - `render_webgl` contains a WebGL2 backend specifically for `wasm32` if the `webgl` feature is
34-
//! active.
35-
//!
3630
//! See the individual module documentation for more details on usage and implementation.
3731
3832
#![no_std]
3933

4034
extern crate alloc;
4135

4236
mod render;
43-
#[cfg(all(target_arch = "wasm32", feature = "webgl"))]
44-
mod render_webgl;
45-
#[cfg(feature = "wgpu")]
46-
mod render_wgpu;
47-
4837
mod scene;
4938
#[cfg(any(all(target_arch = "wasm32", feature = "webgl"), feature = "wgpu"))]
5039
mod schedule;
5140
pub mod util;
5241

53-
pub use render::{Config, GpuStrip, RenderSize};
5442
#[cfg(all(target_arch = "wasm32", feature = "webgl"))]
55-
pub use render_webgl::WebGlRenderer;
43+
pub use render::WebGlRenderer;
44+
pub use render::{Config, GpuStrip, RenderSize};
5645
#[cfg(feature = "wgpu")]
57-
pub use render_wgpu::{RenderTargetConfig, Renderer};
46+
pub use render::{RenderTargetConfig, Renderer};
5847
pub use scene::Scene;
5948
pub use util::DimensionConstraints;
6049
pub use vello_common::pixmap::Pixmap;

sparse_strips/vello_hybrid/src/render.rs renamed to sparse_strips/vello_hybrid/src/render/common.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// Copyright 2025 the Vello Authors
22
// SPDX-License-Identifier: Apache-2.0 OR MIT
33

4-
//! Backend agnostic render module.
5-
//!
6-
//! For backend specific render code see `render_wgpu` or `render_webgl`.
4+
//! Backend agnostic renderer module.
75
86
use bytemuck::{Pod, Zeroable};
97

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright 2025 the Vello Authors
2+
// SPDX-License-Identifier: Apache-2.0 OR MIT
3+
4+
//! Provides renderer backends which handle GPU resource management and executes draw operations.
5+
//!
6+
//! ## Renderer Backends
7+
//!
8+
//! - `wgpu` contains the default renderer backend, leveraging `wgpu`.
9+
//! - `webgl` contains a WebGL2 backend specifically for `wasm32` if the `webgl` feature is active.
10+
11+
mod common;
12+
#[cfg(all(target_arch = "wasm32", feature = "webgl"))]
13+
mod webgl;
14+
#[cfg(feature = "wgpu")]
15+
mod wgpu;
16+
17+
pub use common::{Config, GpuStrip, RenderSize};
18+
19+
#[cfg(all(target_arch = "wasm32", feature = "webgl"))]
20+
pub use webgl::WebGlRenderer;
21+
#[cfg(feature = "wgpu")]
22+
pub use wgpu::{RenderTargetConfig, Renderer};

0 commit comments

Comments
 (0)