Files
UnrealEngineUWP/Engine/Source/Runtime/RenderCore/Private/RenderGraphBlackboard.cpp
zach bethel 7c55500b43 RDG refactors in preparation for scene render targets refactor.
- Added simple blackboard container.
 - Added support for checking if a resource has been produced within the graph.
 - Moved all RHI validation into user validation cpp file.
 - Fixed bug in graph producer compilation logic when switching to subresources.

#rb none

[CL 14766062 by zach bethel in ue5-main branch]
2020-11-17 17:04:48 -04:00

28 lines
655 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "RenderGraphBlackboard.h"
FString FRDGBlackboard::GetTypeName(const TCHAR* ClassName, const TCHAR* FileName, uint32 LineNumber)
{
return FString::Printf(TEXT("%s %s %d"), ClassName, FileName, LineNumber);
}
uint32 FRDGBlackboard::AllocateIndex(FString&& TypeName)
{
check(IsInRenderingThread());
static TMap<FString, uint32> StructMap;
static uint32 NextIndex = 0;
uint32 Result;
if (const uint32* FoundIndex = StructMap.Find(TypeName))
{
Result = *FoundIndex;
}
else
{
StructMap.Emplace(MoveTemp(TypeName), NextIndex);
Result = NextIndex;
NextIndex++;
}
return Result;
}