2019-12-26 14:45:42 -05:00
|
|
|
// Copyright 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"
|
2019-06-18 13:23:41 -04:00
|
|
|
#include "RenderGraphBarrierBatcher.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
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
namespace
|
|
|
|
|
{
|
|
|
|
|
const int32 kRDGEmitWarningsOnce = 1;
|
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-06-11 18:27:07 -04:00
|
|
|
#if RDG_ENABLE_DEBUG
|
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-06-11 18:27:07 -04:00
|
|
|
int32 GRDGImmediateMode = 0;
|
|
|
|
|
FAutoConsoleVariableRef CVarImmediateMode(
|
2018-12-18 21:41:17 -05:00
|
|
|
TEXT("r.RDG.ImmediateMode"),
|
2019-06-11 18:27:07 -04:00
|
|
|
GRDGImmediateMode,
|
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-06-11 18:27:07 -04:00
|
|
|
int32 GRDGDebug = 0;
|
|
|
|
|
FAutoConsoleVariableRef CVarRDGDebug(
|
|
|
|
|
TEXT("r.RDG.Debug"),
|
|
|
|
|
GRDGDebug,
|
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);
|
|
|
|
|
|
2019-08-15 18:58:08 -04:00
|
|
|
TAutoConsoleVariable<int32> CVarRDGEnableBreakpoint(
|
|
|
|
|
TEXT("r.RDG.EnableBreakpoint"), 0,
|
2019-06-11 20:13:27 -04:00
|
|
|
TEXT("Breakpoint in debugger when a warning is raised.\n"),
|
|
|
|
|
ECVF_RenderThreadSafe);
|
|
|
|
|
|
2019-08-15 18:58:08 -04:00
|
|
|
int32 GRDGClobberResources = 0;
|
|
|
|
|
FAutoConsoleVariableRef CVarRDGClobberResources(
|
|
|
|
|
TEXT("r.RDG.ClobberResources"),
|
|
|
|
|
GRDGClobberResources,
|
|
|
|
|
TEXT("Clears all render targets and texture / buffer UAVs with the requested clear color at allocation time. Useful for debugging.\n")
|
|
|
|
|
TEXT(" 0:off (default);\n")
|
|
|
|
|
TEXT(" 1: 1000 on RGBA channels;\n")
|
|
|
|
|
TEXT(" 2: NaN on RGBA channels;\n")
|
|
|
|
|
TEXT(" 3: +INFINITY on RGBA channels.\n"),
|
|
|
|
|
ECVF_Cheat | ECVF_RenderThreadSafe);
|
|
|
|
|
|
|
|
|
|
FLinearColor GetClobberColor()
|
|
|
|
|
{
|
|
|
|
|
switch (GRDGClobberResources)
|
|
|
|
|
{
|
|
|
|
|
case 2:
|
|
|
|
|
return FLinearColor(NAN, NAN, NAN, NAN);
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
return FLinearColor(INFINITY, INFINITY, INFINITY, INFINITY);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
return FLinearColor(1000, 1000, 1000, 1000);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32 GetClobberBufferValue()
|
|
|
|
|
{
|
|
|
|
|
return 1000;
|
|
|
|
|
}
|
2019-06-11 20:13:27 -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
|
|
|
#else
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
const int32 GRDGImmediateMode = 0;
|
|
|
|
|
const int32 GRDGDebug = 0;
|
2019-08-15 18:58:08 -04:00
|
|
|
const int32 GRDGClobberResources = 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
|
2019-08-15 18:58:08 -04:00
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
} //! namespace
|
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-08-15 18:58:08 -04:00
|
|
|
bool IsRDGClobberResourcesEnabled()
|
|
|
|
|
{
|
|
|
|
|
return GRDGClobberResources > 0;
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
bool GetEmitRDGEvents()
|
|
|
|
|
{
|
2019-06-28 21:53:33 -04:00
|
|
|
check(IsInRenderingThread());
|
2019-06-11 18:27:07 -04:00
|
|
|
#if RDG_EVENTS != RDG_EVENTS_NONE
|
|
|
|
|
return GetEmitDrawEvents() || GRDGDebug;
|
|
|
|
|
#else
|
|
|
|
|
return false;
|
|
|
|
|
#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
|
|
|
|
2019-07-16 13:08:56 -04:00
|
|
|
bool IsRDGDebugEnabled()
|
|
|
|
|
{
|
|
|
|
|
return GRDGDebug != 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool IsRDGImmediateModeEnabled()
|
|
|
|
|
{
|
|
|
|
|
return GRDGImmediateMode != 0;
|
|
|
|
|
}
|
|
|
|
|
|
2018-12-18 21:41:17 -05:00
|
|
|
void InitRenderGraph()
|
|
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
#if RDG_ENABLE_DEBUG_WITH_ENGINE
|
2018-12-18 21:41:17 -05:00
|
|
|
if (FParse::Param(FCommandLine::Get(), TEXT("rdgimmediate")))
|
|
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
GRDGImmediateMode = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (FParse::Param(FCommandLine::Get(), TEXT("rdgdebug")))
|
|
|
|
|
{
|
|
|
|
|
GRDGDebug = 1;
|
2018-12-18 21:41:17 -05:00
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
void EmitRDGWarning(const FString& WarningMessage)
|
2019-01-16 15:48:28 -05:00
|
|
|
{
|
2019-06-11 20:13:27 -04:00
|
|
|
#if RDG_ENABLE_DEBUG_WITH_ENGINE
|
2019-06-11 18:27:07 -04:00
|
|
|
if (!GRDGDebug)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
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
|
|
|
|
2019-09-03 19:19:28 -04:00
|
|
|
const bool bEnableBreakpoint = CVarRDGEnableBreakpoint.GetValueOnRenderThread() != 0;
|
2019-06-11 20:13:27 -04:00
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
if (GRDGDebug == kRDGEmitWarningsOnce)
|
2019-01-16 16:12:36 -05:00
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
if (!GAlreadyEmittedWarnings.Contains(WarningMessage))
|
|
|
|
|
{
|
|
|
|
|
GAlreadyEmittedWarnings.Add(WarningMessage);
|
|
|
|
|
UE_LOG(LogRendererCore, Warning, TEXT("%s"), *WarningMessage);
|
2019-08-15 18:58:08 -04:00
|
|
|
|
|
|
|
|
if (bEnableBreakpoint)
|
2019-06-11 20:13:27 -04:00
|
|
|
{
|
|
|
|
|
UE_DEBUG_BREAK();
|
|
|
|
|
}
|
2019-06-11 18:27:07 -04:00
|
|
|
}
|
2019-01-16 16:12:36 -05:00
|
|
|
}
|
2019-06-11 18:27:07 -04:00
|
|
|
else
|
2019-01-16 15:48:28 -05:00
|
|
|
{
|
|
|
|
|
UE_LOG(LogRendererCore, Warning, TEXT("%s"), *WarningMessage);
|
2019-08-15 18:58:08 -04:00
|
|
|
|
|
|
|
|
if (bEnableBreakpoint)
|
2019-06-11 20:13:27 -04:00
|
|
|
{
|
|
|
|
|
UE_DEBUG_BREAK();
|
|
|
|
|
}
|
2019-01-16 15:48:28 -05:00
|
|
|
}
|
2019-06-11 20:13:27 -04:00
|
|
|
#endif
|
2019-01-16 15:48:28 -05:00
|
|
|
}
|
|
|
|
|
|
2019-07-09 17:22:17 -04:00
|
|
|
void FRDGBuilder::TickPoolElements()
|
|
|
|
|
{
|
|
|
|
|
GRenderGraphResourcePool.TickPoolElements();
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
FRDGBuilder::FRDGBuilder(FRHICommandListImmediate& InRHICmdList)
|
|
|
|
|
: RHICmdList(InRHICmdList)
|
|
|
|
|
, MemStack(FMemStack::Get())
|
2020-03-26 07:21:03 -04:00
|
|
|
, BarrierBatcher(MakeUnique<FRDGBarrierBatcher>())
|
2019-06-11 18:27:07 -04:00
|
|
|
, EventScopeStack(RHICmdList)
|
|
|
|
|
, StatScopeStack(RHICmdList)
|
2020-03-25 13:21:18 -04:00
|
|
|
{
|
|
|
|
|
AllocatedTextures.Reserve(16);
|
|
|
|
|
AllocatedBuffers.Reserve(16);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FRDGBuilder::~FRDGBuilder() {}
|
2019-06-11 18:27:07 -04:00
|
|
|
|
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);
|
2020-03-25 13:21:18 -04:00
|
|
|
SCOPED_NAMED_EVENT(FRDGBuilder_Execute, FColor::Emerald);
|
2018-11-21 20:33:41 -05:00
|
|
|
|
2019-07-16 13:08:56 -04:00
|
|
|
IF_RDG_ENABLE_DEBUG(Validation.ValidateExecuteBegin());
|
2020-03-25 13:21:18 -04:00
|
|
|
AllocatedBuffers.Reserve(BufferCount);
|
|
|
|
|
AllocatedTextures.Reserve(TextureCount);
|
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-06-11 18:27:07 -04:00
|
|
|
EventScopeStack.BeginExecute();
|
|
|
|
|
StatScopeStack.BeginExecute();
|
|
|
|
|
|
|
|
|
|
if (!GRDGImmediateMode)
|
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
|
|
|
{
|
|
|
|
|
WalkGraphDependencies();
|
|
|
|
|
|
2018-10-22 14:28:32 -04:00
|
|
|
QUICK_SCOPE_CYCLE_COUNTER(STAT_FRDGBuilder_Execute);
|
2019-06-11 18:27:07 -04:00
|
|
|
for (const FRDGPass* Pass : Passes)
|
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
|
|
|
{
|
|
|
|
|
ExecutePass(Pass);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
EventScopeStack.EndExecute();
|
|
|
|
|
StatScopeStack.EndExecute();
|
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();
|
|
|
|
|
|
2019-07-16 13:08:56 -04:00
|
|
|
IF_RDG_ENABLE_DEBUG(Validation.ValidateExecuteEnd());
|
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-07-16 13:08:56 -04:00
|
|
|
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
|
|
|
}
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
void FRDGBuilder::AddPassInternal(FRDGPass* 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
|
|
|
{
|
2019-08-15 18:58:08 -04:00
|
|
|
ClobberPassOutputs(Pass);
|
|
|
|
|
|
|
|
|
|
IF_RDG_ENABLE_DEBUG(Validation.ValidateAddPass(Pass, bInDebugPassScope));
|
2019-06-11 18:27:07 -04:00
|
|
|
|
|
|
|
|
Pass->EventScope = EventScopeStack.GetCurrentScope();
|
|
|
|
|
Pass->StatScope = StatScopeStack.GetCurrentScope();
|
|
|
|
|
Passes.Emplace(Pass);
|
|
|
|
|
|
|
|
|
|
if (GRDGImmediateMode)
|
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
|
|
|
{
|
|
|
|
|
ExecutePass(Pass);
|
|
|
|
|
}
|
2018-11-21 20:22:47 -05:00
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
VisualizePassOutputs(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
|
|
|
}
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
void FRDGBuilder::VisualizePassOutputs(const FRDGPass* Pass)
|
2018-11-21 20:22:47 -05:00
|
|
|
{
|
2018-12-18 21:41:17 -05:00
|
|
|
#if SUPPORTS_VISUALIZE_TEXTURE
|
2019-08-15 18:58:08 -04:00
|
|
|
if (!GVisualizeTexture.bEnabled || bInDebugPassScope)
|
2018-11-21 20:22:47 -05:00
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
return;
|
|
|
|
|
}
|
2018-11-21 20:22:47 -05:00
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
FRDGPassParameterStruct ParameterStruct = Pass->GetParameters();
|
|
|
|
|
|
|
|
|
|
const uint32 ParameterCount = ParameterStruct.GetParameterCount();
|
|
|
|
|
|
|
|
|
|
for (uint32 ParameterIndex = 0; ParameterIndex < ParameterCount; ++ParameterIndex)
|
|
|
|
|
{
|
|
|
|
|
FRDGPassParameter Parameter = ParameterStruct.GetParameter(ParameterIndex);
|
|
|
|
|
|
|
|
|
|
switch (Parameter.GetType())
|
2018-11-21 20:22:47 -05:00
|
|
|
{
|
2019-01-04 14:52:46 -05:00
|
|
|
case UBMT_RDG_TEXTURE_UAV:
|
2018-11-21 20:22:47 -05:00
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
if (FRDGTextureUAVRef UAV = Parameter.GetAsTextureUAV())
|
2018-11-21 20:22:47 -05:00
|
|
|
{
|
2019-06-28 21:53:33 -04:00
|
|
|
FRDGTextureRef Texture = UAV->Desc.Texture;
|
|
|
|
|
check(Texture);
|
|
|
|
|
|
|
|
|
|
int32 CaptureId = GVisualizeTexture.ShouldCapture(Texture->Name);
|
|
|
|
|
if (CaptureId != FVisualizeTexture::kInvalidCaptureId && UAV->Desc.MipLevel == GVisualizeTexture.CustomMip)
|
2019-06-11 18:27:07 -04:00
|
|
|
{
|
2019-06-28 21:53:33 -04:00
|
|
|
GVisualizeTexture.CreateContentCapturePass(*this, Texture, CaptureId);
|
2019-06-11 18:27:07 -04:00
|
|
|
}
|
2018-11-21 20:22:47 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case UBMT_RENDER_TARGET_BINDING_SLOTS:
|
|
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
const FRenderTargetBindingSlots& RenderTargetBindingSlots = Parameter.GetAsRenderTargetBindingSlots();
|
|
|
|
|
const auto& DepthStencil = RenderTargetBindingSlots.DepthStencil;
|
|
|
|
|
const auto& RenderTargets = RenderTargetBindingSlots.Output;
|
|
|
|
|
|
|
|
|
|
if (FRDGTextureRef Texture = DepthStencil.GetTexture())
|
2018-11-21 20:22:47 -05:00
|
|
|
{
|
2019-07-23 14:26:29 -04:00
|
|
|
const bool bHasStoreAction = DepthStencil.GetDepthStencilAccess().IsAnyWrite();
|
2019-06-11 18:27:07 -04:00
|
|
|
|
2019-06-28 21:53:33 -04:00
|
|
|
if (bHasStoreAction)
|
2018-11-21 20:22:47 -05:00
|
|
|
{
|
2019-06-28 21:53:33 -04:00
|
|
|
// Depth render target binding can only be done on mip level 0.
|
|
|
|
|
const int32 MipLevel = 0;
|
|
|
|
|
|
|
|
|
|
int32 CaptureId = GVisualizeTexture.ShouldCapture(Texture->Name);
|
|
|
|
|
if (CaptureId != FVisualizeTexture::kInvalidCaptureId && MipLevel == GVisualizeTexture.CustomMip)
|
|
|
|
|
{
|
|
|
|
|
GVisualizeTexture.CreateContentCapturePass(*this, Texture, CaptureId);
|
|
|
|
|
}
|
2019-06-11 18:27:07 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const uint32 RenderTargetCount = RenderTargets.Num();
|
|
|
|
|
|
|
|
|
|
for (uint32 RenderTargetIndex = 0; RenderTargetIndex < RenderTargetCount; ++RenderTargetIndex)
|
|
|
|
|
{
|
|
|
|
|
const FRenderTargetBinding& RenderTarget = RenderTargets[RenderTargetIndex];
|
|
|
|
|
|
|
|
|
|
if (FRDGTextureRef Texture = RenderTarget.GetTexture())
|
|
|
|
|
{
|
2019-07-23 14:26:29 -04:00
|
|
|
int32 CaptureId = GVisualizeTexture.ShouldCapture(Texture->Name);
|
2019-06-28 21:53:33 -04:00
|
|
|
|
2019-07-23 14:26:29 -04:00
|
|
|
if (CaptureId != FVisualizeTexture::kInvalidCaptureId && RenderTarget.GetMipIndex() == GVisualizeTexture.CustomMip)
|
2019-06-11 18:27:07 -04:00
|
|
|
{
|
2019-07-23 14:26:29 -04:00
|
|
|
GVisualizeTexture.CreateContentCapturePass(*this, Texture, CaptureId);
|
2019-06-11 18:27:07 -04:00
|
|
|
}
|
2018-11-21 20:22:47 -05:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-06-11 18:27:07 -04:00
|
|
|
#endif
|
2018-11-21 20:22:47 -05:00
|
|
|
}
|
|
|
|
|
|
2019-08-15 18:58:08 -04:00
|
|
|
void FRDGBuilder::ClobberPassOutputs(const FRDGPass* Pass)
|
|
|
|
|
{
|
2019-08-16 14:50:26 -04:00
|
|
|
#if RDG_ENABLE_DEBUG
|
2019-08-15 18:58:08 -04:00
|
|
|
if (!IsRDGClobberResourcesEnabled())
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (bInDebugPassScope)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
bInDebugPassScope = true;
|
|
|
|
|
|
|
|
|
|
const auto TryMarkForClobber = [](FRDGParentResourceRef Resource) -> bool
|
|
|
|
|
{
|
|
|
|
|
const bool bClobber = !Resource->bHasBeenClobbered && !Resource->IsExternal();
|
|
|
|
|
|
|
|
|
|
if (bClobber)
|
|
|
|
|
{
|
|
|
|
|
Resource->bHasBeenClobbered = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return bClobber;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const FLinearColor ClobberColor = GetClobberColor();
|
|
|
|
|
|
|
|
|
|
FRDGPassParameterStruct ParameterStruct = Pass->GetParameters();
|
|
|
|
|
|
|
|
|
|
const uint32 ParameterCount = ParameterStruct.GetParameterCount();
|
|
|
|
|
|
|
|
|
|
for (uint32 ParameterIndex = 0; ParameterIndex < ParameterCount; ++ParameterIndex)
|
|
|
|
|
{
|
|
|
|
|
FRDGPassParameter Parameter = ParameterStruct.GetParameter(ParameterIndex);
|
|
|
|
|
|
|
|
|
|
switch (Parameter.GetType())
|
|
|
|
|
{
|
|
|
|
|
case UBMT_RDG_BUFFER_UAV:
|
|
|
|
|
{
|
|
|
|
|
if (FRDGBufferUAVRef UAV = Parameter.GetAsBufferUAV())
|
|
|
|
|
{
|
|
|
|
|
FRDGBufferRef Buffer = UAV->GetParent();
|
|
|
|
|
|
|
|
|
|
if (TryMarkForClobber(Buffer))
|
|
|
|
|
{
|
|
|
|
|
AddClearUAVPass(*this, UAV, GetClobberBufferValue());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case UBMT_RDG_TEXTURE_UAV:
|
|
|
|
|
{
|
|
|
|
|
if (FRDGTextureUAVRef UAV = Parameter.GetAsTextureUAV())
|
|
|
|
|
{
|
|
|
|
|
FRDGTextureRef Texture = UAV->GetParent();
|
|
|
|
|
|
|
|
|
|
if (TryMarkForClobber(Texture))
|
|
|
|
|
{
|
|
|
|
|
AddClearUAVPass(*this, UAV, ClobberColor);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case UBMT_RENDER_TARGET_BINDING_SLOTS:
|
|
|
|
|
{
|
|
|
|
|
const FRenderTargetBindingSlots& RenderTargetBindingSlots = Parameter.GetAsRenderTargetBindingSlots();
|
|
|
|
|
const auto& DepthStencil = RenderTargetBindingSlots.DepthStencil;
|
|
|
|
|
const auto& RenderTargets = RenderTargetBindingSlots.Output;
|
|
|
|
|
|
|
|
|
|
if (FRDGTextureRef Texture = DepthStencil.GetTexture())
|
|
|
|
|
{
|
|
|
|
|
if (TryMarkForClobber(Texture))
|
|
|
|
|
{
|
2019-08-16 11:25:10 -04:00
|
|
|
// These are arbitrarily chosen to be something unusual.
|
|
|
|
|
const float ClobberDepth = 0.56789f;
|
|
|
|
|
const uint8 ClobberStencil = 123;
|
|
|
|
|
|
|
|
|
|
AddClearDepthStencilPass(*this, Texture, true, ClobberDepth, true, ClobberStencil);
|
2019-08-15 18:58:08 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const uint32 RenderTargetCount = RenderTargets.Num();
|
|
|
|
|
|
|
|
|
|
for (uint32 RenderTargetIndex = 0; RenderTargetIndex < RenderTargetCount; ++RenderTargetIndex)
|
|
|
|
|
{
|
|
|
|
|
const FRenderTargetBinding& RenderTarget = RenderTargets[RenderTargetIndex];
|
|
|
|
|
|
|
|
|
|
if (FRDGTextureRef Texture = RenderTarget.GetTexture())
|
|
|
|
|
{
|
|
|
|
|
if (TryMarkForClobber(Texture))
|
|
|
|
|
{
|
|
|
|
|
AddClearRenderTargetPass(*this, Texture, ClobberColor);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
bInDebugPassScope = false;
|
|
|
|
|
#endif
|
2019-08-16 14:50:26 -04:00
|
|
|
}
|
2019-08-15 18:58:08 -04: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
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
for (const FRDGPass* Pass : Passes)
|
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-06-11 18:27:07 -04:00
|
|
|
FRDGPassParameterStruct ParameterStruct = Pass->GetParameters();
|
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-06-11 18:27:07 -04:00
|
|
|
const uint32 ParameterCount = ParameterStruct.GetParameterCount();
|
|
|
|
|
|
|
|
|
|
for (uint32 ParameterIndex = 0; ParameterIndex < ParameterCount; ++ParameterIndex)
|
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-06-11 18:27:07 -04:00
|
|
|
FRDGPassParameter Parameter = ParameterStruct.GetParameter(ParameterIndex);
|
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-08-07 18:32:00 -04:00
|
|
|
if (Parameter.IsParentResource())
|
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-08-07 18:32:00 -04:00
|
|
|
if (FRDGParentResourceRef Resource = Parameter.GetAsParentResource())
|
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
|
|
|
}
|
|
|
|
|
}
|
2019-08-07 18:32:00 -04:00
|
|
|
else if (Parameter.IsChildResource())
|
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-08-07 18:32:00 -04:00
|
|
|
if (FRDGChildResourceRef Resource = Parameter.GetAsChildResource())
|
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-08-07 18:32:00 -04:00
|
|
|
Resource->GetParent()->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
|
|
|
}
|
|
|
|
|
}
|
2019-08-07 18:32:00 -04:00
|
|
|
else if (Parameter.IsRenderTargetBindingSlots())
|
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-06-11 18:27:07 -04:00
|
|
|
const FRenderTargetBindingSlots& RenderTargetBindingSlots = Parameter.GetAsRenderTargetBindingSlots();
|
|
|
|
|
const auto& DepthStencil = RenderTargetBindingSlots.DepthStencil;
|
|
|
|
|
const auto& RenderTargets = RenderTargetBindingSlots.Output;
|
|
|
|
|
const uint32 RenderTargetCount = RenderTargets.Num();
|
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-06-11 18:27:07 -04:00
|
|
|
for (uint32 RenderTargetIndex = 0; RenderTargetIndex < RenderTargetCount; ++RenderTargetIndex)
|
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-06-11 18:27:07 -04:00
|
|
|
const FRenderTargetBinding& RenderTarget = RenderTargets[RenderTargetIndex];
|
|
|
|
|
|
|
|
|
|
if (FRDGTextureRef Texture = RenderTarget.GetTexture())
|
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-06-11 18:27:07 -04:00
|
|
|
Texture->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
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
if (FRDGTextureRef Texture = DepthStencil.GetTexture())
|
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-06-11 18:27:07 -04:00
|
|
|
Texture->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
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-06-11 18:27:07 -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
|
|
|
|
|
|
|
|
// Add additional dependencies from deferred queries.
|
|
|
|
|
for (const auto& Query : DeferredInternalTextureQueries)
|
|
|
|
|
{
|
|
|
|
|
Query.Texture->ReferenceCount++;
|
|
|
|
|
}
|
2019-06-11 18:27:07 -04:00
|
|
|
for (const auto& Query : DeferredInternalBufferQueries)
|
|
|
|
|
{
|
|
|
|
|
Query.Buffer->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
|
|
|
|
|
|
|
|
// 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-06-11 18:27:07 -04:00
|
|
|
Pair.Key->ResourceRHI = nullptr;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Release external buffers that have ReferenceCount == 0 and yet are already allocated.
|
|
|
|
|
for (auto Pair : AllocatedBuffers)
|
|
|
|
|
{
|
|
|
|
|
if (Pair.Key->ReferenceCount == 0)
|
|
|
|
|
{
|
|
|
|
|
Pair.Value = nullptr;
|
|
|
|
|
Pair.Key->PooledBuffer = nullptr;
|
|
|
|
|
Pair.Key->ResourceRHI = 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
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
void FRDGBuilder::AllocateRHITextureIfNeeded(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);
|
|
|
|
|
|
|
|
|
|
if (Texture->PooledRenderTarget)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
check(Texture->ReferenceCount > 0 || GRDGImmediateMode);
|
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
|
|
|
|
|
|
|
|
TRefCountPtr<IPooledRenderTarget>& PooledRenderTarget = AllocatedTextures.FindOrAdd(Texture);
|
2019-06-18 13:23:41 -04:00
|
|
|
|
|
|
|
|
const bool bDoWriteBarrier = false;
|
|
|
|
|
GRenderTargetPool.FindFreeElement(RHICmdList, Texture->Desc, PooledRenderTarget, Texture->Name, bDoWriteBarrier);
|
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
|
|
|
|
|
|
|
|
Texture->PooledRenderTarget = PooledRenderTarget;
|
2019-06-11 18:27:07 -04:00
|
|
|
Texture->ResourceRHI = PooledRenderTarget->GetRenderTargetItem().ShaderResourceTexture;
|
2019-07-16 15:10:54 -04:00
|
|
|
check(Texture->ResourceRHI);
|
2018-10-22 23:01:29 -04:00
|
|
|
}
|
|
|
|
|
|
2019-07-18 19:08:07 -04:00
|
|
|
void FRDGBuilder::AllocateRHITextureSRVIfNeeded(FRDGTextureSRV* SRV)
|
|
|
|
|
{
|
|
|
|
|
check(SRV);
|
|
|
|
|
|
|
|
|
|
if (SRV->ResourceRHI)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FRDGTextureRef Texture = SRV->Desc.Texture;
|
|
|
|
|
check(Texture->PooledRenderTarget);
|
|
|
|
|
FSceneRenderTargetItem& RenderTarget = Texture->PooledRenderTarget->GetRenderTargetItem();
|
|
|
|
|
|
2019-10-01 13:03:04 -04:00
|
|
|
if (SRV->Desc.MetaData == ERDGTextureMetaDataAccess::HTile)
|
|
|
|
|
{
|
|
|
|
|
check(GRHISupportsExplicitHTile);
|
|
|
|
|
if (!RenderTarget.HTileSRV)
|
|
|
|
|
{
|
|
|
|
|
RenderTarget.HTileSRV = RHICreateShaderResourceViewHTile((FTexture2DRHIRef&)RenderTarget.TargetableTexture);
|
|
|
|
|
}
|
|
|
|
|
SRV->ResourceRHI = RenderTarget.HTileSRV;
|
|
|
|
|
check(SRV->ResourceRHI);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-29 14:13:26 -05:00
|
|
|
for (int32 Idx = 0; Idx < RenderTarget.SRVs.Num(); ++Idx)
|
2019-07-18 19:08:07 -04:00
|
|
|
{
|
2020-01-29 14:13:26 -05:00
|
|
|
if (RenderTarget.SRVs[Idx].Key == SRV->Desc)
|
|
|
|
|
{
|
|
|
|
|
SRV->ResourceRHI = RenderTarget.SRVs[Idx].Value;
|
|
|
|
|
return;
|
|
|
|
|
}
|
2019-07-18 19:08:07 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FShaderResourceViewRHIRef RHIShaderResourceView = RHICreateShaderResourceView(RenderTarget.ShaderResourceTexture, SRV->Desc);
|
|
|
|
|
|
|
|
|
|
SRV->ResourceRHI = RHIShaderResourceView;
|
2020-01-29 14:13:26 -05:00
|
|
|
RenderTarget.SRVs.Emplace(SRV->Desc, MoveTemp(RHIShaderResourceView));
|
2019-07-18 19:08:07 -04:00
|
|
|
}
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
void FRDGBuilder::AllocateRHITextureUAVIfNeeded(FRDGTextureUAV* UAV)
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
|
|
|
|
check(UAV);
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
if (UAV->ResourceRHI)
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
AllocateRHITextureIfNeeded(UAV->Desc.Texture);
|
2018-10-22 23:01:29 -04:00
|
|
|
|
2019-10-01 13:03:04 -04:00
|
|
|
FRDGTextureRef Texture = UAV->Desc.Texture;
|
|
|
|
|
check(Texture->PooledRenderTarget);
|
|
|
|
|
FSceneRenderTargetItem& RenderTarget = Texture->PooledRenderTarget->GetRenderTargetItem();
|
|
|
|
|
|
|
|
|
|
if (UAV->Desc.MetaData == ERDGTextureMetaDataAccess::HTile)
|
|
|
|
|
{
|
|
|
|
|
check(GRHISupportsExplicitHTile);
|
|
|
|
|
if (!RenderTarget.HTileUAV)
|
|
|
|
|
{
|
|
|
|
|
RenderTarget.HTileUAV = RHICreateUnorderedAccessViewHTile((FTexture2DRHIRef&)RenderTarget.TargetableTexture);
|
|
|
|
|
}
|
|
|
|
|
UAV->ResourceRHI = RenderTarget.HTileUAV;
|
|
|
|
|
check(UAV->ResourceRHI);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UAV->ResourceRHI = RenderTarget.MipUAVs[UAV->Desc.MipLevel];
|
2018-10-22 23:01:29 -04:00
|
|
|
}
|
|
|
|
|
|
2019-06-18 13:23:41 -04:00
|
|
|
void FRDGBuilder::AllocateRHIBufferIfNeeded(FRDGBuffer* Buffer)
|
|
|
|
|
{
|
|
|
|
|
check(Buffer);
|
|
|
|
|
|
|
|
|
|
if (Buffer->PooledBuffer)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
check(Buffer->ReferenceCount > 0 || GRDGImmediateMode);
|
|
|
|
|
|
|
|
|
|
TRefCountPtr<FPooledRDGBuffer>& AllocatedBuffer = AllocatedBuffers.FindOrAdd(Buffer);
|
|
|
|
|
GRenderGraphResourcePool.FindFreeBuffer(RHICmdList, Buffer->Desc, AllocatedBuffer, Buffer->Name);
|
|
|
|
|
check(AllocatedBuffer);
|
|
|
|
|
Buffer->PooledBuffer = AllocatedBuffer;
|
2020-01-24 18:07:01 -05:00
|
|
|
|
|
|
|
|
switch (Buffer->Desc.UnderlyingType)
|
|
|
|
|
{
|
|
|
|
|
case FRDGBufferDesc::EUnderlyingType::VertexBuffer:
|
|
|
|
|
Buffer->ResourceRHI = AllocatedBuffer->VertexBuffer;
|
|
|
|
|
break;
|
|
|
|
|
case FRDGBufferDesc::EUnderlyingType::IndexBuffer:
|
|
|
|
|
Buffer->ResourceRHI = AllocatedBuffer->IndexBuffer;
|
|
|
|
|
break;
|
|
|
|
|
case FRDGBufferDesc::EUnderlyingType::StructuredBuffer:
|
|
|
|
|
Buffer->ResourceRHI = AllocatedBuffer->StructuredBuffer;
|
|
|
|
|
break;
|
|
|
|
|
}
|
2019-06-18 13:23:41 -04:00
|
|
|
}
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
void FRDGBuilder::AllocateRHIBufferSRVIfNeeded(FRDGBufferSRV* SRV)
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
|
|
|
|
check(SRV);
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
if (SRV->ResourceRHI)
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
FRDGBufferRef Buffer = SRV->Desc.Buffer;
|
|
|
|
|
|
|
|
|
|
check(Buffer->PooledBuffer);
|
|
|
|
|
|
|
|
|
|
if (Buffer->PooledBuffer->SRVs.Contains(SRV->Desc))
|
|
|
|
|
{
|
|
|
|
|
SRV->ResourceRHI = Buffer->PooledBuffer->SRVs[SRV->Desc];
|
2018-10-22 23:01:29 -04:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FShaderResourceViewRHIRef RHIShaderResourceView;
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
if (Buffer->Desc.UnderlyingType == FRDGBufferDesc::EUnderlyingType::VertexBuffer)
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
RHIShaderResourceView = RHICreateShaderResourceView(Buffer->PooledBuffer->VertexBuffer, SRV->Desc.BytesPerElement, SRV->Desc.Format);
|
2018-10-22 23:01:29 -04:00
|
|
|
}
|
2019-06-11 18:27:07 -04:00
|
|
|
else if (Buffer->Desc.UnderlyingType == FRDGBufferDesc::EUnderlyingType::StructuredBuffer)
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
RHIShaderResourceView = RHICreateShaderResourceView(Buffer->PooledBuffer->StructuredBuffer);
|
2018-10-22 23:01:29 -04:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
check(0);
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
SRV->ResourceRHI = RHIShaderResourceView;
|
|
|
|
|
Buffer->PooledBuffer->SRVs.Add(SRV->Desc, RHIShaderResourceView);
|
2018-10-22 23:01:29 -04:00
|
|
|
}
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
void FRDGBuilder::AllocateRHIBufferUAVIfNeeded(FRDGBufferUAV* UAV)
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
|
|
|
|
check(UAV);
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
if (UAV->ResourceRHI)
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
2019-01-15 19:57:23 -05:00
|
|
|
|
|
|
|
|
FRDGBufferRef Buffer = UAV->Desc.Buffer;
|
2019-06-18 13:23:41 -04:00
|
|
|
AllocateRHIBufferIfNeeded(Buffer);
|
2019-01-15 19:57:23 -05:00
|
|
|
|
|
|
|
|
if (Buffer->PooledBuffer->UAVs.Contains(UAV->Desc))
|
|
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
UAV->ResourceRHI = Buffer->PooledBuffer->UAVs[UAV->Desc];
|
2018-10-22 23:01:29 -04:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
// Hack to make sure only one UAVs is around.
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
UAV->ResourceRHI = RHIUnorderedAccessView;
|
2019-01-15 19:57:23 -05:00
|
|
|
Buffer->PooledBuffer->UAVs.Add(UAV->Desc, RHIUnorderedAccessView);
|
2018-10-22 23:01:29 -04:00
|
|
|
}
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
void FRDGBuilder::ExecutePass(const FRDGPass* 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
|
|
|
|
2019-07-16 13:08:56 -04:00
|
|
|
IF_RDG_ENABLE_DEBUG(Validation.ValidateExecutePassBegin(Pass));
|
2019-06-11 18:27:07 -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
|
|
|
FRHIRenderPassInfo RPInfo;
|
2020-01-24 18:07:01 -05:00
|
|
|
PrepareResourcesForExecute(Pass, &RPInfo);
|
2019-06-11 18:27:07 -04:00
|
|
|
|
|
|
|
|
EventScopeStack.BeginExecutePass(Pass);
|
|
|
|
|
StatScopeStack.BeginExecutePass(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
|
|
|
|
2019-07-16 16:39:50 -04:00
|
|
|
if (Pass->IsRaster())
|
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
|
|
|
{
|
2020-01-24 18:07:01 -05:00
|
|
|
RHICmdList.BeginRenderPass(RPInfo, 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
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-04-06 16:28:53 -04:00
|
|
|
PRAGMA_DISABLE_DEPRECATION_WARNINGS
|
2018-10-29 17:45:21 -04:00
|
|
|
UnbindRenderTargets(RHICmdList);
|
2020-04-07 11:03:39 -04:00
|
|
|
PRAGMA_ENABLE_DEPRECATION_WARNINGS
|
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-08-15 18:58:08 -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
|
|
|
Pass->Execute(RHICmdList);
|
|
|
|
|
|
2019-09-03 19:19:28 -04:00
|
|
|
if (Pass->IsRaster())
|
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
|
|
|
{
|
|
|
|
|
RHICmdList.EndRenderPass();
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
EventScopeStack.EndExecutePass();
|
|
|
|
|
|
2019-07-16 13:08:56 -04:00
|
|
|
IF_RDG_ENABLE_DEBUG(Validation.ValidateExecutePassEnd(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
|
|
|
|
|
|
|
|
// Can't release resources with immediate mode, because don't know if whether they are gonna be used.
|
2019-06-11 18:27:07 -04:00
|
|
|
if (!GRDGImmediateMode)
|
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-06-11 18:27:07 -04:00
|
|
|
ReleaseUnreferencedResources(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
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-24 18:07:01 -05:00
|
|
|
void FRDGBuilder::PrepareResourcesForExecute(const FRDGPass* Pass, struct FRHIRenderPassInfo* OutRPInfo)
|
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-06-18 13:23:41 -04:00
|
|
|
check(Pass);
|
|
|
|
|
|
|
|
|
|
const bool bIsCompute = Pass->IsCompute();
|
2019-06-11 18:27:07 -04:00
|
|
|
|
2020-03-25 13:21:18 -04:00
|
|
|
BarrierBatcher->Begin(Pass);
|
2019-06-18 13:23:41 -04:00
|
|
|
|
2019-10-01 13:03:04 -04:00
|
|
|
#if WITH_MGPU
|
2020-03-25 13:21:18 -04:00
|
|
|
BarrierBatcher->SetNameForTemporalEffect(NameForTemporalEffect);
|
2019-10-01 13:03:04 -04:00
|
|
|
#endif
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
FRDGPassParameterStruct ParameterStruct = Pass->GetParameters();
|
|
|
|
|
|
|
|
|
|
const uint32 ParameterCount = ParameterStruct.GetParameterCount();
|
2020-03-25 13:21:18 -04:00
|
|
|
ReadTextures.Reserve(ParameterCount);
|
|
|
|
|
ModifiedTextures.Reserve(ParameterCount);
|
|
|
|
|
|
2019-11-13 13:12:15 -05:00
|
|
|
for (uint32 ParameterIndex = 0; ParameterIndex < ParameterCount; ++ParameterIndex)
|
|
|
|
|
{
|
|
|
|
|
FRDGPassParameter Parameter = ParameterStruct.GetParameter(ParameterIndex);
|
|
|
|
|
|
|
|
|
|
switch (Parameter.GetType())
|
|
|
|
|
{
|
|
|
|
|
case UBMT_RDG_TEXTURE:
|
|
|
|
|
{
|
|
|
|
|
if (FRDGTextureRef Texture = Parameter.GetAsTexture())
|
|
|
|
|
{
|
|
|
|
|
ReadTextures.Add(Texture);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case UBMT_RDG_TEXTURE_SRV:
|
|
|
|
|
{
|
|
|
|
|
if (FRDGTextureSRVRef SRV = Parameter.GetAsTextureSRV())
|
|
|
|
|
{
|
|
|
|
|
ReadTextures.Add(SRV->GetParent());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case UBMT_RDG_TEXTURE_UAV:
|
|
|
|
|
{
|
|
|
|
|
if (FRDGTextureUAVRef UAV = Parameter.GetAsTextureUAV())
|
|
|
|
|
{
|
|
|
|
|
ModifiedTextures.Add(UAV->GetParent());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case UBMT_RDG_TEXTURE_COPY_DEST:
|
|
|
|
|
{
|
|
|
|
|
if (FRDGTextureRef Texture = Parameter.GetAsTexture())
|
|
|
|
|
{
|
|
|
|
|
ModifiedTextures.Add(Texture);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case UBMT_RENDER_TARGET_BINDING_SLOTS:
|
|
|
|
|
{
|
|
|
|
|
const FRenderTargetBindingSlots& RenderTargetBindingSlots = Parameter.GetAsRenderTargetBindingSlots();
|
|
|
|
|
const auto& RenderTargets = RenderTargetBindingSlots.Output;
|
|
|
|
|
const uint32 RenderTargetCount = RenderTargets.Num();
|
|
|
|
|
|
|
|
|
|
for (uint32 RenderTargetIndex = 0; RenderTargetIndex < RenderTargetCount; RenderTargetIndex++)
|
|
|
|
|
{
|
|
|
|
|
if (FRDGTextureRef Texture = RenderTargets[RenderTargetIndex].GetTexture())
|
|
|
|
|
{
|
|
|
|
|
ModifiedTextures.Add(Texture);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (FRDGTextureRef Texture = RenderTargetBindingSlots.DepthStencil.GetTexture())
|
|
|
|
|
{
|
|
|
|
|
if (RenderTargetBindingSlots.DepthStencil.GetDepthStencilAccess().IsAnyWrite())
|
|
|
|
|
ModifiedTextures.Add(Texture);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
for (uint32 ParameterIndex = 0; ParameterIndex < ParameterCount; ++ParameterIndex)
|
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-06-11 18:27:07 -04:00
|
|
|
FRDGPassParameter Parameter = ParameterStruct.GetParameter(ParameterIndex);
|
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-06-11 18:27:07 -04:00
|
|
|
switch (Parameter.GetType())
|
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-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
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
if (FRDGTextureRef Texture = Parameter.GetAsTexture())
|
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-06-11 18:27:07 -04:00
|
|
|
check(Texture->PooledRenderTarget);
|
|
|
|
|
check(Texture->ResourceRHI);
|
2019-06-18 13:23:41 -04:00
|
|
|
|
2019-11-13 13:12:15 -05:00
|
|
|
check(!ModifiedTextures.Contains(Texture));
|
2020-03-25 13:21:18 -04:00
|
|
|
BarrierBatcher->QueueTransitionTexture(Texture, FRDGResourceState::EAccess::Read);
|
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
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
if (FRDGTextureSRVRef SRV = Parameter.GetAsTextureSRV())
|
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-06-11 18:27:07 -04:00
|
|
|
FRDGTextureRef Texture = SRV->Desc.Texture;
|
|
|
|
|
|
2019-07-18 19:08:07 -04:00
|
|
|
AllocateRHITextureSRVIfNeeded(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
|
|
|
|
2019-11-13 13:12:15 -05:00
|
|
|
if (ModifiedTextures.Contains(Texture))
|
|
|
|
|
{
|
|
|
|
|
// If it is bound to a RT, no need for ERWSubResBarrier.
|
|
|
|
|
// If it is bound as a UAV, the UAV is going to issue the ERWSubResBarrier.
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-03-25 13:21:18 -04:00
|
|
|
BarrierBatcher->QueueTransitionTexture(Texture, FRDGResourceState::EAccess::Read);
|
2019-11-13 13:12:15 -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;
|
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
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
if (FRDGTextureUAVRef UAV = Parameter.GetAsTextureUAV())
|
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-06-11 18:27:07 -04:00
|
|
|
FRDGTextureRef Texture = UAV->Desc.Texture;
|
2019-11-13 13:12:15 -05:00
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
AllocateRHITextureUAVIfNeeded(UAV);
|
|
|
|
|
|
|
|
|
|
FRHIUnorderedAccessView* UAVRHI = UAV->GetRHI();
|
|
|
|
|
|
2019-11-13 13:12:15 -05:00
|
|
|
bool bGeneratingMips = ReadTextures.Contains(Texture);
|
|
|
|
|
|
2020-03-25 13:21:18 -04:00
|
|
|
BarrierBatcher->QueueTransitionUAV(UAVRHI, Texture, FRDGResourceState::EAccess::Write, bGeneratingMips);
|
2018-10-22 23:01:29 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2019-06-18 16:53:31 -04:00
|
|
|
case UBMT_RDG_TEXTURE_COPY_DEST:
|
|
|
|
|
{
|
|
|
|
|
if (FRDGTextureRef Texture = Parameter.GetAsTexture())
|
|
|
|
|
{
|
|
|
|
|
AllocateRHITextureIfNeeded(Texture);
|
2019-10-01 13:03:04 -04:00
|
|
|
|
2019-11-13 17:29:52 -05:00
|
|
|
check(!ReadTextures.Contains(Texture));
|
2020-03-25 13:21:18 -04:00
|
|
|
BarrierBatcher->QueueTransitionTexture(Texture, FRDGResourceState::EAccess::Write);
|
2019-06-18 16:53:31 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2019-01-04 14:52:46 -05:00
|
|
|
case UBMT_RDG_BUFFER:
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
if (FRDGBufferRef Buffer = Parameter.GetAsBuffer())
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
// TODO(RDG): super hacky, find the UAV and transition it. Hopefully there is one...
|
|
|
|
|
check(Buffer->PooledBuffer);
|
|
|
|
|
check(Buffer->PooledBuffer->UAVs.Num() == 1);
|
2019-06-18 13:23:41 -04:00
|
|
|
FRHIUnorderedAccessView* UAVRHI = Buffer->PooledBuffer->UAVs.CreateIterator().Value();
|
2019-06-11 18:27:07 -04:00
|
|
|
|
2020-03-25 13:21:18 -04:00
|
|
|
BarrierBatcher->QueueTransitionUAV(UAVRHI, Buffer, FRDGResourceState::EAccess::Read);
|
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
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
if (FRDGBufferSRVRef SRV = Parameter.GetAsBufferSRV())
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
FRDGBufferRef Buffer = SRV->Desc.Buffer;
|
|
|
|
|
|
|
|
|
|
AllocateRHIBufferSRVIfNeeded(SRV);
|
|
|
|
|
|
|
|
|
|
check(Buffer->PooledBuffer);
|
|
|
|
|
|
2019-09-03 19:19:28 -04:00
|
|
|
// TODO(RDG): super hacky, find the UAV and transition it. Hopefully there is one...
|
|
|
|
|
if (Buffer->PooledBuffer->UAVs.Num() > 0)
|
|
|
|
|
{
|
|
|
|
|
check(Buffer->PooledBuffer->UAVs.Num() == 1);
|
|
|
|
|
FRHIUnorderedAccessView* UAVRHI = Buffer->PooledBuffer->UAVs.CreateIterator().Value();
|
|
|
|
|
|
2020-03-25 13:21:18 -04:00
|
|
|
BarrierBatcher->QueueTransitionUAV(UAVRHI, Buffer, FRDGResourceState::EAccess::Read);
|
2019-09-03 19:19:28 -04:00
|
|
|
}
|
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
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
if (FRDGBufferUAVRef UAV = Parameter.GetAsBufferUAV())
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
FRDGBufferRef Buffer = UAV->Desc.Buffer;
|
2019-01-15 19:57:23 -05:00
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
AllocateRHIBufferUAVIfNeeded(UAV);
|
|
|
|
|
|
|
|
|
|
FRHIUnorderedAccessView* UAVRHI = UAV->GetRHI();
|
|
|
|
|
|
2020-03-25 13:21:18 -04:00
|
|
|
BarrierBatcher->QueueTransitionUAV(UAVRHI, Buffer, FRDGResourceState::EAccess::Write);
|
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-06-18 16:53:31 -04:00
|
|
|
case UBMT_RDG_BUFFER_COPY_DEST:
|
|
|
|
|
{
|
|
|
|
|
if (FRDGBufferRef Buffer = Parameter.GetAsBuffer())
|
|
|
|
|
{
|
|
|
|
|
#if RDG_ENABLE_DEBUG
|
|
|
|
|
{
|
|
|
|
|
Buffer->PassAccessCount++;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
AllocateRHIBufferIfNeeded(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:
|
|
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
const FRenderTargetBindingSlots& RenderTargetBindingSlots = Parameter.GetAsRenderTargetBindingSlots();
|
|
|
|
|
const auto& RenderTargets = RenderTargetBindingSlots.Output;
|
|
|
|
|
const auto& DepthStencil = RenderTargetBindingSlots.DepthStencil;
|
|
|
|
|
const uint32 RenderTargetCount = RenderTargets.Num();
|
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-06-11 18:27:07 -04:00
|
|
|
uint32 ValidRenderTargetCount = 0;
|
|
|
|
|
uint32 ValidDepthStencilCount = 0;
|
|
|
|
|
uint32 SampleCount = 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
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
for (uint32 RenderTargetIndex = 0; RenderTargetIndex < RenderTargetCount; RenderTargetIndex++)
|
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-06-11 18:27:07 -04:00
|
|
|
const FRenderTargetBinding& RenderTarget = RenderTargets[RenderTargetIndex];
|
|
|
|
|
|
|
|
|
|
if (FRDGTextureRef Texture = RenderTarget.GetTexture())
|
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-06-11 18:27:07 -04:00
|
|
|
AllocateRHITextureIfNeeded(Texture);
|
|
|
|
|
|
|
|
|
|
auto& OutRenderTarget = OutRPInfo->ColorRenderTargets[RenderTargetIndex];
|
|
|
|
|
|
|
|
|
|
// TODO(RDG): Clean up this legacy hack of the FPooledRenderTarget that can have TargetableTexture != ShaderResourceTexture
|
|
|
|
|
// for MSAA texture. Instead the two texture should be independent FRDGTexture explicitly handled by the user code.
|
|
|
|
|
FRHITexture* TargetableTexture = Texture->PooledRenderTarget->GetRenderTargetItem().TargetableTexture;
|
|
|
|
|
FRHITexture* ShaderResourceTexture = Texture->PooledRenderTarget->GetRenderTargetItem().ShaderResourceTexture;
|
|
|
|
|
|
2020-03-10 13:58:15 -04:00
|
|
|
if (RenderTarget.GetMsaaPlane() == ERenderTargetMsaaPlane::Resolved)
|
|
|
|
|
{
|
|
|
|
|
TargetableTexture = ShaderResourceTexture;
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
// TODO(RDG): The load store action could actually be optimised by render graph for tile hardware when there is multiple
|
|
|
|
|
// consecutive rasterizer passes that have RDG resource as render target, a bit like resource transitions.
|
2019-07-23 14:26:29 -04:00
|
|
|
ERenderTargetStoreAction StoreAction = ERenderTargetStoreAction::EStore;
|
2019-06-11 18:27:07 -04:00
|
|
|
|
|
|
|
|
// Automatically switch the store action to MSAA resolve when there is MSAA texture.
|
|
|
|
|
if (TargetableTexture != ShaderResourceTexture && Texture->Desc.NumSamples > 1 && StoreAction == ERenderTargetStoreAction::EStore)
|
|
|
|
|
{
|
|
|
|
|
StoreAction = ERenderTargetStoreAction::EMultisampleResolve;
|
|
|
|
|
}
|
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
|
|
|
|
|
|
|
|
// TODO(RDG): should force TargetableTexture == ShaderResourceTexture with MSAA, and instead have an explicit MSAA resolve pass.
|
2019-06-11 18:27:07 -04:00
|
|
|
OutRenderTarget.RenderTarget = TargetableTexture;
|
|
|
|
|
OutRenderTarget.ResolveTarget = ShaderResourceTexture != TargetableTexture ? ShaderResourceTexture : nullptr;
|
2020-02-12 13:27:19 -05:00
|
|
|
OutRenderTarget.ArraySlice = RenderTarget.GetArraySlice();
|
2019-06-11 18:27:07 -04:00
|
|
|
OutRenderTarget.MipIndex = RenderTarget.GetMipIndex();
|
|
|
|
|
OutRenderTarget.Action = MakeRenderTargetActions(RenderTarget.GetLoadAction(), StoreAction);
|
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
|
|
|
|
2020-03-25 13:21:18 -04:00
|
|
|
BarrierBatcher->QueueTransitionTexture(Texture, FRDGResourceState::EAccess::Write);
|
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-06-11 18:27:07 -04:00
|
|
|
SampleCount |= OutRenderTarget.RenderTarget->GetNumSamples();
|
|
|
|
|
ValidRenderTargetCount++;
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
if (FRDGTextureRef Texture = DepthStencil.GetTexture())
|
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-06-11 18:27:07 -04:00
|
|
|
AllocateRHITextureIfNeeded(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
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
auto& OutDepthStencil = OutRPInfo->DepthStencilRenderTarget;
|
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-07-23 14:26:29 -04:00
|
|
|
FExclusiveDepthStencil ExclusiveDepthStencil = DepthStencil.GetDepthStencilAccess();
|
|
|
|
|
|
|
|
|
|
ERenderTargetStoreAction DepthStoreAction = ExclusiveDepthStencil.IsDepthWrite() ? ERenderTargetStoreAction::EStore : ERenderTargetStoreAction::ENoAction;
|
|
|
|
|
ERenderTargetStoreAction StencilStoreAction = ExclusiveDepthStencil.IsStencilWrite() ? ERenderTargetStoreAction::EStore : ERenderTargetStoreAction::ENoAction;
|
|
|
|
|
|
2020-03-10 13:58:15 -04:00
|
|
|
const FSceneRenderTargetItem& RenderTargetItem = Texture->PooledRenderTarget->GetRenderTargetItem();
|
|
|
|
|
|
|
|
|
|
OutDepthStencil.DepthStencilTarget = DepthStencil.GetMsaaPlane() == ERenderTargetMsaaPlane::Unresolved ? RenderTargetItem.TargetableTexture : RenderTargetItem.ShaderResourceTexture;
|
2019-06-11 18:27:07 -04:00
|
|
|
OutDepthStencil.ResolveTarget = nullptr;
|
|
|
|
|
OutDepthStencil.Action = MakeDepthStencilTargetActions(
|
2019-07-23 14:26:29 -04:00
|
|
|
MakeRenderTargetActions(DepthStencil.GetDepthLoadAction(), DepthStoreAction),
|
|
|
|
|
MakeRenderTargetActions(DepthStencil.GetStencilLoadAction(), StencilStoreAction));
|
|
|
|
|
OutDepthStencil.ExclusiveDepthStencil = ExclusiveDepthStencil;
|
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
|
|
|
|
2020-03-25 13:21:18 -04:00
|
|
|
BarrierBatcher->QueueTransitionTexture(Texture,
|
2019-07-23 14:26:29 -04:00
|
|
|
ExclusiveDepthStencil.IsAnyWrite() ?
|
2019-07-16 13:08:56 -04:00
|
|
|
FRDGResourceState::EAccess::Write :
|
|
|
|
|
FRDGResourceState::EAccess::Read);
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
SampleCount |= OutDepthStencil.DepthStencilTarget->GetNumSamples();
|
|
|
|
|
ValidDepthStencilCount++;
|
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-06-11 18:27:07 -04:00
|
|
|
OutRPInfo->bIsMSAA = SampleCount > 1;
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-12-11 13:44:34 -05:00
|
|
|
|
2019-11-13 13:12:15 -05:00
|
|
|
OutRPInfo->bGeneratingMips = Pass->IsGenerateMips();
|
2020-03-25 13:21:18 -04:00
|
|
|
|
|
|
|
|
BarrierBatcher->End(RHICmdList);
|
2020-03-26 07:21:08 -04:00
|
|
|
ReadTextures.Reset();
|
|
|
|
|
ModifiedTextures.Reset();
|
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-06-11 18:27:07 -04:00
|
|
|
void FRDGBuilder::ReleaseRHITextureIfUnreferenced(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-06-11 18:27:07 -04:00
|
|
|
Texture->ResourceRHI = 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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
void FRDGBuilder::ReleaseRHIBufferIfUnreferenced(FRDGBuffer* Buffer)
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
|
|
|
|
check(Buffer->ReferenceCount > 0);
|
|
|
|
|
Buffer->ReferenceCount--;
|
|
|
|
|
|
|
|
|
|
if (Buffer->ReferenceCount == 0)
|
|
|
|
|
{
|
|
|
|
|
Buffer->PooledBuffer = nullptr;
|
2019-06-11 18:27:07 -04:00
|
|
|
Buffer->ResourceRHI = nullptr;
|
2018-10-22 23:01:29 -04:00
|
|
|
AllocatedBuffers.FindChecked(Buffer) = nullptr;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
void FRDGBuilder::ReleaseUnreferencedResources(const FRDGPass* 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
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
FRDGPassParameterStruct ParameterStruct = Pass->GetParameters();
|
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-06-11 18:27:07 -04:00
|
|
|
const uint32 ParameterCount = ParameterStruct.GetParameterCount();
|
|
|
|
|
|
|
|
|
|
for (uint32 ParameterIndex = 0; ParameterIndex < ParameterCount; ++ParameterIndex)
|
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-06-11 18:27:07 -04:00
|
|
|
FRDGPassParameter Parameter = ParameterStruct.GetParameter(ParameterIndex);
|
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-06-11 18:27:07 -04:00
|
|
|
switch (Parameter.GetType())
|
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-04 14:52:46 -05:00
|
|
|
case UBMT_RDG_TEXTURE:
|
2019-06-18 16:53:31 -04:00
|
|
|
case UBMT_RDG_TEXTURE_COPY_DEST:
|
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-06-11 18:27:07 -04:00
|
|
|
if (FRDGTextureRef Texture = Parameter.GetAsTexture())
|
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-06-11 18:27:07 -04:00
|
|
|
ReleaseRHITextureIfUnreferenced(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
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
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
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
if (FRDGTextureSRVRef SRV = Parameter.GetAsTextureSRV())
|
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-06-11 18:27:07 -04:00
|
|
|
ReleaseRHITextureIfUnreferenced(SRV->Desc.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
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
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
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
if (FRDGTextureUAVRef UAV = Parameter.GetAsTextureUAV())
|
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-06-11 18:27:07 -04:00
|
|
|
ReleaseRHITextureIfUnreferenced(UAV->Desc.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
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2019-01-04 14:52:46 -05:00
|
|
|
case UBMT_RDG_BUFFER:
|
2019-06-18 16:53:31 -04:00
|
|
|
case UBMT_RDG_BUFFER_COPY_DEST:
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
if (FRDGBufferRef Buffer = Parameter.GetAsBuffer())
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
ReleaseRHIBufferIfUnreferenced(Buffer);
|
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
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
if (FRDGBufferSRVRef SRV = Parameter.GetAsBufferSRV())
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
ReleaseRHIBufferIfUnreferenced(SRV->Desc.Buffer);
|
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
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
if (FRDGBufferUAVRef UAV = Parameter.GetAsBufferUAV())
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
ReleaseRHIBufferIfUnreferenced(UAV->Desc.Buffer);
|
2018-10-22 23:01:29 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
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:
|
|
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
const FRenderTargetBindingSlots& RenderTargetBindingSlots = Parameter.GetAsRenderTargetBindingSlots();
|
|
|
|
|
const auto& RenderTargets = RenderTargetBindingSlots.Output;
|
|
|
|
|
const auto& DepthStencil = RenderTargetBindingSlots.DepthStencil;
|
|
|
|
|
const uint32 RenderTargetCount = RenderTargets.Num();
|
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-06-11 18:27:07 -04:00
|
|
|
for (uint32 RenderTargetIndex = 0; RenderTargetIndex < RenderTargetCount; RenderTargetIndex++)
|
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-06-11 18:27:07 -04:00
|
|
|
const FRenderTargetBinding& RenderTarget = RenderTargets[RenderTargetIndex];
|
|
|
|
|
|
|
|
|
|
if (FRDGTextureRef Texture = RenderTarget.GetTexture())
|
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-06-11 18:27:07 -04:00
|
|
|
ReleaseRHITextureIfUnreferenced(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
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-06-11 18:27:07 -04:00
|
|
|
|
|
|
|
|
if (FRDGTextureRef Texture = DepthStencil.GetTexture())
|
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-06-11 18:27:07 -04:00
|
|
|
ReleaseRHITextureIfUnreferenced(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
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
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
|
|
|
{
|
2020-03-25 13:21:18 -04:00
|
|
|
BarrierBatcher->Begin(nullptr);
|
2019-06-18 13:23:41 -04:00
|
|
|
|
2019-10-01 13:03:04 -04:00
|
|
|
#if WITH_MGPU
|
2020-03-25 13:21:18 -04:00
|
|
|
BarrierBatcher->SetNameForTemporalEffect(NameForTemporalEffect);
|
2019-10-01 13:03:04 -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
|
|
|
for (const auto& Query : DeferredInternalTextureQueries)
|
|
|
|
|
{
|
|
|
|
|
check(Query.Texture->PooledRenderTarget);
|
|
|
|
|
|
|
|
|
|
if (Query.bTransitionToRead)
|
|
|
|
|
{
|
2020-03-25 13:21:18 -04:00
|
|
|
BarrierBatcher->QueueTransitionTexture(Query.Texture, FRDGResourceState::EAccess::Read);
|
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
|
|
|
}
|
|
|
|
|
|
|
|
|
|
*Query.OutTexturePtr = AllocatedTextures.FindChecked(Query.Texture);
|
2019-06-11 18:27:07 -04:00
|
|
|
if (!GRDGImmediateMode)
|
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-06-11 18:27:07 -04:00
|
|
|
ReleaseRHITextureIfUnreferenced(Query.Texture);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (const auto& Query : DeferredInternalBufferQueries)
|
|
|
|
|
{
|
2019-09-03 19:19:28 -04:00
|
|
|
check(Query.Buffer->PooledBuffer);
|
|
|
|
|
|
|
|
|
|
for (TMap<FRDGBufferUAVDesc, FUnorderedAccessViewRHIRef, FDefaultSetAllocator, TMapRDGBufferUAVFuncs<FRDGBufferUAVDesc, FUnorderedAccessViewRHIRef>>::TIterator It(Query.Buffer->PooledBuffer->UAVs); It; ++It)
|
|
|
|
|
{
|
2020-03-25 13:21:18 -04:00
|
|
|
BarrierBatcher->QueueTransitionUAV(It.Value(), Query.Buffer, Query.DestinationAccess, /* bGeneratingMips = */ false, Query.DestinationPipeline);
|
2019-09-03 19:19:28 -04:00
|
|
|
}
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
*Query.OutBufferPtr = AllocatedBuffers.FindChecked(Query.Buffer);
|
|
|
|
|
|
2019-03-28 18:40:44 -04:00
|
|
|
// No need to manually release in immediate mode, since it is done directly when emptying AllocatedBuffer in DestructPasses().
|
2019-06-11 18:27:07 -04:00
|
|
|
if (!GRDGImmediateMode)
|
|
|
|
|
{
|
|
|
|
|
ReleaseRHIBufferIfUnreferenced(Query.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
|
|
|
}
|
|
|
|
|
}
|
2020-03-25 13:21:18 -04:00
|
|
|
|
|
|
|
|
BarrierBatcher->End(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-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
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
for (int32 PassIndex = Passes.Num() - 1; PassIndex >= 0; --PassIndex)
|
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-06-11 18:27:07 -04:00
|
|
|
Passes[PassIndex]->~FRDGPass();
|
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
|
|
|
}
|
|
|
|
|
Passes.Empty();
|
2019-06-11 18:27:07 -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
|
|
|
DeferredInternalTextureQueries.Empty();
|
2019-06-11 18:27:07 -04:00
|
|
|
DeferredInternalBufferQueries.Empty();
|
2019-06-18 22:23:27 -04:00
|
|
|
ExternalTextures.Empty();
|
|
|
|
|
ExternalBuffers.Empty();
|
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.Empty();
|
2019-06-11 18:27:07 -04:00
|
|
|
AllocatedBuffers.Empty();
|
2019-01-22 02:15:37 -05:00
|
|
|
}
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
void FRDGBuilder::BeginEventScope(FRDGEventName&& ScopeName)
|
2019-01-22 02:15:37 -05:00
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
EventScopeStack.BeginScope(Forward<FRDGEventName&&>(ScopeName));
|
2019-01-22 02:15:37 -05:00
|
|
|
}
|
2019-06-11 18:27:07 -04:00
|
|
|
|
|
|
|
|
void FRDGBuilder::EndEventScope()
|
|
|
|
|
{
|
|
|
|
|
EventScopeStack.EndScope();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FRDGBuilder::BeginStatScope(const FName& Name, const FName& StatName)
|
|
|
|
|
{
|
|
|
|
|
StatScopeStack.BeginScope(Name, StatName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FRDGBuilder::EndStatScope()
|
|
|
|
|
{
|
|
|
|
|
StatScopeStack.EndScope();
|
2020-03-26 07:21:03 -04:00
|
|
|
}
|