|
|
|
|
@ -8,15 +8,21 @@ use graph_craft::document::value::*;
|
|
|
|
|
use graph_craft::document::*;
|
|
|
|
|
use graph_craft::imaginate_input::ImaginateSamplingMethod;
|
|
|
|
|
use graph_craft::NodeIdentifier;
|
|
|
|
|
#[cfg(feature = "gpu")]
|
|
|
|
|
use graphene_core::application_io::SurfaceHandle;
|
|
|
|
|
use graphene_core::raster::brush_cache::BrushCache;
|
|
|
|
|
use graphene_core::raster::{BlendMode, Color, Image, ImageFrame, LuminanceCalculation, RedGreenBlue, RelativeAbsolute, SelectiveColorChoice};
|
|
|
|
|
use graphene_core::text::Font;
|
|
|
|
|
use graphene_core::vector::VectorData;
|
|
|
|
|
use graphene_core::*;
|
|
|
|
|
|
|
|
|
|
#[cfg(feature = "gpu")]
|
|
|
|
|
use gpu_executor::*;
|
|
|
|
|
use graphene_std::wasm_application_io::WasmEditorApi;
|
|
|
|
|
use once_cell::sync::Lazy;
|
|
|
|
|
use std::collections::VecDeque;
|
|
|
|
|
#[cfg(feature = "gpu")]
|
|
|
|
|
use wgpu_executor::WgpuExecutor;
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Clone, PartialEq, Hash)]
|
|
|
|
|
pub struct DocumentInputType {
|
|
|
|
|
@ -743,8 +749,8 @@ fn static_nodes() -> Vec<DocumentNodeType> {
|
|
|
|
|
},
|
|
|
|
|
DocumentNode {
|
|
|
|
|
name: "Create Uniform".to_string(),
|
|
|
|
|
inputs: vec![NodeInput::Network(concrete!(f32))],
|
|
|
|
|
implementation: DocumentNodeImplementation::Unresolved(NodeIdentifier::new("gpu-executor::UniformNode<_>")),
|
|
|
|
|
inputs: vec![NodeInput::Network(generic!(T)), NodeInput::node(0, 0)],
|
|
|
|
|
implementation: DocumentNodeImplementation::Unresolved(NodeIdentifier::new("gpu_executor::UniformNode<_>")),
|
|
|
|
|
..Default::default()
|
|
|
|
|
},
|
|
|
|
|
DocumentNode {
|
|
|
|
|
@ -776,9 +782,466 @@ fn static_nodes() -> Vec<DocumentNodeType> {
|
|
|
|
|
name: "Uniform",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
}],
|
|
|
|
|
properties: node_properties::no_properties,
|
|
|
|
|
},
|
|
|
|
|
#[cfg(feature = "gpu")]
|
|
|
|
|
DocumentNodeType {
|
|
|
|
|
name: "Storage",
|
|
|
|
|
category: "Gpu",
|
|
|
|
|
identifier: NodeImplementation::DocumentNode(NodeNetwork {
|
|
|
|
|
inputs: vec![1, 0],
|
|
|
|
|
outputs: vec![NodeOutput::new(2, 0)],
|
|
|
|
|
nodes: [
|
|
|
|
|
DocumentNode {
|
|
|
|
|
name: "Extract Executor".to_string(),
|
|
|
|
|
inputs: vec![NodeInput::Network(concrete!(WasmEditorApi))],
|
|
|
|
|
implementation: DocumentNodeImplementation::Unresolved(NodeIdentifier::new("graphene_core::ops::IntoNode<_, &WgpuExecutor>")),
|
|
|
|
|
..Default::default()
|
|
|
|
|
},
|
|
|
|
|
DocumentNode {
|
|
|
|
|
name: "Create Storage".to_string(),
|
|
|
|
|
inputs: vec![NodeInput::Network(concrete!(Vec<u8>)), NodeInput::node(0, 0)],
|
|
|
|
|
implementation: DocumentNodeImplementation::Unresolved(NodeIdentifier::new("gpu_executor::StorageNode<_>")),
|
|
|
|
|
..Default::default()
|
|
|
|
|
},
|
|
|
|
|
DocumentNode {
|
|
|
|
|
name: "Cache".to_string(),
|
|
|
|
|
inputs: vec![NodeInput::ShortCircut(concrete!(())), NodeInput::node(1, 0)],
|
|
|
|
|
implementation: DocumentNodeImplementation::Unresolved(NodeIdentifier::new("graphene_core::memo::MemoNode<_, _>")),
|
|
|
|
|
..Default::default()
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
.into_iter()
|
|
|
|
|
.enumerate()
|
|
|
|
|
.map(|(id, node)| (id as NodeId, node))
|
|
|
|
|
.collect(),
|
|
|
|
|
..Default::default()
|
|
|
|
|
}),
|
|
|
|
|
inputs: vec![
|
|
|
|
|
DocumentInputType {
|
|
|
|
|
name: "In",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
default: NodeInput::value(TaggedValue::None, true),
|
|
|
|
|
},
|
|
|
|
|
DocumentInputType {
|
|
|
|
|
name: "In",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
default: NodeInput::Network(concrete!(WasmEditorApi)),
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
outputs: vec![DocumentOutputType {
|
|
|
|
|
name: "Storage",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
}],
|
|
|
|
|
properties: node_properties::no_properties,
|
|
|
|
|
},
|
|
|
|
|
#[cfg(feature = "gpu")]
|
|
|
|
|
DocumentNodeType {
|
|
|
|
|
name: "CreateOutputBuffer",
|
|
|
|
|
category: "Gpu",
|
|
|
|
|
identifier: NodeImplementation::DocumentNode(NodeNetwork {
|
|
|
|
|
inputs: vec![1, 1, 0],
|
|
|
|
|
outputs: vec![NodeOutput::new(2, 0)],
|
|
|
|
|
nodes: [
|
|
|
|
|
DocumentNode {
|
|
|
|
|
name: "Extract Executor".to_string(),
|
|
|
|
|
inputs: vec![NodeInput::Network(concrete!(WasmEditorApi))],
|
|
|
|
|
implementation: DocumentNodeImplementation::Unresolved(NodeIdentifier::new("graphene_core::ops::IntoNode<_, &WgpuExecutor>")),
|
|
|
|
|
..Default::default()
|
|
|
|
|
},
|
|
|
|
|
DocumentNode {
|
|
|
|
|
name: "Create Output Buffer".to_string(),
|
|
|
|
|
inputs: vec![NodeInput::Network(concrete!(usize)), NodeInput::node(0, 0), NodeInput::Network(concrete!(Type))],
|
|
|
|
|
implementation: DocumentNodeImplementation::Unresolved(NodeIdentifier::new("gpu_executor::CreateOutputBufferNode<_, _>")),
|
|
|
|
|
..Default::default()
|
|
|
|
|
},
|
|
|
|
|
DocumentNode {
|
|
|
|
|
name: "Cache".to_string(),
|
|
|
|
|
inputs: vec![NodeInput::ShortCircut(concrete!(())), NodeInput::node(1, 0)],
|
|
|
|
|
implementation: DocumentNodeImplementation::Unresolved(NodeIdentifier::new("graphene_core::memo::MemoNode<_, _>")),
|
|
|
|
|
..Default::default()
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
.into_iter()
|
|
|
|
|
.enumerate()
|
|
|
|
|
.map(|(id, node)| (id as NodeId, node))
|
|
|
|
|
.collect(),
|
|
|
|
|
..Default::default()
|
|
|
|
|
}),
|
|
|
|
|
inputs: vec![
|
|
|
|
|
DocumentInputType {
|
|
|
|
|
name: "In",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
default: NodeInput::value(TaggedValue::None, true),
|
|
|
|
|
},
|
|
|
|
|
DocumentInputType {
|
|
|
|
|
name: "In",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
default: NodeInput::Network(concrete!(WasmEditorApi)),
|
|
|
|
|
},
|
|
|
|
|
DocumentInputType {
|
|
|
|
|
name: "In",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
default: NodeInput::value(TaggedValue::None, true),
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
outputs: vec![DocumentOutputType {
|
|
|
|
|
name: "OutputBuffer",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
}],
|
|
|
|
|
properties: node_properties::input_properties,
|
|
|
|
|
},
|
|
|
|
|
#[cfg(feature = "gpu")]
|
|
|
|
|
DocumentNodeType {
|
|
|
|
|
name: "CreateComputePass",
|
|
|
|
|
category: "Gpu",
|
|
|
|
|
identifier: NodeImplementation::DocumentNode(NodeNetwork {
|
|
|
|
|
inputs: vec![1, 0, 1, 1],
|
|
|
|
|
outputs: vec![NodeOutput::new(2, 0)],
|
|
|
|
|
nodes: [
|
|
|
|
|
DocumentNode {
|
|
|
|
|
name: "Extract Executor".to_string(),
|
|
|
|
|
inputs: vec![NodeInput::Network(concrete!(WasmEditorApi))],
|
|
|
|
|
implementation: DocumentNodeImplementation::Unresolved(NodeIdentifier::new("graphene_core::ops::IntoNode<_, &WgpuExecutor>")),
|
|
|
|
|
..Default::default()
|
|
|
|
|
},
|
|
|
|
|
DocumentNode {
|
|
|
|
|
name: "Create Compute Pass".to_string(),
|
|
|
|
|
inputs: vec![
|
|
|
|
|
NodeInput::Network(concrete!(gpu_executor::PipelineLayout<WgpuExecutor>)),
|
|
|
|
|
NodeInput::node(0, 0),
|
|
|
|
|
NodeInput::Network(concrete!(ShaderInput<WgpuExecutor>)),
|
|
|
|
|
NodeInput::Network(concrete!(gpu_executor::ComputePassDimensions)),
|
|
|
|
|
],
|
|
|
|
|
implementation: DocumentNodeImplementation::Unresolved(NodeIdentifier::new("gpu_executor::CreateComputePassNode<_, _, _>")),
|
|
|
|
|
..Default::default()
|
|
|
|
|
},
|
|
|
|
|
DocumentNode {
|
|
|
|
|
name: "Cache".to_string(),
|
|
|
|
|
inputs: vec![NodeInput::ShortCircut(concrete!(())), NodeInput::node(1, 0)],
|
|
|
|
|
implementation: DocumentNodeImplementation::Unresolved(NodeIdentifier::new("graphene_core::memo::MemoNode<_, _>")),
|
|
|
|
|
..Default::default()
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
.into_iter()
|
|
|
|
|
.enumerate()
|
|
|
|
|
.map(|(id, node)| (id as NodeId, node))
|
|
|
|
|
.collect(),
|
|
|
|
|
..Default::default()
|
|
|
|
|
}),
|
|
|
|
|
inputs: vec![
|
|
|
|
|
DocumentInputType {
|
|
|
|
|
name: "In",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
default: NodeInput::Network(concrete!(gpu_executor::PipelineLayout<WgpuExecutor>)),
|
|
|
|
|
},
|
|
|
|
|
DocumentInputType {
|
|
|
|
|
name: "In",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
default: NodeInput::Network(concrete!(WasmEditorApi)),
|
|
|
|
|
},
|
|
|
|
|
DocumentInputType {
|
|
|
|
|
name: "In",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
default: NodeInput::Network(concrete!(ShaderInput<WgpuExecutor>)),
|
|
|
|
|
},
|
|
|
|
|
DocumentInputType {
|
|
|
|
|
name: "In",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
default: NodeInput::Network(concrete!(gpu_executor::ComputePassDimensions)),
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
outputs: vec![DocumentOutputType {
|
|
|
|
|
name: "CommandBuffer",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
}],
|
|
|
|
|
properties: node_properties::input_properties,
|
|
|
|
|
},
|
|
|
|
|
#[cfg(feature = "gpu")]
|
|
|
|
|
DocumentNodeType {
|
|
|
|
|
name: "CreatePipelineLayout",
|
|
|
|
|
category: "Gpu",
|
|
|
|
|
identifier: NodeImplementation::proto("gpu_executor::CreatePipelineLayoutNode<_, _, _, _>"),
|
|
|
|
|
inputs: vec![
|
|
|
|
|
DocumentInputType {
|
|
|
|
|
name: "ShaderHandle",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
default: NodeInput::Network(concrete!(<WgpuExecutor as GpuExecutor>::ShaderHandle)),
|
|
|
|
|
},
|
|
|
|
|
DocumentInputType {
|
|
|
|
|
name: "String",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
default: NodeInput::Network(concrete!(String)),
|
|
|
|
|
},
|
|
|
|
|
DocumentInputType {
|
|
|
|
|
name: "Bindgroup",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
default: NodeInput::Network(concrete!(gpu_executor::Bindgroup<WgpuExecutor>)),
|
|
|
|
|
},
|
|
|
|
|
DocumentInputType {
|
|
|
|
|
name: "ArcShaderInput",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
default: NodeInput::Network(concrete!(Arc<ShaderInput<WgpuExecutor>>)),
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
outputs: vec![DocumentOutputType {
|
|
|
|
|
name: "PipelineLayout",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
}],
|
|
|
|
|
properties: node_properties::input_properties,
|
|
|
|
|
},
|
|
|
|
|
#[cfg(feature = "gpu")]
|
|
|
|
|
DocumentNodeType {
|
|
|
|
|
name: "ExecuteComputePipeline",
|
|
|
|
|
category: "Gpu",
|
|
|
|
|
identifier: NodeImplementation::DocumentNode(NodeNetwork {
|
|
|
|
|
inputs: vec![1, 0],
|
|
|
|
|
outputs: vec![NodeOutput::new(2, 0)],
|
|
|
|
|
nodes: [
|
|
|
|
|
DocumentNode {
|
|
|
|
|
name: "Extract Executor".to_string(),
|
|
|
|
|
inputs: vec![NodeInput::Network(concrete!(WasmEditorApi))],
|
|
|
|
|
implementation: DocumentNodeImplementation::Unresolved(NodeIdentifier::new("graphene_core::ops::IntoNode<_, &WgpuExecutor>")),
|
|
|
|
|
..Default::default()
|
|
|
|
|
},
|
|
|
|
|
DocumentNode {
|
|
|
|
|
name: "Execute Compute Pipeline".to_string(),
|
|
|
|
|
inputs: vec![NodeInput::Network(concrete!(<WgpuExecutor as GpuExecutor>::CommandBuffer)), NodeInput::node(0, 0)],
|
|
|
|
|
implementation: DocumentNodeImplementation::Unresolved(NodeIdentifier::new("gpu_executor::ExecuteComputePipelineNode<_>")),
|
|
|
|
|
..Default::default()
|
|
|
|
|
},
|
|
|
|
|
DocumentNode {
|
|
|
|
|
name: "Cache".to_string(),
|
|
|
|
|
inputs: vec![NodeInput::ShortCircut(concrete!(())), NodeInput::node(1, 0)],
|
|
|
|
|
implementation: DocumentNodeImplementation::Unresolved(NodeIdentifier::new("graphene_core::memo::MemoNode<_, _>")),
|
|
|
|
|
..Default::default()
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
.into_iter()
|
|
|
|
|
.enumerate()
|
|
|
|
|
.map(|(id, node)| (id as NodeId, node))
|
|
|
|
|
.collect(),
|
|
|
|
|
..Default::default()
|
|
|
|
|
}),
|
|
|
|
|
inputs: vec![
|
|
|
|
|
DocumentInputType {
|
|
|
|
|
name: "In",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
default: NodeInput::value(TaggedValue::None, true),
|
|
|
|
|
},
|
|
|
|
|
DocumentInputType {
|
|
|
|
|
name: "In",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
default: NodeInput::Network(concrete!(WasmEditorApi)),
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
outputs: vec![DocumentOutputType {
|
|
|
|
|
name: "PipelineResult",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
}],
|
|
|
|
|
properties: node_properties::no_properties,
|
|
|
|
|
},
|
|
|
|
|
#[cfg(feature = "gpu")]
|
|
|
|
|
DocumentNodeType {
|
|
|
|
|
name: "ReadOutputBuffer",
|
|
|
|
|
category: "Gpu",
|
|
|
|
|
identifier: NodeImplementation::DocumentNode(NodeNetwork {
|
|
|
|
|
inputs: vec![1, 0],
|
|
|
|
|
outputs: vec![NodeOutput::new(2, 0)],
|
|
|
|
|
nodes: [
|
|
|
|
|
DocumentNode {
|
|
|
|
|
name: "Extract Executor".to_string(),
|
|
|
|
|
inputs: vec![NodeInput::Network(concrete!(WasmEditorApi))],
|
|
|
|
|
implementation: DocumentNodeImplementation::Unresolved(NodeIdentifier::new("graphene_core::ops::IntoNode<_, &WgpuExecutor>")),
|
|
|
|
|
..Default::default()
|
|
|
|
|
},
|
|
|
|
|
DocumentNode {
|
|
|
|
|
name: "Read Output Buffer".to_string(),
|
|
|
|
|
inputs: vec![NodeInput::Network(concrete!(Arc<ShaderInput<WgpuExecutor>>)), NodeInput::node(0, 0)],
|
|
|
|
|
implementation: DocumentNodeImplementation::Unresolved(NodeIdentifier::new("gpu_executor::ReadOutputBufferNode<_, _>")),
|
|
|
|
|
..Default::default()
|
|
|
|
|
},
|
|
|
|
|
DocumentNode {
|
|
|
|
|
name: "Cache".to_string(),
|
|
|
|
|
inputs: vec![NodeInput::ShortCircut(concrete!(())), NodeInput::node(1, 0)],
|
|
|
|
|
implementation: DocumentNodeImplementation::Unresolved(NodeIdentifier::new("graphene_core::memo::MemoNode<_, _>")),
|
|
|
|
|
..Default::default()
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
.into_iter()
|
|
|
|
|
.enumerate()
|
|
|
|
|
.map(|(id, node)| (id as NodeId, node))
|
|
|
|
|
.collect(),
|
|
|
|
|
..Default::default()
|
|
|
|
|
}),
|
|
|
|
|
inputs: vec![
|
|
|
|
|
DocumentInputType {
|
|
|
|
|
name: "In",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
default: NodeInput::value(TaggedValue::None, true),
|
|
|
|
|
},
|
|
|
|
|
DocumentInputType {
|
|
|
|
|
name: "In",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
default: NodeInput::Network(concrete!(WasmEditorApi)),
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
outputs: vec![DocumentOutputType {
|
|
|
|
|
name: "Buffer",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
}],
|
|
|
|
|
properties: node_properties::no_properties,
|
|
|
|
|
},
|
|
|
|
|
#[cfg(feature = "gpu")]
|
|
|
|
|
DocumentNodeType {
|
|
|
|
|
name: "CreateGpuSurface",
|
|
|
|
|
category: "Gpu",
|
|
|
|
|
identifier: NodeImplementation::DocumentNode(NodeNetwork {
|
|
|
|
|
inputs: vec![0],
|
|
|
|
|
outputs: vec![NodeOutput::new(1, 0)],
|
|
|
|
|
nodes: [
|
|
|
|
|
DocumentNode {
|
|
|
|
|
name: "Create Gpu Surface".to_string(),
|
|
|
|
|
inputs: vec![NodeInput::Network(concrete!(WasmEditorApi))],
|
|
|
|
|
implementation: DocumentNodeImplementation::Unresolved(NodeIdentifier::new("gpu_executor::CreateGpuSurfaceNode")),
|
|
|
|
|
..Default::default()
|
|
|
|
|
},
|
|
|
|
|
DocumentNode {
|
|
|
|
|
name: "Cache".to_string(),
|
|
|
|
|
inputs: vec![NodeInput::ShortCircut(concrete!(())), NodeInput::node(0, 0)],
|
|
|
|
|
implementation: DocumentNodeImplementation::Unresolved(NodeIdentifier::new("graphene_core::memo::MemoNode<_, _>")),
|
|
|
|
|
..Default::default()
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
.into_iter()
|
|
|
|
|
.enumerate()
|
|
|
|
|
.map(|(id, node)| (id as NodeId, node))
|
|
|
|
|
.collect(),
|
|
|
|
|
..Default::default()
|
|
|
|
|
}),
|
|
|
|
|
inputs: vec![DocumentInputType {
|
|
|
|
|
name: "In",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
default: NodeInput::Network(concrete!(WasmEditorApi)),
|
|
|
|
|
}],
|
|
|
|
|
outputs: vec![DocumentOutputType {
|
|
|
|
|
name: "GpuSurface",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
}],
|
|
|
|
|
properties: node_properties::no_properties,
|
|
|
|
|
},
|
|
|
|
|
#[cfg(feature = "gpu")]
|
|
|
|
|
DocumentNodeType {
|
|
|
|
|
name: "RenderTexture",
|
|
|
|
|
category: "Gpu",
|
|
|
|
|
identifier: NodeImplementation::DocumentNode(NodeNetwork {
|
|
|
|
|
inputs: vec![1, 1, 0],
|
|
|
|
|
outputs: vec![NodeOutput::new(2, 0)],
|
|
|
|
|
nodes: [
|
|
|
|
|
DocumentNode {
|
|
|
|
|
name: "Extract Executor".to_string(),
|
|
|
|
|
inputs: vec![NodeInput::Network(concrete!(WasmEditorApi))],
|
|
|
|
|
implementation: DocumentNodeImplementation::Unresolved(NodeIdentifier::new("graphene_core::ops::IntoNode<_, &WgpuExecutor>")),
|
|
|
|
|
..Default::default()
|
|
|
|
|
},
|
|
|
|
|
DocumentNode {
|
|
|
|
|
name: "Render Texture".to_string(),
|
|
|
|
|
inputs: vec![
|
|
|
|
|
NodeInput::Network(concrete!(ShaderInputFrame<WgpuExecutor>)),
|
|
|
|
|
NodeInput::Network(concrete!(Arc<SurfaceHandle<<WgpuExecutor as GpuExecutor>::Surface>>)),
|
|
|
|
|
NodeInput::node(0, 0),
|
|
|
|
|
],
|
|
|
|
|
implementation: DocumentNodeImplementation::Unresolved(NodeIdentifier::new("gpu_executor::RenderTextureNode<_, _>")),
|
|
|
|
|
..Default::default()
|
|
|
|
|
},
|
|
|
|
|
DocumentNode {
|
|
|
|
|
name: "Cache".to_string(),
|
|
|
|
|
inputs: vec![NodeInput::ShortCircut(concrete!(())), NodeInput::node(1, 0)],
|
|
|
|
|
implementation: DocumentNodeImplementation::Unresolved(NodeIdentifier::new("graphene_core::memo::MemoNode<_, _>")),
|
|
|
|
|
..Default::default()
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
.into_iter()
|
|
|
|
|
.enumerate()
|
|
|
|
|
.map(|(id, node)| (id as NodeId, node))
|
|
|
|
|
.collect(),
|
|
|
|
|
..Default::default()
|
|
|
|
|
}),
|
|
|
|
|
inputs: vec![
|
|
|
|
|
DocumentInputType {
|
|
|
|
|
name: "Texture",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
default: NodeInput::value(TaggedValue::None, true),
|
|
|
|
|
},
|
|
|
|
|
DocumentInputType {
|
|
|
|
|
name: "Surface",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
default: NodeInput::value(TaggedValue::None, true),
|
|
|
|
|
},
|
|
|
|
|
DocumentInputType {
|
|
|
|
|
name: "EditorApi",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
default: NodeInput::Network(concrete!(WasmEditorApi)),
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
outputs: vec![DocumentOutputType {
|
|
|
|
|
name: "RenderedTexture",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
}],
|
|
|
|
|
properties: node_properties::no_properties,
|
|
|
|
|
},
|
|
|
|
|
#[cfg(feature = "gpu")]
|
|
|
|
|
DocumentNodeType {
|
|
|
|
|
name: "UploadTexture",
|
|
|
|
|
category: "Gpu",
|
|
|
|
|
identifier: NodeImplementation::DocumentNode(NodeNetwork {
|
|
|
|
|
inputs: vec![1, 0],
|
|
|
|
|
outputs: vec![NodeOutput::new(2, 0)],
|
|
|
|
|
nodes: [
|
|
|
|
|
DocumentNode {
|
|
|
|
|
name: "Extract Executor".to_string(),
|
|
|
|
|
inputs: vec![NodeInput::Network(concrete!(WasmEditorApi))],
|
|
|
|
|
implementation: DocumentNodeImplementation::Unresolved(NodeIdentifier::new("graphene_core::ops::IntoNode<_, &WgpuExecutor>")),
|
|
|
|
|
..Default::default()
|
|
|
|
|
},
|
|
|
|
|
DocumentNode {
|
|
|
|
|
name: "Upload Texture".to_string(),
|
|
|
|
|
inputs: vec![NodeInput::Network(concrete!(ImageFrame<Color>)), NodeInput::node(0, 0)],
|
|
|
|
|
implementation: DocumentNodeImplementation::Unresolved(NodeIdentifier::new("gpu_executor::UploadTextureNode<_>")),
|
|
|
|
|
..Default::default()
|
|
|
|
|
},
|
|
|
|
|
DocumentNode {
|
|
|
|
|
name: "Cache".to_string(),
|
|
|
|
|
inputs: vec![NodeInput::ShortCircut(concrete!(())), NodeInput::node(1, 0)],
|
|
|
|
|
implementation: DocumentNodeImplementation::Unresolved(NodeIdentifier::new("graphene_core::memo::MemoNode<_, _>")),
|
|
|
|
|
..Default::default()
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
.into_iter()
|
|
|
|
|
.enumerate()
|
|
|
|
|
.map(|(id, node)| (id as NodeId, node))
|
|
|
|
|
.collect(),
|
|
|
|
|
..Default::default()
|
|
|
|
|
}),
|
|
|
|
|
inputs: vec![
|
|
|
|
|
DocumentInputType {
|
|
|
|
|
name: "In",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
default: NodeInput::value(TaggedValue::ImageFrame(ImageFrame::empty()), true),
|
|
|
|
|
},
|
|
|
|
|
DocumentInputType {
|
|
|
|
|
name: "In",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
default: NodeInput::Network(concrete!(WasmEditorApi)),
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
outputs: vec![DocumentOutputType {
|
|
|
|
|
name: "Texture",
|
|
|
|
|
data_type: FrontendGraphDataType::General,
|
|
|
|
|
}],
|
|
|
|
|
properties: node_properties::no_properties,
|
|
|
|
|
},
|
|
|
|
|
#[cfg(feature = "gpu")]
|
|
|
|
|
DocumentNodeType {
|
|
|
|
|
name: "GpuImage",
|
|
|
|
|
category: "Image Adjustments",
|
|
|
|
|
@ -826,7 +1289,6 @@ fn static_nodes() -> Vec<DocumentNodeType> {
|
|
|
|
|
properties: node_properties::no_properties,
|
|
|
|
|
},
|
|
|
|
|
#[cfg(feature = "quantization")]
|
|
|
|
|
#[cfg(feature = "quantization")]
|
|
|
|
|
DocumentNodeType {
|
|
|
|
|
name: "Generate Quantization",
|
|
|
|
|
category: "Quantization",
|
|
|
|
|
|