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.