FRDGBuilder

Use the render graph builder to build up a graph of passes and then call [Execute()](API\Runtime\RenderCore\FRDGBuilder\Execute) to process them.

Windows
MacOS
Linux

References

Module

RenderCore

Header

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

Include

#include "RenderGraphBuilder.h"

Syntax

class FRDGBuilder

Remarks

Use the render graph builder to build up a graph of passes and then call Execute() to process them. Resource barriers and lifetimes are derived from RDG parameters in the pass parameter struct provided to each AddPass call. The resulting graph is compiled, culled, and executed in Execute(). The builder should be created on the stack and executed prior to destruction.

Variables

Name Description

Public variable

FRDGBlackboard

 

Blackboard

The blackboard used to hold common data tied to the graph lifetime.

Public variable

FRHICommandList...

 

RHICmdList

The RHI command list used for the render graph.

Constructors

Name Description

Public function

FRDGBuilder

(
    const FRDGBuilder&
)

Public function

FRDGBuilder

(
    FRHICommandListImmediate& InRHICmd...,
    FRDGEventName InName,
    const char* UnaccountedCSVStat
)

Functions

Name Description

Public function

FRDGPassRef

 

AddPass

(
    FRDGEventName&& Name,
    const ParameterStructType* Par...,
    ERDGPassFlags Flags,
    ExecuteLambdaType&& ExecuteLambda
)

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

Public function

FRDGPassRef

 

AddPass

(
    FRDGEventName&& Name,
    ERDGPassFlags Flags,
    ExecuteLambdaType&& ExecuteLambda
)

Adds a lambda pass to the graph without any parameters.

Public function

void *

 

Alloc

(
    uint32 SizeInBytes,
    uint32 AlignInBytes
)

Allocates raw memory using an allocator tied to the lifetime of the graph.

Public function

ObjectType &...

 

AllocObject

(
    TArgs&&... Args
)

Allocates a C++ object using an allocator tied to the lifetime of the graph.

Public function

ParameterStr...

 

AllocParameters()

Allocates a parameter struct with a lifetime tied to graph execution.

Public function

PODType *...

 

AllocPOD()

Allocates POD memory using an allocator tied to the lifetime of the graph.

Public function

FRDGBufferRe...

 

CreateBuffer

(
    const FRDGBufferDesc& Desc,
    const TCHAR* Name,
    ERDGBufferFlags Flags
)

Create graph tracked buffer from a descriptor.

Public function

FRDGBufferSR...

 

CreateSRV

(
    FRDGBufferRef Buffer,
    EPixelFormat Format
)

Public function

FRDGBufferSR...

 

CreateSRV

(
    const FRDGBufferSRVDesc& Desc
)

Create graph tracked SRV for a buffer from a descriptor.

Public function

FRDGTextureS...

 

CreateSRV

(
    const FRDGTextureSRVDesc& Desc
)

Create graph tracked SRV for a texture from a descriptor.

Public function

FRDGTextureR...

 

CreateTexture

(
    const FRDGTextureDesc& Desc,
    const TCHAR* Name,
    ERDGTextureFlags Flags
)

Create graph tracked texture from a descriptor.

Public function

FRDGBufferUA...

 

CreateUAV

(
    const FRDGBufferUAVDesc& Desc,
    ERDGUnorderedAccessViewFlags Flags
)

Create graph tracked UAV for a buffer from a descriptor.

Public function

FRDGBufferUA...

 

CreateUAV

(
    FRDGBufferRef Buffer,
    EPixelFormat Format,
    ERDGUnorderedAccessViewFlags Flags
)

Public function

FRDGTextureU...

 

CreateUAV

(
    FRDGTextureRef Texture,
    ERDGUnorderedAccessViewFlags Flags
)

Public function

FRDGTextureU...

 

CreateUAV

(
    const FRDGTextureUAVDesc& Desc,
    ERDGUnorderedAccessViewFlags Flags
)

Create graph tracked UAV for a texture from a descriptor.

Public function

TRDGUniformB...

 

CreateUniformBuffer

(
    ParameterStructType* Parameter...
)

Creates a graph tracked uniform buffer which can be attached to passes.

Public function

void

 

Execute()

Executes the queued passes, managing setting of render targets (RHI RenderPasses), resource transitions and queued texture extraction.

Public function Const

FRDGTextureR...

 

FindExternalTexture

(
    IPooledRenderTarget* ExternalP...,
    ERenderTargetTexture Texture
)

Finds an RDG texture associated with the external texture, or returns null if none is found.

Public function Const

FRDGTextureR...

 

FindExternalTexture

(
    FRHITexture* Texture
)

Finds an RDG texture associated with the external texture, or returns null if none is found.

Public function Const

const TRefCo...

 

GetPooledBuffer

(
    FRDGBufferRef Buffer
)

Performs an immediate query for the underlying pooled buffer.

Public function Const

const TRefCo...

 

GetPooledTexture

(
    FRDGTextureRef Texture
)

Performs an immediate query for the underlying pooled texture.

Public function

void

 

PreallocateBuffer

(
    FRDGBufferRef Buffer
)

Public function

void

 

PreallocateTexture

(
    FRDGTextureRef Texture
)

For graph-created resources, this forces immediate allocation of the underlying pooled resource, effectively promoting it to an external resource.

Public function

void

 

QueueBufferExtraction

(
    FRDGBufferRef Buffer,
    TRefCountPtr< FRDGPooledBuffer >&#...
)

Queues a pooled buffer extraction to happen at the end of graph execution.

Public function

void

 

QueueBufferExtraction

(
    FRDGBufferRef Buffer,
    TRefCountPtr< FRDGPooledBuffer >&#...,
    ERHIAccess AccessFinal
)

Queues a pooled buffer extraction to happen at the end of graph execution.

Public function

void

 

QueueTextureExtraction

(
    FRDGTextureRef Texture,
    TRefCountPtr< IPooledRenderTarget >...
)

Queues a pooled render target extraction to happen at the end of graph execution.

Public function

void

 

QueueTextureExtraction

(
    FRDGTextureRef Texture,
    TRefCountPtr< IPooledRenderTarget >...,
    ERHIAccess AccessFinal
)

Queues a pooled render target extraction to happen at the end of graph execution.

Public function

FRDGBufferRe...

 

RegisterExternalBuffer

(
    const TRefCountPtr< FRDGPooledBuffe...,
    ERDGBufferFlags Flags
)

Register a external buffer to be tracked by the render graph.

Public function

FRDGBufferRe...

 

RegisterExternalBuffer

(
    const TRefCountPtr< FRDGPooledBuffe...,
    ERDGBufferFlags Flags,
    ERHIAccess AccessFinal
)

Register a external buffer to be tracked by the render graph.

Public function

FRDGBufferRe...

 

RegisterExternalBuffer

(
    const TRefCountPtr< FRDGPooledBuffe...,
    const TCHAR* NameIfNotRegister...,
    ERDGBufferFlags Flags
)

Register an external buffer with a custom name.

Public function

FRDGTextureR...

 

RegisterExternalTexture

(
    const TRefCountPtr< IPooledRenderTa...,
    ERenderTargetTexture Texture,
    ERDGTextureFlags Flags
)

Registers a external pooled render target texture to be tracked by the render graph.

Public function

FRDGTextureR...

 

RegisterExternalTexture

(
    const TRefCountPtr< IPooledRenderTa...,
    const TCHAR* NameIfNotRegister...,
    ERenderTargetTexture RenderTargetTe...,
    ERDGTextureFlags Flags
)

Register an external texture with a custom name.

Public function

void

 

RemoveUnusedBufferWarning

(
    FRDGBufferRef Buffer
)

Flag a buffer that is produced by a pass but never used or extracted to not emit an 'unused' warning.

Public function

void

 

RemoveUnusedTextureWarning

(
    FRDGTextureRef Texture
)

Flag a texture that is produced by a pass but never used or extracted to not emit an 'unused' warning.

Public function

void

 

SetBufferAccessFinal

(
    FRDGBufferRef Buffer,
    ERHIAccess Access
)

Sets the access to transition to after execution.

Public function

void

 

SetTextureAccessFinal

(
    FRDGTextureRef Texture,
    ERHIAccess Access
)

Sets the access to transition to after execution.

Public function Static

void

 

TickPoolElements()

Per-frame update of the render graph resource pool.

Constants

Deprecated Functions

Name Description

Public function

void

 

QueueTextureExtraction

(
    FRDGTextureRef Texture,
    TRefCountPtr< IPooledRenderTarget >...,
    bool bTransitionToRead
)

QueueTextureExtraction with bTransitionToRead is deprecated; use the ERHIAccess variant instead.

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