/** * @import { FramePass } from '../platform/graphics/frame-pass.js' * @import { GraphicsDevice } from '../platform/graphics/graphics-device.js' * @import { RenderPass } from '../platform/graphics/render-pass.js' * @import { RenderTarget } from '../platform/graphics/render-target.js' */ /** * A frame graph represents a single rendering frame as a sequence of frame passes. * * @ignore */ export class FrameGraph { /** @type {FramePass[]} */ passes: FramePass[]; /** * Map used during frame graph compilation. It maps a render target to its previous occurrence. * * @type {Map} */ renderTargetMap: Map; /** * Active multi-view capture wrapper. When non-null, passes scheduled via * {@link FrameGraph#addPass} are appended as children of this wrapper instead of being * pushed directly into {@link FrameGraph#passes}. Set/cleared via * {@link FrameGraph#beginMultiView} / {@link FrameGraph#endMultiView}. * * @type {FramePassMultiView|null} */ multiview: FramePassMultiView | null; /** * Open a multi-view capture scope. Subsequent passes added through * {@link FrameGraph#addPass} are captured as children of a single * {@link FramePassMultiView} until {@link FrameGraph#endMultiView} is called. * * @param {GraphicsDevice} device - The graphics device used to construct the wrapper. */ beginMultiView(device: GraphicsDevice): void; /** * Close the multi-view capture scope. Pushes the wrapper into the frame graph passes * unless it captured no children (in which case it is dropped). * * A captured pass which does not render per view (see {@link FramePass#perView}), such as the * shadow pass of a directional light, or a compute pass executing before the views, is moved * out of the wrapper ahead of it, so it renders once before all the views. This is not done when another such pass of the scope renders to * the same target, such as the shadow passes of a light shared by several cameras rendered in * the scope. Each of those renders the target for the passes following it, and so keeps its * place between them, rendering per view. */ endMultiView(): void; /** * Returns true when another pass which does not render per view renders to the same target * as the pass. A pass without a target, such as a compute pass executing before the views, * shares none. * * @param {FramePass[]} passes - The passes of a multi-view capture scope. * @param {FramePass} pass - The pass to test. * @returns {boolean} True when the target is shared. * @private */ private _sharesTarget; /** * Add a frame pass to the frame, together with its before and after passes. A disabled pass * is skipped with all of them, and its {@link FramePass#frameUpdate} is not called. * * @param {FramePass} pass - The frame pass to add. */ addPass(pass: FramePass): void; reset(): void; compile(): void; /** * Run the frame-graph compile optimizations (store-on-no-clear, pass merging) over a flat list * of passes. * * @param {FramePass[]} passes - Passes to optimize. * @private */ private _compilePasses; render(device: any): void; } import type { FramePass } from '../platform/graphics/frame-pass.js'; import type { RenderTarget } from '../platform/graphics/render-target.js'; import type { RenderPass } from '../platform/graphics/render-pass.js'; import { FramePassMultiView } from './renderer/frame-pass-multi-view.js'; import type { GraphicsDevice } from '../platform/graphics/graphics-device.js';