2019-01-03 19:16:26 -05:00
|
|
|
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
|
|
|
|
|
#include "RenderGraphBuilder.h"
|
|
|
|
|
#include "RenderCore.h"
|
|
|
|
|
#include "RenderTargetPool.h"
|
2018-10-22 23:01:29 -04:00
|
|
|
#include "RenderGraphResourcePool.h"
|
2019-06-18 22:15:02 -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);
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
const int32 GRDGImmediateMode = 0;
|
|
|
|
|
const int32 GRDGDebug = 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-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-06-11 18:27:07 -04:00
|
|
|
bool GetEmitRDGEvents()
|
|
|
|
|
{
|
|
|
|
|
#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:06:34 -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 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-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-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-07-09 17:21:54 -04:00
|
|
|
void FRDGBuilder::TickPoolElements()
|
|
|
|
|
{
|
|
|
|
|
GRenderGraphResourcePool.TickPoolElements();
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
FRDGBuilder::FRDGBuilder(FRHICommandListImmediate& InRHICmdList)
|
|
|
|
|
: RHICmdList(InRHICmdList)
|
|
|
|
|
, MemStack(FMemStack::Get())
|
|
|
|
|
, EventScopeStack(RHICmdList)
|
|
|
|
|
, StatScopeStack(RHICmdList)
|
|
|
|
|
{}
|
|
|
|
|
|
2018-10-22 14:28:32 -04:00
|
|
|
void FRDGBuilder::Execute()
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
2019-04-12 10:05:47 -04:00
|
|
|
CSV_SCOPED_TIMING_STAT_EXCLUSIVE(FRDGBuilder_Execute);
|
2018-11-21 20:33:41 -05:00
|
|
|
|
2019-07-16 13:06:34 -04:00
|
|
|
IF_RDG_ENABLE_DEBUG(Validation.ValidateExecuteBegin());
|
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:06:34 -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:06:34 -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-07-16 13:06:34 -04:00
|
|
|
IF_RDG_ENABLE_DEBUG(Validation.ValidateAddPass(Pass));
|
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-06-11 18:27:07 -04:00
|
|
|
if (!GVisualizeTexture.bEnabled)
|
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-11 18:27:07 -04:00
|
|
|
if (FRDGTextureRef Texture = UAV->Desc.Texture)
|
|
|
|
|
{
|
|
|
|
|
if (GVisualizeTexture.ShouldCapture(Texture->Name))
|
|
|
|
|
{
|
|
|
|
|
GVisualizeTexture.CreateContentCapturePass(*this, Texture);
|
|
|
|
|
}
|
|
|
|
|
}
|
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-06-11 18:27:07 -04:00
|
|
|
const bool bHasStoreAction = DepthStencil.GetDepthStoreAction() != ERenderTargetStoreAction::ENoAction || DepthStencil.GetStencilStoreAction() != ERenderTargetStoreAction::ENoAction;
|
|
|
|
|
|
|
|
|
|
if (bHasStoreAction && GVisualizeTexture.ShouldCapture(Texture->Name))
|
2018-11-21 20:22:47 -05:00
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
GVisualizeTexture.CreateContentCapturePass(*this, Texture);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const uint32 RenderTargetCount = RenderTargets.Num();
|
|
|
|
|
|
|
|
|
|
for (uint32 RenderTargetIndex = 0; RenderTargetIndex < RenderTargetCount; ++RenderTargetIndex)
|
|
|
|
|
{
|
|
|
|
|
const FRenderTargetBinding& RenderTarget = RenderTargets[RenderTargetIndex];
|
|
|
|
|
|
|
|
|
|
if (FRDGTextureRef Texture = RenderTarget.GetTexture())
|
|
|
|
|
{
|
|
|
|
|
const bool bHasStoreAction = RenderTarget.GetStoreAction() != ERenderTargetStoreAction::ENoAction;
|
|
|
|
|
|
|
|
|
|
if (bHasStoreAction && GVisualizeTexture.ShouldCapture(Texture->Name))
|
|
|
|
|
{
|
|
|
|
|
GVisualizeTexture.CreateContentCapturePass(*this, Texture);
|
|
|
|
|
}
|
2018-11-21 20:22:47 -05:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-06-11 18:27:07 -04:00
|
|
|
#endif
|
2018-11-21 20:22:47 -05:00
|
|
|
}
|
|
|
|
|
|
2018-10-22 14:28:32 -04:00
|
|
|
void FRDGBuilder::WalkGraphDependencies()
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
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-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:
|
|
|
|
|
case UBMT_RDG_BUFFER:
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
if (FRDGTrackedResourceRef Resource = Parameter.GetAsTrackedResource())
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
2018-10-22 23:01:29 -04:00
|
|
|
Resource->ReferenceCount++;
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2019-01-04 14:52:46 -05:00
|
|
|
case UBMT_RDG_TEXTURE_SRV:
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
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
|
|
|
{
|
|
|
|
|
SRV->Desc.Texture->ReferenceCount++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2019-01-04 14:52:46 -05:00
|
|
|
case UBMT_RDG_TEXTURE_UAV:
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
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
|
|
|
{
|
|
|
|
|
UAV->Desc.Texture->ReferenceCount++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2019-01-04 14:52:46 -05:00
|
|
|
case UBMT_RDG_BUFFER_SRV:
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
if (FRDGBufferSRVRef SRV = Parameter.GetAsBufferSRV())
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
|
|
|
|
SRV->Desc.Buffer->ReferenceCount++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2019-01-04 14:52:46 -05:00
|
|
|
case UBMT_RDG_BUFFER_UAV:
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
if (FRDGBufferUAVRef UAV = Parameter.GetAsBufferUAV())
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
|
|
|
|
UAV->Desc.Buffer->ReferenceCount++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
case UBMT_RENDER_TARGET_BINDING_SLOTS:
|
|
|
|
|
{
|
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
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
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 22:15:02 -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:44 -04:00
|
|
|
check(Texture->ResourceRHI);
|
2018-10-22 23:01:29 -04:00
|
|
|
}
|
|
|
|
|
|
2019-06-18 22:15:02 -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;
|
|
|
|
|
}
|
|
|
|
|
|
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-06-11 18:27:07 -04:00
|
|
|
UAV->ResourceRHI = UAV->Desc.Texture->PooledRenderTarget->GetRenderTargetItem().MipUAVs[UAV->Desc.MipLevel];
|
2018-10-22 23:01:29 -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 22:15:02 -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:06:34 -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;
|
|
|
|
|
bool bHasRenderTargets = false;
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
PrepareResourcesForExecute(Pass, &RPInfo, &bHasRenderTargets);
|
|
|
|
|
|
|
|
|
|
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-06-11 18:27:07 -04:00
|
|
|
if (!Pass->IsCompute())
|
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(bHasRenderTargets);
|
|
|
|
|
RHICmdList.BeginRenderPass( RPInfo, Pass->GetName() );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2018-10-29 17:45:21 -04:00
|
|
|
UnbindRenderTargets(RHICmdList);
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Pass->Execute(RHICmdList);
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
if (bHasRenderTargets)
|
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:06:34 -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
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
void FRDGBuilder::PrepareResourcesForExecute(const FRDGPass* Pass, struct FRHIRenderPassInfo* OutRPInfo, bool* bOutHasRenderTargets)
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
{
|
2019-06-18 22:15:02 -04:00
|
|
|
check(Pass);
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
OutRPInfo->NumUAVs = 0;
|
|
|
|
|
OutRPInfo->UAVIndex = 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-18 22:15:02 -04:00
|
|
|
const bool bIsCompute = Pass->IsCompute();
|
2019-06-11 18:27:07 -04:00
|
|
|
|
2019-07-16 13:06:34 -04:00
|
|
|
FRDGBarrierBatcher BarrierBatcher(RHICmdList, Pass);
|
2019-06-18 22:15:02 -04:00
|
|
|
|
|
|
|
|
// NOTE: When generating mips, we don't perform any transitions on textures. They are done implicitly by the RHI.
|
|
|
|
|
const bool bGeneratingMips = Pass->IsGenerateMips();
|
2019-06-11 18:27:07 -04:00
|
|
|
|
|
|
|
|
FRDGPassParameterStruct ParameterStruct = Pass->GetParameters();
|
|
|
|
|
|
|
|
|
|
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:
|
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 22:15:02 -04:00
|
|
|
|
2019-07-16 13:06:34 -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-01-15 19:57:23 -05:00
|
|
|
// Might be the first time using this render graph SRV, so need to setup the cached rhi resource.
|
2019-06-11 18:27:07 -04:00
|
|
|
if (!SRV->ResourceRHI)
|
2019-01-15 19:57:23 -05:00
|
|
|
{
|
2019-06-11 18:27:07 -04:00
|
|
|
SRV->ResourceRHI = Texture->PooledRenderTarget->GetRenderTargetItem().MipSRVs[SRV->Desc.MipLevel];
|
2019-01-15 19:57:23 -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
|
|
|
|
2019-07-16 13:06:34 -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_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;
|
|
|
|
|
|
|
|
|
|
AllocateRHITextureUAVIfNeeded(UAV);
|
|
|
|
|
|
|
|
|
|
FRHIUnorderedAccessView* UAVRHI = UAV->GetRHI();
|
|
|
|
|
|
2019-06-18 22:15:02 -04:00
|
|
|
if (!bIsCompute)
|
2019-06-11 18:27:07 -04:00
|
|
|
{
|
|
|
|
|
OutRPInfo->UAVs[OutRPInfo->NumUAVs++] = UAVRHI; // Bind UAVs in declaration order
|
|
|
|
|
}
|
|
|
|
|
|
2019-07-16 13:06:34 -04:00
|
|
|
BarrierBatcher.QueueTransitionUAV(UAVRHI, Texture, FRDGResourceState::EAccess::Write);
|
2018-10-22 23:01:29 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2019-01-04 14:52:46 -05:00
|
|
|
case UBMT_RDG_BUFFER:
|
2018-10-22 23:01:29 -04:00
|
|
|
{
|
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 22:15:02 -04:00
|
|
|
FRHIUnorderedAccessView* UAVRHI = Buffer->PooledBuffer->UAVs.CreateIterator().Value();
|
2019-06-11 18:27:07 -04:00
|
|
|
|
2019-07-16 13:06:34 -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);
|
|
|
|
|
|
|
|
|
|
// 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 22:15:02 -04:00
|
|
|
FRHIUnorderedAccessView* UAVRHI = Buffer->PooledBuffer->UAVs.CreateIterator().Value();
|
2019-06-11 18:27:07 -04:00
|
|
|
|
2019-07-16 13:06:34 -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_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();
|
|
|
|
|
|
2019-06-18 22:15:02 -04:00
|
|
|
if (!bIsCompute)
|
2019-06-11 18:27:07 -04:00
|
|
|
{
|
|
|
|
|
OutRPInfo->UAVs[OutRPInfo->NumUAVs++] = UAVRHI; // Bind UAVs in declaration order
|
|
|
|
|
}
|
2019-06-18 22:15:02 -04:00
|
|
|
|
2019-07-16 13:06:34 -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;
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
// TODO(RDG): Looks like the store action on FRenderTargetBinding is not necessary, because: if want to bind a RT,
|
|
|
|
|
// that is most certainly to modify it as oposed to depth-stencil that might be for read only purposes. And if modify
|
|
|
|
|
// this resource, that certainly for being used by another pass. Otherwise this pass should be culled.
|
|
|
|
|
//
|
|
|
|
|
// 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.
|
|
|
|
|
ERenderTargetStoreAction StoreAction = RenderTarget.GetStoreAction();
|
|
|
|
|
|
|
|
|
|
// 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;
|
|
|
|
|
OutRenderTarget.ArraySlice = -1;
|
|
|
|
|
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
|
|
|
|
2019-07-16 13:06:34 -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
|
|
|
OutRPInfo->UAVIndex = ValidRenderTargetCount;
|
|
|
|
|
|
|
|
|
|
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-06-11 18:27:07 -04:00
|
|
|
// TODO(RDG): Addresses the TODO of the color scene render target.
|
|
|
|
|
ensureMsgf(Texture->Desc.NumSamples == 1, TEXT("MSAA dept-stencil render target not yet supported."));
|
|
|
|
|
OutDepthStencil.DepthStencilTarget = Texture->PooledRenderTarget->GetRenderTargetItem().TargetableTexture;
|
|
|
|
|
OutDepthStencil.ResolveTarget = nullptr;
|
|
|
|
|
OutDepthStencil.Action = MakeDepthStencilTargetActions(
|
|
|
|
|
MakeRenderTargetActions(DepthStencil.GetDepthLoadAction(), DepthStencil.GetDepthStoreAction()),
|
|
|
|
|
MakeRenderTargetActions(DepthStencil.GetStencilLoadAction(), DepthStencil.GetStencilStoreAction()));
|
|
|
|
|
OutDepthStencil.ExclusiveDepthStencil = DepthStencil.GetDepthStencilAccess();
|
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 22:15:02 -04:00
|
|
|
BarrierBatcher.QueueTransitionTexture(Texture,
|
|
|
|
|
DepthStencil.GetDepthStencilAccess().IsAnyWrite() ?
|
2019-07-16 13:06:34 -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
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
*bOutHasRenderTargets = ValidRenderTargetCount + ValidDepthStencilCount > 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
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-12-11 13:44:34 -05:00
|
|
|
|
|
|
|
|
OutRPInfo->bGeneratingMips = bGeneratingMips;
|
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
|
|
|
}
|
|
|
|
|
|
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:
|
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:
|
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
|
|
|
{
|
2019-07-16 13:06:34 -04:00
|
|
|
FRDGBarrierBatcher BarrierBatcher(RHICmdList, nullptr);
|
2019-06-18 22:15:02 -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
|
|
|
for (const auto& Query : DeferredInternalTextureQueries)
|
|
|
|
|
{
|
|
|
|
|
check(Query.Texture->PooledRenderTarget);
|
|
|
|
|
|
|
|
|
|
if (Query.bTransitionToRead)
|
|
|
|
|
{
|
2019-07-16 13:06:34 -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)
|
|
|
|
|
{
|
|
|
|
|
*Query.OutBufferPtr = AllocatedBuffers.FindChecked(Query.Buffer);
|
|
|
|
|
|
2019-07-16 15:10:44 -04:00
|
|
|
// No need to manually release in immediate mode, since it is done directly when emptying AllocatedTextures 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
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
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:15:02 -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();
|
|
|
|
|
}
|