pub struct GraphExecutor {
pub resource_pool: ResourcePool,
pub timeline: FrameTimeline,
/* private fields */
}Expand description
The main execution engine. Walks sorted passes, inserts barriers, tracks timing, and manages resources.
Fields§
§resource_pool: ResourcePoolResource pool for automatic allocation.
timeline: FrameTimelineFrame timeline for triple-buffered frame management.
Implementations§
Source§impl GraphExecutor
impl GraphExecutor
pub fn new(backbuffer_width: u32, backbuffer_height: u32) -> Self
pub fn with_timing(self, enable: bool) -> Self
pub fn with_max_stats_history(self, n: usize) -> Self
Sourcepub fn register_executor(&mut self, name: &str, executor: BoxedPassExecutor)
pub fn register_executor(&mut self, name: &str, executor: BoxedPassExecutor)
Register a pass executor.
Sourcepub fn register_fn(&mut self, name: &str, func: impl Fn(&PassContext) + 'static)
pub fn register_fn(&mut self, name: &str, func: impl Fn(&PassContext) + 'static)
Register a closure-based executor.
Sourcepub fn resize(&mut self, width: u32, height: u32)
pub fn resize(&mut self, width: u32, height: u32)
Set backbuffer dimensions (e.g., on window resize).
Sourcepub fn set_delta_time(&mut self, dt: f32)
pub fn set_delta_time(&mut self, dt: f32)
Set delta time for the current frame.
Sourcepub fn execute_frame(
&mut self,
graph: &mut RenderGraph,
) -> Result<ExecutionStats, String>
pub fn execute_frame( &mut self, graph: &mut RenderGraph, ) -> Result<ExecutionStats, String>
Execute one frame of the render graph.
Sourcepub fn set_config(&mut self, config: GraphConfig)
pub fn set_config(&mut self, config: GraphConfig)
Set a graph config for hot-reload support.
Sourcepub fn set_config_path(&mut self, path: &str)
pub fn set_config_path(&mut self, path: &str)
Set the path to watch for config changes.
Sourcepub fn rebuild_from_config(&mut self) -> Option<RenderGraph>
pub fn rebuild_from_config(&mut self) -> Option<RenderGraph>
Rebuild the graph from the current config (hot-reload).
Sourcepub fn check_hot_reload(&mut self) -> Option<RenderGraph>
pub fn check_hot_reload(&mut self) -> Option<RenderGraph>
Check if config has been modified and rebuild if needed. In a real implementation, this would watch the filesystem.
pub fn stats_history(&self) -> &[ExecutionStats]
pub fn last_stats(&self) -> Option<&ExecutionStats>
Sourcepub fn average_frame_time(&self, n: usize) -> Duration
pub fn average_frame_time(&self, n: usize) -> Duration
Average frame time over the last N frames.
Sourcepub fn average_barrier_count(&self, n: usize) -> f32
pub fn average_barrier_count(&self, n: usize) -> f32
Average barrier count over the last N frames.
pub fn backbuffer_size(&self) -> (u32, u32)
Sourcepub fn frame_report(&self) -> String
pub fn frame_report(&self) -> String
Generate a text report of the last frame’s execution.
Auto Trait Implementations§
impl Freeze for GraphExecutor
impl !RefUnwindSafe for GraphExecutor
impl !Send for GraphExecutor
impl !Sync for GraphExecutor
impl Unpin for GraphExecutor
impl UnsafeUnpin for GraphExecutor
impl !UnwindSafe for GraphExecutor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.