pub struct CompiledGraph<'a> { /* private fields */ }Expand description
A compiled graph: ordered passes, exact barriers, and a transient plan.
Implementations§
Source§impl<'a> CompiledGraph<'a>
impl<'a> CompiledGraph<'a>
Sourcepub fn passes(&self) -> &[CompiledPass<'a>]
pub fn passes(&self) -> &[CompiledPass<'a>]
The compiled passes, in execution order.
Sourcepub const fn final_barriers(&self) -> &GraphBarriers
pub const fn final_barriers(&self) -> &GraphBarriers
The barriers emitted after the last pass, returning imported resources to the states their owners require.
Sourcepub fn physical_image_count(&self) -> usize
pub fn physical_image_count(&self) -> usize
How many physical images the transients were packed onto.
Lower than the number of transients declared exactly when aliasing happened, which is what makes the saving assertable.
Sourcepub fn physical_buffer_count(&self) -> usize
pub fn physical_buffer_count(&self) -> usize
How many physical buffers the transients were packed onto.
Sourcepub fn images_alias(&self, first: ImageId, second: ImageId) -> bool
pub fn images_alias(&self, first: ImageId, second: ImageId) -> bool
Whether two virtual images share one physical image.
Sourcepub fn barrier_batches(&self) -> Vec<&GraphBarriers>
pub fn barrier_batches(&self) -> Vec<&GraphBarriers>
Every barrier the frame will emit, batch by batch, ending with the final batch. The shape a test asserts on.
Sourcepub fn dump(&self) -> String
pub fn dump(&self) -> String
The graph, as text a human reads.
Stage 2 §2.4’s debug-tools principle: “the graph must be able to explain itself”, and its exit criteria require the dump to be “readable and correct for the sandbox frame”. Every line is derived from the compiled form rather than re-walked from the declarations, so a dump that says a barrier happened is evidence that it will.
Sourcepub fn execute(
self,
device: &dyn Device,
pool: &mut TransientPool,
encoder: &mut dyn CommandEncoder,
timers: Option<&mut PassTimers>,
) -> Result<(), GraphError>
pub fn execute( self, device: &dyn Device, pool: &mut TransientPool, encoder: &mut dyn CommandEncoder, timers: Option<&mut PassTimers>, ) -> Result<(), GraphError>
Records the whole frame into encoder.
Realises the transients out of pool, then for each pass in order:
emits its barrier batch as one call, opens the pass — naming the two
queries timers gave it, which the backend samples where the pass opens
and closes — sets a full-target viewport and scissor, runs the body and
closes the pass. A PassKind::Copy is the exception twice over: its
body runs with no scope open at all, because that is the only place the
seam permits a copy, and having no scope it has no boundary to time.
Finally emits the barriers that return
imported resources to their required states, and tells pool what this
frame left each physical transient in — which is what the next frame’s
first barrier uses as its source scope.
pool must be the one RenderGraph::compile was given, or the
barriers name states the resources are not in.
The encoder is left outside any pass, with nothing to clean up.
§Errors
GraphError::Hal if the pool could not create a transient. Nothing
else can fail here — everything checkable was checked at compile time.