Skip to content

Commit

Permalink
Re-export wgpu (#591)
Browse files Browse the repository at this point in the history
These changes first re-export wgpu under the vello module.
Then, all examples are updated to use vello::wgpu.

Fixes #585
  • Loading branch information
tannal authored Jun 4, 2024
1 parent 13e9a39 commit 96a447f
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 15 deletions.
4 changes: 0 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ static_assertions = "1.1.0"
thiserror = "1.0.61"

# NOTE: Make sure to keep this in sync with the version badge in README.md
# as well as examples/simple/Cargo.toml
wgpu = { version = "0.20.0" }
log = "0.4.21"

Expand Down
1 change: 0 additions & 1 deletion examples/headless/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ scenes = { path = "../scenes" }
anyhow = { workspace = true }
clap = { workspace = true, features = ["derive"] }

wgpu = { workspace = true }
pollster = { workspace = true }
env_logger = "0.11.3"
png = "0.17.13"
Expand Down
6 changes: 3 additions & 3 deletions examples/headless/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ use clap::Parser;
use scenes::{ImageCache, SceneParams, SceneSet, SimpleText};
use vello::kurbo::{Affine, Vec2};
use vello::util::RenderContext;
use vello::{block_on_wgpu, RendererOptions, Scene};
use wgpu::{
BufferDescriptor, BufferUsages, CommandEncoderDescriptor, Extent3d, ImageCopyBuffer,
use vello::wgpu::{
self, BufferDescriptor, BufferUsages, CommandEncoderDescriptor, Extent3d, ImageCopyBuffer,
TextureDescriptor, TextureFormat, TextureUsages,
};
use vello::{block_on_wgpu, RendererOptions, Scene};

fn main() -> Result<()> {
#[cfg(not(target_arch = "wasm32"))]
Expand Down
1 change: 0 additions & 1 deletion examples/simple/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ workspace = true
vello = { version = "0.1.0", path = "../../vello" }
anyhow = "1.0.83"
pollster = "0.3.0"
wgpu = "0.20.0"
winit = "0.30.0"
1 change: 1 addition & 0 deletions examples/simple/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use winit::event::*;
use winit::event_loop::{ActiveEventLoop, ControlFlow, EventLoop};
use winit::window::Window;

use vello::wgpu;
// Simple struct to hold the state of the renderer
pub struct ActiveRenderState<'s> {
// The fields MUST be in this order, so that the surface is dropped before the window
Expand Down
1 change: 0 additions & 1 deletion examples/with_winit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ clap = { workspace = true, features = ["derive"] }
pollster = { workspace = true }
wgpu-profiler = { workspace = true, optional = true }

wgpu = { workspace = true }
winit = "0.30.0"
log = { workspace = true }

Expand Down
2 changes: 2 additions & 0 deletions examples/with_winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ use winit::dpi::LogicalSize;
use winit::event_loop::EventLoop;
use winit::window::{Window, WindowAttributes};

use vello::wgpu;

#[cfg(not(any(target_arch = "wasm32", target_os = "android")))]
mod hot_reload;
mod multi_touch;
Expand Down
3 changes: 3 additions & 0 deletions vello/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ pub use skrifa;

pub mod glyph;

#[cfg(feature = "wgpu")]
pub use wgpu;

#[cfg(feature = "wgpu")]
pub mod util;

Expand Down
1 change: 0 additions & 1 deletion vello_tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ workspace = true
vello = { workspace = true }
anyhow = { workspace = true }

wgpu = { workspace = true }
pollster = { workspace = true }
png = "0.17.13"
futures-intrusive = { workspace = true }
6 changes: 3 additions & 3 deletions vello_tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ use std::sync::Arc;
use anyhow::{anyhow, bail, Result};
use vello::peniko::{Blob, Color, Format, Image};
use vello::util::RenderContext;
use vello::{block_on_wgpu, RendererOptions, Scene};
use wgpu::{
BufferDescriptor, BufferUsages, CommandEncoderDescriptor, Extent3d, ImageCopyBuffer,
use vello::wgpu::{
self, BufferDescriptor, BufferUsages, CommandEncoderDescriptor, Extent3d, ImageCopyBuffer,
TextureDescriptor, TextureFormat, TextureUsages,
};
use vello::{block_on_wgpu, RendererOptions, Scene};

pub struct TestParams {
pub width: u32,
Expand Down

0 comments on commit 96a447f

Please sign in to comment.