Skip to main content

execute_layers

Function execute_layers 

Source
pub fn execute_layers<H: Hal>(
    ctx: &mut H::Context,
    recording: &Recording,
    images: &[&H::Texture],
    format: PixelFormat,
) -> Result<Transient<H>>
where H::Context: HalContext<Hal = H>,
Expand description

Render every pass except the root, returning the layer targets in order.

Split out from execute so that a caller who has to submit the root pass itself can still get the layers rendered. That is not a hypothetical: the root is the pass that lands in a presentable image, and presenting one means submitting it gated on the acquire and present semaphores — which is a different call from the one that renders offscreen and waits. Without this split, a frame with layers could be rendered offscreen and never presented.

The returned textures are the caller’s to destroy, and must outlive the submission that samples them.