File tree 1 file changed +9
-4
lines changed
crates/bevy_render/src/render_graph 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -28,19 +28,24 @@ impl RenderGraphApp for App {
28
28
node_name : & ' static str ,
29
29
) -> & mut Self {
30
30
let node = T :: from_world ( & mut self . world ) ;
31
- let mut render_graph = self . world . resource_mut :: < RenderGraph > ( ) ;
31
+ let mut render_graph = self . world . get_resource_mut :: < RenderGraph > ( ) . expect (
32
+ "RenderGraph not found. Make sure you are using add_render_graph_node on the RenderApp" ,
33
+ ) ;
32
34
33
- let graph = render_graph. get_sub_graph_mut ( sub_graph_name) . unwrap ( ) ;
35
+ let graph = render_graph. sub_graph_mut ( sub_graph_name) ;
34
36
graph. add_node ( node_name, node) ;
35
37
self
36
38
}
39
+
37
40
fn add_render_graph_edges (
38
41
& mut self ,
39
42
sub_graph_name : & ' static str ,
40
43
edges : & [ & ' static str ] ,
41
44
) -> & mut Self {
42
- let mut render_graph = self . world . resource_mut :: < RenderGraph > ( ) ;
43
- let graph = render_graph. get_sub_graph_mut ( sub_graph_name) . unwrap ( ) ;
45
+ let mut render_graph = self . world . get_resource_mut :: < RenderGraph > ( ) . expect (
46
+ "RenderGraph not found. Make sure you are using add_render_graph_node on the RenderApp" ,
47
+ ) ;
48
+ let graph = render_graph. sub_graph_mut ( sub_graph_name) ;
44
49
graph. add_node_edges ( edges) ;
45
50
self
46
51
}
You can’t perform that action at this time.
0 commit comments