Skip to content

Commit 9a36d58

Browse files
committed
add single edge variant
1 parent 7bc7a48 commit 9a36d58

File tree

1 file changed

+21
-0
lines changed
  • crates/bevy_render/src/render_graph

1 file changed

+21
-0
lines changed

crates/bevy_render/src/render_graph/app.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ pub trait RenderGraphApp {
1919
sub_graph_name: &'static str,
2020
edges: &[&'static str],
2121
) -> &mut Self;
22+
/// Add node edge to the specified graph
23+
fn add_render_graph_edge(
24+
&mut self,
25+
sub_graph_name: &'static str,
26+
output_edge: &'static str,
27+
input_edge: &'static str,
28+
) -> &mut Self;
2229
}
2330

2431
impl RenderGraphApp for App {
@@ -49,4 +56,18 @@ impl RenderGraphApp for App {
4956
graph.add_node_edges(edges);
5057
self
5158
}
59+
60+
fn add_render_graph_edge(
61+
&mut self,
62+
sub_graph_name: &'static str,
63+
output_edge: &'static str,
64+
input_edge: &'static str,
65+
) -> &mut Self {
66+
let mut render_graph = self.world.get_resource_mut::<RenderGraph>().expect(
67+
"RenderGraph not found. Make sure you are using add_render_graph_node on the RenderApp",
68+
);
69+
let graph = render_graph.sub_graph_mut(sub_graph_name);
70+
graph.add_node_edge(output_edge, input_edge);
71+
self
72+
}
5273
}

0 commit comments

Comments
 (0)