Skip to content

Commit

Permalink
add single edge variant
Browse files Browse the repository at this point in the history
  • Loading branch information
IceSentry committed Apr 4, 2023
1 parent 7bc7a48 commit 9a36d58
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions crates/bevy_render/src/render_graph/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ pub trait RenderGraphApp {
sub_graph_name: &'static str,
edges: &[&'static str],
) -> &mut Self;
/// Add node edge to the specified graph
fn add_render_graph_edge(
&mut self,
sub_graph_name: &'static str,
output_edge: &'static str,
input_edge: &'static str,
) -> &mut Self;
}

impl RenderGraphApp for App {
Expand Down Expand Up @@ -49,4 +56,18 @@ impl RenderGraphApp for App {
graph.add_node_edges(edges);
self
}

fn add_render_graph_edge(
&mut self,
sub_graph_name: &'static str,
output_edge: &'static str,
input_edge: &'static str,
) -> &mut Self {
let mut render_graph = self.world.get_resource_mut::<RenderGraph>().expect(
"RenderGraph not found. Make sure you are using add_render_graph_node on the RenderApp",
);
let graph = render_graph.sub_graph_mut(sub_graph_name);
graph.add_node_edge(output_edge, input_edge);
self
}
}

0 comments on commit 9a36d58

Please sign in to comment.