Add compute pipeline test

This commit is contained in:
Dennis Kobert
2023-06-17 08:20:22 -07:00
committed by Keavon Chambers
parent e03da35a83
commit 21c62ace64
8 changed files with 11 additions and 13 deletions
Generated
+1
View File
@@ -1767,6 +1767,7 @@ dependencies = [
"serde", "serde",
"serde_json", "serde_json",
"test-case", "test-case",
"tokio",
"wasm-bindgen", "wasm-bindgen",
"wgpu-executor", "wgpu-executor",
] ]
+1
View File
@@ -210,6 +210,7 @@ pub struct IntoNode<I, O> {
_i: PhantomData<I>, _i: PhantomData<I>,
_o: PhantomData<O>, _o: PhantomData<O>,
} }
#[cfg(feature = "alloc")]
#[node_macro::node_fn(IntoNode<_I, _O>)] #[node_macro::node_fn(IntoNode<_I, _O>)]
async fn into<_I, _O>(input: _I) -> _O async fn into<_I, _O>(input: _I) -> _O
where where
+1
View File
@@ -11,6 +11,7 @@ pub mod adjustments;
pub mod bbox; pub mod bbox;
#[cfg(not(target_arch = "spirv"))] #[cfg(not(target_arch = "spirv"))]
pub mod brightness_contrast; pub mod brightness_contrast;
#[cfg(not(target_arch = "spirv"))]
pub mod brush_cache; pub mod brush_cache;
pub mod color; pub mod color;
pub mod discrete_srgb; pub mod discrete_srgb;
-2
View File
@@ -597,7 +597,6 @@ dependencies = [
"bytemuck", "bytemuck",
"dyn-any", "dyn-any",
"glam", "glam",
"js-sys",
"kurbo", "kurbo",
"log", "log",
"node-macro", "node-macro",
@@ -610,7 +609,6 @@ dependencies = [
"specta", "specta",
"spin", "spin",
"spirv-std", "spirv-std",
"wasm-bindgen",
"web-sys", "web-sys",
] ]
+2 -7
View File
@@ -6,13 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features] [features]
gpu = [ gpu = ["interpreted-executor/gpu", "graphene-std/gpu", "graphene-core/gpu", "wgpu-executor", "gpu-executor"]
"interpreted-executor/gpu",
"graphene-std/gpu",
"graphene-core/gpu",
"wgpu-executor",
"gpu-executor",
]
default = ["wgpu"] default = ["wgpu"]
wgpu = ["wgpu-executor", "gpu"] wgpu = ["wgpu-executor", "gpu"]
wayland = ["graphene-std/wayland"] wayland = ["graphene-std/wayland"]
@@ -44,6 +38,7 @@ wasm-bindgen = { version = "0.2.86", optional = true }
futures = "0.3.28" futures = "0.3.28"
fern = { version = "0.6.2", features = ["colored"] } fern = { version = "0.6.2", features = ["colored"] }
chrono = "0.4.26" chrono = "0.4.26"
tokio = { version = "1.28.2", features = ["macros", "rt"] }
[dependencies.document-legacy] [dependencies.document-legacy]
path = "../../document-legacy" path = "../../document-legacy"
+4 -3
View File
@@ -25,7 +25,8 @@ impl NodeGraphUpdateSender for UpdateLogger {
} }
} }
fn main() -> Result<(), Box<dyn Error>> { #[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
init_logging(); init_logging();
let document_path = std::env::args().nth(1).expect("No document path provided"); let document_path = std::env::args().nth(1).expect("No document path provided");
@@ -41,9 +42,9 @@ fn main() -> Result<(), Box<dyn Error>> {
node_graph_message_sender: &UpdateLogger {}, node_graph_message_sender: &UpdateLogger {},
imaginate_preferences: &ImaginatePreferences::default(), imaginate_preferences: &ImaginatePreferences::default(),
}; };
for i in 0..10 { for i in 0..100 {
//println!("executing"); //println!("executing");
let result = block_on((&executor).execute(editor_api.clone()))?; let result = (&executor).execute(editor_api.clone()).await?;
//println!("result: {:?}", result); //println!("result: {:?}", result);
std::thread::sleep(std::time::Duration::from_secs(1)); std::thread::sleep(std::time::Duration::from_secs(1));
} }
File diff suppressed because one or more lines are too long
@@ -310,7 +310,7 @@ fn node_registry() -> HashMap<NodeIdentifier, HashMap<NodeIOTypes, NodeConstruct
}, },
NodeIOTypes::new( NodeIOTypes::new(
concrete!(ImageFrame<Color>), concrete!(ImageFrame<Color>),
concrete!(SurfaceFrame), concrete!(ImageFrame<Color>),
vec![fn_type!(graph_craft::document::DocumentNode), fn_type!(WasmEditorApi)], vec![fn_type!(graph_craft::document::DocumentNode), fn_type!(WasmEditorApi)],
), ),
)], )],