MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / execute

Method execute

native/shared/src/renderer/graph.rs:145–155  ·  view source on GitHub ↗

Schedule + run all nodes in order. Consumes the graph because each node's `run` closure is `FnOnce`.

(self, ctx: &mut Ctx)

Source from the content-addressed store, hash-verified

143 /// Schedule + run all nodes in order. Consumes the graph because
144 /// each node's `run` closure is `FnOnce`.
145 pub fn execute(self, ctx: &mut Ctx) -> Result<(), GraphError> {
146 let order = schedule(&self.nodes)?;
147 // Drain in order. Using Option<PassNode> trick so we can take()
148 // nodes out by index without panicking the Vec's geometry.
149 let mut slots: Vec<Option<PassNode<'a, Ctx>>> = self.nodes.into_iter().map(Some).collect();
150 for i in order {
151 let node = slots[i].take().expect("each node scheduled exactly once");
152 (node.run)(ctx);
153 }
154 Ok(())
155 }
156}
157
158impl<'a, Ctx> Default for Graph<'a, Ctx> {

Calls 1

scheduleFunction · 0.85