Runtime.Graphics.RenderGraph (Visera.Runtime.Graphics.RenderGraph)¶
Render graph: declarative passes and resource dependencies. Drives frame rendering. Pass execution receives a pass context (command list and render list); compile produces an executable that runs against FRenderContext.
FRDGPassContext¶
Per-pass execution context passed to each pass’s execute lambda.
| Member | Type | Description |
|---|---|---|
CommandList |
FRHICommandList& |
Command list for this frame. |
RenderList |
const FRenderList& |
Sorted batches (opaque/transparent); draw passes iterate this. |
FRenderGraph¶
AddPass(I_Name, I_Setup, I_Execute)— Adds a pass.I_NameisFName(e.g.EName::PresentTransition). Setup lambda configures reads/writes; execute lambda receivesFRDGPassContext(command list + render list).Compile(I_RHI)— Builds barriers and order; returns an executable.Execute(I_RenderContext)— Creates a command list fromI_RenderContext->RHI, runs all passes withFRenderContext(includingRenderList), then submits the command list. RequiresI_RenderContext->RenderListto be non-null.
Swap chain is identified by FRHISwapChainID (no separate type alias).
CullDeadPasses¶
Dead pass culling: removes passes whose outputs are never consumed by any live pass. Algorithm is O(N+E) reverse BFS (replacing the previous O(N³) fixed-point iteration):
- Build a ResourceWriters map (resource → node indices that write it).
- Seed the alive set with nodes that write to external resources (back buffer, cached textures).
- BFS backwards: for each alive node’s reads, mark all writers of that resource alive. Passes not reached are removed.