FRDGBlackboard

The blackboard is a map of struct instances with a lifetime tied to a render graph allocator.

Windows
MacOS
Linux

References

Module

RenderCore

Header

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

Include

#include "RenderGraphBlackboard.h"

Syntax

class FRDGBlackboard

Remarks

The blackboard is a map of struct instances with a lifetime tied to a render graph allocator. It is designed to solve cases where explicit marshaling of immutable data is undesirable. Structures are created once and the mutable reference is returned. Only the immutable version is accessible from the blackboard. This constraint on mutability is to discourage relying entirely on the blackboard. The mutable version should be marshaled around if needed. Good candidates for the blackboard would be data that is created once and immutably fetched across the entire renderer pipeline, where marshaling would create more maintenance burden than benefit. More constrained data structures should be marshaled through function calls instead.

Example of Usage:

class FMyStruct { public: FRDGTextureRef TextureA = nullptr; FRDGTextureRef TextureB = nullptr; FRDGTextureRef TextureC = nullptr; };

RDG_REGISTER_BLACKBOARD_STRUCT(FMyStruct);

static void InitStruct(FRDGBlackboard& GraphBlackboard) { auto& MyStruct = GraphBlackboard.Create<FMyStruct>();

static void UseStruct(const FRDGBlackboard& GraphBlackboard) { const auto& MyStruct = GraphBlackboard.GetChecked<FMyStruct>();

Constructors

Name Description

Public function

FRDGBlackboard

(
    FRDGAllocator& InAllocator
)

Public function

FRDGBlackboard

(
    FRDGBlackboard&&
)

Copy / Move not allowed.

Public function

FRDGBlackboard

(
    const FRDGBlackboard&
)

Functions

Name Description

Public function

void

 

Clear()

Public function

StructType &

 

Create

(
    ArgsType&&... Args
)

Creates a new instance of a struct. Asserts if one already existed.

Public function Const

const Struct...

 

Get()

Gets an immutable instance of the struct. Returns null if not present in the blackboard.

Public function Const

const Struct...

 

GetChecked()

Gets an immutable instance of the struct. Asserts if not present in the blackboard.

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