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 15:01:03 -04:00
# include "RenderGraphBarrierBatcher.h"
2018-11-21 20:22:47 -05:00
# include "VisualizeTexture.h"
2019-04-18 14:58:19 -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-04-30 19:41:44 -04:00
namespace
{
2019-05-03 13:41:38 -04:00
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-05-03 13:41:38 -04:00
# if RDG_ENABLE_DEBUG
int32 GRDGImmediateMode = 0 ;
FAutoConsoleVariableRef CVarImmediateMode (
TEXT ( " r.RDG.ImmediateMode " ) ,
GRDGImmediateMode ,
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-05-09 20:12:15 -04:00
int32 GRDGDebug = 0 ;
FAutoConsoleVariableRef CVarRDGDebug (
TEXT ( " r.RDG.Debug " ) ,
GRDGDebug ,
2019-05-03 13:41:38 -04: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. " ) ,
ECVF_RenderThreadSafe ) ;
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.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 20:13:27 -04:00
static TAutoConsoleVariable < int32 > CVarRDGEnableBreakPoint (
TEXT ( " r.RDG.EnableBreakPoint " ) , 0 ,
TEXT ( " Breakpoint in debugger when a warning is raised. \n " ) ,
ECVF_RenderThreadSafe ) ;
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
# else
2019-05-03 13:41:38 -04:00
const int32 GRDGImmediateMode = 0 ;
2019-05-09 20:12:15 -04:00
const int32 GRDGDebug = 0 ;
2019-05-03 13:41:38 -04:00
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
# endif
2019-05-03 13:41:38 -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-04-30 19:41:44 -04:00
bool GetEmitRDGEvents ( )
{
2019-06-28 21:53:33 -04:00
check ( IsInRenderingThread ( ) ) ;
2019-04-30 19:41:44 -04:00
# if RDG_EVENTS != RDG_EVENTS_NONE
2019-05-09 20:12:15 -04:00
return GetEmitDrawEvents ( ) | | GRDGDebug ;
2019-04-30 19:41:44 -04:00
# 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
2018-12-18 21:41:17 -05:00
void InitRenderGraph ( )
{
2019-04-30 19:41:44 -04:00
# if RDG_ENABLE_DEBUG_WITH_ENGINE
2018-12-18 21:41:17 -05:00
if ( FParse : : Param ( FCommandLine : : Get ( ) , TEXT ( " rdgimmediate " ) ) )
{
2019-05-03 13:41:38 -04:00
GRDGImmediateMode = 1 ;
2018-12-18 21:41:17 -05:00
}
2019-04-08 23:16:25 -04:00
if ( FParse : : Param ( FCommandLine : : Get ( ) , TEXT ( " rdgdebug " ) ) )
{
2019-05-09 20:12:15 -04:00
GRDGDebug = 1 ;
2019-04-08 23:16:25 -04:00
}
2018-12-18 21:41:17 -05:00
# endif
}
2019-05-03 13:41:38 -04:00
void EmitRDGWarning ( const FString & WarningMessage )
2019-01-16 15:48:28 -05:00
{
2019-06-11 20:13:27 -04:00
# if RDG_ENABLE_DEBUG_WITH_ENGINE
2019-05-09 20:12:15 -04:00
if ( ! GRDGDebug )
2019-05-03 13:41:38 -04:00
{
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 20:13:27 -04:00
const bool bEnableBreakPoint = CVarRDGEnableBreakPoint . GetValueOnRenderThread ( ) ;
2019-05-09 20:12:15 -04:00
if ( GRDGDebug = = kRDGEmitWarningsOnce )
2019-01-16 16:12:36 -05:00
{
2019-05-03 13:41:38 -04:00
if ( ! GAlreadyEmittedWarnings . Contains ( WarningMessage ) )
{
GAlreadyEmittedWarnings . Add ( WarningMessage ) ;
UE_LOG ( LogRendererCore , Warning , TEXT ( " %s " ) , * WarningMessage ) ;
2019-06-11 20:13:27 -04:00
if ( bEnableBreakPoint )
{
UE_DEBUG_BREAK ( ) ;
}
2019-05-03 13:41:38 -04:00
}
2019-01-16 16:12:36 -05:00
}
2019-05-03 13:41:38 -04:00
else
2019-01-16 15:48:28 -05:00
{
UE_LOG ( LogRendererCore , Warning , TEXT ( " %s " ) , * WarningMessage ) ;
2019-06-11 20:13:27 -04:00
if ( bEnableBreakPoint )
{
UE_DEBUG_BREAK ( ) ;
}
2019-01-16 15:48:28 -05:00
}
2019-06-11 20:13:27 -04:00
# endif
2019-01-16 15:48:28 -05:00
}
2019-05-03 13:41:38 -04:00
# define EmitRDGWarningf(WarningMessageFormat, ...) \
EmitRDGWarning ( FString : : Printf ( WarningMessageFormat , # # __VA_ARGS__ ) ) ;
2018-12-11 13:44:34 -05:00
2019-07-09 17:24:17 -04:00
void FRDGBuilder : : TickPoolElements ( )
{
GRenderGraphResourcePool . TickPoolElements ( ) ;
}
2019-05-03 13:41:38 -04:00
FRDGBuilder : : FRDGBuilder ( FRHICommandListImmediate & InRHICmdList )
: RHICmdList ( InRHICmdList )
, MemStack ( FMemStack : : Get ( ) )
, EventScopeStack ( RHICmdList )
2019-05-06 21:16:08 -04:00
, StatScopeStack ( RHICmdList )
2019-05-03 13:41:38 -04:00
{ }
FRDGBuilder : : ~ FRDGBuilder ( )
2018-12-11 13:44:34 -05:00
{
2019-05-03 13:41:38 -04:00
# if RDG_ENABLE_DEBUG
2018-12-11 13:44:34 -05:00
{
2019-05-03 13:41:38 -04:00
checkf ( bHasExecuted , TEXT ( " Render graph execution is required to ensure consistency with immediate mode. " ) ) ;
2018-12-11 13:44:34 -05:00
}
2019-05-03 13:41:38 -04:00
# endif
2018-12-11 13:44:34 -05:00
}
2018-10-22 14:28:32 -04:00
void FRDGBuilder : : Execute ( )
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
{
2019-04-18 14:58:19 -04:00
CSV_SCOPED_TIMING_STAT_EXCLUSIVE ( FRDGBuilder_Execute ) ;
2018-11-21 20:33:41 -05:00
2019-04-30 19:41:44 -04:00
# if RDG_ENABLE_DEBUG
{
2019-01-22 02:15:37 -05:00
checkf ( ! bHasExecuted , TEXT ( " Render graph execution should only happen once to ensure consistency with immediate mode. " ) ) ;
2019-02-26 16:43:29 -05:00
/** FRDGBuilder::AllocParameters() allocates shader parameter structure for the life time until pass execution.
* But they are allocated on a FMemStack for CPU performance reason , and have their destructor called right after
* the pass execution . Therefore allocating pass parameter unused by a FRDGBuilder : : AddPass ( ) can lead on a memory
* leak of RHI resource that have been reference in the parameter structure .
*/
checkf (
AllocatedUnusedPassParameters . Num ( ) = = 0 ,
TEXT ( " %i pass parameter structure has been allocated with FRDGBuilder::AllocParameters(), but has not be used by a " )
TEXT ( " FRDGBuilder::AddPass() that can cause RHI resource leak. " ) , AllocatedUnusedPassParameters . Num ( ) ) ;
2018-10-21 16:35:13 -04:00
}
# endif
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
2019-04-30 19:41:44 -04:00
EventScopeStack . BeginExecute ( ) ;
2019-05-06 21:16:08 -04:00
StatScopeStack . BeginExecute ( ) ;
2019-04-30 19:41:44 -04:00
2019-05-03 13:41:38 -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
{
WalkGraphDependencies ( ) ;
2018-10-22 14:28:32 -04:00
QUICK_SCOPE_CYCLE_COUNTER ( STAT_FRDGBuilder_Execute ) ;
2019-04-30 19:41:44 -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-04-30 19:41:44 -04:00
EventScopeStack . EndExecute ( ) ;
2019-05-06 21:16:08 -04:00
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 ( ) ;
DestructPasses ( ) ;
2019-04-30 19:41:44 -04:00
# if RDG_ENABLE_DEBUG
2018-10-21 16:35:13 -04:00
{
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
bHasExecuted = true ;
2018-10-21 16:35:13 -04:00
}
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
# endif
}
2019-04-30 19:41:44 -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-05-03 13:41:38 -04:00
# if RDG_ENABLE_DEBUG
2019-04-30 19:41:44 -04:00
{
checkf ( ! bHasExecuted , TEXT ( " Render graph pass %s needs to be added before the builder execution. " ) , Pass - > GetName ( ) ) ;
2019-05-03 13:41:38 -04:00
const void * ParameterStructData = Pass - > GetParameters ( ) . GetContents ( ) ;
/** The lifetime of each pass parameter structure must extend until deferred pass execution; therefore, it needs to be
* allocated with FRDGBuilder : : AllocParameters ( ) . Also , all references held by the parameter structure are released
* immediately after pass execution , so a pass parameter struct instance must be 1 - to - 1 with a pass instance ( i . e . one
* per AddPass ( ) call ) .
*/
2019-04-30 19:41:44 -04:00
checkf (
AllocatedUnusedPassParameters . Contains ( ParameterStructData ) ,
TEXT ( " The pass parameter structure has not been allocated for correct life time FRDGBuilder::AllocParameters() or has already " )
TEXT ( " been used by another previous FRDGBuilder::AddPass(). " ) ) ;
AllocatedUnusedPassParameters . Remove ( ParameterStructData ) ;
}
2019-05-03 13:41:38 -04:00
# endif
2019-04-30 19:41:44 -04:00
2019-05-06 21:16:08 -04:00
Pass - > EventScope = EventScopeStack . GetCurrentScope ( ) ;
Pass - > StatScope = StatScopeStack . GetCurrentScope ( ) ;
2019-04-30 19:41:44 -04:00
Passes . Emplace ( 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
ValidatePass ( Pass ) ;
2019-05-03 13:41:38 -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
{
ExecutePass ( Pass ) ;
}
2018-11-21 20:22:47 -05:00
2019-05-03 13:41:38 -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-04-30 19:41:44 -04:00
void FRDGBuilder : : ValidatePass ( const FRDGPass * Pass ) const
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
{
2019-04-30 19:41:44 -04:00
# if RDG_ENABLE_DEBUG
2019-05-03 13:41:38 -04:00
const FRenderTargetBindingSlots * RenderTargetBindingSlots = 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-05-03 13:41:38 -04:00
const TCHAR * PassName = Pass - > GetName ( ) ;
2019-06-18 23:57:06 -04:00
const bool bIsGraphics = Pass - > IsGraphics ( ) ;
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.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-05-03 13:41:38 -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-05-03 13:41:38 -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-05-03 13:41:38 -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-07 14:44:04 -05:00
case UBMT_RDG_TEXTURE :
{
2019-05-03 13:41:38 -04:00
if ( FRDGTextureRef Texture = Parameter . GetAsTexture ( ) )
{
checkf ( Texture - > HasBeenProduced ( ) ,
TEXT ( " Pass %s has a dependency over the texture %s that has never been produced. " ) ,
PassName , Texture - > Name ) ;
}
2019-01-07 14:44:04 -05:00
}
break ;
case UBMT_RDG_TEXTURE_SRV :
{
2019-05-03 13:41:38 -04:00
if ( FRDGTextureSRVRef SRV = Parameter . GetAsTextureSRV ( ) )
2019-01-07 14:44:04 -05:00
{
2019-05-03 13:41:38 -04:00
FRDGTextureRef Texture = SRV - > Desc . Texture ;
checkf ( Texture - > HasBeenProduced ( ) ,
2019-01-07 14:44:04 -05:00
TEXT ( " Pass %s has a dependency over the texture %s that has never been produced. " ) ,
2019-05-03 13:41:38 -04:00
PassName , Texture - > Name ) ;
2019-01-07 14:44:04 -05:00
}
}
break ;
2019-01-04 14:52:46 -05:00
case UBMT_RDG_TEXTURE_UAV :
2019-01-07 14:44:04 -05:00
{
2019-05-03 13:41:38 -04:00
if ( FRDGTextureUAVRef UAV = Parameter . GetAsTextureUAV ( ) )
2019-01-07 14:44:04 -05:00
{
2019-05-03 13:41:38 -04:00
FRDGTextureRef Texture = UAV - > Desc . Texture ;
2019-01-15 19:57:23 -05:00
2019-05-03 13:41:38 -04:00
Texture - > MarkAsProducedBy ( Pass ) ;
2019-01-07 14:44:04 -05:00
}
}
break ;
case UBMT_RDG_BUFFER :
{
2019-05-03 13:41:38 -04:00
if ( FRDGBufferRef Buffer = Parameter . GetAsBuffer ( ) )
{
checkf ( Buffer - > HasBeenProduced ( ) ,
TEXT ( " Pass %s has a dependency over the buffer %s that has never been produced. " ) ,
PassName , Buffer - > Name ) ;
}
2019-01-07 14:44:04 -05:00
}
break ;
case UBMT_RDG_BUFFER_SRV :
{
2019-05-03 13:41:38 -04:00
if ( FRDGBufferSRVRef SRV = Parameter . GetAsBufferSRV ( ) )
2019-01-07 14:44:04 -05:00
{
2019-05-03 13:41:38 -04:00
FRDGBufferRef Buffer = SRV - > Desc . Buffer ;
checkf ( Buffer - > HasBeenProduced ( ) ,
2019-01-07 14:44:04 -05:00
TEXT ( " Pass %s has a dependency over the buffer %s that has never been produced. " ) ,
2019-05-03 13:41:38 -04:00
PassName , SRV - > Desc . Buffer - > Name ) ;
2019-01-07 14:44:04 -05:00
}
}
break ;
2019-01-04 14:52:46 -05:00
case UBMT_RDG_BUFFER_UAV :
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
{
2019-05-03 13:41:38 -04:00
if ( FRDGBufferUAVRef UAV = Parameter . GetAsBufferUAV ( ) )
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.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-05-03 13:41:38 -04:00
FRDGBufferRef Buffer = UAV - > Desc . Buffer ;
2019-01-15 19:57:23 -05:00
2019-05-03 13:41:38 -04:00
Buffer - > MarkAsProducedBy ( 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
}
}
break ;
2019-06-18 16:53:31 -04:00
case UBMT_RDG_TEXTURE_COPY_DEST :
case UBMT_RDG_BUFFER_COPY_DEST :
{
if ( FRDGTrackedResourceRef Resource = Parameter . GetAsTrackedResource ( ) )
{
Resource - > MarkAsProducedBy ( Pass ) ;
}
}
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-05-03 13:41:38 -04:00
if ( ! RenderTargetBindingSlots )
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.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-05-03 13:41:38 -04:00
RenderTargetBindingSlots = & Parameter . GetAsRenderTargetBindingSlots ( ) ;
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.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-05-09 20:12:15 -04:00
else if ( GRDGDebug )
2018-12-18 21:41:17 -05:00
{
2019-05-03 13:41:38 -04:00
EmitRDGWarningf (
2019-01-16 15:48:28 -05:00
TEXT ( " Pass %s have duplicated render target binding slots. " ) ,
2019-05-03 13:41:38 -04:00
PassName ) ;
2018-12-18 21:41:17 -05:00
}
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
}
break ;
default :
break ;
}
}
2019-05-03 13:41:38 -04:00
/** Validate that raster passes have render target binding slots and compute passes don't. */
if ( RenderTargetBindingSlots )
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.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 23:57:06 -04:00
checkf ( bIsGraphics , TEXT ( " Pass '%s' has render target binding slots but is flagged as 'Compute'. " ) , PassName ) ;
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
}
else
{
2019-06-18 23:57:06 -04:00
checkf ( ! bIsGraphics , TEXT ( " Pass '%s' is missing render target binding slots. Set the 'Compute' or 'Copy' flag if render targets are not required. " ) , PassName ) ;
2019-05-03 13:41:38 -04:00
}
/** Validate render target / depth stencil binding usage. */
if ( RenderTargetBindingSlots )
{
const auto & RenderTargets = RenderTargetBindingSlots - > Output ;
const uint32 RenderTargetCount = RenderTargets . Num ( ) ;
{
/** Tracks the number of contiguous, non-null textures in the render target output array. */
uint32 ValidRenderTargetCount = 0 ;
for ( uint32 RenderTargetIndex = 0 ; RenderTargetIndex < RenderTargetCount ; + + RenderTargetIndex )
{
const FRenderTargetBinding & RenderTarget = RenderTargets [ RenderTargetIndex ] ;
if ( FRDGTextureRef Texture = RenderTarget . GetTexture ( ) )
{
const bool bIsLoadAction = RenderTarget . GetLoadAction ( ) = = ERenderTargetLoadAction : : ELoad ;
2019-06-18 16:53:31 -04:00
/** Validate that load action is correct. We can only load contents if a pass previously produced something. */
{
const bool bIsLoadActionInvalid = bIsLoadAction & & ! Texture - > HasBeenProduced ( ) ;
checkf (
! bIsLoadActionInvalid ,
TEXT ( " Pass '%s' attempted to bind texture '%s' as a render target with the 'Load' action specified, but the texture has not been produced yet. The render target must use either 'Clear' or 'NoAction' action instead. " ) ,
Pass - > GetName ( ) ,
Texture - > Name ) ;
}
/** Validate that any previously produced texture contents are loaded. This occurs if the user failed to specify a load action
* on a texture that was produced by a previous pass , effectively losing that data . This can also happen if the user ' re - uses '
* a texture for some other purpose . The latter is considered bad practice , since it increases memory pressure on the render
* target pool . Instead , the user should create a new texture instance . An exception to this rule are untracked render targets ,
* which are not actually managed by the render target pool and likely represent the frame buffer .
*/
{
// We only validate single-mip textures since we don't track production at the subresource level.
const bool bFailedToLoadProducedContent = ! bIsLoadAction & & Texture - > HasBeenProduced ( ) & & Texture - > Desc . NumMips = = 1 ;
// Untracked render targets aren't actually managed by the render target pool.
const bool bIsUntrackedRenderTarget = Texture - > PooledRenderTarget & & Texture - > PooledRenderTarget - > IsTracked ( ) ;
ensureMsgf ( ! bFailedToLoadProducedContent | | bIsUntrackedRenderTarget ,
TEXT ( " Pass '%s' attempted to bind texture '%s' as a render target without the 'Load' action specified, despite a prior pass having produced it. It's invalid to completely clobber the contents of a resource. Create a new texture instance instead. " ) ,
Pass - > GetName ( ) ,
Texture - > Name ) ;
}
2019-05-08 20:22:42 -04:00
2019-05-03 13:41:38 -04:00
/** Mark the pass as a producer for render targets with a store action. */
{
2019-05-08 20:22:42 -04:00
const bool bIsStoreAction = RenderTarget . GetStoreAction ( ) ! = ERenderTargetStoreAction : : ENoAction ;
check ( bIsStoreAction ) ; // already been validated in FRenderTargetBinding::Validate()
2019-05-03 13:41:38 -04:00
Texture - > MarkAsProducedBy ( Pass ) ;
}
}
else
{
/** Found end of contiguous interval of valid render targets. */
ValidRenderTargetCount = RenderTargetIndex ;
break ;
}
}
/** Validate that no holes exist in the render target output array. Render targets must be bound contiguously. */
for ( uint32 RenderTargetIndex = ValidRenderTargetCount ; RenderTargetIndex < RenderTargetCount ; + + RenderTargetIndex )
{
const FRenderTargetBinding & RenderTarget = RenderTargets [ RenderTargetIndex ] ;
checkf ( RenderTarget . GetTexture ( ) = = nullptr , TEXT ( " Render targets must be packed. No empty spaces in the array. " ) ) ;
}
}
const auto IsMipLevelBoundForRead = [ ParameterStruct , ParameterCount ] ( FRDGTextureRef Texture , uint32 MipLevel )
{
for ( uint32 ParameterIndex = 0 ; ParameterIndex < ParameterCount ; + + ParameterIndex )
{
FRDGPassParameter Parameter = ParameterStruct . GetParameter ( ParameterIndex ) ;
switch ( Parameter . GetType ( ) )
{
case UBMT_RDG_TEXTURE :
{
if ( Parameter . GetAsTexture ( ) = = Texture )
{
/** Full texture view bound. */
return true ;
}
break ;
}
case UBMT_RDG_TEXTURE_SRV :
{
if ( const FRDGTextureSRVRef InputSRV = Parameter . GetAsTextureSRV ( ) )
{
const FRDGTextureSRVDesc & InputSRVDesc = InputSRV - > Desc ;
if ( InputSRVDesc . Texture = = Texture )
{
return InputSRVDesc . MipLevel = = MipLevel ;
}
}
break ;
}
default :
break ;
}
}
return false ;
} ;
/** Validate that texture mips are not bound as a render target and SRV at the same time. */
for ( uint32 RenderTargetIndex = 0 ; RenderTargetIndex < RenderTargetCount ; + + RenderTargetIndex )
{
const FRenderTargetBinding & RenderTarget = RenderTargets [ RenderTargetIndex ] ;
if ( FRDGTextureRef Texture = RenderTarget . GetTexture ( ) )
{
if ( IsMipLevelBoundForRead ( Texture , RenderTarget . GetMipIndex ( ) ) )
{
checkf ( false , TEXT ( " Texture '%s', Mip '%d' is bound as a render target and SRV at the same time. " ) , Texture - > Name , RenderTarget . GetMipIndex ( ) ) ;
}
}
else
{
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
}
2019-04-30 19:41:44 -04:00
# endif // 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-05-03 13:41:38 -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-05-06 21:03:11 -04:00
if ( ! GVisualizeTexture . bEnabled )
{
return ;
}
2019-05-03 13:41:38 -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-05-03 13:41:38 -04:00
if ( FRDGTextureUAVRef UAV = Parameter . GetAsTextureUAV ( ) )
2018-11-21 20:22:47 -05:00
{
2019-06-28 21:53:33 -04:00
FRDGTextureRef Texture = UAV - > Desc . Texture ;
check ( Texture ) ;
int32 CaptureId = GVisualizeTexture . ShouldCapture ( Texture - > Name ) ;
if ( CaptureId ! = FVisualizeTexture : : kInvalidCaptureId & & UAV - > Desc . MipLevel = = GVisualizeTexture . CustomMip )
2019-05-03 13:41:38 -04:00
{
2019-06-28 21:53:33 -04:00
GVisualizeTexture . CreateContentCapturePass ( * this , Texture , CaptureId ) ;
2019-05-03 13:41:38 -04:00
}
2018-11-21 20:22:47 -05:00
}
}
break ;
case UBMT_RENDER_TARGET_BINDING_SLOTS :
{
2019-05-03 13:41:38 -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-05-03 13:41:38 -04:00
const bool bHasStoreAction = DepthStencil . GetDepthStoreAction ( ) ! = ERenderTargetStoreAction : : ENoAction | | DepthStencil . GetStencilStoreAction ( ) ! = ERenderTargetStoreAction : : ENoAction ;
2019-06-28 21:53:33 -04:00
if ( bHasStoreAction )
2019-05-03 13:41:38 -04:00
{
2019-06-28 21:53:33 -04:00
// Depth render target binding can only be done on mip level 0.
const int32 MipLevel = 0 ;
int32 CaptureId = GVisualizeTexture . ShouldCapture ( Texture - > Name ) ;
if ( CaptureId ! = FVisualizeTexture : : kInvalidCaptureId & & MipLevel = = GVisualizeTexture . CustomMip )
{
GVisualizeTexture . CreateContentCapturePass ( * this , Texture , CaptureId ) ;
}
2019-05-03 13:41:38 -04:00
}
2018-11-21 20:22:47 -05:00
}
2019-05-03 13:41:38 -04:00
const uint32 RenderTargetCount = RenderTargets . Num ( ) ;
for ( uint32 RenderTargetIndex = 0 ; RenderTargetIndex < RenderTargetCount ; + + RenderTargetIndex )
2018-11-21 20:22:47 -05:00
{
2019-05-03 13:41:38 -04:00
const FRenderTargetBinding & RenderTarget = RenderTargets [ RenderTargetIndex ] ;
if ( FRDGTextureRef Texture = RenderTarget . GetTexture ( ) )
{
const bool bHasStoreAction = RenderTarget . GetStoreAction ( ) ! = ERenderTargetStoreAction : : ENoAction ;
2019-06-28 21:53:33 -04:00
if ( bHasStoreAction )
2019-05-03 13:41:38 -04:00
{
2019-06-28 21:53:33 -04:00
int32 CaptureId = GVisualizeTexture . ShouldCapture ( Texture - > Name ) ;
if ( CaptureId ! = FVisualizeTexture : : kInvalidCaptureId & & RenderTarget . GetMipIndex ( ) = = GVisualizeTexture . CustomMip )
{
GVisualizeTexture . CreateContentCapturePass ( * this , Texture , CaptureId ) ;
}
2019-05-03 13:41:38 -04:00
}
}
else
2019-04-23 20:54:11 -04:00
{
break ;
}
2018-11-21 20:22:47 -05:00
}
}
break ;
default :
break ;
}
}
2019-05-03 13:41:38 -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-04-30 19:41:44 -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-05-03 13:41:38 -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-05-03 13:41:38 -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-05-03 13:41:38 -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-05-03 13:41:38 -04:00
switch ( Parameter . GetType ( ) )
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
{
2019-01-04 14:52:46 -05:00
case UBMT_RDG_TEXTURE :
2019-06-18 16:53:31 -04:00
case UBMT_RDG_TEXTURE_COPY_DEST :
2019-01-04 14:52:46 -05:00
case UBMT_RDG_BUFFER :
2019-06-18 16:53:31 -04:00
case UBMT_RDG_BUFFER_COPY_DEST :
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.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-05-03 13:41:38 -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-05-03 13:41:38 -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-05-03 13:41:38 -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-05-03 13:41:38 -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-05-03 13:41:38 -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-05-03 13:41:38 -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-05-03 13:41:38 -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-05-03 13:41:38 -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-05-03 13:41:38 -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-05-03 13:41:38 -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-05-03 13:41:38 -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-04-30 19:41:44 -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-03-28 18:40:44 -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-05-09 14:20:46 -04:00
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-03-28 18:40:44 -04:00
// 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 ;
2019-05-09 14:20:46 -04:00
Pair . Key - > ResourceRHI = nullptr ;
2019-03-28 18:40:44 -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
}
2019-05-13 18:17:36 -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-05-03 13:41:38 -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 15:01:03 -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-05-09 14:20:46 -04:00
Texture - > ResourceRHI = PooledRenderTarget - > GetRenderTargetItem ( ) . ShaderResourceTexture ;
check ( Texture - > ResourceRHI ) ;
2018-10-22 23:01:29 -04:00
}
2019-05-13 18:17:36 -04:00
void FRDGBuilder : : AllocateRHITextureUAVIfNeeded ( FRDGTextureUAV * UAV )
2018-10-22 23:01:29 -04:00
{
check ( UAV ) ;
2019-05-09 14:20:46 -04:00
if ( UAV - > ResourceRHI )
2018-10-22 23:01:29 -04:00
{
return ;
}
2019-05-13 18:17:36 -04:00
AllocateRHITextureIfNeeded ( UAV - > Desc . Texture ) ;
2018-10-22 23:01:29 -04:00
2019-05-09 14:20:46 -04:00
UAV - > ResourceRHI = UAV - > Desc . Texture - > PooledRenderTarget - > GetRenderTargetItem ( ) . MipUAVs [ UAV - > Desc . MipLevel ] ;
2018-10-22 23:01:29 -04:00
}
2019-06-18 15:01:03 -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-05-13 18:17:36 -04:00
void FRDGBuilder : : AllocateRHIBufferSRVIfNeeded ( FRDGBufferSRV * SRV )
2018-10-22 23:01:29 -04:00
{
check ( SRV ) ;
2019-05-09 14:20:46 -04:00
if ( SRV - > ResourceRHI )
2018-10-22 23:01:29 -04:00
{
return ;
}
2019-05-03 13:41:38 -04:00
FRDGBufferRef Buffer = SRV - > Desc . Buffer ;
2019-01-15 19:57:23 -05:00
// The underlying buffer have already been allocated by a prior pass through AllocateRHIBufferUAVIfNeeded().
2019-04-30 19:41:44 -04:00
# if RDG_ENABLE_DEBUG
2019-01-21 20:08:38 -05:00
{
2019-05-03 13:41:38 -04:00
check ( Buffer - > HasBeenProduced ( ) ) ;
}
2019-01-21 20:08:38 -05:00
# endif
2018-10-22 23:01:29 -04:00
2019-05-03 13:41:38 -04:00
check ( Buffer - > PooledBuffer ) ;
if ( Buffer - > PooledBuffer - > SRVs . Contains ( SRV - > Desc ) )
2018-10-22 23:01:29 -04:00
{
2019-05-09 14:20:46 -04:00
SRV - > ResourceRHI = Buffer - > PooledBuffer - > SRVs [ SRV - > Desc ] ;
2018-10-22 23:01:29 -04:00
return ;
}
FShaderResourceViewRHIRef RHIShaderResourceView ;
2019-05-03 13:41:38 -04:00
if ( Buffer - > Desc . UnderlyingType = = FRDGBufferDesc : : EUnderlyingType : : VertexBuffer )
2018-10-22 23:01:29 -04:00
{
2019-05-03 13:41:38 -04:00
RHIShaderResourceView = RHICreateShaderResourceView ( Buffer - > PooledBuffer - > VertexBuffer , SRV - > Desc . BytesPerElement , SRV - > Desc . Format ) ;
2018-10-22 23:01:29 -04:00
}
2019-05-03 13:41:38 -04:00
else if ( Buffer - > Desc . UnderlyingType = = FRDGBufferDesc : : EUnderlyingType : : StructuredBuffer )
2018-10-22 23:01:29 -04:00
{
2019-05-03 13:41:38 -04:00
RHIShaderResourceView = RHICreateShaderResourceView ( Buffer - > PooledBuffer - > StructuredBuffer ) ;
2018-10-22 23:01:29 -04:00
}
else
{
check ( 0 ) ;
}
2019-05-09 14:20:46 -04:00
SRV - > ResourceRHI = RHIShaderResourceView ;
2019-05-03 13:41:38 -04:00
Buffer - > PooledBuffer - > SRVs . Add ( SRV - > Desc , RHIShaderResourceView ) ;
2018-10-22 23:01:29 -04:00
}
2019-05-13 18:17:36 -04:00
void FRDGBuilder : : AllocateRHIBufferUAVIfNeeded ( FRDGBufferUAV * UAV )
2018-10-22 23:01:29 -04:00
{
check ( UAV ) ;
2019-05-09 14:20:46 -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 15:01:03 -04:00
AllocateRHIBufferIfNeeded ( Buffer ) ;
2019-01-15 19:57:23 -05:00
if ( Buffer - > PooledBuffer - > UAVs . Contains ( UAV - > Desc ) )
{
2019-05-09 14:20:46 -04:00
UAV - > ResourceRHI = Buffer - > PooledBuffer - > UAVs [ UAV - > Desc ] ;
2018-10-22 23:01:29 -04:00
return ;
}
2019-05-03 13:41:38 -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-05-09 14:20:46 -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-04-30 19:41:44 -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-04-10 16:20:50 -04:00
{
2019-05-03 13:41:38 -04:00
const bool bAllowAccess = true ;
UpdateAccessGuardForPassResources ( Pass , bAllowAccess ) ;
2019-04-10 16:20:50 -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
2019-05-09 14:20:46 -04:00
FRHIRenderPassInfo RPInfo ;
bool bHasRenderTargets = false ;
PrepareResourcesForExecute ( Pass , & RPInfo , & bHasRenderTargets ) ;
2019-04-30 19:41:44 -04:00
EventScopeStack . BeginExecutePass ( Pass ) ;
2019-05-06 21:16:08 -04:00
StatScopeStack . BeginExecutePass ( Pass ) ;
2018-11-21 20:33:41 -05:00
2019-06-18 23:57:06 -04:00
if ( Pass - > IsGraphics ( ) )
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.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-05-03 13:41:38 -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-04-30 19:41:44 -04:00
EventScopeStack . EndExecutePass ( ) ;
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
{
2019-05-03 13:41:38 -04:00
const bool bAllowAccess = false ;
UpdateAccessGuardForPassResources ( Pass , bAllowAccess ) ;
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.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-05-03 13:41:38 -04:00
UnmarkUsedResources ( 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-05-03 13:41:38 -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-05-03 13:41:38 -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-05-03 13:41:38 -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 15:01:03 -04:00
check ( Pass ) ;
2019-05-02 06:55:47 -04:00
OutRPInfo - > NumUAVs = 0 ;
OutRPInfo - > UAVIndex = 0 ;
2019-06-18 15:01:03 -04:00
const bool bIsCompute = Pass - > IsCompute ( ) ;
2019-05-13 18:17:36 -04:00
2019-06-18 15:01:03 -04:00
FRDGBarrierBatcher BarrierBatcher ;
BarrierBatcher . Begin ( ) ;
// NOTE: When generating mips, we don't perform any transitions on textures. They are done implicitly by the RHI.
const bool bGeneratingMips = Pass - > IsGenerateMips ( ) ;
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.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-05-03 13:41:38 -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 ( ) )
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.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-05-03 13:41:38 -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-01-15 19:57:23 -05:00
// The underlying texture have already been allocated by a prior pass.
2019-04-30 19:41:44 -04:00
# if RDG_ENABLE_DEBUG
2019-01-21 20:08:38 -05:00
{
2019-05-03 13:41:38 -04:00
check ( Texture - > HasBeenProduced ( ) ) ;
Texture - > PassAccessCount + + ;
}
2019-01-21 20:08:38 -05:00
# endif
2019-05-03 13:41:38 -04:00
2019-01-15 19:57:23 -05:00
check ( Texture - > PooledRenderTarget ) ;
2019-05-09 14:20:46 -04:00
check ( Texture - > ResourceRHI ) ;
2019-06-18 15:01:03 -04:00
if ( ! bGeneratingMips )
{
BarrierBatcher . QueueTransitionTexture ( Texture , FRDGResourceState : : CreateRead ( 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
}
}
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-05-03 13:41:38 -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-05-03 13:41:38 -04:00
FRDGTextureRef Texture = SRV - > Desc . Texture ;
2019-01-15 19:57:23 -05:00
// The underlying texture have already been allocated by a prior pass.
2019-04-30 19:41:44 -04:00
# if RDG_ENABLE_DEBUG
2019-01-21 20:08:38 -05:00
{
2019-05-03 13:41:38 -04:00
check ( Texture - > HasBeenProduced ( ) ) ;
Texture - > PassAccessCount + + ;
}
2019-01-21 20:08:38 -05:00
# endif
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-05-09 14:20:46 -04:00
if ( ! SRV - > ResourceRHI )
2019-01-15 19:57:23 -05:00
{
2019-05-09 14:20:46 -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-06-18 15:01:03 -04:00
if ( ! bGeneratingMips )
{
BarrierBatcher . QueueTransitionTexture ( Texture , FRDGResourceState : : CreateRead ( 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
}
}
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-05-03 13:41:38 -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-05-03 13:41:38 -04:00
FRDGTextureRef Texture = UAV - > Desc . Texture ;
2019-06-10 18:30:42 -04:00
2019-04-30 19:41:44 -04:00
# if RDG_ENABLE_DEBUG
2019-01-15 19:57:23 -05:00
{
2019-05-03 13:41:38 -04:00
Texture - > PassAccessCount + + ;
2019-01-15 19:57:23 -05:00
}
# endif
2019-05-03 13:41:38 -04:00
2019-05-13 18:17:36 -04:00
AllocateRHITextureUAVIfNeeded ( UAV ) ;
2019-06-10 18:30:42 -04:00
FRHIUnorderedAccessView * UAVRHI = UAV - > GetRHI ( ) ;
2019-06-18 15:01:03 -04:00
if ( ! bIsCompute )
2019-06-10 18:30:42 -04:00
{
OutRPInfo - > UAVs [ OutRPInfo - > NumUAVs + + ] = UAVRHI ; // Bind UAVs in declaration order
}
2019-06-18 15:01:03 -04:00
BarrierBatcher . QueueTransitionUAV ( UAVRHI , Texture , FRDGResourceState : : CreateWrite ( Pass ) ) ;
2018-10-22 23:01:29 -04:00
}
}
break ;
2019-06-18 16:53:31 -04:00
case UBMT_RDG_TEXTURE_COPY_DEST :
{
if ( FRDGTextureRef Texture = Parameter . GetAsTexture ( ) )
{
# if RDG_ENABLE_DEBUG
{
Texture - > PassAccessCount + + ;
}
# endif
AllocateRHITextureIfNeeded ( Texture ) ;
}
}
break ;
2019-01-04 14:52:46 -05:00
case UBMT_RDG_BUFFER :
2018-10-22 23:01:29 -04:00
{
2019-05-03 13:41:38 -04:00
if ( FRDGBufferRef Buffer = Parameter . GetAsBuffer ( ) )
2018-10-22 23:01:29 -04:00
{
2019-01-15 19:57:23 -05:00
// The underlying buffer have already been allocated by a prior pass through AllocateRHIBufferUAVIfNeeded().
2019-04-30 19:41:44 -04:00
# if RDG_ENABLE_DEBUG
2019-01-21 20:08:38 -05:00
{
2019-05-03 13:41:38 -04:00
check ( Buffer - > HasBeenProduced ( ) ) ;
Buffer - > PassAccessCount + + ;
2019-04-01 19:37:48 -04:00
}
2019-01-21 20:08:38 -05:00
# endif
2018-10-22 23:01:29 -04:00
2019-05-03 13:41:38 -04:00
// TODO(RDG): super hacky, find the UAV and transition it. Hopefully there is one...
check ( Buffer - > PooledBuffer ) ;
2018-10-22 23:01:29 -04:00
check ( Buffer - > PooledBuffer - > UAVs . Num ( ) = = 1 ) ;
2019-06-18 15:01:03 -04:00
FRHIUnorderedAccessView * UAVRHI = Buffer - > PooledBuffer - > UAVs . CreateIterator ( ) . Value ( ) ;
2019-05-13 18:17:36 -04:00
2019-06-18 15:01:03 -04:00
BarrierBatcher . QueueTransitionUAV ( UAVRHI , Buffer , FRDGResourceState : : CreateRead ( Pass ) ) ;
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-05-03 13:41:38 -04:00
if ( FRDGBufferSRVRef SRV = Parameter . GetAsBufferSRV ( ) )
2018-10-22 23:01:29 -04:00
{
2019-05-03 13:41:38 -04:00
FRDGBufferRef Buffer = SRV - > Desc . Buffer ;
2019-01-15 19:57:23 -05:00
// The underlying buffer have already been allocated by a prior pass through AllocateRHIBufferUAVIfNeeded().
2019-04-30 19:41:44 -04:00
# if RDG_ENABLE_DEBUG
2019-01-21 20:08:38 -05:00
{
2019-05-03 13:41:38 -04:00
check ( Buffer - > HasBeenProduced ( ) ) ;
Buffer - > PassAccessCount + + ;
2019-04-01 19:37:48 -04:00
}
2019-01-21 20:08:38 -05:00
# endif
2019-05-03 13:41:38 -04:00
2019-06-10 18:30:42 -04:00
AllocateRHIBufferSRVIfNeeded ( SRV ) ;
2019-05-03 13:41:38 -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 15:01:03 -04:00
FRHIUnorderedAccessView * UAVRHI = Buffer - > PooledBuffer - > UAVs . CreateIterator ( ) . Value ( ) ;
2019-05-03 13:41:38 -04:00
2019-06-18 15:01:03 -04:00
BarrierBatcher . QueueTransitionUAV ( UAVRHI , Buffer , FRDGResourceState : : CreateRead ( Pass ) ) ;
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-05-03 13:41:38 -04:00
if ( FRDGBufferUAVRef UAV = Parameter . GetAsBufferUAV ( ) )
2018-10-22 23:01:29 -04:00
{
2019-05-03 13:41:38 -04:00
FRDGBufferRef Buffer = UAV - > Desc . Buffer ;
2019-01-15 19:57:23 -05:00
2019-04-30 19:41:44 -04:00
# if RDG_ENABLE_DEBUG
2019-01-15 19:57:23 -05:00
{
2019-05-03 13:41:38 -04:00
Buffer - > PassAccessCount + + ;
2019-01-15 19:57:23 -05:00
}
# endif
2019-05-03 13:41:38 -04:00
2019-05-13 18:17:36 -04:00
AllocateRHIBufferUAVIfNeeded ( UAV ) ;
2019-06-10 18:30:42 -04:00
FRHIUnorderedAccessView * UAVRHI = UAV - > GetRHI ( ) ;
2019-06-18 15:01:03 -04:00
if ( ! bIsCompute )
2019-06-10 18:30:42 -04:00
{
OutRPInfo - > UAVs [ OutRPInfo - > NumUAVs + + ] = UAVRHI ; // Bind UAVs in declaration order
}
2019-06-18 15:01:03 -04:00
BarrierBatcher . QueueTransitionUAV ( UAVRHI , Buffer , FRDGResourceState : : CreateWrite ( 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
}
}
break ;
2019-06-18 16:53:31 -04:00
case UBMT_RDG_BUFFER_COPY_DEST :
{
if ( FRDGBufferRef Buffer = Parameter . GetAsBuffer ( ) )
{
# if RDG_ENABLE_DEBUG
{
Buffer - > PassAccessCount + + ;
}
# endif
AllocateRHIBufferIfNeeded ( Buffer ) ;
}
}
break ;
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
case UBMT_RENDER_TARGET_BINDING_SLOTS :
{
2019-06-18 15:01:03 -04:00
check ( ! 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
2019-05-03 13:41:38 -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-05-03 13:41:38 -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-05-03 13:41:38 -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-05-03 13:41:38 -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-05-13 18:17:36 -04:00
AllocateRHITextureIfNeeded ( Texture ) ;
2019-05-03 13:41:38 -04:00
auto & OutRenderTarget = OutRPInfo - > ColorRenderTargets [ 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-05-16 16:44:42 -04:00
// 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-05-16 16:44:42 -04:00
OutRenderTarget . RenderTarget = TargetableTexture ;
2019-05-16 19:33:43 -04:00
OutRenderTarget . ResolveTarget = ShaderResourceTexture ! = TargetableTexture ? ShaderResourceTexture : nullptr ;
2019-05-03 13:41:38 -04:00
OutRenderTarget . ArraySlice = - 1 ;
OutRenderTarget . MipIndex = RenderTarget . GetMipIndex ( ) ;
2019-05-16 16:44:42 -04:00
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
2018-12-11 13:44:34 -05:00
if ( ! bGeneratingMips )
{
2019-06-18 15:01:03 -04:00
BarrierBatcher . QueueTransitionTexture ( Texture , FRDGResourceState : : CreateWrite ( Pass ) ) ;
2018-12-11 13:44:34 -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-05-03 13:41:38 -04:00
SampleCount | = OutRenderTarget . RenderTarget - > GetNumSamples ( ) ;
ValidRenderTargetCount + + ;
2019-04-30 19:41:44 -04:00
# if RDG_ENABLE_DEBUG
2019-01-15 19:57:23 -05:00
{
2019-05-03 13:41:38 -04:00
Texture - > PassAccessCount + + ;
2019-01-15 19:57:23 -05:00
}
# endif
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
}
else
{
break ;
}
}
2019-05-03 13:41:38 -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-05-13 18:17:36 -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-05-03 13:41:38 -04:00
auto & OutDepthStencil = OutRPInfo - > DepthStencilRenderTarget ;
2019-05-16 16:44:42 -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. " ) ) ;
2019-05-03 13:41:38 -04:00
OutDepthStencil . DepthStencilTarget = Texture - > PooledRenderTarget - > GetRenderTargetItem ( ) . TargetableTexture ;
OutDepthStencil . ResolveTarget = nullptr ;
OutDepthStencil . Action = MakeDepthStencilTargetActions (
2019-04-23 14:24:55 -04:00
MakeRenderTargetActions ( DepthStencil . GetDepthLoadAction ( ) , DepthStencil . GetDepthStoreAction ( ) ) ,
MakeRenderTargetActions ( DepthStencil . GetStencilLoadAction ( ) , DepthStencil . GetStencilStoreAction ( ) ) ) ;
2019-05-03 13:41:38 -04:00
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 15:01:03 -04:00
BarrierBatcher . QueueTransitionTexture ( Texture ,
DepthStencil . GetDepthStencilAccess ( ) . IsAnyWrite ( ) ?
FRDGResourceState : : CreateWrite ( Pass ) :
FRDGResourceState : : CreateRead ( Pass ) ) ;
2019-05-03 13:41:38 -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-04-30 19:41:44 -04:00
# if RDG_ENABLE_DEBUG
2019-01-15 19:57:23 -05:00
{
2019-05-03 13:41:38 -04:00
Texture - > PassAccessCount + + ;
2019-01-15 19:57:23 -05:00
}
# endif
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
}
2019-05-03 13:41:38 -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-05-03 13:41:38 -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 ;
2019-06-18 15:01:03 -04:00
BarrierBatcher . End ( RHICmdList ) ;
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
}
2019-04-30 19:41:44 -04:00
void FRDGBuilder : : UpdateAccessGuardForPassResources ( const FRDGPass * Pass , bool bAllowAccess )
2019-04-10 16:20:50 -04:00
{
2019-04-30 19:41:44 -04:00
# if RDG_ENABLE_DEBUG
2019-05-03 13:41:38 -04:00
FRDGPassParameterStruct ParameterStruct = Pass - > GetParameters ( ) ;
2019-04-10 16:20:50 -04:00
2019-05-03 13:41:38 -04:00
const uint32 ParameterCount = ParameterStruct . GetParameterCount ( ) ;
for ( uint32 ParameterIndex = 0 ; ParameterIndex < ParameterCount ; + + ParameterIndex )
2019-04-10 16:20:50 -04:00
{
2019-05-03 13:41:38 -04:00
FRDGPassParameter Parameter = ParameterStruct . GetParameter ( ParameterIndex ) ;
2019-04-10 16:20:50 -04:00
2019-05-03 13:41:38 -04:00
if ( Parameter . IsResource ( ) )
2019-04-10 16:20:50 -04:00
{
2019-05-03 13:41:38 -04:00
if ( FRDGResourceRef Resource = Parameter . GetAsResource ( ) )
2019-04-10 16:20:50 -04:00
{
2019-05-03 13:41:38 -04:00
Resource - > bAllowRHIAccess = bAllowAccess ;
}
}
else if ( Parameter . GetType ( ) = = UBMT_RENDER_TARGET_BINDING_SLOTS )
{
const FRenderTargetBindingSlots & RenderTargetBindingSlots = Parameter . GetAsRenderTargetBindingSlots ( ) ;
const auto & RenderTargets = RenderTargetBindingSlots . Output ;
const auto & DepthStencil = RenderTargetBindingSlots . DepthStencil ;
const uint32 RenderTargetCount = RenderTargets . Num ( ) ;
for ( uint32 RenderTargetIndex = 0 ; RenderTargetIndex < RenderTargetCount ; RenderTargetIndex + + )
{
const FRenderTargetBinding & RenderTarget = RenderTargets [ RenderTargetIndex ] ;
if ( FRDGTextureRef Texture = RenderTarget . GetTexture ( ) )
{
Texture - > bAllowRHIAccess = bAllowAccess ;
}
2019-04-10 16:20:50 -04:00
else
2019-05-03 13:41:38 -04:00
{
2019-04-10 16:20:50 -04:00
break ;
2019-05-03 13:41:38 -04:00
}
2019-04-10 16:20:50 -04:00
}
2019-05-03 13:41:38 -04:00
if ( FRDGTextureRef Texture = DepthStencil . GetTexture ( ) )
2019-04-10 16:20:50 -04:00
{
2019-05-03 13:41:38 -04:00
Texture - > bAllowRHIAccess = bAllowAccess ;
2019-04-10 16:20:50 -04:00
}
}
}
# endif
}
2019-05-03 13:41:38 -04:00
void FRDGBuilder : : UnmarkUsedResources ( 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-05-03 13:41:38 -04:00
# if RDG_ENABLE_DEBUG
FRDGPassParameterStruct ParameterStruct = Pass - > GetParameters ( ) ;
const uint32 ParameterCount = ParameterStruct . GetParameterCount ( ) ;
2019-05-09 20:12:15 -04:00
if ( GRDGDebug )
2018-12-18 21:41:17 -05:00
{
2019-05-03 13:41:38 -04:00
uint32 TrackedResourceCount = 0 ;
uint32 UsedResourceCount = 0 ;
2018-12-18 21:41:17 -05:00
2019-05-03 13:41:38 -04:00
for ( uint32 ParameterIndex = 0 ; ParameterIndex < ParameterCount ; + + ParameterIndex )
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
{
2019-05-03 13:41:38 -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-05-03 13:41:38 -04:00
if ( Parameter . IsResource ( ) )
2019-01-16 15:48:28 -05:00
{
2019-05-03 13:41:38 -04:00
if ( FRDGResourceRef Resource = Parameter . GetAsResource ( ) )
{
TrackedResourceCount + + ;
UsedResourceCount + = Resource - > bIsActuallyUsedByPass ? 1 : 0 ;
}
2019-01-16 15:48:28 -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-01-16 15:48:28 -05:00
2019-05-03 13:41:38 -04:00
if ( TrackedResourceCount ! = UsedResourceCount )
{
FString WarningMessage = FString : : Printf (
TEXT ( " '%d' of the '%d' resources of the pass '%s' where not actually used. " ) ,
TrackedResourceCount - UsedResourceCount , TrackedResourceCount , Pass - > GetName ( ) ) ;
for ( uint32 ParameterIndex = 0 ; ParameterIndex < ParameterCount ; + + ParameterIndex )
{
FRDGPassParameter Parameter = ParameterStruct . GetParameter ( ParameterIndex ) ;
if ( Parameter . IsResource ( ) )
{
if ( const FRDGResourceRef Resource = Parameter . GetAsResource ( ) )
{
if ( ! Resource - > bIsActuallyUsedByPass )
{
WarningMessage + = FString : : Printf ( TEXT ( " \n %s " ) , Resource - > Name ) ;
}
}
}
}
EmitRDGWarning ( WarningMessage ) ;
}
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
}
2019-05-03 13:41:38 -04:00
for ( uint32 ParameterIndex = 0 ; ParameterIndex < ParameterCount ; + + ParameterIndex )
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
{
2019-05-03 13:41:38 -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-05-03 13:41:38 -04:00
if ( Parameter . IsResource ( ) )
{
if ( const FRDGResourceRef Resource = Parameter . GetAsResource ( ) )
{
Resource - > bIsActuallyUsedByPass = false ;
}
}
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
}
2019-05-03 13:41:38 -04:00
# endif
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
}
2019-05-03 13:41:38 -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-05-09 14:20:46 -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-05-03 13:41:38 -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-05-09 14:20:46 -04:00
Buffer - > ResourceRHI = nullptr ;
2018-10-22 23:01:29 -04:00
AllocatedBuffers . FindChecked ( Buffer ) = nullptr ;
}
}
2019-05-03 13:41:38 -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-05-03 13:41:38 -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-05-03 13:41:38 -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-05-03 13:41:38 -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-05-03 13:41:38 -04:00
switch ( Parameter . GetType ( ) )
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
{
2019-01-04 14:52:46 -05:00
case UBMT_RDG_TEXTURE :
2019-06-18 16:53:31 -04:00
case UBMT_RDG_TEXTURE_COPY_DEST :
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
{
2019-05-03 13:41:38 -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-05-03 13:41:38 -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-05-03 13:41:38 -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-05-03 13:41:38 -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-05-03 13:41:38 -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-05-03 13:41:38 -04:00
ReleaseRHITextureIfUnreferenced ( UAV - > Desc . Texture ) ;
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
}
}
break ;
2019-01-04 14:52:46 -05:00
case UBMT_RDG_BUFFER :
2019-06-18 16:53:31 -04:00
case UBMT_RDG_BUFFER_COPY_DEST :
2018-10-22 23:01:29 -04:00
{
2019-05-03 13:41:38 -04:00
if ( FRDGBufferRef Buffer = Parameter . GetAsBuffer ( ) )
2018-10-22 23:01:29 -04:00
{
2019-05-03 13:41:38 -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-05-03 13:41:38 -04:00
if ( FRDGBufferSRVRef SRV = Parameter . GetAsBufferSRV ( ) )
2018-10-22 23:01:29 -04:00
{
2019-05-03 13:41:38 -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-05-03 13:41:38 -04:00
if ( FRDGBufferUAVRef UAV = Parameter . GetAsBufferUAV ( ) )
2018-10-22 23:01:29 -04:00
{
2019-05-03 13:41:38 -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-05-03 13:41:38 -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-05-03 13:41:38 -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-05-03 13:41:38 -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-05-03 13:41:38 -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-05-03 13:41:38 -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-05-03 13:41:38 -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-06-18 15:01:03 -04:00
FRDGBarrierBatcher BarrierBatcher ;
BarrierBatcher . Begin ( ) ;
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.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-06-18 15:01:03 -04:00
BarrierBatcher . QueueTransitionTexture (
Query . Texture ,
FRDGResourceState (
nullptr ,
FRDGResourceState : : EPipeline : : Graphics ,
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-01-15 19:57:23 -05:00
2019-04-30 19:41:44 -04:00
# if RDG_ENABLE_DEBUG
2019-01-15 19:57:23 -05:00
{
2019-03-28 18:40:44 -04:00
// Increment the number of times the texture has been accessed to avoid warning on produced but never used resources that were produced
2019-01-15 19:57:23 -05:00
// only to be extracted for the graph.
2019-05-03 13:41:38 -04:00
Query . Texture - > PassAccessCount + = 1 ;
2019-01-15 19:57:23 -05:00
}
# endif
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
// No need to manually release in immediate mode, since it is done directly when emptying AllocatedTextures in DestructPasses().
2019-05-03 13:41:38 -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-05-03 13:41:38 -04:00
ReleaseRHITextureIfUnreferenced ( Query . 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-03-28 18:40:44 -04:00
for ( const auto & Query : DeferredInternalBufferQueries )
{
* Query . OutBufferPtr = AllocatedBuffers . FindChecked ( Query . Buffer ) ;
2019-05-03 13:41:38 -04:00
# if RDG_ENABLE_DEBUG
2019-03-28 18:40:44 -04:00
{
// Increment the number of times the buffer has been accessed to avoid warning on produced but never used resources that were produced
// only to be extracted for the graph.
2019-05-03 13:41:38 -04:00
Query . Buffer - > PassAccessCount + = 1 ;
2019-03-28 18:40:44 -04:00
}
2019-05-03 13:41:38 -04:00
# endif
2019-03-28 18:40:44 -04:00
// No need to manually release in immediate mode, since it is done directly when emptying AllocatedBuffer in DestructPasses().
2019-05-03 13:41:38 -04:00
if ( ! GRDGImmediateMode )
2019-03-28 18:40:44 -04:00
{
2019-05-03 13:41:38 -04:00
ReleaseRHIBufferIfUnreferenced ( Query . Buffer ) ;
2019-03-28 18:40:44 -04:00
}
}
2019-06-18 15:01:03 -04:00
BarrierBatcher . End ( RHICmdList ) ;
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
}
2018-10-22 14:28:32 -04:00
void FRDGBuilder : : DestructPasses ( )
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
{
2019-04-30 19:41:44 -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-10 13:12:49 -04:00
const bool bEmitWarnings = ( GRDGDebug > 0 ) ;
2019-05-03 13:41:38 -04:00
for ( const FRDGTrackedResourceRef Resource : TrackedResources )
Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.
Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.
Names of the graph managed resources are not final.
#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer
[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00
{
check ( Resource - > ReferenceCount = = 0 ) ;
2019-01-15 19:57:23 -05:00
2019-05-03 13:41:38 -04:00
const bool bProducedButNeverUsed = Resource - > PassAccessCount = = 1 & & Resource - > FirstProducer ;
2019-01-15 19:57:23 -05:00
2019-05-03 13:41:38 -04:00
if ( bEmitWarnings & & bProducedButNeverUsed )
{
check ( Resource - > HasBeenProduced ( ) ) ;
EmitRDGWarningf (
2019-01-15 19:57:23 -05:00
TEXT ( " Resources %s has been produced by the pass %s, but never used by another pass. " ) ,
2019-05-03 13:41:38 -04:00
Resource - > Name , Resource - > FirstProducer - > GetName ( ) ) ;
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-05-03 13:41:38 -04:00
TrackedResources . 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
}
# endif
2019-05-03 13:41:38 -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-05-03 13:41:38 -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-05-03 13:41:38 -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-03-28 18:40:44 -04:00
DeferredInternalBufferQueries . Empty ( ) ;
2019-06-18 18:39:45 -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-03-28 18:40:44 -04:00
AllocatedBuffers . Empty ( ) ;
2019-01-22 02:15:37 -05:00
}
2019-04-30 19:41:44 -04:00
void FRDGBuilder : : BeginEventScope ( FRDGEventName & & ScopeName )
{
2019-05-06 21:16:08 -04:00
EventScopeStack . BeginScope ( Forward < FRDGEventName & & > ( ScopeName ) ) ;
2019-04-30 19:41:44 -04:00
}
void FRDGBuilder : : EndEventScope ( )
{
2019-05-06 21:16:08 -04:00
EventScopeStack . EndScope ( ) ;
}
void FRDGBuilder : : BeginStatScope ( const FName & Name , const FName & StatName )
{
StatScopeStack . BeginScope ( Name , StatName ) ;
}
void FRDGBuilder : : EndStatScope ( )
{
StatScopeStack . EndScope ( ) ;
2019-05-03 13:41:38 -04:00
}