2019-01-03 19:16:26 -05:00
|
|
|
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
|
|
|
|
|
#include "RenderGraphBuilder.h"
|
|
|
|
|
#include "RenderCore.h"
|
|
|
|
|
#include "RenderTargetPool.h"
|
2018-10-22 23:01:29 -04:00
|
|
|
#include "RenderGraphResourcePool.h"
|
2018-11-21 20:22:47 -05:00
|
|
|
#include "VisualizeTexture.h"
|
2019-04-12 10:05:47 -04:00
|
|
|
#include "ProfilingDebugging/CsvProfiler.h"
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
|
|
|
|
|
#if RENDER_GRAPH_DEBUGGING
|
|
|
|
|
|
|
|
|
|
static int32 GRenderGraphImmediateMode = 0;
|
|
|
|
|
static FAutoConsoleVariableRef CVarImmediateMode(
|
2018-12-18 21:41:17 -05:00
|
|
|
TEXT("r.RDG.ImmediateMode"),
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
GRenderGraphImmediateMode,
|
2018-12-18 21:41:17 -05:00
|
|
|
TEXT("Executes passes as they get created. Useful to have a callstack of the wiring code when crashing in the pass' lambda."),
|
|
|
|
|
ECVF_RenderThreadSafe);
|
|
|
|
|
|
2019-02-04 10:14:58 -05:00
|
|
|
static int32 GRenderGraphEmitWarnings = 0;
|
2018-12-18 21:41:17 -05:00
|
|
|
static FAutoConsoleVariableRef CVarEmitWarnings(
|
|
|
|
|
TEXT("r.RDG.EmitWarnings"),
|
|
|
|
|
GRenderGraphEmitWarnings,
|
2019-01-16 16:12:36 -05:00
|
|
|
TEXT("Allow to output warnings for inefficiencies found during wiring and execution of the passes.\n")
|
|
|
|
|
TEXT(" 0: disabled;\n")
|
|
|
|
|
TEXT(" 1: emit warning once (default);\n")
|
|
|
|
|
TEXT(" 2: emit warning everytime issue is detected."),
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
ECVF_RenderThreadSafe);
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
static const int32 GRenderGraphImmediateMode = 0;
|
2018-12-18 21:41:17 -05:00
|
|
|
static const int32 GRenderGraphEmitWarnings = 0;
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
2018-12-18 21:41:17 -05:00
|
|
|
void InitRenderGraph()
|
|
|
|
|
{
|
|
|
|
|
#if RENDER_GRAPH_DEBUGGING && WITH_ENGINE
|
|
|
|
|
if (FParse::Param(FCommandLine::Get(), TEXT("rdgimmediate")))
|
|
|
|
|
{
|
|
|
|
|
GRenderGraphImmediateMode = 1;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-16 15:48:28 -05:00
|
|
|
static void EmitRenderGraphWarning(const FString& WarningMessage)
|
|
|
|
|
{
|
|
|
|
|
check(GRenderGraphEmitWarnings);
|
2019-01-16 16:12:36 -05:00
|
|
|
|
2019-01-16 15:48:28 -05:00
|
|
|
static TSet<FString> GAlreadyEmittedWarnings;
|
2019-01-16 16:12:36 -05:00
|
|
|
|
|
|
|
|
if (GRenderGraphEmitWarnings == 2)
|
|
|
|
|
{
|
|
|
|
|
UE_LOG(LogRendererCore, Warning, TEXT("%s"), *WarningMessage);
|
|
|
|
|
}
|
|
|
|
|
else if (!GAlreadyEmittedWarnings.Contains(WarningMessage))
|
2019-01-16 15:48:28 -05:00
|
|
|
{
|
|
|
|
|
GAlreadyEmittedWarnings.Add(WarningMessage);
|
|
|
|
|
UE_LOG(LogRendererCore, Warning, TEXT("%s"), *WarningMessage);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#define EmitRenderGraphWarningf(WarningMessageFormat, ...) \
|
|
|
|
|
EmitRenderGraphWarning(FString::Printf(WarningMessageFormat, ##__VA_ARGS__));
|
2018-12-11 13:44:34 -05:00
|
|
|
|
|
|
|
|
static bool IsBoundAsReadable(const FRDGTexture* Texture, FShaderParameterStructRef ParameterStruct)
|
|
|
|
|
{
|
2018-12-18 21:41:17 -05:00
|
|
|
for (int ResourceIndex = 0, Num = ParameterStruct.Layout->Resources.Num(); ResourceIndex < Num; ResourceIndex++)
|
2018-12-11 13:44:34 -05:00
|
|
|
{
|
2018-12-18 21:41:17 -05:00
|
|
|
EUniformBufferBaseType Type = ParameterStruct.Layout->Resources[ResourceIndex].MemberType;
|
|
|
|
|
uint16 Offset = ParameterStruct.Layout->Resources[ResourceIndex].MemberOffset;
|
2018-12-11 13:44:34 -05:00
|
|
|
|
|
|
|
|
switch (Type)
|
|
|
|
|
{
|
2019-01-04 14:52:46 -05:00
|
|
|
case UBMT_RDG_TEXTURE:
|
2018-12-11 13:44:34 -05:00
|
|
|
{
|
|
|
|
|
const FRDGTexture* InputTexture = *ParameterStruct.GetMemberPtrAtOffset<const FRDGTexture*>(Offset);
|
|
|
|
|
if (Texture == InputTexture)
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2019-01-04 14:52:46 -05:00
|
|
|
case UBMT_RDG_TEXTURE_SRV:
|
2018-12-11 13:44:34 -05:00
|
|
|
{
|
|
|
|
|
const FRDGTextureSRV* InputSRV = *ParameterStruct.GetMemberPtrAtOffset<const FRDGTextureSRV*>(Offset);
|
|
|
|
|
if (InputSRV && Texture == InputSRV->Desc.Texture)
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2018-11-21 20:33:41 -05:00
|
|
|
#if RENDER_GRAPH_DRAW_EVENTS == 2
|
|
|
|
|
|
|
|
|
|
FRDGEventName::FRDGEventName(const TCHAR* EventFormat, ...)
|
|
|
|
|
{
|
|
|
|
|
if (GetEmitDrawEvents())
|
|
|
|
|
{
|
|
|
|
|
va_list ptr;
|
|
|
|
|
va_start(ptr, EventFormat);
|
|
|
|
|
TCHAR TempStr[256];
|
|
|
|
|
// Build the string in the temp buffer
|
2019-01-23 17:01:56 -05:00
|
|
|
FCString::GetVarArgs(TempStr, ARRAY_COUNT(TempStr), EventFormat, ptr);
|
|
|
|
|
va_end(ptr);
|
2018-11-21 20:33:41 -05:00
|
|
|
|
|
|
|
|
EventName = TempStr;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
2018-10-22 14:28:32 -04:00
|
|
|
void FRDGBuilder::Execute()
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
2019-04-12 10:05:47 -04:00
|
|
|
CSV_SCOPED_TIMING_STAT_EXCLUSIVE(FRDGBuilder_Execute);
|
2018-10-21 16:35:13 -04:00
|
|
|
#if RENDER_GRAPH_DEBUGGING
|
|
|
|
|
{
|
2019-01-22 02:15:37 -05:00
|
|
|
/** The usage need RDG_EVENT_SCOPE() needs to happen in inner scope of the one containing FRDGBuilder because of
|
|
|
|
|
* FStackRDGEventScopeRef's destructor modifying this FRDGBuilder instance.
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* FRDGBuilder GraphBuilder(RHICmdList);
|
|
|
|
|
* {
|
|
|
|
|
* RDG_EVENT_SCOPE(GraphBuilder, "MyEventScope");
|
|
|
|
|
* // ...
|
|
|
|
|
* }
|
|
|
|
|
* GraphBuilder.Execute();
|
|
|
|
|
*/
|
2018-11-21 20:33:41 -05:00
|
|
|
checkf(CurrentScope == nullptr, TEXT("Render graph needs to have all scopes ended to execute."));
|
|
|
|
|
|
2019-01-22 02:15:37 -05:00
|
|
|
checkf(!bHasExecuted, TEXT("Render graph execution should only happen once to ensure consistency with immediate mode."));
|
2019-02-14 14:23:27 -05:00
|
|
|
|
|
|
|
|
/** FRDGBuilder::AllocParameters() allocates shader parameter structure for the life time until pass execution.
|
|
|
|
|
* But they are allocated on a FMemStack for CPU performance reason, and have their destructor called right after
|
|
|
|
|
* the pass execution. Therefore allocating pass parameter unused by a FRDGBuilder::AddPass() can lead on a memory
|
|
|
|
|
* leak of RHI resource that have been reference in the parameter structure.
|
|
|
|
|
*/
|
|
|
|
|
checkf(
|
|
|
|
|
AllocatedUnusedPassParameters.Num() == 0,
|
|
|
|
|
TEXT("%i pass parameter structure has been allocated with FRDGBuilder::AllocParameters(), but has not be used by a ")
|
|
|
|
|
TEXT("FRDGBuilder::AddPass() that can cause RHI resource leak."), AllocatedUnusedPassParameters.Num());
|
2018-10-21 16:35:13 -04:00
|
|
|
}
|
|
|
|
|
#endif
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
|
|
|
|
|
if (!GRenderGraphImmediateMode)
|
|
|
|
|
{
|
|
|
|
|
WalkGraphDependencies();
|
|
|
|
|
|
2018-10-22 14:28:32 -04:00
|
|
|
QUICK_SCOPE_CYCLE_COUNTER(STAT_FRDGBuilder_Execute);
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
for (const FRenderGraphPass* Pass : Passes)
|
|
|
|
|
{
|
|
|
|
|
ExecutePass(Pass);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-21 20:33:41 -05:00
|
|
|
// Pops remaining scopes
|
2019-01-24 14:01:53 -05:00
|
|
|
if (RENDER_GRAPH_DRAW_EVENTS)
|
2018-11-21 20:33:41 -05:00
|
|
|
{
|
2019-01-24 14:01:53 -05:00
|
|
|
if (GetEmitDrawEvents())
|
2018-11-21 20:33:41 -05:00
|
|
|
{
|
2019-01-24 14:01:53 -05:00
|
|
|
for (int32 i = 0; i < kMaxScopeCount; i++)
|
|
|
|
|
{
|
|
|
|
|
if (!ScopesStack[i])
|
|
|
|
|
break;
|
|
|
|
|
RHICmdList.PopEvent();
|
|
|
|
|
}
|
2018-11-21 20:33:41 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
ProcessDeferredInternalResourceQueries();
|
|
|
|
|
|
|
|
|
|
DestructPasses();
|
|
|
|
|
|
2018-10-21 16:35:13 -04:00
|
|
|
#if RENDER_GRAPH_DEBUGGING
|
|
|
|
|
{
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
bHasExecuted = true;
|
2018-10-21 16:35:13 -04:00
|
|
|
}
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-22 14:28:32 -04:00
|
|
|
void FRDGBuilder::DebugPass(const FRenderGraphPass* Pass)
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
2018-12-18 21:41:17 -05:00
|
|
|
#if RENDER_GRAPH_DEBUGGING
|
|
|
|
|
// Verify all the settings of the pass make sense.
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
ValidatePass(Pass);
|
|
|
|
|
|
2018-12-18 21:41:17 -05:00
|
|
|
// Executes the pass immediatly as they get added mode, to have callstack of wiring code when crashing within the pass.
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
if (GRenderGraphImmediateMode)
|
|
|
|
|
{
|
|
|
|
|
ExecutePass(Pass);
|
|
|
|
|
}
|
2018-12-18 21:41:17 -05:00
|
|
|
#endif
|
2018-11-21 20:22:47 -05:00
|
|
|
|
2018-12-18 21:41:17 -05:00
|
|
|
#if WITH_ENGINE && SUPPORTS_VISUALIZE_TEXTURE
|
2018-11-21 20:22:47 -05:00
|
|
|
// If visualizing a texture, look for any output of the pass. This must be done after the
|
2018-12-18 21:41:17 -05:00
|
|
|
// GRenderGraphImmediateMode's ExecutePass() because this will actually create a capturing
|
2018-11-21 20:22:47 -05:00
|
|
|
// pass if needed that would have to be executed right away as well.
|
|
|
|
|
if (GVisualizeTexture.bEnabled)
|
|
|
|
|
{
|
|
|
|
|
CaptureAnyInterestingPassOutput(Pass);
|
|
|
|
|
}
|
2018-12-18 21:41:17 -05:00
|
|
|
#endif
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
}
|
|
|
|
|
|
2018-10-22 14:28:32 -04:00
|
|
|
void FRDGBuilder::ValidatePass(const FRenderGraphPass* Pass) const
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
2018-12-18 21:41:17 -05:00
|
|
|
#if RENDER_GRAPH_DEBUGGING
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
FRenderTargetBindingSlots* RESTRICT RenderTargets = nullptr;
|
|
|
|
|
FShaderParameterStructRef ParameterStruct = Pass->GetParameters();
|
|
|
|
|
|
|
|
|
|
bool bIsCompute = Pass->IsCompute();
|
|
|
|
|
bool bCanUseUAVs = bIsCompute;
|
|
|
|
|
bool bRequiresRenderTargetSlots = !bIsCompute;
|
|
|
|
|
|
|
|
|
|
for (int ResourceIndex = 0, Num = ParameterStruct.Layout->Resources.Num(); ResourceIndex < Num; ResourceIndex++)
|
|
|
|
|
{
|
2018-12-18 21:41:17 -05:00
|
|
|
EUniformBufferBaseType Type = ParameterStruct.Layout->Resources[ResourceIndex].MemberType;
|
|
|
|
|
uint16 Offset = ParameterStruct.Layout->Resources[ResourceIndex].MemberOffset;
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
|
|
|
|
|
switch (Type)
|
|
|
|
|
{
|
2019-01-07 14:44:04 -05:00
|
|
|
case UBMT_RDG_TEXTURE:
|
|
|
|
|
{
|
|
|
|
|
FRDGTexture* RESTRICT Texture = *ParameterStruct.GetMemberPtrAtOffset<FRDGTexture*>(Offset);
|
|
|
|
|
checkf(!Texture || Texture->bHasEverBeenProduced,
|
|
|
|
|
TEXT("Pass %s has a dependency over the texture %s that has never been produced."),
|
|
|
|
|
Pass->GetName(), Texture->Name);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case UBMT_RDG_TEXTURE_SRV:
|
|
|
|
|
{
|
|
|
|
|
FRDGTextureSRV* RESTRICT SRV = *ParameterStruct.GetMemberPtrAtOffset<FRDGTextureSRV*>(Offset);
|
|
|
|
|
if (SRV)
|
|
|
|
|
{
|
|
|
|
|
checkf(SRV->Desc.Texture->bHasEverBeenProduced,
|
|
|
|
|
TEXT("Pass %s has a dependency over the texture %s that has never been produced."),
|
|
|
|
|
Pass->GetName(), SRV->Desc.Texture->Name);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2019-01-04 14:52:46 -05:00
|
|
|
case UBMT_RDG_TEXTURE_UAV:
|
2019-01-07 14:44:04 -05:00
|
|
|
{
|
|
|
|
|
FRDGTextureUAV* RESTRICT UAV = *ParameterStruct.GetMemberPtrAtOffset<FRDGTextureUAV*>(Offset);
|
|
|
|
|
if (UAV)
|
|
|
|
|
{
|
2019-01-15 19:57:23 -05:00
|
|
|
if (!UAV->Desc.Texture->bHasEverBeenProduced)
|
|
|
|
|
{
|
|
|
|
|
UAV->Desc.Texture->bHasEverBeenProduced = true;
|
|
|
|
|
UAV->Desc.Texture->DebugFirstProducer = Pass;
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-07 14:44:04 -05:00
|
|
|
if (!bCanUseUAVs && GRenderGraphEmitWarnings)
|
|
|
|
|
{
|
2019-01-16 15:48:28 -05:00
|
|
|
EmitRenderGraphWarningf(
|
|
|
|
|
TEXT("UAV can only been bound to compute shaders, therefore UAV %s is certainly useless for pass %s."),
|
|
|
|
|
UAV->Name, Pass->GetName());
|
2019-01-07 14:44:04 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case UBMT_RDG_BUFFER:
|
|
|
|
|
{
|
|
|
|
|
FRDGBuffer* RESTRICT Buffer = *ParameterStruct.GetMemberPtrAtOffset<FRDGBuffer*>(Offset);
|
|
|
|
|
checkf(!Buffer || Buffer->bHasEverBeenProduced,
|
|
|
|
|
TEXT("Pass %s has a dependency over the buffer %s that has never been produced."),
|
|
|
|
|
Pass->GetName(), Buffer->Name);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case UBMT_RDG_BUFFER_SRV:
|
|
|
|
|
{
|
|
|
|
|
FRDGBufferSRV* RESTRICT SRV = *ParameterStruct.GetMemberPtrAtOffset<FRDGBufferSRV*>(Offset);
|
|
|
|
|
if (SRV)
|
|
|
|
|
{
|
|
|
|
|
checkf(SRV->Desc.Buffer->bHasEverBeenProduced,
|
|
|
|
|
TEXT("Pass %s has a dependency over the buffer %s that has never been produced."),
|
|
|
|
|
Pass->GetName(), SRV->Desc.Buffer->Name);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2019-01-04 14:52:46 -05:00
|
|
|
case UBMT_RDG_BUFFER_UAV:
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
2019-01-07 14:44:04 -05:00
|
|
|
FRDGBufferUAV* RESTRICT UAV = *ParameterStruct.GetMemberPtrAtOffset<FRDGBufferUAV*>(Offset);
|
|
|
|
|
if (UAV)
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
2019-01-15 19:57:23 -05:00
|
|
|
if (!UAV->Desc.Buffer->bHasEverBeenProduced)
|
|
|
|
|
{
|
|
|
|
|
UAV->Desc.Buffer->bHasEverBeenProduced = true;
|
|
|
|
|
UAV->Desc.Buffer->DebugFirstProducer = Pass;
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-07 14:44:04 -05:00
|
|
|
if (!bCanUseUAVs && GRenderGraphEmitWarnings)
|
|
|
|
|
{
|
2019-01-16 15:48:28 -05:00
|
|
|
EmitRenderGraphWarningf(
|
|
|
|
|
TEXT("UAV can only been bound to compute shaders, therefore UAV %s is certainly useless for pass %s."),
|
|
|
|
|
UAV->Name, Pass->GetName());
|
2019-01-07 14:44:04 -05:00
|
|
|
}
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case UBMT_RENDER_TARGET_BINDING_SLOTS:
|
|
|
|
|
{
|
2018-12-18 21:41:17 -05:00
|
|
|
if (!RenderTargets)
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
|
|
|
|
RenderTargets = ParameterStruct.GetMemberPtrAtOffset<FRenderTargetBindingSlots>(Offset);
|
|
|
|
|
}
|
2018-12-18 21:41:17 -05:00
|
|
|
else if (GRenderGraphEmitWarnings)
|
|
|
|
|
{
|
2019-01-16 15:48:28 -05:00
|
|
|
EmitRenderGraphWarningf(
|
|
|
|
|
TEXT("Pass %s have duplicated render target binding slots."),
|
|
|
|
|
Pass->GetName());
|
2018-12-18 21:41:17 -05:00
|
|
|
}
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (RenderTargets)
|
|
|
|
|
{
|
|
|
|
|
checkf(bRequiresRenderTargetSlots, TEXT("Render pass %s does not need render target binging slots"), Pass->GetName());
|
|
|
|
|
|
2018-12-11 13:44:34 -05:00
|
|
|
const bool bGeneratingMips = (Pass->GetFlags() & ERenderGraphPassFlags::GenerateMips) == ERenderGraphPassFlags::GenerateMips;
|
|
|
|
|
bool bFoundRTBound = false;
|
|
|
|
|
|
2019-01-07 14:44:04 -05:00
|
|
|
int32 NumRenderTargets = 0;
|
|
|
|
|
for (int32 i = 0; i < RenderTargets->Output.Num(); i++)
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
|
|
|
|
const FRenderTargetBinding& RenderTarget = RenderTargets->Output[i];
|
2019-01-07 14:44:04 -05:00
|
|
|
const FRDGTexture* Texture = RenderTarget.GetTexture();
|
|
|
|
|
|
|
|
|
|
if (!Texture)
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
|
|
|
|
NumRenderTargets = i;
|
|
|
|
|
break;
|
|
|
|
|
}
|
2019-01-07 14:44:04 -05:00
|
|
|
|
|
|
|
|
if (!Texture->bHasEverBeenProduced)
|
|
|
|
|
{
|
|
|
|
|
checkf(RenderTarget.GetLoadAction() != ERenderTargetLoadAction::ELoad,
|
|
|
|
|
TEXT("Can't load a render target %s that has never been produced."),
|
|
|
|
|
RenderTarget.GetTexture()->Name);
|
|
|
|
|
|
|
|
|
|
// TODO(RDG): should only be done when there is a store action.
|
2019-01-15 19:57:23 -05:00
|
|
|
if (!Texture->bHasEverBeenProduced)
|
|
|
|
|
{
|
|
|
|
|
Texture->bHasEverBeenProduced = true;
|
|
|
|
|
Texture->DebugFirstProducer = Pass;
|
|
|
|
|
}
|
2019-01-07 14:44:04 -05:00
|
|
|
}
|
|
|
|
|
|
2018-12-11 13:44:34 -05:00
|
|
|
bFoundRTBound = bFoundRTBound || IsBoundAsReadable(RenderTarget.GetTexture(), ParameterStruct);
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
}
|
2019-01-07 14:44:04 -05:00
|
|
|
for (int32 i = NumRenderTargets; i < RenderTargets->Output.Num(); i++)
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
|
|
|
|
const FRenderTargetBinding& RenderTarget = RenderTargets->Output[i];
|
|
|
|
|
checkf(RenderTarget.GetTexture() == nullptr, TEXT("Render targets must be packed. No empty spaces in the array."));
|
|
|
|
|
}
|
2018-12-11 13:44:34 -05:00
|
|
|
ensureMsgf(!bGeneratingMips || bFoundRTBound, TEXT("GenerateMips enabled but no RT found as source!"));
|
2019-01-07 14:44:04 -05:00
|
|
|
|
|
|
|
|
const FRDGTexture* Texture = RenderTargets->DepthStencil.Texture;
|
|
|
|
|
if (Texture && !Texture->bHasEverBeenProduced)
|
|
|
|
|
{
|
|
|
|
|
checkf(RenderTargets->DepthStencil.DepthLoadAction != ERenderTargetLoadAction::ELoad,
|
|
|
|
|
TEXT("Can't load depth from a render target that has never been produced."));
|
|
|
|
|
checkf(RenderTargets->DepthStencil.StencilLoadAction != ERenderTargetLoadAction::ELoad,
|
|
|
|
|
TEXT("Can't load stencil from a render target that has never been produced."));
|
|
|
|
|
|
|
|
|
|
// TODO(RDG): should only be done when there is a store action.
|
2019-01-15 19:57:23 -05:00
|
|
|
if (!Texture->bHasEverBeenProduced)
|
|
|
|
|
{
|
|
|
|
|
Texture->bHasEverBeenProduced = true;
|
|
|
|
|
Texture->DebugFirstProducer = Pass;
|
|
|
|
|
}
|
2019-01-07 14:44:04 -05:00
|
|
|
}
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
checkf(!bRequiresRenderTargetSlots, TEXT("Render pass %s requires render target binging slots"), Pass->GetName());
|
|
|
|
|
}
|
2019-01-21 20:08:38 -05:00
|
|
|
#endif // RENDER_GRAPH_DEBUGGING
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
}
|
|
|
|
|
|
2018-11-21 20:22:47 -05:00
|
|
|
void FRDGBuilder::CaptureAnyInterestingPassOutput(const FRenderGraphPass* Pass)
|
|
|
|
|
{
|
2018-12-18 21:41:17 -05:00
|
|
|
#if SUPPORTS_VISUALIZE_TEXTURE
|
2018-11-21 20:22:47 -05:00
|
|
|
FShaderParameterStructRef ParameterStruct = Pass->GetParameters();
|
|
|
|
|
for (int ResourceIndex = 0, Num = ParameterStruct.Layout->Resources.Num(); ResourceIndex < Num; ResourceIndex++)
|
|
|
|
|
{
|
2018-12-18 21:41:17 -05:00
|
|
|
EUniformBufferBaseType Type = ParameterStruct.Layout->Resources[ResourceIndex].MemberType;
|
|
|
|
|
uint16 Offset = ParameterStruct.Layout->Resources[ResourceIndex].MemberOffset;
|
2018-11-21 20:22:47 -05:00
|
|
|
|
|
|
|
|
switch (Type)
|
|
|
|
|
{
|
2019-01-04 14:52:46 -05:00
|
|
|
case UBMT_RDG_TEXTURE_UAV:
|
2018-11-21 20:22:47 -05:00
|
|
|
{
|
|
|
|
|
FRDGTextureUAV* RESTRICT UAV = *ParameterStruct.GetMemberPtrAtOffset<FRDGTextureUAV*>(Offset);
|
|
|
|
|
if (UAV && GVisualizeTexture.ShouldCapture(UAV->Desc.Texture->Name))
|
|
|
|
|
{
|
|
|
|
|
GVisualizeTexture.CreateContentCapturePass(*this, UAV->Desc.Texture);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case UBMT_RENDER_TARGET_BINDING_SLOTS:
|
|
|
|
|
{
|
|
|
|
|
FRenderTargetBindingSlots* RESTRICT RenderTargets = ParameterStruct.GetMemberPtrAtOffset<FRenderTargetBindingSlots>(Offset);
|
|
|
|
|
if (RenderTargets->DepthStencil.Texture &&
|
|
|
|
|
(RenderTargets->DepthStencil.DepthStoreAction != ERenderTargetStoreAction::ENoAction || RenderTargets->DepthStencil.StencilStoreAction != ERenderTargetStoreAction::ENoAction) &&
|
|
|
|
|
GVisualizeTexture.ShouldCapture(RenderTargets->DepthStencil.Texture->Name))
|
|
|
|
|
{
|
|
|
|
|
GVisualizeTexture.CreateContentCapturePass(*this, RenderTargets->DepthStencil.Texture);
|
|
|
|
|
}
|
2019-01-07 14:44:04 -05:00
|
|
|
for (int32 i = 0; i < RenderTargets->Output.Num(); i++)
|
2018-11-21 20:22:47 -05:00
|
|
|
{
|
|
|
|
|
const FRenderTargetBinding& RenderTarget = RenderTargets->Output[i];
|
|
|
|
|
if (RenderTarget.GetTexture() &&
|
|
|
|
|
RenderTarget.GetStoreAction() != ERenderTargetStoreAction::ENoAction &&
|
|
|
|
|
GVisualizeTexture.ShouldCapture(RenderTarget.GetTexture()->Name))
|
|
|
|
|
{
|
|
|
|
|
GVisualizeTexture.CreateContentCapturePass(*this, RenderTarget.GetTexture());
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-12-18 21:41:17 -05:00
|
|
|
#endif // SUPPORTS_VISUALIZE_TEXTURE
|
2018-11-21 20:22:47 -05:00
|
|
|
}
|
|
|
|
|
|
2018-10-22 14:28:32 -04:00
|
|
|
void FRDGBuilder::WalkGraphDependencies()
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
|
|
|
|
for (const FRenderGraphPass* Pass : Passes)
|
|
|
|
|
{
|
|
|
|
|
FShaderParameterStructRef ParameterStruct = Pass->GetParameters();
|
|
|
|
|
|
2018-10-22 14:28:32 -04:00
|
|
|
/** Increments all the FRDGResource::ReferenceCount. */
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
for (int ResourceIndex = 0, Num = ParameterStruct.Layout->Resources.Num(); ResourceIndex < Num; ResourceIndex++)
|
|
|
|
|
{
|
2018-12-18 21:41:17 -05:00
|
|
|
EUniformBufferBaseType Type = ParameterStruct.Layout->Resources[ResourceIndex].MemberType;
|
|
|
|
|
uint16 Offset = ParameterStruct.Layout->Resources[ResourceIndex].MemberOffset;
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
|
|
|
|
|
switch (Type)
|
|
|
|
|
{
|
2019-01-04 14:52:46 -05:00
|
|
|
case UBMT_RDG_TEXTURE:
|
|
|
|
|
case UBMT_RDG_BUFFER:
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
2018-10-22 23:01:29 -04:00
|
|
|
FRDGResource* RESTRICT Resource = *ParameterStruct.GetMemberPtrAtOffset<FRDGResource*>(Offset);
|
|
|
|
|
if (Resource)
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
2018-10-22 23:01:29 -04:00
|
|
|
Resource->ReferenceCount++;
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2019-01-04 14:52:46 -05:00
|
|
|
case UBMT_RDG_TEXTURE_SRV:
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
2018-10-22 14:28:32 -04:00
|
|
|
FRDGTextureSRV* RESTRICT SRV = *ParameterStruct.GetMemberPtrAtOffset<FRDGTextureSRV*>(Offset);
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
if (SRV)
|
|
|
|
|
{
|
|
|
|
|
SRV->Desc.Texture->ReferenceCount++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2019-01-04 14:52:46 -05:00
|
|
|
case UBMT_RDG_TEXTURE_UAV:
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
2018-10-22 14:28:32 -04:00
|
|
|
FRDGTextureUAV* RESTRICT UAV = *ParameterStruct.GetMemberPtrAtOffset<FRDGTextureUAV*>(Offset);
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
if (UAV)
|
|
|
|
|
{
|
|
|
|
|
UAV->Desc.Texture->ReferenceCount++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2019-01-04 14:52:46 -05:00
|
|
|
case UBMT_RDG_BUFFER_SRV:
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
|
|
|
|
FRDGBufferSRV* RESTRICT SRV = *ParameterStruct.GetMemberPtrAtOffset<FRDGBufferSRV*>(Offset);
|
|
|
|
|
if (SRV)
|
|
|
|
|
{
|
|
|
|
|
SRV->Desc.Buffer->ReferenceCount++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2019-01-04 14:52:46 -05:00
|
|
|
case UBMT_RDG_BUFFER_UAV:
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
|
|
|
|
FRDGBufferUAV* RESTRICT UAV = *ParameterStruct.GetMemberPtrAtOffset<FRDGBufferUAV*>(Offset);
|
|
|
|
|
if (UAV)
|
|
|
|
|
{
|
|
|
|
|
UAV->Desc.Buffer->ReferenceCount++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
case UBMT_RENDER_TARGET_BINDING_SLOTS:
|
|
|
|
|
{
|
|
|
|
|
FRenderTargetBindingSlots* RESTRICT RenderTargets = ParameterStruct.GetMemberPtrAtOffset<FRenderTargetBindingSlots>(Offset);
|
|
|
|
|
|
2019-01-07 14:44:04 -05:00
|
|
|
for (int32 i = 0; i < RenderTargets->Output.Num(); i++)
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
|
|
|
|
const FRenderTargetBinding& RenderTarget = RenderTargets->Output[i];
|
|
|
|
|
if (RenderTarget.GetTexture())
|
|
|
|
|
{
|
|
|
|
|
RenderTarget.GetTexture()->ReferenceCount++;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const FDepthStencilBinding& DepthStencil = RenderTargets->DepthStencil;
|
|
|
|
|
if (DepthStencil.Texture)
|
|
|
|
|
{
|
|
|
|
|
DepthStencil.Texture->ReferenceCount++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} // for (const FRenderGraphPass* Pass : Passes)
|
|
|
|
|
|
|
|
|
|
// Add additional dependencies from deferred queries.
|
|
|
|
|
for (const auto& Query : DeferredInternalTextureQueries)
|
|
|
|
|
{
|
|
|
|
|
Query.Texture->ReferenceCount++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Release external texture that have ReferenceCount == 0 and yet are already allocated.
|
|
|
|
|
for (auto Pair : AllocatedTextures)
|
|
|
|
|
{
|
|
|
|
|
if (Pair.Key->ReferenceCount == 0)
|
|
|
|
|
{
|
|
|
|
|
Pair.Value = nullptr;
|
|
|
|
|
Pair.Key->PooledRenderTarget = nullptr;
|
2019-01-15 19:57:23 -05:00
|
|
|
Pair.Key->CachedRHI.Resource = nullptr;
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-22 14:28:32 -04:00
|
|
|
void FRDGBuilder::AllocateRHITextureIfNeeded(const FRDGTexture* Texture, bool bComputePass)
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
|
|
|
|
check(Texture);
|
|
|
|
|
|
|
|
|
|
if (Texture->PooledRenderTarget)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
check(Texture->ReferenceCount > 0 || GRenderGraphImmediateMode);
|
|
|
|
|
|
|
|
|
|
// TODO(RDG): should avoid bDoWritableBarrier = true
|
|
|
|
|
TRefCountPtr<IPooledRenderTarget>& PooledRenderTarget = AllocatedTextures.FindOrAdd(Texture);
|
|
|
|
|
GRenderTargetPool.FindFreeElement(RHICmdList, Texture->Desc, PooledRenderTarget, Texture->Name, /* bDoWritableBarrier = */ true);
|
|
|
|
|
|
|
|
|
|
Texture->PooledRenderTarget = PooledRenderTarget;
|
2018-12-18 21:41:17 -05:00
|
|
|
Texture->CachedRHI.Texture = PooledRenderTarget->GetRenderTargetItem().ShaderResourceTexture;
|
2019-01-15 19:57:23 -05:00
|
|
|
check(Texture->CachedRHI.Resource);
|
2018-10-22 23:01:29 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FRDGBuilder::AllocateRHITextureUAVIfNeeded(const FRDGTextureUAV* UAV, bool bComputePass)
|
|
|
|
|
{
|
|
|
|
|
check(UAV);
|
|
|
|
|
|
|
|
|
|
if (UAV->CachedRHI.UAV)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AllocateRHITextureIfNeeded(UAV->Desc.Texture, bComputePass);
|
|
|
|
|
|
|
|
|
|
UAV->CachedRHI.UAV = UAV->Desc.Texture->PooledRenderTarget->GetRenderTargetItem().MipUAVs[UAV->Desc.MipLevel];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FRDGBuilder::AllocateRHIBufferSRVIfNeeded(const FRDGBufferSRV* SRV, bool bComputePass)
|
|
|
|
|
{
|
|
|
|
|
check(SRV);
|
|
|
|
|
|
|
|
|
|
if (SRV->CachedRHI.SRV)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
2019-01-15 19:57:23 -05:00
|
|
|
|
|
|
|
|
// The underlying buffer have already been allocated by a prior pass through AllocateRHIBufferUAVIfNeeded().
|
2019-01-21 20:08:38 -05:00
|
|
|
#if RENDER_GRAPH_DEBUGGING
|
|
|
|
|
{
|
|
|
|
|
check(SRV->Desc.Buffer->bHasEverBeenProduced);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2019-01-15 19:57:23 -05:00
|
|
|
check(SRV->Desc.Buffer->PooledBuffer);
|
2018-10-22 23:01:29 -04:00
|
|
|
|
|
|
|
|
if (SRV->Desc.Buffer->PooledBuffer->SRVs.Contains(SRV->Desc))
|
|
|
|
|
{
|
|
|
|
|
SRV->CachedRHI.SRV = SRV->Desc.Buffer->PooledBuffer->SRVs[SRV->Desc];
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FShaderResourceViewRHIRef RHIShaderResourceView;
|
|
|
|
|
|
|
|
|
|
if (SRV->Desc.Buffer->Desc.UnderlyingType == FRDGBufferDesc::EUnderlyingType::VertexBuffer)
|
|
|
|
|
{
|
|
|
|
|
RHIShaderResourceView = RHICreateShaderResourceView(SRV->Desc.Buffer->PooledBuffer->VertexBuffer, SRV->Desc.BytesPerElement, SRV->Desc.Format);
|
|
|
|
|
}
|
2018-10-23 16:44:28 -04:00
|
|
|
else if (SRV->Desc.Buffer->Desc.UnderlyingType == FRDGBufferDesc::EUnderlyingType::StructuredBuffer)
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
|
|
|
|
RHIShaderResourceView = RHICreateShaderResourceView(SRV->Desc.Buffer->PooledBuffer->StructuredBuffer);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
check(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SRV->CachedRHI.SRV = RHIShaderResourceView;
|
|
|
|
|
SRV->Desc.Buffer->PooledBuffer->SRVs.Add(SRV->Desc, RHIShaderResourceView);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FRDGBuilder::AllocateRHIBufferUAVIfNeeded(const FRDGBufferUAV* UAV, bool bComputePass)
|
|
|
|
|
{
|
|
|
|
|
check(UAV);
|
|
|
|
|
|
|
|
|
|
if (UAV->CachedRHI.UAV)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
2019-01-15 19:57:23 -05:00
|
|
|
|
|
|
|
|
FRDGBufferRef Buffer = UAV->Desc.Buffer;
|
2018-10-22 23:01:29 -04:00
|
|
|
|
2019-01-15 19:57:23 -05:00
|
|
|
// Allocate a buffer resource.
|
|
|
|
|
if (!Buffer->PooledBuffer)
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
2019-01-15 19:57:23 -05:00
|
|
|
check(Buffer->ReferenceCount > 0 || GRenderGraphImmediateMode);
|
|
|
|
|
|
|
|
|
|
TRefCountPtr<FPooledRDGBuffer>& AllocatedBuffer = AllocatedBuffers.FindOrAdd(Buffer);
|
|
|
|
|
GRenderGraphResourcePool.FindFreeBuffer(RHICmdList, Buffer->Desc, AllocatedBuffer, Buffer->Name);
|
|
|
|
|
|
|
|
|
|
Buffer->PooledBuffer = AllocatedBuffer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Buffer->PooledBuffer->UAVs.Contains(UAV->Desc))
|
|
|
|
|
{
|
|
|
|
|
UAV->CachedRHI.UAV = Buffer->PooledBuffer->UAVs[UAV->Desc];
|
2018-10-22 23:01:29 -04:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Hack to make sure only one UAVs is arround.
|
2019-01-15 19:57:23 -05:00
|
|
|
Buffer->PooledBuffer->UAVs.Empty();
|
2018-10-22 23:01:29 -04:00
|
|
|
|
|
|
|
|
FUnorderedAccessViewRHIRef RHIUnorderedAccessView;
|
|
|
|
|
|
2019-01-15 19:57:23 -05:00
|
|
|
if (Buffer->Desc.UnderlyingType == FRDGBufferDesc::EUnderlyingType::VertexBuffer)
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
2019-01-15 19:57:23 -05:00
|
|
|
RHIUnorderedAccessView = RHICreateUnorderedAccessView(Buffer->PooledBuffer->VertexBuffer, UAV->Desc.Format);
|
2018-10-22 23:01:29 -04:00
|
|
|
}
|
2019-01-15 19:57:23 -05:00
|
|
|
else if (Buffer->Desc.UnderlyingType == FRDGBufferDesc::EUnderlyingType::StructuredBuffer)
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
2019-01-15 19:57:23 -05:00
|
|
|
RHIUnorderedAccessView = RHICreateUnorderedAccessView(Buffer->PooledBuffer->StructuredBuffer, UAV->Desc.bSupportsAtomicCounter, UAV->Desc.bSupportsAppendBuffer);
|
2018-10-22 23:01:29 -04:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
check(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UAV->CachedRHI.UAV = RHIUnorderedAccessView;
|
2019-01-15 19:57:23 -05:00
|
|
|
Buffer->PooledBuffer->UAVs.Add(UAV->Desc, RHIUnorderedAccessView);
|
2018-10-22 23:01:29 -04:00
|
|
|
}
|
|
|
|
|
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
static EResourceTransitionPipeline CalcTransitionPipeline(bool bCurrentCompute, bool bTargetCompute)
|
|
|
|
|
{
|
|
|
|
|
// TODO(RDG) convert table to math
|
|
|
|
|
uint32 Bits;
|
|
|
|
|
Bits = (uint32)bCurrentCompute;
|
|
|
|
|
Bits |= (uint32)bTargetCompute << 1;
|
|
|
|
|
|
|
|
|
|
EResourceTransitionPipeline Table[] = {
|
|
|
|
|
EResourceTransitionPipeline::EGfxToGfx,
|
|
|
|
|
EResourceTransitionPipeline::EComputeToGfx,
|
|
|
|
|
EResourceTransitionPipeline::EGfxToCompute,
|
|
|
|
|
EResourceTransitionPipeline::EComputeToCompute
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return static_cast< EResourceTransitionPipeline >( Table[ Bits ] );
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-22 14:28:32 -04:00
|
|
|
void FRDGBuilder::TransitionTexture( const FRDGTexture* Texture, EResourceTransitionAccess TransitionAccess, bool bRequiredCompute ) const
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
|
|
|
|
const bool bRequiredWritable = TransitionAccess != EResourceTransitionAccess::EReadable;
|
|
|
|
|
|
|
|
|
|
if( Texture->bWritable != bRequiredWritable || Texture->bCompute != bRequiredCompute )
|
|
|
|
|
{
|
|
|
|
|
RHICmdList.TransitionResource( TransitionAccess, Texture->PooledRenderTarget->GetRenderTargetItem().ShaderResourceTexture );
|
|
|
|
|
Texture->bWritable = bRequiredWritable;
|
|
|
|
|
Texture->bCompute = bRequiredCompute;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-22 23:01:29 -04:00
|
|
|
void FRDGBuilder::TransitionUAV(FUnorderedAccessViewRHIParamRef UAV, const FRDGResource* UnderlyingResource, EResourceTransitionAccess TransitionAccess, bool bRequiredCompute ) const
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
2019-04-29 18:23:20 -04:00
|
|
|
const bool bRequiredWritable = TransitionAccess != EResourceTransitionAccess::EReadable;
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
|
2019-04-29 18:23:20 -04:00
|
|
|
if (bRequiredWritable && UnderlyingResource->bWritable)
|
|
|
|
|
{
|
|
|
|
|
// Force a RW barrier between UAV write.
|
|
|
|
|
// TODO(RDG): allow to have no barriere in the API when multiple pass write concurrently to same resource.
|
|
|
|
|
EResourceTransitionPipeline TransitionPipeline = CalcTransitionPipeline(UnderlyingResource->bCompute, bRequiredCompute);
|
|
|
|
|
RHICmdList.TransitionResource(EResourceTransitionAccess::ERWBarrier, TransitionPipeline, UAV);
|
|
|
|
|
}
|
|
|
|
|
else if(UnderlyingResource->bWritable != bRequiredWritable || UnderlyingResource->bCompute != bRequiredCompute )
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
2018-10-22 23:01:29 -04:00
|
|
|
EResourceTransitionPipeline TransitionPipeline = CalcTransitionPipeline(UnderlyingResource->bCompute, bRequiredCompute );
|
|
|
|
|
RHICmdList.TransitionResource( TransitionAccess, TransitionPipeline, UAV);
|
|
|
|
|
UnderlyingResource->bWritable = bRequiredWritable;
|
|
|
|
|
UnderlyingResource->bCompute = bRequiredCompute;
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-21 20:33:41 -05:00
|
|
|
void FRDGBuilder::PushDrawEventStack(const FRenderGraphPass* Pass)
|
|
|
|
|
{
|
|
|
|
|
// Push the scope event.
|
|
|
|
|
{
|
|
|
|
|
// Find out how many scope events needs to be poped.
|
|
|
|
|
TStaticArray<const FRDGEventScope*, kMaxScopeCount> TraversedScopes;
|
|
|
|
|
int32 CommonScopeId = -1;
|
|
|
|
|
int32 TraversedScopeCount = 0;
|
|
|
|
|
const FRDGEventScope* PassParentScope = Pass->ParentScope;
|
|
|
|
|
while (PassParentScope)
|
|
|
|
|
{
|
|
|
|
|
TraversedScopes[TraversedScopeCount] = PassParentScope;
|
|
|
|
|
|
|
|
|
|
for (int32 i = 0; i < ScopesStack.Num(); i++)
|
|
|
|
|
{
|
|
|
|
|
if (ScopesStack[i] == PassParentScope)
|
|
|
|
|
{
|
|
|
|
|
CommonScopeId = i;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (CommonScopeId != -1)
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TraversedScopeCount++;
|
|
|
|
|
PassParentScope = PassParentScope->ParentScope;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Pop no longer used scopes
|
2019-02-14 14:23:27 -05:00
|
|
|
for (int32 i = CommonScopeId + 1; i < kMaxScopeCount; i++)
|
2018-11-21 20:33:41 -05:00
|
|
|
{
|
|
|
|
|
if (!ScopesStack[i])
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
RHICmdList.PopEvent();
|
|
|
|
|
ScopesStack[i] = nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Push new scopes
|
|
|
|
|
const FColor ScopeColor(0);
|
|
|
|
|
for (int32 i = TraversedScopeCount - 1; i >= 0; i--)
|
|
|
|
|
{
|
|
|
|
|
RHICmdList.PushEvent(TraversedScopes[i]->Name.GetTCHAR(), ScopeColor);
|
|
|
|
|
CommonScopeId++;
|
|
|
|
|
ScopesStack[CommonScopeId] = TraversedScopes[i];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Push the pass's event with some color.
|
|
|
|
|
{
|
|
|
|
|
FColor Color(0, 0, 0);
|
|
|
|
|
|
|
|
|
|
if (Pass->IsCompute())
|
|
|
|
|
{
|
|
|
|
|
// Green for compute.
|
|
|
|
|
Color = FColor(128, 255, 128);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Ref for rasterizer.
|
|
|
|
|
Color = FColor(255, 128, 128);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RHICmdList.PushEvent(Pass->GetName(), Color);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-22 14:28:32 -04:00
|
|
|
void FRDGBuilder::ExecutePass( const FRenderGraphPass* Pass )
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
2018-10-22 14:28:32 -04:00
|
|
|
QUICK_SCOPE_CYCLE_COUNTER(STAT_FRDGBuilder_ExecutePass);
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
|
|
|
|
|
FRHIRenderPassInfo RPInfo;
|
|
|
|
|
bool bHasRenderTargets = false;
|
|
|
|
|
|
|
|
|
|
AllocateAndTransitionPassResources(Pass, &RPInfo, &bHasRenderTargets);
|
|
|
|
|
|
2018-12-05 09:07:49 -05:00
|
|
|
if (RENDER_GRAPH_DRAW_EVENTS)
|
2018-11-21 20:33:41 -05:00
|
|
|
{
|
2018-12-05 09:07:49 -05:00
|
|
|
if (GetEmitDrawEvents())
|
|
|
|
|
{
|
|
|
|
|
PushDrawEventStack(Pass);
|
|
|
|
|
}
|
2018-11-21 20:33:41 -05:00
|
|
|
}
|
|
|
|
|
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
if( !Pass->IsCompute())
|
|
|
|
|
{
|
|
|
|
|
check(bHasRenderTargets);
|
|
|
|
|
RHICmdList.BeginRenderPass( RPInfo, Pass->GetName() );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2018-10-29 17:45:21 -04:00
|
|
|
UnbindRenderTargets(RHICmdList);
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
}
|
|
|
|
|
|
2018-11-21 20:49:28 -05:00
|
|
|
// The name of the pass just for debuging convenience when crashing in the Execute().
|
|
|
|
|
const TCHAR* PassName = Pass->GetName();
|
|
|
|
|
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
Pass->Execute(RHICmdList);
|
|
|
|
|
|
|
|
|
|
if( bHasRenderTargets )
|
|
|
|
|
{
|
|
|
|
|
RHICmdList.EndRenderPass();
|
|
|
|
|
}
|
|
|
|
|
|
2018-12-05 09:07:49 -05:00
|
|
|
if (RENDER_GRAPH_DRAW_EVENTS)
|
2018-11-21 20:33:41 -05:00
|
|
|
{
|
2018-12-05 09:07:49 -05:00
|
|
|
if (GetEmitDrawEvents())
|
|
|
|
|
{
|
|
|
|
|
RHICmdList.PopEvent();
|
|
|
|
|
}
|
2018-11-21 20:33:41 -05:00
|
|
|
}
|
|
|
|
|
|
2018-10-21 16:35:13 -04:00
|
|
|
if (RENDER_GRAPH_DEBUGGING)
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
|
|
|
|
WarnForUselessPassDependencies(Pass);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Can't release resources with immediate mode, because don't know if whether they are gonna be used.
|
|
|
|
|
if (!GRenderGraphImmediateMode)
|
|
|
|
|
{
|
|
|
|
|
ReleaseUnecessaryResources(Pass);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-22 14:28:32 -04:00
|
|
|
void FRDGBuilder::AllocateAndTransitionPassResources(const FRenderGraphPass* Pass, struct FRHIRenderPassInfo* OutRPInfo, bool* bOutHasRenderTargets)
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
|
|
|
|
bool bIsCompute = Pass->IsCompute();
|
|
|
|
|
FShaderParameterStructRef ParameterStruct = Pass->GetParameters();
|
|
|
|
|
|
2018-12-11 13:44:34 -05:00
|
|
|
const bool bGeneratingMips = (Pass->GetFlags() & ERenderGraphPassFlags::GenerateMips) == ERenderGraphPassFlags::GenerateMips;
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
for (int ResourceIndex = 0, Num = ParameterStruct.Layout->Resources.Num(); ResourceIndex < Num; ResourceIndex++)
|
|
|
|
|
{
|
2018-12-18 21:41:17 -05:00
|
|
|
EUniformBufferBaseType Type = ParameterStruct.Layout->Resources[ResourceIndex].MemberType;
|
|
|
|
|
uint16 Offset = ParameterStruct.Layout->Resources[ResourceIndex].MemberOffset;
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
|
|
|
|
|
switch (Type)
|
|
|
|
|
{
|
2019-01-04 14:52:46 -05:00
|
|
|
case UBMT_RDG_TEXTURE:
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
2018-10-22 14:28:32 -04:00
|
|
|
FRDGTexture* RESTRICT Texture = *ParameterStruct.GetMemberPtrAtOffset<FRDGTexture*>(Offset);
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
if (Texture)
|
|
|
|
|
{
|
2019-01-15 19:57:23 -05:00
|
|
|
// The underlying texture have already been allocated by a prior pass.
|
2019-01-21 20:08:38 -05:00
|
|
|
#if RENDER_GRAPH_DEBUGGING
|
|
|
|
|
{
|
|
|
|
|
check(Texture->bHasEverBeenProduced);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2019-01-15 19:57:23 -05:00
|
|
|
check(Texture->PooledRenderTarget);
|
|
|
|
|
check(Texture->CachedRHI.Resource);
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
TransitionTexture(Texture, EResourceTransitionAccess::EReadable, bIsCompute);
|
2019-01-15 19:57:23 -05:00
|
|
|
|
|
|
|
|
#if RENDER_GRAPH_DEBUGGING
|
|
|
|
|
{
|
|
|
|
|
Texture->DebugPassAccessCount++;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2019-01-04 14:52:46 -05:00
|
|
|
case UBMT_RDG_TEXTURE_SRV:
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
2018-10-22 14:28:32 -04:00
|
|
|
FRDGTextureSRV* RESTRICT SRV = *ParameterStruct.GetMemberPtrAtOffset<FRDGTextureSRV*>(Offset);
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
if (SRV)
|
|
|
|
|
{
|
2019-01-15 19:57:23 -05:00
|
|
|
// The underlying texture have already been allocated by a prior pass.
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
check(SRV->Desc.Texture);
|
2019-01-21 20:08:38 -05:00
|
|
|
#if RENDER_GRAPH_DEBUGGING
|
|
|
|
|
{
|
|
|
|
|
check(SRV->Desc.Texture->bHasEverBeenProduced);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2019-01-15 19:57:23 -05:00
|
|
|
check(SRV->Desc.Texture->PooledRenderTarget);
|
|
|
|
|
|
|
|
|
|
// Might be the first time using this render graph SRV, so need to setup the cached rhi resource.
|
|
|
|
|
if (!SRV->CachedRHI.SRV)
|
|
|
|
|
{
|
|
|
|
|
SRV->CachedRHI.SRV = SRV->Desc.Texture->PooledRenderTarget->GetRenderTargetItem().MipSRVs[SRV->Desc.MipLevel];
|
|
|
|
|
}
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
|
2018-10-22 23:01:29 -04:00
|
|
|
TransitionTexture(SRV->Desc.Texture, EResourceTransitionAccess::EReadable, bIsCompute);
|
2019-01-15 19:57:23 -05:00
|
|
|
|
|
|
|
|
#if RENDER_GRAPH_DEBUGGING
|
|
|
|
|
{
|
|
|
|
|
SRV->Desc.Texture->DebugPassAccessCount++;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2019-01-04 14:52:46 -05:00
|
|
|
case UBMT_RDG_TEXTURE_UAV:
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
2018-10-22 14:28:32 -04:00
|
|
|
FRDGTextureUAV* RESTRICT UAV = *ParameterStruct.GetMemberPtrAtOffset<FRDGTextureUAV*>(Offset);
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
if (UAV)
|
|
|
|
|
{
|
2018-10-22 23:01:29 -04:00
|
|
|
AllocateRHITextureUAVIfNeeded(UAV, bIsCompute);
|
|
|
|
|
TransitionUAV(UAV->CachedRHI.UAV, UAV->Desc.Texture, EResourceTransitionAccess::EWritable, bIsCompute);
|
2019-01-15 19:57:23 -05:00
|
|
|
|
|
|
|
|
#if RENDER_GRAPH_DEBUGGING
|
|
|
|
|
{
|
|
|
|
|
UAV->Desc.Texture->DebugPassAccessCount++;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2018-10-22 23:01:29 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2019-01-04 14:52:46 -05:00
|
|
|
case UBMT_RDG_BUFFER:
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
|
|
|
|
FRDGBuffer* RESTRICT Buffer = *ParameterStruct.GetMemberPtrAtOffset<FRDGBuffer*>(Offset);
|
|
|
|
|
if (Buffer)
|
|
|
|
|
{
|
2019-01-15 19:57:23 -05:00
|
|
|
// The underlying buffer have already been allocated by a prior pass through AllocateRHIBufferUAVIfNeeded().
|
2019-01-21 20:08:38 -05:00
|
|
|
#if RENDER_GRAPH_DEBUGGING
|
|
|
|
|
{
|
|
|
|
|
check(Buffer->bHasEverBeenProduced);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2019-01-15 19:57:23 -05:00
|
|
|
check(Buffer->PooledBuffer);
|
2018-10-22 23:01:29 -04:00
|
|
|
|
|
|
|
|
// TODO(RDG): supper hacky, find the UAV and transition it. Hopefully there is one...
|
|
|
|
|
check(Buffer->PooledBuffer->UAVs.Num() == 1);
|
|
|
|
|
FUnorderedAccessViewRHIParamRef UAV = Buffer->PooledBuffer->UAVs.CreateIterator().Value();
|
|
|
|
|
TransitionUAV(UAV, Buffer, EResourceTransitionAccess::EReadable, bIsCompute);
|
2019-01-15 19:57:23 -05:00
|
|
|
|
|
|
|
|
#if RENDER_GRAPH_DEBUGGING
|
|
|
|
|
{
|
|
|
|
|
Buffer->DebugPassAccessCount++;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2018-10-22 23:01:29 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2019-01-04 14:52:46 -05:00
|
|
|
case UBMT_RDG_BUFFER_SRV:
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
|
|
|
|
FRDGBufferSRV* RESTRICT SRV = *ParameterStruct.GetMemberPtrAtOffset<FRDGBufferSRV*>(Offset);
|
|
|
|
|
if (SRV)
|
|
|
|
|
{
|
2019-01-15 19:57:23 -05:00
|
|
|
// The underlying buffer have already been allocated by a prior pass through AllocateRHIBufferUAVIfNeeded().
|
|
|
|
|
check(SRV->Desc.Buffer);
|
2019-01-21 20:08:38 -05:00
|
|
|
#if RENDER_GRAPH_DEBUGGING
|
|
|
|
|
{
|
|
|
|
|
check(SRV->Desc.Buffer->bHasEverBeenProduced);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2019-01-15 19:57:23 -05:00
|
|
|
check(SRV->Desc.Buffer->PooledBuffer);
|
|
|
|
|
|
2018-10-22 23:01:29 -04:00
|
|
|
AllocateRHIBufferSRVIfNeeded(SRV, bIsCompute);
|
|
|
|
|
|
|
|
|
|
// TODO(RDG): supper hacky, find the UAV and transition it. Hopefully there is one...
|
|
|
|
|
check(SRV->Desc.Buffer->PooledBuffer->UAVs.Num() == 1);
|
|
|
|
|
FUnorderedAccessViewRHIParamRef UAV = SRV->Desc.Buffer->PooledBuffer->UAVs.CreateIterator().Value();
|
|
|
|
|
TransitionUAV(UAV, SRV->Desc.Buffer, EResourceTransitionAccess::EReadable, bIsCompute);
|
2019-01-15 19:57:23 -05:00
|
|
|
|
|
|
|
|
#if RENDER_GRAPH_DEBUGGING
|
|
|
|
|
{
|
|
|
|
|
SRV->Desc.Buffer->DebugPassAccessCount++;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2018-10-22 23:01:29 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2019-01-04 14:52:46 -05:00
|
|
|
case UBMT_RDG_BUFFER_UAV:
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
|
|
|
|
FRDGBufferUAV* RESTRICT UAV = *ParameterStruct.GetMemberPtrAtOffset<FRDGBufferUAV*>(Offset);
|
|
|
|
|
if (UAV)
|
|
|
|
|
{
|
|
|
|
|
AllocateRHIBufferUAVIfNeeded(UAV, bIsCompute);
|
|
|
|
|
TransitionUAV(UAV->CachedRHI.UAV, UAV->Desc.Buffer, EResourceTransitionAccess::EWritable, bIsCompute);
|
2019-01-15 19:57:23 -05:00
|
|
|
|
|
|
|
|
#if RENDER_GRAPH_DEBUGGING
|
|
|
|
|
{
|
|
|
|
|
UAV->Desc.Buffer->DebugPassAccessCount++;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case UBMT_RENDER_TARGET_BINDING_SLOTS:
|
|
|
|
|
{
|
|
|
|
|
check(!bIsCompute);
|
|
|
|
|
|
|
|
|
|
FRenderTargetBindingSlots* RESTRICT RenderTargets = ParameterStruct.GetMemberPtrAtOffset<FRenderTargetBindingSlots>(Offset);
|
|
|
|
|
|
|
|
|
|
uint32 NumRenderTargets = 0;
|
|
|
|
|
uint32 NumDepthStencilTargets = 0;
|
|
|
|
|
uint32 NumSamples = 0;
|
|
|
|
|
|
2019-01-07 14:44:04 -05:00
|
|
|
for (int32 i = 0; i < RenderTargets->Output.Num(); i++)
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
|
|
|
|
const FRenderTargetBinding& RenderTarget = RenderTargets->Output[i];
|
|
|
|
|
if (RenderTarget.GetTexture())
|
|
|
|
|
{
|
|
|
|
|
AllocateRHITextureIfNeeded(RenderTarget.GetTexture(), false);
|
|
|
|
|
|
|
|
|
|
// TODO(RDG): should force TargetableTexture == ShaderResourceTexture with MSAA, and instead have an explicit MSAA resolve pass.
|
|
|
|
|
OutRPInfo->ColorRenderTargets[i].RenderTarget = RenderTarget.GetTexture()->PooledRenderTarget->GetRenderTargetItem().TargetableTexture;
|
|
|
|
|
OutRPInfo->ColorRenderTargets[i].ResolveTarget = nullptr;
|
|
|
|
|
OutRPInfo->ColorRenderTargets[i].ArraySlice = -1;
|
|
|
|
|
OutRPInfo->ColorRenderTargets[i].MipIndex = RenderTarget.GetMipIndex();
|
|
|
|
|
OutRPInfo->ColorRenderTargets[i].Action = MakeRenderTargetActions(RenderTarget.GetLoadAction(), RenderTarget.GetStoreAction());
|
|
|
|
|
|
2018-12-11 13:44:34 -05:00
|
|
|
if (!bGeneratingMips)
|
|
|
|
|
{
|
|
|
|
|
// Implicit assurance the RHI will do the correct transitions
|
|
|
|
|
TransitionTexture(RenderTarget.GetTexture(), EResourceTransitionAccess::EWritable, false);
|
|
|
|
|
}
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
|
|
|
|
|
NumSamples |= OutRPInfo->ColorRenderTargets[i].RenderTarget->GetNumSamples();
|
|
|
|
|
NumRenderTargets++;
|
2019-01-15 19:57:23 -05:00
|
|
|
|
|
|
|
|
#if RENDER_GRAPH_DEBUGGING
|
|
|
|
|
{
|
|
|
|
|
RenderTarget.GetTexture()->DebugPassAccessCount++;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const FDepthStencilBinding& DepthStencil = RenderTargets->DepthStencil;
|
|
|
|
|
if (DepthStencil.Texture)
|
|
|
|
|
{
|
|
|
|
|
AllocateRHITextureIfNeeded(DepthStencil.Texture, false);
|
|
|
|
|
|
|
|
|
|
OutRPInfo->DepthStencilRenderTarget.DepthStencilTarget = DepthStencil.Texture->PooledRenderTarget->GetRenderTargetItem().TargetableTexture;
|
|
|
|
|
OutRPInfo->DepthStencilRenderTarget.ResolveTarget = nullptr;
|
|
|
|
|
OutRPInfo->DepthStencilRenderTarget.Action = MakeDepthStencilTargetActions(
|
|
|
|
|
MakeRenderTargetActions(DepthStencil.DepthLoadAction, DepthStencil.DepthStoreAction),
|
|
|
|
|
MakeRenderTargetActions(DepthStencil.StencilLoadAction, DepthStencil.StencilStoreAction));
|
|
|
|
|
OutRPInfo->DepthStencilRenderTarget.ExclusiveDepthStencil = FExclusiveDepthStencil::DepthWrite_StencilWrite;
|
|
|
|
|
|
|
|
|
|
TransitionTexture(DepthStencil.Texture, EResourceTransitionAccess::EWritable, false);
|
|
|
|
|
|
|
|
|
|
NumSamples |= OutRPInfo->DepthStencilRenderTarget.DepthStencilTarget->GetNumSamples();
|
|
|
|
|
NumDepthStencilTargets++;
|
2019-01-15 19:57:23 -05:00
|
|
|
|
|
|
|
|
#if RENDER_GRAPH_DEBUGGING
|
|
|
|
|
{
|
|
|
|
|
DepthStencil.Texture->DebugPassAccessCount++;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
OutRPInfo->bIsMSAA = NumSamples > 1;
|
|
|
|
|
|
|
|
|
|
*bOutHasRenderTargets = NumRenderTargets + NumDepthStencilTargets > 0;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-12-11 13:44:34 -05:00
|
|
|
|
|
|
|
|
OutRPInfo->bGeneratingMips = bGeneratingMips;
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// static
|
2018-10-22 14:28:32 -04:00
|
|
|
void FRDGBuilder::WarnForUselessPassDependencies(const FRenderGraphPass* Pass)
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
2018-12-18 21:41:17 -05:00
|
|
|
if (!GRenderGraphEmitWarnings)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
FShaderParameterStructRef ParameterStruct = Pass->GetParameters();
|
|
|
|
|
|
|
|
|
|
int32 TrackedResourceCount = 0;
|
|
|
|
|
int32 UsedResourceCount = 0;
|
|
|
|
|
|
|
|
|
|
// First pass to count resources.
|
|
|
|
|
for (int ResourceIndex = 0, Num = ParameterStruct.Layout->Resources.Num(); ResourceIndex < Num; ResourceIndex++)
|
|
|
|
|
{
|
2018-12-18 21:41:17 -05:00
|
|
|
EUniformBufferBaseType Type = ParameterStruct.Layout->Resources[ResourceIndex].MemberType;
|
|
|
|
|
uint16 Offset = ParameterStruct.Layout->Resources[ResourceIndex].MemberOffset;
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
|
2019-01-10 17:53:26 -05:00
|
|
|
if (!IsRDGResourceReferenceShaderParameterType(Type))
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
continue;
|
|
|
|
|
|
2018-10-22 14:28:32 -04:00
|
|
|
const FRDGResource* Resource = *ParameterStruct.GetMemberPtrAtOffset<const FRDGResource*>(Offset);
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
|
|
|
|
|
if (!Resource)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
TrackedResourceCount++;
|
|
|
|
|
UsedResourceCount += Resource->bIsActuallyUsedByPass ? 1 : 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (TrackedResourceCount != UsedResourceCount)
|
|
|
|
|
{
|
2019-01-16 15:48:28 -05:00
|
|
|
FString WarningMessage = FString::Printf(
|
|
|
|
|
TEXT("%i of the %i resources of the pass %s where not actually used."),
|
|
|
|
|
TrackedResourceCount - UsedResourceCount, TrackedResourceCount, Pass->GetName());
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
|
|
|
|
|
for (int ResourceIndex = 0, Num = ParameterStruct.Layout->Resources.Num(); ResourceIndex < Num; ResourceIndex++)
|
|
|
|
|
{
|
2018-12-18 21:41:17 -05:00
|
|
|
EUniformBufferBaseType Type = ParameterStruct.Layout->Resources[ResourceIndex].MemberType;
|
|
|
|
|
uint16 Offset = ParameterStruct.Layout->Resources[ResourceIndex].MemberOffset;
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
|
2019-01-10 17:53:26 -05:00
|
|
|
if (!IsRDGResourceReferenceShaderParameterType(Type))
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
continue;
|
|
|
|
|
|
2018-10-22 14:28:32 -04:00
|
|
|
const FRDGResource* Resource = *ParameterStruct.GetMemberPtrAtOffset<const FRDGResource*>(Offset);
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
|
|
|
|
|
if (!Resource)
|
|
|
|
|
continue;
|
|
|
|
|
|
2018-10-22 23:01:29 -04:00
|
|
|
if (!Resource->bIsActuallyUsedByPass)
|
2019-01-16 15:48:28 -05:00
|
|
|
{
|
|
|
|
|
WarningMessage += FString::Printf(TEXT("\n %s"), Resource->Name);
|
|
|
|
|
}
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
}
|
2019-01-16 15:48:28 -05:00
|
|
|
|
|
|
|
|
EmitRenderGraphWarning(WarningMessage);
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Last pass to clean the bIsActuallyUsedByPass flags.
|
|
|
|
|
for (int ResourceIndex = 0, Num = ParameterStruct.Layout->Resources.Num(); ResourceIndex < Num; ResourceIndex++)
|
|
|
|
|
{
|
2018-12-18 21:41:17 -05:00
|
|
|
EUniformBufferBaseType Type = ParameterStruct.Layout->Resources[ResourceIndex].MemberType;
|
|
|
|
|
uint16 Offset = ParameterStruct.Layout->Resources[ResourceIndex].MemberOffset;
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
|
2019-01-10 17:53:26 -05:00
|
|
|
if (!IsRDGResourceReferenceShaderParameterType(Type))
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
continue;
|
|
|
|
|
|
2018-10-22 14:28:32 -04:00
|
|
|
const FRDGResource* Resource = *ParameterStruct.GetMemberPtrAtOffset<const FRDGResource*>(Offset);
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
|
|
|
|
|
if (!Resource)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
Resource->bIsActuallyUsedByPass = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-22 14:28:32 -04:00
|
|
|
void FRDGBuilder::ReleaseRHITextureIfPossible(const FRDGTexture* Texture)
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
|
|
|
|
check(Texture->ReferenceCount > 0);
|
|
|
|
|
Texture->ReferenceCount--;
|
|
|
|
|
|
|
|
|
|
if (Texture->ReferenceCount == 0)
|
|
|
|
|
{
|
|
|
|
|
Texture->PooledRenderTarget = nullptr;
|
2019-01-15 19:57:23 -05:00
|
|
|
Texture->CachedRHI.Resource = nullptr;
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
AllocatedTextures.FindChecked(Texture) = nullptr;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-22 23:01:29 -04:00
|
|
|
void FRDGBuilder::ReleaseRHIBufferIfPossible(const FRDGBuffer* Buffer)
|
|
|
|
|
{
|
|
|
|
|
check(Buffer->ReferenceCount > 0);
|
|
|
|
|
Buffer->ReferenceCount--;
|
|
|
|
|
|
|
|
|
|
if (Buffer->ReferenceCount == 0)
|
|
|
|
|
{
|
|
|
|
|
Buffer->PooledBuffer = nullptr;
|
2019-01-15 19:57:23 -05:00
|
|
|
Buffer->CachedRHI.Resource = nullptr;
|
2018-10-22 23:01:29 -04:00
|
|
|
AllocatedBuffers.FindChecked(Buffer) = nullptr;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-22 14:28:32 -04:00
|
|
|
void FRDGBuilder::ReleaseUnecessaryResources(const FRenderGraphPass* Pass)
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
|
|
|
|
FShaderParameterStructRef ParameterStruct = Pass->GetParameters();
|
|
|
|
|
|
2018-10-22 14:28:32 -04:00
|
|
|
/** Increments all the FRDGResource::ReferenceCount. */
|
2018-10-22 23:01:29 -04:00
|
|
|
// TODO(RDG): Investigate the cost of branch miss-prediction.
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
for (int ResourceIndex = 0, Num = ParameterStruct.Layout->Resources.Num(); ResourceIndex < Num; ResourceIndex++)
|
|
|
|
|
{
|
2018-12-18 21:41:17 -05:00
|
|
|
EUniformBufferBaseType Type = ParameterStruct.Layout->Resources[ResourceIndex].MemberType;
|
|
|
|
|
uint16 Offset = ParameterStruct.Layout->Resources[ResourceIndex].MemberOffset;
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
|
|
|
|
|
switch (Type)
|
|
|
|
|
{
|
2019-01-04 14:52:46 -05:00
|
|
|
case UBMT_RDG_TEXTURE:
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
2018-10-22 14:28:32 -04:00
|
|
|
FRDGTexture* RESTRICT Texture = *ParameterStruct.GetMemberPtrAtOffset<FRDGTexture*>(Offset);
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
if (Texture)
|
|
|
|
|
{
|
|
|
|
|
ReleaseRHITextureIfPossible(Texture);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2019-01-04 14:52:46 -05:00
|
|
|
case UBMT_RDG_TEXTURE_SRV:
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
2018-10-22 14:28:32 -04:00
|
|
|
FRDGTextureSRV* RESTRICT SRV = *ParameterStruct.GetMemberPtrAtOffset<FRDGTextureSRV*>(Offset);
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
if (SRV)
|
|
|
|
|
{
|
|
|
|
|
ReleaseRHITextureIfPossible(SRV->Desc.Texture);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2019-01-04 14:52:46 -05:00
|
|
|
case UBMT_RDG_TEXTURE_UAV:
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
2018-10-22 14:28:32 -04:00
|
|
|
FRDGTextureUAV* RESTRICT UAV = *ParameterStruct.GetMemberPtrAtOffset<FRDGTextureUAV*>(Offset);
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
if (UAV)
|
|
|
|
|
{
|
|
|
|
|
ReleaseRHITextureIfPossible(UAV->Desc.Texture);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2019-01-04 14:52:46 -05:00
|
|
|
case UBMT_RDG_BUFFER:
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
|
|
|
|
FRDGBuffer* RESTRICT Buffer = *ParameterStruct.GetMemberPtrAtOffset<FRDGBuffer*>(Offset);
|
|
|
|
|
if (Buffer)
|
|
|
|
|
{
|
|
|
|
|
ReleaseRHIBufferIfPossible(Buffer);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2019-01-04 14:52:46 -05:00
|
|
|
case UBMT_RDG_BUFFER_SRV:
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
|
|
|
|
FRDGBufferSRV* RESTRICT SRV = *ParameterStruct.GetMemberPtrAtOffset<FRDGBufferSRV*>(Offset);
|
|
|
|
|
if (SRV)
|
|
|
|
|
{
|
|
|
|
|
ReleaseRHIBufferIfPossible(SRV->Desc.Buffer);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2019-01-04 14:52:46 -05:00
|
|
|
case UBMT_RDG_BUFFER_UAV:
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
|
|
|
|
FRDGBufferUAV* RESTRICT UAV = *ParameterStruct.GetMemberPtrAtOffset<FRDGBufferUAV*>(Offset);
|
|
|
|
|
if (UAV)
|
|
|
|
|
{
|
|
|
|
|
ReleaseRHIBufferIfPossible(UAV->Desc.Buffer);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
case UBMT_RENDER_TARGET_BINDING_SLOTS:
|
|
|
|
|
{
|
|
|
|
|
FRenderTargetBindingSlots* RESTRICT RenderTargets = ParameterStruct.GetMemberPtrAtOffset<FRenderTargetBindingSlots>(Offset);
|
|
|
|
|
|
2019-01-07 14:44:04 -05:00
|
|
|
for (int32 i = 0; i < RenderTargets->Output.Num(); i++)
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
|
|
|
|
const FRenderTargetBinding& RenderTarget = RenderTargets->Output[i];
|
|
|
|
|
if (RenderTarget.GetTexture())
|
|
|
|
|
{
|
|
|
|
|
ReleaseRHITextureIfPossible(RenderTarget.GetTexture());
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (RenderTargets->DepthStencil.Texture)
|
|
|
|
|
{
|
|
|
|
|
ReleaseRHITextureIfPossible(RenderTargets->DepthStencil.Texture);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-22 14:28:32 -04:00
|
|
|
void FRDGBuilder::ProcessDeferredInternalResourceQueries()
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
|
|
|
|
for (const auto& Query : DeferredInternalTextureQueries)
|
|
|
|
|
{
|
|
|
|
|
check(Query.Texture->PooledRenderTarget);
|
|
|
|
|
|
|
|
|
|
if (Query.bTransitionToRead)
|
|
|
|
|
{
|
|
|
|
|
RHICmdList.TransitionResource(EResourceTransitionAccess::EReadable, Query.Texture->PooledRenderTarget->GetRenderTargetItem().ShaderResourceTexture);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
*Query.OutTexturePtr = AllocatedTextures.FindChecked(Query.Texture);
|
2019-01-15 19:57:23 -05:00
|
|
|
|
|
|
|
|
#if RENDER_GRAPH_DEBUGGING
|
|
|
|
|
{
|
|
|
|
|
// Increment the number of time the texture has been accessed to avoid warning on produced but never used resources that were produced
|
|
|
|
|
// only to be extracted for the graph.
|
|
|
|
|
Query.Texture->DebugPassAccessCount += 1;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
|
|
|
|
|
// No need to manually release in immediate mode, since it is done directly when emptying AllocatedTextures in DestructPasses().
|
|
|
|
|
if (!GRenderGraphImmediateMode)
|
|
|
|
|
{
|
|
|
|
|
ReleaseRHITextureIfPossible(Query.Texture);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-22 14:28:32 -04:00
|
|
|
void FRDGBuilder::DestructPasses()
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
2018-11-21 20:33:41 -05:00
|
|
|
#if RENDER_GRAPH_DRAW_EVENTS == 2
|
|
|
|
|
{
|
|
|
|
|
// Event scopes are allocated on FMemStack, so need to call their destructor because have a FString within them.
|
|
|
|
|
for (FRDGEventScope* EventScope : EventScopes)
|
|
|
|
|
{
|
|
|
|
|
EventScope->~FRDGEventScope();
|
|
|
|
|
}
|
|
|
|
|
EventScopes.Empty();
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2018-10-21 16:35:13 -04:00
|
|
|
#if RENDER_GRAPH_DEBUGGING
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
2019-01-15 19:57:23 -05:00
|
|
|
// Make sure all resource references have been released to ensure no leaks happen,
|
|
|
|
|
// and emit warning if produced resource has not been used.
|
2018-10-22 14:28:32 -04:00
|
|
|
for (const FRDGResource* Resource : Resources)
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
|
|
|
|
check(Resource->ReferenceCount == 0);
|
2019-01-15 19:57:23 -05:00
|
|
|
|
|
|
|
|
if (GRenderGraphEmitWarnings && Resource->DebugPassAccessCount == 1 && Resource->DebugFirstProducer)
|
|
|
|
|
{
|
|
|
|
|
check(Resource->bHasEverBeenProduced);
|
|
|
|
|
|
2019-01-16 15:48:28 -05:00
|
|
|
EmitRenderGraphWarningf(
|
2019-01-15 19:57:23 -05:00
|
|
|
TEXT("Resources %s has been produced by the pass %s, but never used by another pass."),
|
|
|
|
|
Resource->Name, Resource->DebugFirstProducer->GetName());
|
|
|
|
|
}
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
}
|
|
|
|
|
Resources.Empty();
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
// Passes are allocated on FMemStack, so need to call destructor manually.
|
|
|
|
|
for (FRenderGraphPass* Pass : Passes)
|
|
|
|
|
{
|
|
|
|
|
Pass->~FRenderGraphPass();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Passes.Empty();
|
|
|
|
|
DeferredInternalTextureQueries.Empty();
|
|
|
|
|
AllocatedTextures.Empty();
|
2019-01-22 02:15:37 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FRDGBuilder::~FRDGBuilder()
|
|
|
|
|
{
|
|
|
|
|
#if RENDER_GRAPH_DEBUGGING
|
|
|
|
|
{
|
|
|
|
|
checkf(bHasExecuted, TEXT("Render graph execution si required to ensure consistency with immediate mode."));
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
}
|