mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-07-07 07:45:00 +00:00
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
This commit is contained in:
parent
990d5b37cf
commit
ca5ca863cc
22 changed files with 151 additions and 143 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -2263,7 +2263,6 @@ dependencies = [
|
|||
"graph-craft",
|
||||
"graphene-std",
|
||||
"graphite-proc-macros",
|
||||
"image",
|
||||
"interpreted-executor",
|
||||
"js-sys",
|
||||
"log",
|
||||
|
|
63
Cargo.toml
63
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` (<https://doc.rust-lang.org/core/cell/struct.LazyCell.html>) 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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 }
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 }
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -15,7 +15,7 @@ lazy_static = "1.5"
|
|||
num-complex = "0.4"
|
||||
|
||||
[dev-dependencies]
|
||||
criterion = "0.5"
|
||||
criterion = { workspace = true }
|
||||
|
||||
[[bench]]
|
||||
name = "bench"
|
||||
|
|
|
@ -35,7 +35,7 @@ resvg = "0.44"
|
|||
image = "0.25"
|
||||
|
||||
# Required dependencies
|
||||
criterion = { version = "0.5", features = ["html_reports"] }
|
||||
criterion = { workspace = true }
|
||||
|
||||
# Benchmarks
|
||||
[[bench]]
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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]]
|
||||
|
|
|
@ -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))
|
||||
}
|
||||
|
|
|
@ -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<NodeId>,
|
||||
pub identifier: Cow<'static, str>,
|
||||
|
|
|
@ -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<bool> {
|
|||
}
|
||||
}
|
||||
|
||||
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<bool> {
|
|||
|
||||
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::<HtmlCanvasElement>()?;
|
||||
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<wgpu_executor::Window>;
|
||||
pub type WasmSurfaceHandleFrame = SurfaceHandleFrame<wgpu_executor::Window>;
|
||||
#[cfg(feature = "wgpu")]
|
||||
pub type WasmSurfaceHandleFrame = graphene_core::application_io::SurfaceHandleFrame<wgpu_executor::Window>;
|
||||
|
||||
#[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;
|
||||
}
|
||||
|
|
|
@ -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"] }
|
||||
|
|
|
@ -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 }
|
||||
|
|
|
@ -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<WasmSurfaceHandle> {
|
||||
Arc::new(editor.application_io.as_ref().unwrap().create_window())
|
||||
|
|
|
@ -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]]
|
||||
|
|
|
@ -75,6 +75,7 @@ fn node_registry() -> HashMap<ProtoNodeIdentifier, HashMap<NodeIOTypes, NodeCons
|
|||
async_node!(graphene_core::memo::MemoNode<_, _>, input: Context, fn_params: [Context => RasterDataTable<CPU>]),
|
||||
async_node!(graphene_core::memo::MemoNode<_, _>, input: Context, fn_params: [Context => GraphicGroupTable]),
|
||||
async_node!(graphene_core::memo::MemoNode<_, _>, input: Context, fn_params: [Context => Vec<DVec2>]),
|
||||
#[cfg(feature = "gpu")]
|
||||
async_node!(graphene_core::memo::MemoNode<_, _>, input: Context, fn_params: [Context => Arc<WasmSurfaceHandle>]),
|
||||
async_node!(graphene_core::memo::MemoNode<_, _>, input: Context, fn_params: [Context => WindowHandle]),
|
||||
async_node!(graphene_core::memo::MemoNode<_, _>, input: Context, fn_params: [Context => Option<WgpuSurface>]),
|
||||
|
|
|
@ -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 }
|
||||
|
||||
|
|
|
@ -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 }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue