FRDGBuilder::AddPass

Adds a lambda pass to the graph with an accompanied pass parameter struct.

Windows
MacOS
Linux

References

Module

RenderCore

Header

/Engine/Source/Runtime/RenderCore/Public/RenderGraphBuilder.h

Include

#include "RenderGraphBuilder.h"

Source

/Engine/Source/Runtime/RenderCore/Public/RenderGraphBuilder.inl

Syntax

template<typename ParameterStructType, typename ExecuteLambdaType>
FRDGPassRef AddPass
(
    FRDGEventName && Name,
    const ParameterStructType * ParameterStruct,
    ERDGPassFlags Flags,
    ExecuteLambdaType && ExecuteLambda
)

Remarks

Adds a lambda pass to the graph with an accompanied pass parameter struct.

RDG resources declared in the struct (via _RDG parameter macros) are safe to access in the lambda. The pass parameter struct should be allocated by AllocParameters(), and once passed in, should not be mutated. It is safe to provide the same parameter struct to multiple passes, so long as it is kept immutable. The lambda is deferred until execution unless the immediate debug mode is enabled. All lambda captures should assume deferral of execution.

The lambda must include a single RHI command list as its parameter. The exact type of command list depends on the workload. For example, use FRHIComputeCommandList& for Compute / AsyncCompute workloads. Raster passes should use FRHICommandList&. Prefer not to use FRHICommandListImmediate& unless actually required.

Declare the type of GPU workload (i.e. Copy, Compute / AsyncCompute, Graphics) to the pass via the Flags argument. This is used to determine async compute regions, render pass setup / merging, RHI transition accesses, etc. Other flags exist for specialized purposes, like forcing a pass to never be culled (NeverCull). See ERDGPassFlags for more info.

The pass name is used by debugging / profiling tools.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss