From ca5ca863ccd006fcf09b7f3f0eb30da721ca8bf8 Mon Sep 17 00:00:00 2001 From: Firestar99 Date: Sun, 22 Jun 2025 01:26:25 +0200 Subject: [PATCH] Unify feature dependencies with workspace dependencies (#2736) * graph-craft: fix direct wasm build * graph-craft: fix no serde feature failing to compile * graph-craft: make wgpu-executor properly optional * workspace: unify `image` formats in workspace * workspace: turn most dependencies into workspace deps, no actual changes * workspace: unify dependency features in workspace dep --- {frontend/wasm/.cargo => .cargo}/config.toml | 0 Cargo.lock | 1 - Cargo.toml | 63 ++++++++++++++----- editor/Cargo.toml | 27 +++----- frontend/src-tauri/Cargo.toml | 2 +- frontend/wasm/Cargo.toml | 16 ++--- libraries/bezier-rs/Cargo.toml | 2 +- libraries/dyn-any/derive/Cargo.toml | 8 +-- libraries/math-parser/Cargo.toml | 2 +- libraries/path-bool/Cargo.toml | 2 +- node-graph/gcore/Cargo.toml | 36 +++++------ node-graph/graph-craft/Cargo.toml | 23 +++---- node-graph/graph-craft/src/document.rs | 2 + node-graph/graph-craft/src/proto.rs | 6 +- .../graph-craft/src/wasm_application_io.rs | 31 ++++++--- node-graph/graphene-cli/Cargo.toml | 10 +-- node-graph/gstd/Cargo.toml | 30 ++++----- node-graph/gstd/src/wasm_application_io.rs | 1 + node-graph/interpreted-executor/Cargo.toml | 14 ++--- .../interpreted-executor/src/node_registry.rs | 1 + node-graph/node-macro/Cargo.toml | 4 +- node-graph/wgpu-executor/Cargo.toml | 13 ++-- 22 files changed, 151 insertions(+), 143 deletions(-) rename {frontend/wasm/.cargo => .cargo}/config.toml (100%) diff --git a/frontend/wasm/.cargo/config.toml b/.cargo/config.toml similarity index 100% rename from frontend/wasm/.cargo/config.toml rename to .cargo/config.toml diff --git a/Cargo.lock b/Cargo.lock index c39cb7752..f995cdd48 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2263,7 +2263,6 @@ dependencies = [ "graph-craft", "graphene-std", "graphite-proc-macros", - "image", "interpreted-executor", "js-sys", "log", diff --git a/Cargo.toml b/Cargo.toml index b657a7aef..981c1994d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,14 +31,17 @@ resolver = "2" [workspace.dependencies] # Local dependencies -dyn-any = { path = "libraries/dyn-any", features = ["derive", "glam", "reqwest"] } -graphene-core = { path = "node-graph/gcore" } -graph-craft = { path = "node-graph/graph-craft", features = ["serde"] } -wgpu-executor = { path = "node-graph/wgpu-executor" } -bezier-rs = { path = "libraries/bezier-rs", features = ["dyn-any"] } -path-bool = { path = "libraries/path-bool", default-features = false } +bezier-rs = { path = "libraries/bezier-rs", features = ["dyn-any", "serde"] } +dyn-any = { path = "libraries/dyn-any", features = ["derive", "glam", "reqwest", "log-bad-types", "rc"] } math-parser = { path = "libraries/math-parser" } +path-bool = { path = "libraries/path-bool" } +graphene-core = { path = "node-graph/gcore", default-features = false } +graph-craft = { path = "node-graph/graph-craft", features = ["serde"] } +graphene-std = { path = "node-graph/gstd" } +interpreted-executor = { path = "node-graph/interpreted-executor" } node-macro = { path = "node-graph/node-macro" } +wgpu-executor = { path = "node-graph/wgpu-executor" } +graphite-proc-macros = { path = "proc-macros" } # Workspace dependencies rustc-hash = "2.0" @@ -56,30 +59,51 @@ convert_case = "0.7" derivative = "2.2" thiserror = "2" anyhow = "1.0" -proc-macro2 = "1" +proc-macro2 = { version = "1", features = [ "span-locations" ] } quote = "1.0" axum = "0.8" chrono = "0.4" ron = "0.8" fastnoise-lite = "1.1" -spirv-std = { git = "https://github.com/Rust-GPU/rust-gpu.git" } -wgpu = "23" +wgpu = { version = "23", features = [ + # We don't have wgpu on multiple threads (yet) https://github.com/gfx-rs/wgpu/blob/trunk/CHANGELOG.md#wgpu-types-now-send-sync-on-wasm + "fragile-send-sync-non-atomic-wasm", + "spirv", + "strict_asserts", +] } once_cell = "1.13" # Remove when `core::cell::LazyCell` () is stabilized in Rust 1.80 and we bump our MSRV wasm-bindgen = "=0.2.100" # NOTICE: ensure this stays in sync with the `wasm-bindgen-cli` version in `website/content/volunteer/guide/project-setup/_index.md`. We pin this version because wasm-bindgen upgrades may break various things. wasm-bindgen-futures = "0.4" js-sys = "=0.3.77" -web-sys = "=0.3.77" +web-sys = { version = "=0.3.77", features = [ + "Document", + "DomRect", + "Element", + "HtmlCanvasElement", + "CanvasRenderingContext2d", + "CanvasPattern", + "OffscreenCanvas", + "OffscreenCanvasRenderingContext2d", + "TextMetrics", + "Window", + "IdleRequestOptions", + "ImageData", + "Navigator", + "Gpu", + "HtmlImageElement", + "ImageBitmapRenderingContext", +] } winit = "0.29" url = "2.5" -tokio = { version = "1.29", features = ["fs", "io-std"] } +tokio = { version = "1.29", features = ["fs", "macros", "io-std", "rt"] } vello = { git = "https://github.com/linebender/vello.git", rev = "3275ec8" } # TODO switch back to stable when a release is made resvg = "0.44" usvg = "0.44" -rand = { version = "0.9", default-features = false } +rand = { version = "0.9", default-features = false, features = ["std_rng"] } rand_chacha = "0.9" -glam = { version = "0.29", default-features = false, features = ["serde"] } +glam = { version = "0.29", default-features = false, features = ["serde", "scalar-math", "debug-glam-assert"] } base64 = "0.22" -image = { version = "0.25", default-features = false, features = ["png"] } +image = { version = "0.25", default-features = false, features = ["png", "jpeg", "bmp"] } rustybuzz = "0.20" pretty_assertions = "1.4.1" fern = { version = "0.7", features = ["colored"] } @@ -94,11 +118,22 @@ specta = { version = "2.0.0-rc.22", features = [ syn = { version = "2.0", default-features = false, features = [ "full", "derive", + "parsing", + "printing", + "visit-mut", + "visit", + "clone-impls", + "extra-traits", + "proc-macro", ] } kurbo = { version = "0.11.0", features = ["serde"] } petgraph = { version = "0.7.1", default-features = false, features = [ "graphmap", ] } +half = { version = "2.4.1", default-features = false, features = ["bytemuck"] } +tinyvec = { version = "1" } +criterion = { version = "0.5", features = ["html_reports"] } +iai-callgrind = { version = "0.12.3" } [profile.dev] opt-level = 1 diff --git a/editor/Cargo.toml b/editor/Cargo.toml index 9b1c3d75c..904465337 100644 --- a/editor/Cargo.toml +++ b/editor/Cargo.toml @@ -25,12 +25,12 @@ ron = ["dep:ron"] [dependencies] # Local dependencies -graphite-proc-macros = { path = "../proc-macros" } -graph-craft = { path = "../node-graph/graph-craft" } -interpreted-executor = { path = "../node-graph/interpreted-executor", features = [ +graphite-proc-macros = { workspace = true } +graph-craft = { workspace = true } +interpreted-executor = { workspace = true, features = [ "serde", ] } -graphene-std = { path = "../node-graph/gstd", features = ["serde"] } +graphene-std = { workspace = true, features = ["serde"] } # Workspace dependencies js-sys = { workspace = true } @@ -41,31 +41,20 @@ serde = { workspace = true } serde_json = { workspace = true } bezier-rs = { workspace = true } futures = { workspace = true } -glam = { workspace = true, features = ["serde", "debug-glam-assert"] } +glam = { workspace = true } derivative = { workspace = true } specta = { workspace = true } -image = { workspace = true, features = ["bmp", "png"] } dyn-any = { workspace = true } num_enum = { workspace = true } usvg = { workspace = true } once_cell = { workspace = true } -web-sys = { workspace = true, features = [ - "Document", - "DomRect", - "Element", - "HtmlCanvasElement", - "CanvasRenderingContext2d", - "CanvasPattern", - "OffscreenCanvas", - "OffscreenCanvasRenderingContext2d", - "TextMetrics", -] } +web-sys = { workspace = true } # Required dependencies spin = "0.9.8" # Optional local dependencies -wgpu-executor = { path = "../node-graph/wgpu-executor", optional = true } +wgpu-executor = { workspace = true, optional = true } # Optional workspace dependencies wasm-bindgen = { workspace = true, optional = true } @@ -76,7 +65,7 @@ ron = { workspace = true, optional = true } # Workspace dependencies env_logger = { workspace = true } futures = { workspace = true } -tokio = { workspace = true, features = ["rt", "macros"] } +tokio = { workspace = true } [lints.rust] # TODO: figure out why we check these features when they do not exist diff --git a/frontend/src-tauri/Cargo.toml b/frontend/src-tauri/Cargo.toml index b3107ce1b..c2095e3d8 100644 --- a/frontend/src-tauri/Cargo.toml +++ b/frontend/src-tauri/Cargo.toml @@ -29,7 +29,7 @@ graphite-editor = { path = "../../editor", features = [ # Workspace dependencies axum = { workspace = true } chrono = { workspace = true } -tokio = { workspace = true, features = ["macros", "rt"] } +tokio = { workspace = true } ron = { workspace = true } log = { workspace = true } fern = { workspace = true } diff --git a/frontend/wasm/Cargo.toml b/frontend/wasm/Cargo.toml index 98280c975..96bdd5a64 100644 --- a/frontend/wasm/Cargo.toml +++ b/frontend/wasm/Cargo.toml @@ -29,24 +29,16 @@ editor = { path = "../../editor", package = "graphite-editor", features = [ # Workspace dependencies graph-craft = { workspace = true } log = { workspace = true } -graphene-core = { workspace = true } -serde = { workspace = true, features = ["derive"] } +graphene-core = { workspace = true, features = ["wasm"] } +serde = { workspace = true } wasm-bindgen = { workspace = true } serde-wasm-bindgen = { workspace = true } js-sys = { workspace = true } wasm-bindgen-futures = { workspace = true } glam = { workspace = true } math-parser = { workspace = true } -wgpu = { workspace = true, features = [ - "fragile-send-sync-non-atomic-wasm", -] } # We don't have wgpu on multiple threads (yet) https://github.com/gfx-rs/wgpu/blob/trunk/CHANGELOG.md#wgpu-types-now-send-sync-on-wasm -web-sys = { workspace = true, features = [ - "Window", - "CanvasRenderingContext2d", - "Document", - "HtmlCanvasElement", - "IdleRequestOptions", -] } +wgpu = { workspace = true } +web-sys = { workspace = true } [package.metadata.wasm-pack.profile.dev] wasm-opt = false diff --git a/libraries/bezier-rs/Cargo.toml b/libraries/bezier-rs/Cargo.toml index 6bb36c732..ec9d6499f 100644 --- a/libraries/bezier-rs/Cargo.toml +++ b/libraries/bezier-rs/Cargo.toml @@ -15,7 +15,7 @@ documentation = "https://graphite.rs/libraries/bezier-rs/" [dependencies] # Required dependencies -glam = { workspace = true, features = ["serde"] } +glam = { workspace = true } # Optional local dependencies dyn-any = { version = "0.3.0", path = "../dyn-any", optional = true } diff --git a/libraries/dyn-any/derive/Cargo.toml b/libraries/dyn-any/derive/Cargo.toml index 4e5de0030..12cbdd225 100644 --- a/libraries/dyn-any/derive/Cargo.toml +++ b/libraries/dyn-any/derive/Cargo.toml @@ -17,13 +17,7 @@ proc-macro = true # Workspace dependencies proc-macro2 = { workspace = true } quote = { workspace = true } -syn = { workspace = true, default-features = false, features = [ - "derive", - "parsing", - "proc-macro", - "printing", - "clone-impls", -] } +syn = { workspace = true } [dev-dependencies] # Local dependencies diff --git a/libraries/math-parser/Cargo.toml b/libraries/math-parser/Cargo.toml index b84da885f..999631ff3 100644 --- a/libraries/math-parser/Cargo.toml +++ b/libraries/math-parser/Cargo.toml @@ -15,7 +15,7 @@ lazy_static = "1.5" num-complex = "0.4" [dev-dependencies] -criterion = "0.5" +criterion = { workspace = true } [[bench]] name = "bench" diff --git a/libraries/path-bool/Cargo.toml b/libraries/path-bool/Cargo.toml index 40a779c56..d85de28d2 100644 --- a/libraries/path-bool/Cargo.toml +++ b/libraries/path-bool/Cargo.toml @@ -35,7 +35,7 @@ resvg = "0.44" image = "0.25" # Required dependencies -criterion = { version = "0.5", features = ["html_reports"] } +criterion = { workspace = true } # Benchmarks [[bench]] diff --git a/node-graph/gcore/Cargo.toml b/node-graph/gcore/Cargo.toml index 9afddb052..0ca48c350 100644 --- a/node-graph/gcore/Cargo.toml +++ b/node-graph/gcore/Cargo.toml @@ -24,50 +24,42 @@ serde = [ ] [dependencies] +# Local dependencies +math-parser = { workspace = true } + # Workspace dependencies -bytemuck = { workspace = true, features = ["derive"] } +bytemuck = { workspace = true } node-macro = { workspace = true } num-derive = { workspace = true } -num-traits = { workspace = true, default-features = false, features = ["i128"] } +num-traits = { workspace = true } usvg = { workspace = true } -rand = { workspace = true, default-features = false, features = ["std_rng"] } -glam = { workspace = true, default-features = false, features = [ - "scalar-math", -] } +rand = { workspace = true } +glam = { workspace = true } serde_json = { workspace = true } -petgraph = { workspace = true, default-features = false, features = [ - "graphmap", -] } +petgraph = { workspace = true } rustc-hash = { workspace = true } -math-parser = { path = "../../libraries/math-parser" } dyn-any = { workspace = true } ctor = { workspace = true } rand_chacha = { workspace = true } bezier-rs = { workspace = true } specta = { workspace = true } rustybuzz = { workspace = true } -image = { workspace = true, default-features = false, features = [ - "png", -] } - -# Required dependencies -half = { version = "2.4.1", default-features = false, features = ["bytemuck"] } -tinyvec = { version = "1" } +image = { workspace = true } +half = { workspace = true } +tinyvec = { workspace = true } kurbo = { workspace = true } log = { workspace = true } # Optional workspace dependencies -serde = { workspace = true, optional = true, features = ["derive"] } +serde = { workspace = true, optional = true } base64 = { workspace = true, optional = true } vello = { workspace = true, optional = true } wgpu = { workspace = true, optional = true } -web-sys = { workspace = true, optional = true, features = [ - "HtmlCanvasElement", -] } +web-sys = { workspace = true, optional = true } [dev-dependencies] # Workspace dependencies -tokio = { workspace = true, features = ["rt", "macros"] } +tokio = { workspace = true } serde_json = { workspace = true } [lints.rust] diff --git a/node-graph/graph-craft/Cargo.toml b/node-graph/graph-craft/Cargo.toml index 71e718094..e56eb7240 100644 --- a/node-graph/graph-craft/Cargo.toml +++ b/node-graph/graph-craft/Cargo.toml @@ -8,21 +8,17 @@ license = "MIT OR Apache-2.0" default = ["dealloc_nodes"] serde = ["dep:serde", "graphene-core/serde", "glam/serde", "bezier-rs/serde"] dealloc_nodes = ["graphene-core/dealloc_nodes"] -wgpu = [] +wgpu = ["wgpu-executor"] tokio = ["dep:tokio"] wayland = [] loading = ["serde_json", "serde"] [dependencies] # Local dependencies -dyn-any = { path = "../../libraries/dyn-any", features = [ - "log-bad-types", - "rc", - "glam", -] } +dyn-any = { workspace = true } +graphene-core = { workspace = true } # Workspace dependencies -graphene-core = { workspace = true } log = { workspace = true } glam = { workspace = true } bezier-rs = { workspace = true } @@ -30,16 +26,19 @@ specta = { workspace = true } rustc-hash = { workspace = true } url = { workspace = true } reqwest = { workspace = true } -wgpu-executor = { workspace = true } # Optional workspace dependencies +wgpu-executor = { workspace = true, optional = true } serde = { workspace = true, optional = true } tokio = { workspace = true, optional = true } serde_json = { workspace = true, optional = true } # Workspace dependencies [target.'cfg(target_arch = "wasm32")'.dependencies] -web-sys = { workspace = true } +web-sys = { workspace = true, features = [ + "Navigator", + "Gpu", +] } js-sys = { workspace = true } wasm-bindgen = { workspace = true } @@ -50,10 +49,8 @@ winit = { workspace = true } # Workspace dependencies graph-craft = { workspace = true, features = ["loading"] } pretty_assertions = { workspace = true } - -# Required dependencies -criterion = { version = "0.5", features = ["html_reports"] } -iai-callgrind = { version = "0.12.3" } +criterion = { workspace = true } +iai-callgrind = { workspace = true } # Benchmarks [[bench]] diff --git a/node-graph/graph-craft/src/document.rs b/node-graph/graph-craft/src/document.rs index 821f2f3a3..0a400de95 100644 --- a/node-graph/graph-craft/src/document.rs +++ b/node-graph/graph-craft/src/document.rs @@ -676,10 +676,12 @@ fn migrate_layer_to_merge<'de, D: serde::Deserializer<'de>>(deserializer: D) -> Ok(s) } // TODO: Eventually remove this document upgrade code +#[cfg(feature = "serde")] fn default_import_metadata() -> (NodeId, IVec2) { (NodeId::new(), IVec2::new(-25, -4)) } // TODO: Eventually remove this document upgrade code +#[cfg(feature = "serde")] fn default_export_metadata() -> (NodeId, IVec2) { (NodeId::new(), IVec2::new(8, -4)) } diff --git a/node-graph/graph-craft/src/proto.rs b/node-graph/graph-craft/src/proto.rs index 771a0734b..7c5d0f590 100644 --- a/node-graph/graph-craft/src/proto.rs +++ b/node-graph/graph-craft/src/proto.rs @@ -532,7 +532,8 @@ impl ProtoNetwork { Ok(()) } } -#[derive(Clone, PartialEq, serde::Serialize, serde::Deserialize)] +#[derive(Clone, PartialEq)] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum GraphErrorType { NodeNotFound(NodeId), InputNodeNotFound(NodeId), @@ -588,7 +589,8 @@ impl Debug for GraphErrorType { } } } -#[derive(Clone, PartialEq, serde::Serialize, serde::Deserialize)] +#[derive(Clone, PartialEq)] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct GraphError { pub node_path: Vec, pub identifier: Cow<'static, str>, diff --git a/node-graph/graph-craft/src/wasm_application_io.rs b/node-graph/graph-craft/src/wasm_application_io.rs index 8f579fc4c..4a8f4cbed 100644 --- a/node-graph/graph-craft/src/wasm_application_io.rs +++ b/node-graph/graph-craft/src/wasm_application_io.rs @@ -1,5 +1,4 @@ use dyn_any::StaticType; -use graphene_core::application_io::SurfaceHandleFrame; use graphene_core::application_io::{ApplicationError, ApplicationIo, ResourceFuture, SurfaceHandle, SurfaceId}; #[cfg(target_arch = "wasm32")] use js_sys::{Object, Reflect}; @@ -7,6 +6,7 @@ use std::collections::HashMap; use std::sync::Arc; #[cfg(target_arch = "wasm32")] use std::sync::atomic::AtomicU64; +use std::sync::atomic::Ordering; #[cfg(feature = "tokio")] use tokio::io::AsyncReadExt; #[cfg(target_arch = "wasm32")] @@ -17,6 +17,7 @@ use wasm_bindgen::JsValue; use web_sys::HtmlCanvasElement; #[cfg(target_arch = "wasm32")] use web_sys::window; +#[cfg(feature = "wgpu")] use wgpu_executor::WgpuExecutor; #[derive(Debug)] @@ -76,7 +77,7 @@ pub fn wgpu_available() -> Option { } } - match WGPU_AVAILABLE.load(::std::sync::atomic::Ordering::SeqCst) { + match WGPU_AVAILABLE.load(Ordering::SeqCst) { -1 => None, 0 => Some(false), _ => Some(true), @@ -85,7 +86,7 @@ pub fn wgpu_available() -> Option { impl WasmApplicationIo { pub async fn new() -> Self { - #[cfg(target_arch = "wasm32")] + #[cfg(all(feature = "wgpu", target_arch = "wasm32"))] let executor = if let Some(gpu) = web_sys::window().map(|w| w.navigator().gpu()) { let request_adapter = || { let request_adapter = js_sys::Reflect::get(&gpu, &wasm_bindgen::JsValue::from_str("requestAdapter")).ok()?; @@ -101,9 +102,14 @@ impl WasmApplicationIo { None }; - #[cfg(not(target_arch = "wasm32"))] + #[cfg(all(feature = "wgpu", not(target_arch = "wasm32")))] let executor = WgpuExecutor::new().await; - WGPU_AVAILABLE.store(executor.is_some() as i8, ::std::sync::atomic::Ordering::SeqCst); + + #[cfg(not(feature = "wgpu"))] + let wgpu_available = false; + #[cfg(feature = "wgpu")] + let wgpu_available = executor.is_some(); + WGPU_AVAILABLE.store(wgpu_available as i8, Ordering::SeqCst); let mut io = Self { #[cfg(target_arch = "wasm32")] @@ -121,9 +127,14 @@ impl WasmApplicationIo { } pub async fn new_offscreen() -> Self { + #[cfg(feature = "wgpu")] let executor = WgpuExecutor::new().await; - WGPU_AVAILABLE.store(executor.is_some() as i8, ::std::sync::atomic::Ordering::SeqCst); + #[cfg(not(feature = "wgpu"))] + let wgpu_available = false; + #[cfg(feature = "wgpu")] + let wgpu_available = executor.is_some(); + WGPU_AVAILABLE.store(wgpu_available as i8, Ordering::SeqCst); // Always enable wgpu when running with Tauri let mut io = Self { @@ -175,7 +186,7 @@ impl ApplicationIo for WasmApplicationIo { let document = window().expect("should have a window in this context").document().expect("window should have a document"); let canvas: HtmlCanvasElement = document.create_element("canvas")?.dyn_into::()?; - let id = self.ids.fetch_add(1, std::sync::atomic::Ordering::SeqCst); + let id = self.ids.fetch_add(1, Ordering::SeqCst); // store the canvas in the global scope so it doesn't get garbage collected let window = window().expect("should have a window in this context"); let window = Object::from(window); @@ -299,8 +310,10 @@ impl ApplicationIo for WasmApplicationIo { } } +#[cfg(feature = "wgpu")] pub type WasmSurfaceHandle = SurfaceHandle; -pub type WasmSurfaceHandleFrame = SurfaceHandleFrame; +#[cfg(feature = "wgpu")] +pub type WasmSurfaceHandleFrame = graphene_core::application_io::SurfaceHandleFrame; #[derive(Clone, Debug, PartialEq, Hash, specta::Type)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] @@ -330,6 +343,6 @@ impl Default for EditorPreferences { } } -unsafe impl dyn_any::StaticType for EditorPreferences { +unsafe impl StaticType for EditorPreferences { type Static = EditorPreferences; } diff --git a/node-graph/graphene-cli/Cargo.toml b/node-graph/graphene-cli/Cargo.toml index 87e0e679f..16bb7b4a7 100644 --- a/node-graph/graphene-cli/Cargo.toml +++ b/node-graph/graphene-cli/Cargo.toml @@ -20,18 +20,18 @@ gpu = [ [dependencies] # Local dependencies -graphene-std = { path = "../gstd", features = ["serde"] } -interpreted-executor = { path = "../interpreted-executor" } +graphene-core = { workspace = true } +graphene-std = { workspace = true, features = ["serde"] } +interpreted-executor = { workspace = true } +graph-craft = { workspace = true, features = ["loading"] } # Workspace dependencies log = { workspace = true } -graph-craft = { workspace = true, features = ["loading"] } -graphene-core = { workspace = true } futures = { workspace = true } fern = { workspace = true } chrono = { workspace = true } wgpu = { workspace = true } -tokio = { workspace = true, features = ["macros", "rt-multi-thread"] } +tokio = { workspace = true, features = ["rt-multi-thread"] } # Required dependencies clap = { version = "4.5.31", features = ["cargo", "derive"] } diff --git a/node-graph/gstd/Cargo.toml b/node-graph/gstd/Cargo.toml index 80fd05a1f..f5fec67b7 100644 --- a/node-graph/gstd/Cargo.toml +++ b/node-graph/gstd/Cargo.toml @@ -19,39 +19,33 @@ wayland = ["graph-craft/wayland"] [dependencies] # Local dependencies -dyn-any = { path = "../../libraries/dyn-any", features = ["derive", "reqwest"] } -graph-craft = { path = "../graph-craft", features = ["serde"] } -wgpu-executor = { path = "../wgpu-executor" } -graphene-core = { path = "../gcore", default-features = false, features = ["serde"] } +dyn-any = { workspace = true } +graph-craft = { workspace = true, features = ["serde"] } +wgpu-executor = { workspace = true } +graphene-core = { workspace = true, features = ["serde"] } # Workspace dependencies fastnoise-lite = { workspace = true } log = { workspace = true } -bezier-rs = { workspace = true, features = ["serde"] } -path-bool = { workspace = true, features = ["parsing"] } -glam = { workspace = true, features = ["serde"] } +bezier-rs = { workspace = true } +path-bool = { workspace = true } +glam = { workspace = true } node-macro = { workspace = true } reqwest = { workspace = true } futures = { workspace = true } usvg = { workspace = true } rand_chacha = { workspace = true } -rand = { workspace = true, default-features = false, features = [ - "alloc", - "small_rng", -] } +rand = { workspace = true } bytemuck = { workspace = true } -image = { workspace = true, default-features = false, features = [ - "png", - "jpeg", -] } +image = { workspace = true } # Optional workspace dependencies base64 = { workspace = true, optional = true } wasm-bindgen = { workspace = true, optional = true } wasm-bindgen-futures = { workspace = true, optional = true } -tokio = { workspace = true, optional = true, features = ["fs", "io-std"] } +tokio = { workspace = true, optional = true } vello = { workspace = true, optional = true } -serde = { workspace = true, optional = true, features = ["derive"] } +serde = { workspace = true, optional = true } web-sys = { workspace = true, optional = true, features = [ "Window", "CanvasRenderingContext2d", @@ -68,4 +62,4 @@ web-sys = { workspace = true, optional = true, features = [ ndarray = "0.16.1" [dev-dependencies] -tokio = { workspace = true, features = ["macros"] } +tokio = { workspace = true } diff --git a/node-graph/gstd/src/wasm_application_io.rs b/node-graph/gstd/src/wasm_application_io.rs index 265247118..94cc29b9f 100644 --- a/node-graph/gstd/src/wasm_application_io.rs +++ b/node-graph/gstd/src/wasm_application_io.rs @@ -27,6 +27,7 @@ use wasm_bindgen::JsCast; #[cfg(target_arch = "wasm32")] use web_sys::{CanvasRenderingContext2d, HtmlCanvasElement}; +#[cfg(feature = "wgpu")] #[node_macro::node(category("Debug: GPU"))] async fn create_surface<'a: 'n>(_: impl Ctx, editor: &'a WasmEditorApi) -> Arc { Arc::new(editor.application_io.as_ref().unwrap().create_window()) diff --git a/node-graph/interpreted-executor/Cargo.toml b/node-graph/interpreted-executor/Cargo.toml index 03c70e9e8..b4f059a24 100644 --- a/node-graph/interpreted-executor/Cargo.toml +++ b/node-graph/interpreted-executor/Cargo.toml @@ -11,13 +11,13 @@ gpu = ["graphene-std/gpu", "graphene-std/wgpu"] [dependencies] # Local dependencies -graphene-std = { path = "../gstd", features = ["serde"] } -graph-craft = { path = "../graph-craft" } -wgpu-executor = { path = "../wgpu-executor" } +graphene-std = { workspace = true, features = ["serde"] } +graph-craft = { workspace = true } +wgpu-executor = { workspace = true } +graphene-core = { workspace = true } +dyn-any = { workspace = true } # Workspace dependencies -graphene-core = { workspace = true } -dyn-any = { workspace = true, features = ["log-bad-types", "glam"] } log = { workspace = true } glam = { workspace = true } futures = { workspace = true } @@ -29,9 +29,7 @@ serde = { workspace = true, optional = true } [dev-dependencies] # Workspace dependencies graph-craft = { workspace = true, features = ["loading"] } - -# Required dependencies -criterion = { version = "0.5", features = ["html_reports"]} +criterion = { workspace = true } # Benchmarks [[bench]] diff --git a/node-graph/interpreted-executor/src/node_registry.rs b/node-graph/interpreted-executor/src/node_registry.rs index 6ccfdf429..6059e24e6 100644 --- a/node-graph/interpreted-executor/src/node_registry.rs +++ b/node-graph/interpreted-executor/src/node_registry.rs @@ -75,6 +75,7 @@ fn node_registry() -> HashMap, input: Context, fn_params: [Context => RasterDataTable]), async_node!(graphene_core::memo::MemoNode<_, _>, input: Context, fn_params: [Context => GraphicGroupTable]), async_node!(graphene_core::memo::MemoNode<_, _>, input: Context, fn_params: [Context => Vec]), + #[cfg(feature = "gpu")] async_node!(graphene_core::memo::MemoNode<_, _>, input: Context, fn_params: [Context => Arc]), async_node!(graphene_core::memo::MemoNode<_, _>, input: Context, fn_params: [Context => WindowHandle]), async_node!(graphene_core::memo::MemoNode<_, _>, input: Context, fn_params: [Context => Option]), diff --git a/node-graph/node-macro/Cargo.toml b/node-graph/node-macro/Cargo.toml index 2356bcb2b..b63ce4927 100644 --- a/node-graph/node-macro/Cargo.toml +++ b/node-graph/node-macro/Cargo.toml @@ -15,8 +15,8 @@ proc-macro = true [dependencies] # Workspace dependencies -syn = { workspace = true, features = [ "extra-traits", "full", "printing", "parsing", "clone-impls", "proc-macro", "visit-mut", "visit"] } -proc-macro2 = { workspace = true, features = [ "span-locations" ] } +syn = { workspace = true } +proc-macro2 = { workspace = true } quote = { workspace = true } convert_case = { workspace = true } diff --git a/node-graph/wgpu-executor/Cargo.toml b/node-graph/wgpu-executor/Cargo.toml index ecbfc7bcb..6480c056a 100644 --- a/node-graph/wgpu-executor/Cargo.toml +++ b/node-graph/wgpu-executor/Cargo.toml @@ -10,17 +10,16 @@ profiling = [] passthrough = [] [dependencies] -# Workspace dependencies +# Local dependencies graphene-core = { workspace = true, features = ["wgpu"] } -dyn-any = { workspace = true, features = ["log-bad-types", "rc", "glam"] } +dyn-any = { workspace = true } node-macro = { workspace = true } + +# Workspace dependencies glam = { workspace = true } anyhow = { workspace = true } -wgpu = { workspace = true, features = [ - "spirv", - "strict_asserts", -] } +wgpu = { workspace = true } futures = { workspace = true } -web-sys = { workspace = true, features = ["HtmlCanvasElement"] } +web-sys = { workspace = true } winit = { workspace = true } vello = { workspace = true }