Skip to content

Commit 25f29af

Browse files
committed
Update gpu nodes to compile again
Restructure `gpu-executor` and `wgpu-executor` And libssl to nix shell Fix graphene-cli and add half percision color format Fix texture scaling Remove vulkan executor Fix compile errors Improve execution request deduplication
1 parent 3657b37 commit 25f29af

File tree

39 files changed

+1084
-1134
lines changed

39 files changed

+1084
-1134
lines changed

Cargo.lock

Lines changed: 215 additions & 77 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ members = [
1212
"node-graph/node-macro",
1313
"node-graph/compilation-server",
1414
"node-graph/compilation-client",
15-
"node-graph/vulkan-executor",
1615
"node-graph/wgpu-executor",
1716
"node-graph/gpu-executor",
1817
"node-graph/gpu-compiler/gpu-compiler-bin-wrapper",
@@ -58,7 +57,7 @@ ron = "0.8"
5857
fastnoise-lite = "1.1"
5958
spirv-std = { git = "https://github.com/EmbarkStudios/rust-gpu.git" }
6059
wgpu-types = "0.17"
61-
wgpu = "0.19"
60+
wgpu = { version = "0.20", features = ["strict_asserts", "api_log_info"] }
6261
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
6362
wasm-bindgen = "=0.2.92" # wasm-bindgen upgrades may break various things so we pin the version
6463
wasm-bindgen-futures = "0.4"

editor/src/messages/layout/layout_message_handler.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,6 @@ impl LayoutMessageHandler {
385385
fn send_diff(&self, mut diff: Vec<WidgetDiff>, layout_target: LayoutTarget, responses: &mut VecDeque<Message>, action_input_mapping: &impl Fn(&MessageDiscriminant) -> Vec<KeysGroup>) {
386386
diff.iter_mut().for_each(|diff| diff.new_value.apply_keyboard_shortcut(action_input_mapping));
387387

388-
trace!("{layout_target:?} diff {diff:#?}");
389-
390388
let message = match layout_target {
391389
LayoutTarget::DialogButtons => FrontendMessage::UpdateDialogButtons { layout_target, diff },
392390
LayoutTarget::DialogColumn1 => FrontendMessage::UpdateDialogColumn1 { layout_target, diff },

editor/src/messages/portfolio/document/node_graph/document_node_types.rs

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ use crate::messages::portfolio::utility_types::PersistentData;
66
use crate::messages::prelude::Message;
77
use crate::node_graph_executor::NodeGraphExecutor;
88

9+
#[cfg(feature = "gpu")]
10+
use gpu_executor::*;
911
use graph_craft::concrete;
1012
use graph_craft::document::value::*;
1113
use graph_craft::document::*;
@@ -23,7 +25,7 @@ use graphene_core::*;
2325
use graphene_std::application_io::RenderConfig;
2426
use graphene_std::wasm_application_io::WasmEditorApi;
2527
#[cfg(feature = "gpu")]
26-
use {gpu_executor::*, graphene_core::application_io::SurfaceHandle, wgpu_executor::WgpuExecutor};
28+
use wgpu_executor::{Bindgroup, CommandBuffer, PipelineLayout, ShaderHandle, ShaderInputFrame, WgpuShaderInput};
2729

2830
use once_cell::sync::Lazy;
2931
use std::collections::VecDeque;
@@ -994,7 +996,7 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
994996
DocumentNode {
995997
name: "Create Uniform".to_string(),
996998
inputs: vec![NodeInput::network(generic!(T), 0), NodeInput::node(NodeId(0), 0)],
997-
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("gpu_executor::UniformNode<_>")),
999+
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("wgpu_executor::UniformNode<_>")),
9981000
..Default::default()
9991001
},
10001002
DocumentNode {
@@ -1038,7 +1040,7 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
10381040
DocumentNode {
10391041
name: "Create Storage".to_string(),
10401042
inputs: vec![NodeInput::network(concrete!(Vec<u8>), 0), NodeInput::node(NodeId(0), 0)],
1041-
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("gpu_executor::StorageNode<_>")),
1043+
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("wgpu_executor::StorageNode<_>")),
10421044
..Default::default()
10431045
},
10441046
DocumentNode {
@@ -1082,7 +1084,7 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
10821084
DocumentNode {
10831085
name: "Create Output Buffer".to_string(),
10841086
inputs: vec![NodeInput::network(concrete!(usize), 0), NodeInput::node(NodeId(0), 0), NodeInput::network(concrete!(Type), 1)],
1085-
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("gpu_executor::CreateOutputBufferNode<_, _>")),
1087+
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("wgpu_executor::CreateOutputBufferNode<_, _>")),
10861088
..Default::default()
10871089
},
10881090
DocumentNode {
@@ -1134,12 +1136,12 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
11341136
DocumentNode {
11351137
name: "Create Compute Pass".to_string(),
11361138
inputs: vec![
1137-
NodeInput::network(concrete!(gpu_executor::PipelineLayout<WgpuExecutor>), 0),
1139+
NodeInput::network(concrete!(PipelineLayout), 0),
11381140
NodeInput::node(NodeId(0), 0),
1139-
NodeInput::network(concrete!(ShaderInput<WgpuExecutor>), 2),
1141+
NodeInput::network(concrete!(WgpuShaderInput), 2),
11401142
NodeInput::network(concrete!(gpu_executor::ComputePassDimensions), 3),
11411143
],
1142-
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("gpu_executor::CreateComputePassNode<_, _, _>")),
1144+
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("wgpu_executor::CreateComputePassNode<_, _, _>")),
11431145
..Default::default()
11441146
},
11451147
DocumentNode {
@@ -1160,12 +1162,12 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
11601162
DocumentInputType {
11611163
name: "In",
11621164
data_type: FrontendGraphDataType::General,
1163-
default: NodeInput::network(concrete!(gpu_executor::PipelineLayout<WgpuExecutor>), 0),
1165+
default: NodeInput::network(concrete!(PipelineLayout), 0),
11641166
},
11651167
DocumentInputType {
11661168
name: "In",
11671169
data_type: FrontendGraphDataType::General,
1168-
default: NodeInput::network(concrete!(ShaderInput<WgpuExecutor>), 2),
1170+
default: NodeInput::network(concrete!(WgpuShaderInput), 2),
11691171
},
11701172
DocumentInputType {
11711173
name: "In",
@@ -1184,12 +1186,12 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
11841186
DocumentNodeDefinition {
11851187
name: "CreatePipelineLayout",
11861188
category: "Gpu",
1187-
implementation: DocumentNodeImplementation::proto("gpu_executor::CreatePipelineLayoutNode<_, _, _, _>"),
1189+
implementation: DocumentNodeImplementation::proto("wgpu_executor::CreatePipelineLayoutNode<_, _, _>"),
11881190
inputs: vec![
11891191
DocumentInputType {
11901192
name: "ShaderHandle",
11911193
data_type: FrontendGraphDataType::General,
1192-
default: NodeInput::network(concrete!(<WgpuExecutor as GpuExecutor>::ShaderHandle), 0),
1194+
default: NodeInput::network(concrete!(ShaderHandle), 0),
11931195
},
11941196
DocumentInputType {
11951197
name: "String",
@@ -1199,12 +1201,12 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
11991201
DocumentInputType {
12001202
name: "Bindgroup",
12011203
data_type: FrontendGraphDataType::General,
1202-
default: NodeInput::network(concrete!(gpu_executor::Bindgroup<WgpuExecutor>), 2),
1204+
default: NodeInput::network(concrete!(Bindgroup), 2),
12031205
},
12041206
DocumentInputType {
12051207
name: "ArcShaderInput",
12061208
data_type: FrontendGraphDataType::General,
1207-
default: NodeInput::network(concrete!(Arc<ShaderInput<WgpuExecutor>>), 3),
1209+
default: NodeInput::network(concrete!(Arc<WgpuShaderInput>), 3),
12081210
},
12091211
],
12101212
outputs: vec![DocumentOutputType {
@@ -1229,8 +1231,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
12291231
},
12301232
DocumentNode {
12311233
name: "Execute Compute Pipeline".to_string(),
1232-
inputs: vec![NodeInput::network(concrete!(<WgpuExecutor as GpuExecutor>::CommandBuffer), 0), NodeInput::node(NodeId(0), 0)],
1233-
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("gpu_executor::ExecuteComputePipelineNode<_>")),
1234+
inputs: vec![NodeInput::network(concrete!(CommandBuffer), 0), NodeInput::node(NodeId(0), 0)],
1235+
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("wgpu_executor::ExecuteComputePipelineNode<_>")),
12341236
..Default::default()
12351237
},
12361238
DocumentNode {
@@ -1273,8 +1275,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
12731275
},
12741276
DocumentNode {
12751277
name: "Read Output Buffer".to_string(),
1276-
inputs: vec![NodeInput::network(concrete!(Arc<ShaderInput<WgpuExecutor>>), 0), NodeInput::node(NodeId(0), 0)],
1277-
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("gpu_executor::ReadOutputBufferNode<_, _>")),
1278+
inputs: vec![NodeInput::network(concrete!(Arc<WgpuShaderInput>), 0), NodeInput::node(NodeId(0), 0)],
1279+
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("wgpu_executor::ReadOutputBufferNode<_, _>")),
12781280
..Default::default()
12791281
},
12801282
DocumentNode {
@@ -1312,7 +1314,7 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
13121314
DocumentNode {
13131315
name: "Create Gpu Surface".to_string(),
13141316
inputs: vec![NodeInput::scope("editor-api")],
1315-
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("gpu_executor::CreateGpuSurfaceNode")),
1317+
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("wgpu_executor::CreateGpuSurfaceNode")),
13161318
..Default::default()
13171319
},
13181320
DocumentNode {
@@ -1350,12 +1352,13 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
13501352
},
13511353
DocumentNode {
13521354
name: "Render Texture".to_string(),
1355+
manual_composition: Some(concrete!(Footprint)),
13531356
inputs: vec![
1354-
NodeInput::network(concrete!(ShaderInputFrame<WgpuExecutor>), 0),
1355-
NodeInput::network(concrete!(Arc<SurfaceHandle<<WgpuExecutor as GpuExecutor>::Surface<'_>>>), 0),
1357+
NodeInput::network(concrete!(ShaderInputFrame), 0),
1358+
NodeInput::network(concrete!(Arc<wgpu_executor::Surface>), 1),
13561359
NodeInput::node(NodeId(0), 0),
13571360
],
1358-
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("gpu_executor::RenderTextureNode<_, _>")),
1361+
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("wgpu_executor::RenderTextureNode<_, _, _>")),
13591362
..Default::default()
13601363
},
13611364
]
@@ -1399,14 +1402,14 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
13991402
DocumentNode {
14001403
name: "Upload Texture".to_string(),
14011404
inputs: vec![NodeInput::network(concrete!(ImageFrame<Color>), 0), NodeInput::node(NodeId(0), 0)],
1402-
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("gpu_executor::UploadTextureNode<_>")),
1405+
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("wgpu_executor::UploadTextureNode<_>")),
14031406
..Default::default()
14041407
},
14051408
DocumentNode {
14061409
name: "Cache".to_string(),
14071410
manual_composition: Some(concrete!(())),
14081411
inputs: vec![NodeInput::node(NodeId(1), 0)],
1409-
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("graphene_core::memo::MemoNode<_, _>")),
1412+
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("graphene_core::memo::ImpureMemoNode<_, _, _>")),
14101413
..Default::default()
14111414
},
14121415
]

editor/src/messages/portfolio/portfolio_message_handler.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,13 @@ impl MessageHandler<PortfolioMessage, PortfolioMessageData<'_>> for PortfolioMes
287287

288288
self.persistent_data.font_cache.insert(font, preview_url, data, is_default);
289289
self.executor.update_font_cache(self.persistent_data.font_cache.clone());
290+
for document_id in self.document_ids.iter() {
291+
let _ = self.executor.submit_node_graph_evaluation(
292+
self.documents.get_mut(&document_id).expect("Tried to render no existent Document"),
293+
ipp.viewport_bounds.size().as_uvec2(),
294+
true,
295+
);
296+
}
290297

291298
if self.active_document_mut().is_some() {
292299
responses.add(NodeGraphMessage::RunDocumentGraph);
@@ -593,6 +600,7 @@ impl MessageHandler<PortfolioMessage, PortfolioMessageData<'_>> for PortfolioMes
593600
let result = self.executor.submit_node_graph_evaluation(
594601
self.documents.get_mut(&document_id).expect("Tried to render no existent Document"),
595602
ipp.viewport_bounds.size().as_uvec2(),
603+
false,
596604
);
597605

598606
if let Err(description) = result {

0 commit comments

Comments
 (0)