Module |
|
Header |
/Engine/Source/Runtime/RenderCore/Public/RenderGraphBlackboard.h |
Include |
#include "RenderGraphBlackboard.h" |
class FRDGBlackboard
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>();
Name | Description | |
---|---|---|
|
FRDGBlackboard ( |
|
|
FRDGBlackboard ( |
Copy / Move not allowed. |
|
FRDGBlackboard ( |
Name | Description | ||
---|---|---|---|
|
Clear() |
||
|
StructType & |
Create ( |
Creates a new instance of a struct. Asserts if one already existed. |
|
const Struct... |
Get() |
Gets an immutable instance of the struct. Returns null if not present in the blackboard. |
|
const Struct... |
GetChecked() |
Gets an immutable instance of the struct. Asserts if not present in the blackboard. |