2016-01-07 08:17:16 -05:00
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
2014-03-14 14:13:41 -04:00
/*=============================================================================
RenderTargetPool . cpp : Scene render target pool manager .
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
# include "RendererPrivate.h"
# include "ScenePrivate.h"
# include "RenderTargetPool.h"
/** The global render targets pool. */
TGlobalResource < FRenderTargetPool > GRenderTargetPool ;
DEFINE_LOG_CATEGORY_STATIC ( LogRenderTargetPool , Warning , All ) ;
2014-04-23 19:52:11 -04:00
static void DumpRenderTargetPoolMemory ( FOutputDevice & OutputDevice )
{
GRenderTargetPool . DumpMemoryUsage ( OutputDevice ) ;
}
static FAutoConsoleCommandWithOutputDevice GDumpRenderTargetPoolMemoryCmd (
TEXT ( " r.DumpRenderTargetPoolMemory " ) ,
TEXT ( " Dump allocation information for the render target pool. " ) ,
FConsoleCommandWithOutputDeviceDelegate : : CreateStatic ( DumpRenderTargetPoolMemory )
) ;
2014-05-16 18:09:23 -04:00
void RenderTargetPoolEvents ( const TArray < FString > & Args )
2014-04-23 19:52:11 -04:00
{
uint32 SizeInKBThreshold = - 1 ;
if ( Args . Num ( ) & & Args [ 0 ] . IsNumeric ( ) )
{
SizeInKBThreshold = FCString : : Atof ( * Args [ 0 ] ) ;
}
if ( SizeInKBThreshold ! = - 1 )
{
UE_LOG ( LogRenderTargetPool , Display , TEXT ( " r.DumpRenderTargetPoolEvents is now enabled, use r.DumpRenderTargetPoolEvents ? for help " ) ) ;
2014-05-16 17:29:16 -04:00
GRenderTargetPool . EventRecordingSizeThreshold = SizeInKBThreshold ;
GRenderTargetPool . bStartEventRecordingNextTick = true ;
2014-04-23 19:52:11 -04:00
}
else
{
GRenderTargetPool . DisableEventDisplay ( ) ;
UE_LOG ( LogRenderTargetPool , Display , TEXT ( " r.DumpRenderTargetPoolEvents is now disabled, use r.DumpRenderTargetPoolEvents <SizeInKB> to enable or r.DumpRenderTargetPoolEvents ? for help " ) ) ;
}
}
2014-06-25 05:47:33 -04:00
// CVars and commands
2014-04-23 20:00:52 -04:00
static FAutoConsoleCommand GRenderTargetPoolEventsCmd (
TEXT ( " r.RenderTargetPool.Events " ) ,
TEXT ( " Visualize the render target pool events over time in one frame. Optional parameter defines threshold in KB. \n " )
TEXT ( " To disable the view use the command without any parameter " ) ,
FConsoleCommandWithArgsDelegate : : CreateStatic ( RenderTargetPoolEvents )
2014-04-23 19:52:11 -04:00
) ;
2014-06-25 05:47:33 -04:00
# if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
static TAutoConsoleVariable < int32 > CVarRenderTargetPoolTest (
TEXT ( " r.RenderTargetPoolTest " ) ,
0 ,
TEXT ( " Clears the texture returned by the rendertarget pool with a special color \n " )
TEXT ( " so we can see better which passes would need to clear. Doesn't work on volume textures and non rendertargets yet. \n " )
TEXT ( " 0:off (default), 1:on " ) ,
ECVF_Cheat | ECVF_RenderThreadSafe ) ;
# endif
2014-04-23 19:52:11 -04:00
bool FRenderTargetPool : : IsEventRecordingEnabled ( ) const
{
# if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
2014-05-16 17:29:16 -04:00
return bEventRecordingStarted & & bEventRecordingActive ;
2014-04-23 19:52:11 -04:00
# else
return false ;
# endif
}
IPooledRenderTarget * FRenderTargetPoolEvent : : GetValidatedPointer ( ) const
{
int32 Index = GRenderTargetPool . FindIndex ( Pointer ) ;
if ( Index > = 0 )
{
return Pointer ;
}
return 0 ;
}
bool FRenderTargetPoolEvent : : NeedsDeallocEvent ( )
{
if ( GetEventType ( ) = = ERTPE_Alloc )
{
if ( Pointer )
{
IPooledRenderTarget * ValidPointer = GetValidatedPointer ( ) ;
2014-05-06 10:57:40 -04:00
if ( ! ValidPointer | | ValidPointer - > IsFree ( ) )
2014-04-23 19:52:11 -04:00
{
Pointer = 0 ;
return true ;
}
}
}
return false ;
}
2014-03-14 14:13:41 -04:00
static uint32 ComputeSizeInKB ( FPooledRenderTarget & Element )
{
return ( Element . ComputeMemorySize ( ) + 1023 ) / 1024 ;
}
FRenderTargetPool : : FRenderTargetPool ( )
: AllocationLevelInKB ( 0 )
, bCurrentlyOverBudget ( false )
2014-05-16 17:29:16 -04:00
, bStartEventRecordingNextTick ( false )
2014-04-23 20:00:52 -04:00
, EventRecordingSizeThreshold ( 0 )
2014-05-16 17:29:16 -04:00
, bEventRecordingActive ( false )
, bEventRecordingStarted ( false )
2014-04-23 20:00:52 -04:00
, CurrentEventRecordingTime ( 0 )
2014-03-14 14:13:41 -04:00
{
}
2014-09-26 12:37:06 -04:00
static void LogVRamUsage ( FPooledRenderTarget & Ref , FTextureRHIParamRef TexRef )
{
2014-09-29 16:06:34 -04:00
if ( FPlatformProperties : : SupportsFastVRAMMemory ( ) & & TexRef )
2014-09-26 12:37:06 -04:00
{
FRHIResourceInfo Info ;
RHIGetResourceInfo ( TexRef , Info ) ;
if ( Info . VRamAllocation . AllocationSize )
{
// note we do KB for more readable numbers but this can cause quantization loss
UE_LOG ( LogShaders , Log , TEXT ( " VRamInKB(Start/Size):%d/%d %s '%s' " ) ,
Info . VRamAllocation . AllocationStart / 1024 ,
( Info . VRamAllocation . AllocationSize + 1023 ) / 1024 ,
* Ref . GetDesc ( ) . GenerateInfoString ( ) ,
Ref . GetDesc ( ) . DebugName ) ;
}
else
{
UE_LOG ( LogShaders , Log , TEXT ( " VRamInKB request failed %s '%s' " ) ,
* Ref . GetDesc ( ) . GenerateInfoString ( ) ,
Ref . GetDesc ( ) . DebugName ) ;
}
}
}
static void LogVRamUsage ( FPooledRenderTarget & Ref )
{
if ( Ref . GetDesc ( ) . Flags & TexCreate_FastVRAM )
{
LogVRamUsage ( Ref , Ref . GetRenderTargetItem ( ) . TargetableTexture ) ;
2014-10-01 15:25:07 -04:00
if ( Ref . GetRenderTargetItem ( ) . TargetableTexture ! = Ref . GetRenderTargetItem ( ) . ShaderResourceTexture )
{
LogVRamUsage ( Ref , Ref . GetRenderTargetItem ( ) . ShaderResourceTexture ) ;
}
2014-09-26 12:37:06 -04:00
}
}
2015-09-21 20:07:00 -04:00
void FRenderTargetPool : : TransitionTargetsWritable ( FRHICommandListImmediate & RHICmdList )
{
QUICK_SCOPE_CYCLE_COUNTER ( STAT_RenderTargetPoolTransition ) ;
check ( IsInRenderingThread ( ) ) ;
WaitForTransitionFence ( ) ;
TransitionTargets . Reset ( ) ;
for ( int32 i = 0 ; i < PooledRenderTargets . Num ( ) ; + + i )
{
FPooledRenderTarget * PooledRT = PooledRenderTargets [ i ] ;
if ( PooledRT & & PooledRT - > GetDesc ( ) . AutoWritable )
{
FTextureRHIParamRef RenderTarget = PooledRT - > GetRenderTargetItem ( ) . TargetableTexture ;
if ( RenderTarget )
{
TransitionTargets . Add ( RenderTarget ) ;
}
}
}
if ( TransitionTargets . Num ( ) > 0 )
{
RHICmdList . TransitionResourceArrayNoCopy ( EResourceTransitionAccess : : EWritable , TransitionTargets ) ;
if ( GRHIThread )
{
TransitionFence = RHICmdList . RHIThreadFence ( false ) ;
}
}
}
void FRenderTargetPool : : WaitForTransitionFence ( )
{
QUICK_SCOPE_CYCLE_COUNTER ( STAT_RenderTargetPoolTransitionWait ) ;
check ( IsInRenderingThread ( ) ) ;
if ( TransitionFence )
{
check ( IsInRenderingThread ( ) ) ;
FRHICommandListExecutor : : WaitOnRHIThreadFence ( TransitionFence ) ;
TransitionFence = nullptr ;
}
TransitionTargets . Reset ( ) ;
DeferredDeleteArray . Reset ( ) ;
}
bool FRenderTargetPool : : FindFreeElement ( FRHICommandList & RHICmdList , const FPooledRenderTargetDesc & Desc , TRefCountPtr < IPooledRenderTarget > & Out , const TCHAR * InDebugName , bool bDoWritableBarrier )
2014-03-14 14:13:41 -04:00
{
check ( IsInRenderingThread ( ) ) ;
if ( ! Desc . IsValid ( ) )
{
// no need to do anything
return true ;
}
// if we can keep the current one, do that
if ( Out )
{
FPooledRenderTarget * Current = ( FPooledRenderTarget * ) Out . GetReference ( ) ;
2015-05-29 10:47:57 -04:00
check ( ! Current - > IsSnapshot ( ) ) ;
2014-09-26 12:37:06 -04:00
const bool bExactMatch = true ;
if ( Out - > GetDesc ( ) . Compare ( Desc , bExactMatch ) )
2014-03-14 14:13:41 -04:00
{
// we can reuse the same, but the debug name might have changed
Current - > Desc . DebugName = InDebugName ;
RHIBindDebugLabelName ( Current - > GetRenderTargetItem ( ) . TargetableTexture , InDebugName ) ;
check ( ! Out - > IsFree ( ) ) ;
return true ;
}
else
{
// release old reference, it might free a RT we can use
Out = 0 ;
if ( Current - > IsFree ( ) )
{
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main)
#lockdown ben.marsh
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream
Capsule shadows
* Capsule shadows excel at extremely soft area shadows caused by a large light source angle, but don't support accurate self-shadowing
* Artists can setup a physics asset containing Spheres and Sphyls (capsules) for a skeletal mesh that will be used to represent the mesh's occlusion
* These shapes can then be used for direct shadowing (bCastCapsuleDirectShadow) on a skeletal mesh component, whose softness depends on the light source angle / radius
* The shapes can also be used to create an indirect shadow (bCastCapsuleIndirectShadow), whose direction and softness is derived from the precomputed sky occlusion (stationary sky light) or primary indirect lighting (static sky light)
* Capsule shadowing is computed at half res and uses tiled deferred culling for efficiency - only implemented for PC SM5 + PS4 so far
* Shadowing of movable skylights is not yet supported
Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data
Basepass drawlist are now merged within a single drawlist.
Lighting policy parameters are now accessed through a uniform buffer.
Changed the global resource initialization so that InitRHI now comes before InitDynamicRHI
#codereview nick.penwarden
Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams
Remove unused RHI methods:
RHIIsDrawingViewport
RHIGpuTimeBegin
RHIGpuTimeEnd
Made default/empty versions of these calls and removed stubs from RHIs that don't use them:
RHISuspendRendering
RHIResumeRendering
RHIIsRenderingSuspended
Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream
Lighting channels - each component and light can choose from 3 channels
* Primitives output their channel mask to stencil during the base pass, the masks are copied to a texture after the base pass, deferred lighting passes compare the primitive mask against the light's mask
* Dynamic shadow casting also respects the channels
* Only works on opaque materials, direct lighting, dynamic lighting
* Not implemented for tiled deferred atm
* This will replace CastsShadowsFromCinematicObjectsOnly in the future
#rb Martin.Mittring
Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New
First pass at separate Async Compute Context
#codereview Lee.Clark,Daniel.Wright
#rb Gil.Gribb
Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering
Removed a lot of complexity of the skeletal mesh motionblur code (better for multithreading, simpler, faster) but going from one large buffer to per mesh buffers. Upload of bones only needed once.
* GPUSkinCache didn't even work before (in this branch)
* tested BasePass velocity
* tested split screen
* tested editor pause
* matinee camera cut (no need, invalidates velocity)
* tested CPU Skin? (never has motionblur)
* tested CreateSceneProxy (recreation is prevented in CreteSceneProxy unless bone count changes)
* test ES2 -featureleveles2
#rb: Rolando.Caloca
Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data
Embree integration into Lightmass
Can be enabled through Lightmass.ini [DevOptions.StaticLighting]bUseEmbree.
Also [DevOptions.StaticLighting]bVerifyEmbree will compare ray casting results.
Only usable on Win64 with this submit.
#review daniel.wright
Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering
added SSAO CS version, can be enabled with
r.AmbientOcclusion.Compute 1
Not optimized yet
#rb:Olaf.Piesche
Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream
Lightmass solver quality improvements
* IndirectLightingScale is no longer applied to photons, avoids splotchy artifacts when using small scales
* New 'Lightmass Portal' actor / component which tells the solver where to look for significant lighting. When lighting with a Static Skylight only, in a mostly indoor environment, setting up these portals is the only way to get high quality.
* Skylight bounce lighting is now much more accurate and leverages adaptive sampling
* Fixed a bug that effectively disabled adaptive sampling on high IndirectLightingQualities
* Shadow penumbras are also improved by IndirectLightingQuality
* Texel debugging is now a cvar 'r.TexelDebugging', instead of requiring a full recompile
Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data
Quad Complexity ViewMode (PCD3D_SM5 only).
Shader Complexity with Quad Overhead ViewMode (PCD3D_SM5 only). Require ShaderComplexity ViewMode & Show.Visualize.QuadOverhead
#review brian.karis
Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering
improved SSAO quality (less high frequency noise) to avoid TemporalAA smearing
Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S
DevRendering - Enable removing unused outputs on PS4 shader pipelines, disable by default removing unused on D3D (toggable with r.D3DRemoveUnusedInterpolators)
#codereview Marcus.Wassmer
Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev
Submitting pull request from user Pierdek.
Early out of particle collision module update if there are no active particles.
#github
#1614
Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering
UE4 - Fixed the experimental r.RHICmdBalanceParallelLists 2 mode and renabled it for orion.
Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering
UE4 - Added a path so that texture streaming can avoid flushing the RHI thread.
Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream
Added new PrimitiveComponent setting bSingleSampleShadowFromStationaryLights
* When enabled, shadowing of a movable component from a stationary directional light will come from the Volume Lighting Samples precomputed by Lightmass
* This provides essentially free on/off shadow receiving on dynamic objects, with a fade over time between states
* Lighting has to be rebuilt once for this to work
#rb Rolando.Caloca
Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering
UE4 - Dynamically set stream source to avoid creating a separate drawing policy for each static mesh with vertex colors.
#rb Daniel.Wright
Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data
Enabled Embree by default
#review daniel.wright
==========================
ALL CHANGELISTS
==========================
Change 2720123 on 2015/10/07 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - 'integrate' Tem'
Change 2721682 on 2015/10/08 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Eliminated a fatal error '
Change 2721815 on 2015/10/08 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - Fix crash exiti'
Change 2724755 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix Tier'
Change 2724781 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix offse'
Change 2728317 on 2015/10/14 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - hlslcc - Fix fo'
Change 2729170 on 2015/10/14 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Force Lightmass volume sample g'
Change 2732131 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed resource transition issue'
Change 2732218 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code cleanup '
Change 2733533 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Clear stencil to 0 after decals'
Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Capsule shadows * Capsule shado'
Change 2733546 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Light shaft targets are only al'
Change 2733602 on 2015/10/19 by Uriel.Doyon@uriel.doyon_office_data 'Decals not writing to Normal ca'
Change 2733627 on 2015/10/19 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix for transition ensure. '
Change 2735292 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for dark lightmap precision'
Change 2735298 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for speedtree LOD transitio'
Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data 'Basepass drawlist are now merge'
Change 2737214 on 2015/10/21 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Expanded a warning when importi'
Change 2738581 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Updated comment on stencil usag'
Change 2738583 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Changed bound but not set scene'
Change 2738584 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed skylight occlusion maps b'
Change 2738589 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmap streaming fixes * Chan'
Change 2738593 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fix from licensee for race cond'
Change 2738982 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Activating CanTickOnAnyThread f'
Change 2739032 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Fixing compiler barf with Clang'
Change 2741517 on 2015/10/26 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRindering - D3D12 - Integrat'
Change 2743790 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed texel debugging on static'
Change 2743958 on 2015/10/27 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comments '
Change 2744153 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Unity compile fix '
Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams 'Remove unused RHI methods: RHI'
Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lighting channels - each compon'
Change 2746242 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix crashes on init by swapping'
Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'First pass at separate Async Co'
Change 2746296 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Buffer label frees so we don't '
Change 2746297 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'updated comment '
Change 2746343 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment '
Change 2746347 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment '
Change 2746811 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Draw event for compute commandl'
Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Removed a lot of complexity of '
Change 2747127 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Improved game console printout '
Change 2747702 on 2015/10/30 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Bumped Lightmass StaticMesh imp'
Change 2747954 on 2015/10/30 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix SubmitDone not called TRC e'
Change 2747979 on 2015/10/30 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'polish console autocomplete tex'
Change 2750719 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Add Embree 2.7.0 for Win64 and '
Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Embree integration into Lightma'
Change 2750872 on 2015/11/02 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R'
Change 2751934 on 2015/11/03 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Disambiguate template function '
Change 2752190 on 2015/11/03 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed assert relating to '
Change 2752333 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Shader pipeline '
Change 2752655 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - Fix Materials pa'
Change 2752710 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment '
Change 2752711 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added better comment/help text '
Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added SSAO CS version, can be e'
Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmass solver quality improv'
Change 2752869 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Add shader pipel'
Change 2752882 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - hlslcc - Metal -'
Change 2752899 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'small SSAO GPU optimization mov'
Change 2752934 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor GPU optimization for SSAO'
Change 2753109 on 2015/11/03 by Uriel.Doyon@uriel.doyon_office_data 'Fixed final build '
Change 2753669 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed SM4 compiling '
Change 2754002 on 2015/11/04 by Nick.Penwarden@nickp_streams 'test change '
Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data 'Quad Complexity ViewMode (PCD3D'
Change 2754115 on 2015/11/04 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed end of frame update'
Change 2754297 on 2015/11/04 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'PS4 compile fixes #codereview U'
Change 2754405 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor SSAO ALU optimizations fi'
Change 2754512 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'adjusted clamp for cvar '
Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'improved SSAO quality (less hig'
Change 2755572 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - PS4 warning fix '
Change 2755667 on 2015/11/05 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed UE-22742, leak in t'
Change 2755722 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Remove unused co'
Change 2755814 on 2015/11/05 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R'
Change 2755935 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Rebuild static m'
Change 2756003 on 2015/11/05 by Uriel.Doyon@uriel.doyon_office_data 'Reduce the number of precompute'
Change 2756145 on 2015/11/05 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Temp fix for GPU crash #rb none'
Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Enable removing '
Change 2756435 on 2015/11/05 by Olaf.Piesche@Olaf.Piesche_roaming 'Disabling a check, to fix OR-85'
Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev 'Submitting pull request from us'
Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed the experimental r.'
Change 2757341 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Changed the RHI thread di'
Change 2757342 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed lazy uniform buffer'
Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Added a path so that text'
Change 2757500 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Add FrameSync to externalprofil'
Change 2757650 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'GBuffer should only be consider'
Change 2757665 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'UE-22816 Instruction count is n'
Change 2757834 on 2015/11/06 by Michael.Trepka@Michael.Trepka_a4202_Dev-Rendering 'Embree integration into Lightma'
Change 2757930 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix UT ensure #rb Peter.Knepley'
Change 2757931 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix Ocean ensure #rb josh.ander'
Change 2757946 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Removed invalid Lightmass asser'
Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Added new PrimitiveComponent se'
Change 2758049 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'OR-8600 CRASH: AllocationLeveli'
Change 2758059 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'r.DumpTransitionsForResource #r'
Change 2758082 on 2015/11/06 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix resource tra'
Change 2758879 on 2015/11/09 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix PSSL names f'
Change 2758911 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed accidental force di'
Change 2758968 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled single frame buffer us'
Change 2758991 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix togglerhithread crash #rb G'
Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Dynamically set stream so'
Change 2759063 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed UE-22368 CLONE - GitHub 1'
Change 2759073 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code quality improvements'
Change 2759501 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix particle ensure. '
Change 2759522 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix decals using CustomStencil.'
Change 2759610 on 2015/11/09 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed line light source shadows'
Change 2759634 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Refined GBufferA resolving when'
Change 2759657 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Fixed ResourceTransition with r'
Change 2759693 on 2015/11/09 by Rolando.Caloca@Rolando.Caloca_T4688_S 'DevRendering - Fixed global sha'
Change 2759771 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Fixed editor hit proxy renderin'
Change 2760188 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled some more deferred dec'
Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data 'Enabled Embree by default #revi'
[CL 2761339 by Nick Penwarden in Main branch]
2015-11-10 17:11:09 -05:00
AllocationLevelInKB - = ComputeSizeInKB ( * Current ) ;
2014-04-23 19:52:11 -04:00
int32 Index = FindIndex ( Current ) ;
check ( Index > = 0 ) ;
// we don't use Remove() to not shuffle around the elements for better transparency on RenderTargetPoolEvents
PooledRenderTargets [ Index ] = 0 ;
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main)
#lockdown ben.marsh
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream
Capsule shadows
* Capsule shadows excel at extremely soft area shadows caused by a large light source angle, but don't support accurate self-shadowing
* Artists can setup a physics asset containing Spheres and Sphyls (capsules) for a skeletal mesh that will be used to represent the mesh's occlusion
* These shapes can then be used for direct shadowing (bCastCapsuleDirectShadow) on a skeletal mesh component, whose softness depends on the light source angle / radius
* The shapes can also be used to create an indirect shadow (bCastCapsuleIndirectShadow), whose direction and softness is derived from the precomputed sky occlusion (stationary sky light) or primary indirect lighting (static sky light)
* Capsule shadowing is computed at half res and uses tiled deferred culling for efficiency - only implemented for PC SM5 + PS4 so far
* Shadowing of movable skylights is not yet supported
Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data
Basepass drawlist are now merged within a single drawlist.
Lighting policy parameters are now accessed through a uniform buffer.
Changed the global resource initialization so that InitRHI now comes before InitDynamicRHI
#codereview nick.penwarden
Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams
Remove unused RHI methods:
RHIIsDrawingViewport
RHIGpuTimeBegin
RHIGpuTimeEnd
Made default/empty versions of these calls and removed stubs from RHIs that don't use them:
RHISuspendRendering
RHIResumeRendering
RHIIsRenderingSuspended
Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream
Lighting channels - each component and light can choose from 3 channels
* Primitives output their channel mask to stencil during the base pass, the masks are copied to a texture after the base pass, deferred lighting passes compare the primitive mask against the light's mask
* Dynamic shadow casting also respects the channels
* Only works on opaque materials, direct lighting, dynamic lighting
* Not implemented for tiled deferred atm
* This will replace CastsShadowsFromCinematicObjectsOnly in the future
#rb Martin.Mittring
Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New
First pass at separate Async Compute Context
#codereview Lee.Clark,Daniel.Wright
#rb Gil.Gribb
Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering
Removed a lot of complexity of the skeletal mesh motionblur code (better for multithreading, simpler, faster) but going from one large buffer to per mesh buffers. Upload of bones only needed once.
* GPUSkinCache didn't even work before (in this branch)
* tested BasePass velocity
* tested split screen
* tested editor pause
* matinee camera cut (no need, invalidates velocity)
* tested CPU Skin? (never has motionblur)
* tested CreateSceneProxy (recreation is prevented in CreteSceneProxy unless bone count changes)
* test ES2 -featureleveles2
#rb: Rolando.Caloca
Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data
Embree integration into Lightmass
Can be enabled through Lightmass.ini [DevOptions.StaticLighting]bUseEmbree.
Also [DevOptions.StaticLighting]bVerifyEmbree will compare ray casting results.
Only usable on Win64 with this submit.
#review daniel.wright
Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering
added SSAO CS version, can be enabled with
r.AmbientOcclusion.Compute 1
Not optimized yet
#rb:Olaf.Piesche
Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream
Lightmass solver quality improvements
* IndirectLightingScale is no longer applied to photons, avoids splotchy artifacts when using small scales
* New 'Lightmass Portal' actor / component which tells the solver where to look for significant lighting. When lighting with a Static Skylight only, in a mostly indoor environment, setting up these portals is the only way to get high quality.
* Skylight bounce lighting is now much more accurate and leverages adaptive sampling
* Fixed a bug that effectively disabled adaptive sampling on high IndirectLightingQualities
* Shadow penumbras are also improved by IndirectLightingQuality
* Texel debugging is now a cvar 'r.TexelDebugging', instead of requiring a full recompile
Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data
Quad Complexity ViewMode (PCD3D_SM5 only).
Shader Complexity with Quad Overhead ViewMode (PCD3D_SM5 only). Require ShaderComplexity ViewMode & Show.Visualize.QuadOverhead
#review brian.karis
Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering
improved SSAO quality (less high frequency noise) to avoid TemporalAA smearing
Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S
DevRendering - Enable removing unused outputs on PS4 shader pipelines, disable by default removing unused on D3D (toggable with r.D3DRemoveUnusedInterpolators)
#codereview Marcus.Wassmer
Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev
Submitting pull request from user Pierdek.
Early out of particle collision module update if there are no active particles.
#github
#1614
Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering
UE4 - Fixed the experimental r.RHICmdBalanceParallelLists 2 mode and renabled it for orion.
Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering
UE4 - Added a path so that texture streaming can avoid flushing the RHI thread.
Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream
Added new PrimitiveComponent setting bSingleSampleShadowFromStationaryLights
* When enabled, shadowing of a movable component from a stationary directional light will come from the Volume Lighting Samples precomputed by Lightmass
* This provides essentially free on/off shadow receiving on dynamic objects, with a fade over time between states
* Lighting has to be rebuilt once for this to work
#rb Rolando.Caloca
Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering
UE4 - Dynamically set stream source to avoid creating a separate drawing policy for each static mesh with vertex colors.
#rb Daniel.Wright
Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data
Enabled Embree by default
#review daniel.wright
==========================
ALL CHANGELISTS
==========================
Change 2720123 on 2015/10/07 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - 'integrate' Tem'
Change 2721682 on 2015/10/08 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Eliminated a fatal error '
Change 2721815 on 2015/10/08 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - Fix crash exiti'
Change 2724755 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix Tier'
Change 2724781 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix offse'
Change 2728317 on 2015/10/14 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - hlslcc - Fix fo'
Change 2729170 on 2015/10/14 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Force Lightmass volume sample g'
Change 2732131 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed resource transition issue'
Change 2732218 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code cleanup '
Change 2733533 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Clear stencil to 0 after decals'
Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Capsule shadows * Capsule shado'
Change 2733546 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Light shaft targets are only al'
Change 2733602 on 2015/10/19 by Uriel.Doyon@uriel.doyon_office_data 'Decals not writing to Normal ca'
Change 2733627 on 2015/10/19 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix for transition ensure. '
Change 2735292 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for dark lightmap precision'
Change 2735298 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for speedtree LOD transitio'
Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data 'Basepass drawlist are now merge'
Change 2737214 on 2015/10/21 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Expanded a warning when importi'
Change 2738581 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Updated comment on stencil usag'
Change 2738583 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Changed bound but not set scene'
Change 2738584 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed skylight occlusion maps b'
Change 2738589 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmap streaming fixes * Chan'
Change 2738593 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fix from licensee for race cond'
Change 2738982 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Activating CanTickOnAnyThread f'
Change 2739032 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Fixing compiler barf with Clang'
Change 2741517 on 2015/10/26 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRindering - D3D12 - Integrat'
Change 2743790 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed texel debugging on static'
Change 2743958 on 2015/10/27 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comments '
Change 2744153 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Unity compile fix '
Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams 'Remove unused RHI methods: RHI'
Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lighting channels - each compon'
Change 2746242 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix crashes on init by swapping'
Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'First pass at separate Async Co'
Change 2746296 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Buffer label frees so we don't '
Change 2746297 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'updated comment '
Change 2746343 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment '
Change 2746347 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment '
Change 2746811 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Draw event for compute commandl'
Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Removed a lot of complexity of '
Change 2747127 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Improved game console printout '
Change 2747702 on 2015/10/30 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Bumped Lightmass StaticMesh imp'
Change 2747954 on 2015/10/30 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix SubmitDone not called TRC e'
Change 2747979 on 2015/10/30 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'polish console autocomplete tex'
Change 2750719 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Add Embree 2.7.0 for Win64 and '
Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Embree integration into Lightma'
Change 2750872 on 2015/11/02 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R'
Change 2751934 on 2015/11/03 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Disambiguate template function '
Change 2752190 on 2015/11/03 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed assert relating to '
Change 2752333 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Shader pipeline '
Change 2752655 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - Fix Materials pa'
Change 2752710 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment '
Change 2752711 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added better comment/help text '
Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added SSAO CS version, can be e'
Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmass solver quality improv'
Change 2752869 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Add shader pipel'
Change 2752882 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - hlslcc - Metal -'
Change 2752899 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'small SSAO GPU optimization mov'
Change 2752934 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor GPU optimization for SSAO'
Change 2753109 on 2015/11/03 by Uriel.Doyon@uriel.doyon_office_data 'Fixed final build '
Change 2753669 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed SM4 compiling '
Change 2754002 on 2015/11/04 by Nick.Penwarden@nickp_streams 'test change '
Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data 'Quad Complexity ViewMode (PCD3D'
Change 2754115 on 2015/11/04 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed end of frame update'
Change 2754297 on 2015/11/04 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'PS4 compile fixes #codereview U'
Change 2754405 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor SSAO ALU optimizations fi'
Change 2754512 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'adjusted clamp for cvar '
Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'improved SSAO quality (less hig'
Change 2755572 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - PS4 warning fix '
Change 2755667 on 2015/11/05 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed UE-22742, leak in t'
Change 2755722 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Remove unused co'
Change 2755814 on 2015/11/05 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R'
Change 2755935 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Rebuild static m'
Change 2756003 on 2015/11/05 by Uriel.Doyon@uriel.doyon_office_data 'Reduce the number of precompute'
Change 2756145 on 2015/11/05 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Temp fix for GPU crash #rb none'
Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Enable removing '
Change 2756435 on 2015/11/05 by Olaf.Piesche@Olaf.Piesche_roaming 'Disabling a check, to fix OR-85'
Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev 'Submitting pull request from us'
Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed the experimental r.'
Change 2757341 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Changed the RHI thread di'
Change 2757342 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed lazy uniform buffer'
Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Added a path so that text'
Change 2757500 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Add FrameSync to externalprofil'
Change 2757650 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'GBuffer should only be consider'
Change 2757665 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'UE-22816 Instruction count is n'
Change 2757834 on 2015/11/06 by Michael.Trepka@Michael.Trepka_a4202_Dev-Rendering 'Embree integration into Lightma'
Change 2757930 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix UT ensure #rb Peter.Knepley'
Change 2757931 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix Ocean ensure #rb josh.ander'
Change 2757946 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Removed invalid Lightmass asser'
Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Added new PrimitiveComponent se'
Change 2758049 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'OR-8600 CRASH: AllocationLeveli'
Change 2758059 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'r.DumpTransitionsForResource #r'
Change 2758082 on 2015/11/06 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix resource tra'
Change 2758879 on 2015/11/09 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix PSSL names f'
Change 2758911 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed accidental force di'
Change 2758968 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled single frame buffer us'
Change 2758991 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix togglerhithread crash #rb G'
Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Dynamically set stream so'
Change 2759063 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed UE-22368 CLONE - GitHub 1'
Change 2759073 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code quality improvements'
Change 2759501 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix particle ensure. '
Change 2759522 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix decals using CustomStencil.'
Change 2759610 on 2015/11/09 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed line light source shadows'
Change 2759634 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Refined GBufferA resolving when'
Change 2759657 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Fixed ResourceTransition with r'
Change 2759693 on 2015/11/09 by Rolando.Caloca@Rolando.Caloca_T4688_S 'DevRendering - Fixed global sha'
Change 2759771 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Fixed editor hit proxy renderin'
Change 2760188 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled some more deferred dec'
Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data 'Enabled Embree by default #revi'
[CL 2761339 by Nick Penwarden in Main branch]
2015-11-10 17:11:09 -05:00
VerifyAllocationLevel ( ) ;
2014-03-14 14:13:41 -04:00
}
}
}
FPooledRenderTarget * Found = 0 ;
2014-04-23 19:52:11 -04:00
uint32 FoundIndex = - 1 ;
2015-09-21 20:07:00 -04:00
bool bReusingExistingTarget = false ;
2014-03-14 14:13:41 -04:00
// try to find a suitable element in the pool
{
2015-09-10 09:25:56 -04:00
//don't spend time doing 2 passes if the platform doesn't support fastvram
uint32 PassCount = ( ( Desc . Flags & TexCreate_FastVRAM ) & & FPlatformProperties : : SupportsFastVRAMMemory ( ) ) ? 2 : 1 ;
2014-03-14 14:13:41 -04:00
2014-09-26 12:37:06 -04:00
// first we try exact, if that fails we try without TexCreate_FastVRAM
2014-09-26 12:41:57 -04:00
// (easily we can run out of VRam, if this search becomes a performance problem we can optimize or we should use less TexCreate_FastVRAM)
2014-09-26 12:37:06 -04:00
for ( uint32 Pass = 0 ; Pass < PassCount ; + + Pass )
2014-03-14 14:13:41 -04:00
{
2014-09-26 12:37:06 -04:00
bool bExactMatch = ( Pass = = 0 ) ;
for ( uint32 i = 0 , Num = ( uint32 ) PooledRenderTargets . Num ( ) ; i < Num ; + + i )
{
FPooledRenderTarget * Element = PooledRenderTargets [ i ] ;
if ( Element & & Element - > IsFree ( ) & & Element - > GetDesc ( ) . Compare ( Desc , bExactMatch ) )
{
2015-05-29 10:47:57 -04:00
check ( ! Element - > IsSnapshot ( ) ) ;
2014-09-26 12:37:06 -04:00
Found = Element ;
FoundIndex = i ;
2015-09-21 20:07:00 -04:00
bReusingExistingTarget = true ;
2014-09-26 12:37:06 -04:00
break ;
}
}
2015-09-10 09:25:56 -04:00
}
2014-03-14 14:13:41 -04:00
}
if ( ! Found )
2015-09-10 09:25:56 -04:00
{
2014-03-14 14:13:41 -04:00
UE_LOG ( LogRenderTargetPool , Display , TEXT ( " %d MB, NewRT %s %s " ) , ( AllocationLevelInKB + 1023 ) / 1024 , * Desc . GenerateInfoString ( ) , InDebugName ) ;
// not found in the pool, create a new element
Found = new FPooledRenderTarget ( Desc ) ;
PooledRenderTargets . Add ( Found ) ;
2014-05-06 17:45:03 -04:00
// TexCreate_UAV should be used on Desc.TargetableFlags
check ( ! ( Desc . Flags & TexCreate_UAV ) ) ;
2014-03-14 14:13:41 -04:00
2015-07-09 15:11:37 -04:00
FRHIResourceCreateInfo CreateInfo ( Desc . ClearValue ) ;
2014-05-20 15:09:51 -04:00
2014-03-14 14:13:41 -04:00
if ( Desc . TargetableFlags & ( TexCreate_RenderTargetable | TexCreate_DepthStencilTargetable | TexCreate_UAV ) )
{
if ( Desc . Is2DTexture ( ) )
{
RHICreateTargetableShaderResource2D (
Desc . Extent . X ,
Desc . Extent . Y ,
Desc . Format ,
Desc . NumMips ,
Desc . Flags ,
Desc . TargetableFlags ,
Desc . bForceSeparateTargetAndShaderResource ,
2014-05-20 15:09:51 -04:00
CreateInfo ,
2014-03-14 14:13:41 -04:00
( FTexture2DRHIRef & ) Found - > RenderTargetItem . TargetableTexture ,
( FTexture2DRHIRef & ) Found - > RenderTargetItem . ShaderResourceTexture ,
Desc . NumSamples
) ;
2015-01-09 20:56:36 -05:00
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3054480)
#lockdown Nick.Penwarden
#rb none
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3045482 on 2016/07/11 by Zabir.Hoque
DX12 Quries need to individually track their syncpoints. Only when resolving a query on the same frame should be stall.
Change 3045929 on 2016/07/12 by Simon.Tovey
Removing some deprecated node types from Niagara
Change 3045951 on 2016/07/12 by Ben.Woodhouse
D3D11 Log detailed live device info on shutdown if the debug layer is enabled (including resource types)
Change 3046019 on 2016/07/12 by Chris.Bunner
Fixed typo in material input name.
#jira UE-5575
Change 3046053 on 2016/07/12 by Rolando.Caloca
DR - Fix GL4 shutdown
#jira UE-32799
Change 3046055 on 2016/07/12 by Rolando.Caloca
DR - vk - Fix NumInstances=0
Change 3046063 on 2016/07/12 by Rolando.Caloca
DR - vk - Added flat to uint layouts per glslang
- Fix bad extension on dumped shaders
Change 3046067 on 2016/07/12 by Rolando.Caloca
DR - vk - Fix check when not using color RT
- Added queue submit & present counters
Change 3046088 on 2016/07/12 by Ben.Woodhouse
Live GPU stats
A non-hierarchical realtime high level GPU profiler with support for cumulative stat recording.
Stats are added with SCOPED_GPU_STAT macros, e.g. SCOPED_GPU_STAT(RHICmdList, Stat_GPU_Distortion)
The bulk of the files in this change are simply instrumentation for the renderer. The core changes are in SceneUtils.cpp/h and D3D11Query.cpp (this is the XB1/DX11X implementation of timestamp RHI queries, which was missing)
Note: this is currently disabled by default. Enable with the cvar r.gpustatsenabled
Tested on PC, XB1, PS4
Change 3046128 on 2016/07/12 by Olaf.Piesche
Max draw distance and fade range for lights, requested by JonL
Change 3046183 on 2016/07/12 by Ben.Woodhouse
PR #2532: Fix SSAO being applied in unlit viewmode (Contributed by nick-penwarden)
Change 3046223 on 2016/07/12 by Luke.Thatcher
Fix Scene Cube Captures. SceneCaptureSource flag on the ViewFamily was not set for cube components.
#jira UE-32345
Change 3046228 on 2016/07/12 by Marc.Olano
Add Voronoi noise to Noise material node.
Four versions with differing speed/quality levels accessed through the Quality value in the material node. Tooltips give estimates of the cost of each.
Also includes spiffy new Rand3DPCG16 and Rand3DPCG32 int3 to int3 hash functions, and a 20% improvement on the computed gradient noise.
Change 3046269 on 2016/07/12 by Rolando.Caloca
DR - Skip flush on RHIDiscardRenderTargets and only use it on platforms that need it (ie OpenGL)
Change 3046294 on 2016/07/12 by Rolando.Caloca
DR - Fix static analyisis
warning C6326: Potential comparison of a constant with another constant.
Change 3046295 on 2016/07/12 by Rolando.Caloca
DR - Fix the previous fix
Change 3046731 on 2016/07/12 by Marc.Olano
Fix typo in shader random number constant: repeated extra digit made it too big.
Change 3046796 on 2016/07/12 by Uriel.Doyon
The texture streaming manager now keeps a set of all valid textures.
This is used to prevent from indirecting deleted memory upon SetTexturesRemovedTimestamp.
#jira UE-33048
Change 3046800 on 2016/07/12 by Rolando.Caloca
DR - vk - Added create image & renderpass dump
Change 3046845 on 2016/07/12 by John.Billon
Forgot to apply MaxGPUSkinBones Cvar access changes in a few locations.
Change 3047023 on 2016/07/12 by Olaf.Piesche
Niagara:
-a bit of cleanup
-now store and double buffer attributes individually, eliminating unnecessary copy of unused attributes
-removed FNiagaraConstantMap, replaced with an instance of FNiagaraConstants
-some code simplification
-removed some deprecated structs and code used only by old content
Change 3047052 on 2016/07/12 by Zabir.Hoque
Unshelved from pending changelist '3044062':
PR #2588: Adding blend mode BLEND_AlphaComposite (4.12) (Contributed by moritz-wundke)
Change 3047727 on 2016/07/13 by Luke.Thatcher
Fix Scene Capture Components only updating every other frame.
#jira UE-32581
Change 3047919 on 2016/07/13 by Olaf.Piesche
CMask decode, use in deferred decals, for PS4
Change 3047921 on 2016/07/13 by Uriel.Doyon
"Build Texture Streaming" will now remove duplicate error msg when computing texcoord scales.
Also, several texture messages are packed on the same line if they relate to the same material.
Change 3047952 on 2016/07/13 by Rolando.Caloca
DR - vk - Initial prep pass for separating combined images & samplers
Change 3048648 on 2016/07/13 by Marcus.Wassmer
Fix rare GPU hang when asynctexture reallocs would overlap with EndFrame
Change 3049058 on 2016/07/13 by Rolando.Caloca
DR - vk - timestamps
Change 3049725 on 2016/07/14 by Marcus.Wassmer
Fix autosdk bug where not having a platform directory sync'd at all would break manual SDK detection
Change 3049742 on 2016/07/14 by Rolando.Caloca
DR - Fix warning
Change 3049902 on 2016/07/14 by Rolando.Caloca
DR - Fix typo
Change 3050345 on 2016/07/14 by Olaf.Piesche
UE-23925
Clamping noise tessellation for beams at a high but sensible value; also making sure during beam index buffer building that we never get over 2^16 indices; this is a bit hokey, but there are so many variables that can influence triangle/index count, that this is the only way to be sure (short of nuking the entire site from orbit).
Change 3050409 on 2016/07/14 by Olaf.Piesche
Replicating 3049049; missing break and check for active particles when resolving a source point to avoid a potential crash
Change 3050809 on 2016/07/14 by Rolando.Caloca
DR - vk - Remove redundant validation layers
Change 3051319 on 2016/07/15 by Ben.Woodhouse
Fix for world space camera position not being exposed in decal pixel shaders; also fixes decal lighting missing spec and reflection
The fix was to calculate ResolvedView at the top of the shader. Previously this was not initialized
#jira UE-31976
Change 3051692 on 2016/07/15 by Rolando.Caloca
DR - vk - Enable RHI thread by default
Change 3052103 on 2016/07/15 by Uriel.Doyon
Disabled depth offset in depth only pixel shaders when using debug view shaders (to prevent Z fighting).
#jira UE-32765
Change 3052140 on 2016/07/15 by Rolando.Caloca
DR - vk - Fix shader snafu
Change 3052495 on 2016/07/15 by Rolando.Caloca
DR - Fix for Win32 compile
#jira UE-33349
Change 3052536 on 2016/07/15 by Uriel.Doyon
Fixed texture streaming overbudget warning when using per texture bias.
[CL 3054554 by Gil Gribb in Main branch]
2016-07-18 17:17:08 -04:00
if ( GSupportsRenderTargetWriteMask & & Desc . bCreateRenderTargetWriteMask )
{
Found - > RenderTargetItem . RTWriteMaskDataBufferRHI = RHICreateRTWriteMaskBuffer ( ( FTexture2DRHIRef & ) Found - > RenderTargetItem . TargetableTexture ) ;
Found - > RenderTargetItem . RTWriteMaskBufferRHI_SRV = RHICreateShaderResourceView ( Found - > RenderTargetItem . RTWriteMaskDataBufferRHI ) ;
}
2015-01-09 20:56:36 -05:00
if ( Desc . NumMips > 1 )
{
Found - > RenderTargetItem . MipSRVs . SetNum ( Desc . NumMips ) ;
for ( uint16 i = 0 ; i < Desc . NumMips ; i + + )
{
Found - > RenderTargetItem . MipSRVs [ i ] = RHICreateShaderResourceView ( ( FTexture2DRHIRef & ) Found - > RenderTargetItem . ShaderResourceTexture , i ) ;
}
}
2014-03-14 14:13:41 -04:00
}
else if ( Desc . Is3DTexture ( ) )
{
Found - > RenderTargetItem . ShaderResourceTexture = RHICreateTexture3D (
Desc . Extent . X ,
Desc . Extent . Y ,
Desc . Depth ,
Desc . Format ,
Desc . NumMips ,
Desc . TargetableFlags ,
2014-05-20 15:09:51 -04:00
CreateInfo ) ;
2014-03-14 14:13:41 -04:00
// similar to RHICreateTargetableShaderResource2D
Found - > RenderTargetItem . TargetableTexture = Found - > RenderTargetItem . ShaderResourceTexture ;
}
else
{
check ( Desc . IsCubemap ( ) ) ;
if ( Desc . IsArray ( ) )
{
RHICreateTargetableShaderResourceCubeArray (
Desc . Extent . X ,
Desc . ArraySize ,
Desc . Format ,
Desc . NumMips ,
Desc . Flags ,
Desc . TargetableFlags ,
false ,
2014-05-20 15:09:51 -04:00
CreateInfo ,
2014-03-14 14:13:41 -04:00
( FTextureCubeRHIRef & ) Found - > RenderTargetItem . TargetableTexture ,
( FTextureCubeRHIRef & ) Found - > RenderTargetItem . ShaderResourceTexture
) ;
}
else
{
RHICreateTargetableShaderResourceCube (
Desc . Extent . X ,
Desc . Format ,
Desc . NumMips ,
Desc . Flags ,
Desc . TargetableFlags ,
false ,
2014-05-20 15:09:51 -04:00
CreateInfo ,
2014-03-14 14:13:41 -04:00
( FTextureCubeRHIRef & ) Found - > RenderTargetItem . TargetableTexture ,
( FTextureCubeRHIRef & ) Found - > RenderTargetItem . ShaderResourceTexture
) ;
}
}
RHIBindDebugLabelName ( Found - > RenderTargetItem . TargetableTexture , InDebugName ) ;
}
else
{
if ( Desc . Is2DTexture ( ) )
{
// this is useful to get a CPU lockable texture through the same interface
Found - > RenderTargetItem . ShaderResourceTexture = RHICreateTexture2D (
Desc . Extent . X ,
Desc . Extent . Y ,
Desc . Format ,
Desc . NumMips ,
Desc . NumSamples ,
Desc . Flags ,
2014-05-20 15:09:51 -04:00
CreateInfo ) ;
2014-03-14 14:13:41 -04:00
}
else if ( Desc . Is3DTexture ( ) )
{
Found - > RenderTargetItem . ShaderResourceTexture = RHICreateTexture3D (
Desc . Extent . X ,
Desc . Extent . Y ,
Desc . Depth ,
Desc . Format ,
Desc . NumMips ,
Desc . Flags ,
2014-05-20 15:09:51 -04:00
CreateInfo ) ;
2014-03-14 14:13:41 -04:00
}
else
{
check ( Desc . IsCubemap ( ) ) ;
if ( Desc . IsArray ( ) )
{
2014-05-20 15:09:51 -04:00
FTextureCubeRHIRef CubeTexture = RHICreateTextureCubeArray ( Desc . Extent . X , Desc . ArraySize , Desc . Format , Desc . NumMips , Desc . Flags | Desc . TargetableFlags | TexCreate_ShaderResource , CreateInfo ) ;
2014-03-14 14:13:41 -04:00
Found - > RenderTargetItem . TargetableTexture = Found - > RenderTargetItem . ShaderResourceTexture = CubeTexture ;
}
else
{
2014-05-20 15:09:51 -04:00
FTextureCubeRHIRef CubeTexture = RHICreateTextureCube ( Desc . Extent . X , Desc . Format , Desc . NumMips , Desc . Flags | Desc . TargetableFlags | TexCreate_ShaderResource , CreateInfo ) ;
2014-03-14 14:13:41 -04:00
Found - > RenderTargetItem . TargetableTexture = Found - > RenderTargetItem . ShaderResourceTexture = CubeTexture ;
}
}
RHIBindDebugLabelName ( Found - > RenderTargetItem . ShaderResourceTexture , InDebugName ) ;
}
if ( Desc . TargetableFlags & TexCreate_UAV )
{
// The render target desc is invalid if a UAV is requested with an RHI that doesn't support the high-end feature level.
2014-07-24 05:23:50 -04:00
check ( GMaxRHIFeatureLevel = = ERHIFeatureLevel : : SM5 ) ;
2014-03-14 14:13:41 -04:00
Found - > RenderTargetItem . UAV = RHICreateUnorderedAccessView ( Found - > RenderTargetItem . TargetableTexture ) ;
}
AllocationLevelInKB + = ComputeSizeInKB ( * Found ) ;
VerifyAllocationLevel ( ) ;
2014-04-23 19:52:11 -04:00
FoundIndex = PooledRenderTargets . Num ( ) - 1 ;
2014-09-26 12:37:06 -04:00
// done twice but it doesn't hurt an LogVRamUsage gets the new name this way
Found - > Desc . DebugName = InDebugName ;
LogVRamUsage ( * Found ) ;
2014-03-14 14:13:41 -04:00
}
# if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
{
2014-06-27 11:07:13 -04:00
2014-06-25 05:47:33 -04:00
if ( CVarRenderTargetPoolTest . GetValueOnRenderThread ( ) )
2014-03-14 14:13:41 -04:00
{
if ( Found - > GetDesc ( ) . TargetableFlags & TexCreate_RenderTargetable )
{
2014-06-12 07:13:34 -04:00
SetRenderTarget ( RHICmdList , Found - > RenderTargetItem . TargetableTexture , FTextureRHIRef ( ) ) ;
RHICmdList . Clear ( true , FLinearColor ( 1000 , 1000 , 1000 , 1000 ) , false , 1.0f , false , 0 , FIntRect ( ) ) ;
2014-03-14 14:13:41 -04:00
}
else if ( Found - > GetDesc ( ) . TargetableFlags & TexCreate_UAV )
{
const uint32 ZeroClearValue [ 4 ] = { 1000 , 1000 , 1000 , 1000 } ;
2014-06-12 07:13:34 -04:00
RHICmdList . ClearUAV ( Found - > RenderTargetItem . UAV , ZeroClearValue ) ;
2014-03-14 14:13:41 -04:00
}
if ( Desc . TargetableFlags & TexCreate_DepthStencilTargetable )
{
2014-06-12 07:13:34 -04:00
SetRenderTarget ( RHICmdList , FTextureRHIRef ( ) , Found - > RenderTargetItem . TargetableTexture ) ;
RHICmdList . Clear ( false , FLinearColor ( 0 , 0 , 0 , 0 ) , true , 0.0f , false , 0 , FIntRect ( ) ) ;
2014-03-14 14:13:41 -04:00
}
}
}
# endif
check ( Found - > IsFree ( ) ) ;
2015-05-29 10:47:57 -04:00
check ( ! Found - > IsSnapshot ( ) ) ;
2014-03-14 14:13:41 -04:00
Found - > Desc . DebugName = InDebugName ;
Found - > UnusedForNFrames = 0 ;
2014-04-23 19:52:11 -04:00
AddAllocEvent ( FoundIndex , Found ) ;
2014-03-14 14:13:41 -04:00
// assign to the reference counted variable
Out = Found ;
check ( ! Found - > IsFree ( ) ) ;
2015-09-21 20:07:00 -04:00
if ( bReusingExistingTarget & & bDoWritableBarrier )
{
RHICmdList . TransitionResource ( EResourceTransitionAccess : : EWritable , Found - > GetRenderTargetItem ( ) . TargetableTexture ) ;
}
2014-03-14 14:13:41 -04:00
return false ;
}
void FRenderTargetPool : : CreateUntrackedElement ( const FPooledRenderTargetDesc & Desc , TRefCountPtr < IPooledRenderTarget > & Out , const FSceneRenderTargetItem & Item )
{
check ( IsInRenderingThread ( ) ) ;
Out = 0 ;
// not found in the pool, create a new element
FPooledRenderTarget * Found = new FPooledRenderTarget ( Desc ) ;
Found - > RenderTargetItem = Item ;
2015-05-29 10:47:57 -04:00
check ( ! Found - > IsSnapshot ( ) ) ;
2014-03-14 14:13:41 -04:00
// assign to the reference counted variable
Out = Found ;
}
2015-05-29 10:47:57 -04:00
IPooledRenderTarget * FRenderTargetPool : : MakeSnapshot ( const TRefCountPtr < IPooledRenderTarget > & In )
{
check ( IsInRenderingThread ( ) ) ;
FPooledRenderTarget * NewSnapshot = nullptr ;
if ( In . GetReference ( ) )
{
NewSnapshot = new ( FMemStack : : Get ( ) ) FPooledRenderTarget ( * static_cast < FPooledRenderTarget * > ( In . GetReference ( ) ) ) ;
PooledRenderTargetSnapshots . Add ( NewSnapshot ) ;
}
return NewSnapshot ;
}
2014-03-14 14:13:41 -04:00
void FRenderTargetPool : : GetStats ( uint32 & OutWholeCount , uint32 & OutWholePoolInKB , uint32 & OutUsedInKB ) const
{
OutWholeCount = ( uint32 ) PooledRenderTargets . Num ( ) ;
OutUsedInKB = 0 ;
OutWholePoolInKB = 0 ;
for ( uint32 i = 0 ; i < ( uint32 ) PooledRenderTargets . Num ( ) ; + + i )
{
FPooledRenderTarget * Element = PooledRenderTargets [ i ] ;
2014-04-23 19:52:11 -04:00
if ( Element )
2014-03-14 14:13:41 -04:00
{
2015-05-29 10:47:57 -04:00
check ( ! Element - > IsSnapshot ( ) ) ;
2014-04-23 19:52:11 -04:00
uint32 SizeInKB = ComputeSizeInKB ( * Element ) ;
OutWholePoolInKB + = SizeInKB ;
if ( ! Element - > IsFree ( ) )
{
OutUsedInKB + = SizeInKB ;
}
2014-03-14 14:13:41 -04:00
}
}
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main)
#lockdown ben.marsh
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream
Capsule shadows
* Capsule shadows excel at extremely soft area shadows caused by a large light source angle, but don't support accurate self-shadowing
* Artists can setup a physics asset containing Spheres and Sphyls (capsules) for a skeletal mesh that will be used to represent the mesh's occlusion
* These shapes can then be used for direct shadowing (bCastCapsuleDirectShadow) on a skeletal mesh component, whose softness depends on the light source angle / radius
* The shapes can also be used to create an indirect shadow (bCastCapsuleIndirectShadow), whose direction and softness is derived from the precomputed sky occlusion (stationary sky light) or primary indirect lighting (static sky light)
* Capsule shadowing is computed at half res and uses tiled deferred culling for efficiency - only implemented for PC SM5 + PS4 so far
* Shadowing of movable skylights is not yet supported
Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data
Basepass drawlist are now merged within a single drawlist.
Lighting policy parameters are now accessed through a uniform buffer.
Changed the global resource initialization so that InitRHI now comes before InitDynamicRHI
#codereview nick.penwarden
Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams
Remove unused RHI methods:
RHIIsDrawingViewport
RHIGpuTimeBegin
RHIGpuTimeEnd
Made default/empty versions of these calls and removed stubs from RHIs that don't use them:
RHISuspendRendering
RHIResumeRendering
RHIIsRenderingSuspended
Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream
Lighting channels - each component and light can choose from 3 channels
* Primitives output their channel mask to stencil during the base pass, the masks are copied to a texture after the base pass, deferred lighting passes compare the primitive mask against the light's mask
* Dynamic shadow casting also respects the channels
* Only works on opaque materials, direct lighting, dynamic lighting
* Not implemented for tiled deferred atm
* This will replace CastsShadowsFromCinematicObjectsOnly in the future
#rb Martin.Mittring
Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New
First pass at separate Async Compute Context
#codereview Lee.Clark,Daniel.Wright
#rb Gil.Gribb
Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering
Removed a lot of complexity of the skeletal mesh motionblur code (better for multithreading, simpler, faster) but going from one large buffer to per mesh buffers. Upload of bones only needed once.
* GPUSkinCache didn't even work before (in this branch)
* tested BasePass velocity
* tested split screen
* tested editor pause
* matinee camera cut (no need, invalidates velocity)
* tested CPU Skin? (never has motionblur)
* tested CreateSceneProxy (recreation is prevented in CreteSceneProxy unless bone count changes)
* test ES2 -featureleveles2
#rb: Rolando.Caloca
Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data
Embree integration into Lightmass
Can be enabled through Lightmass.ini [DevOptions.StaticLighting]bUseEmbree.
Also [DevOptions.StaticLighting]bVerifyEmbree will compare ray casting results.
Only usable on Win64 with this submit.
#review daniel.wright
Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering
added SSAO CS version, can be enabled with
r.AmbientOcclusion.Compute 1
Not optimized yet
#rb:Olaf.Piesche
Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream
Lightmass solver quality improvements
* IndirectLightingScale is no longer applied to photons, avoids splotchy artifacts when using small scales
* New 'Lightmass Portal' actor / component which tells the solver where to look for significant lighting. When lighting with a Static Skylight only, in a mostly indoor environment, setting up these portals is the only way to get high quality.
* Skylight bounce lighting is now much more accurate and leverages adaptive sampling
* Fixed a bug that effectively disabled adaptive sampling on high IndirectLightingQualities
* Shadow penumbras are also improved by IndirectLightingQuality
* Texel debugging is now a cvar 'r.TexelDebugging', instead of requiring a full recompile
Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data
Quad Complexity ViewMode (PCD3D_SM5 only).
Shader Complexity with Quad Overhead ViewMode (PCD3D_SM5 only). Require ShaderComplexity ViewMode & Show.Visualize.QuadOverhead
#review brian.karis
Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering
improved SSAO quality (less high frequency noise) to avoid TemporalAA smearing
Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S
DevRendering - Enable removing unused outputs on PS4 shader pipelines, disable by default removing unused on D3D (toggable with r.D3DRemoveUnusedInterpolators)
#codereview Marcus.Wassmer
Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev
Submitting pull request from user Pierdek.
Early out of particle collision module update if there are no active particles.
#github
#1614
Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering
UE4 - Fixed the experimental r.RHICmdBalanceParallelLists 2 mode and renabled it for orion.
Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering
UE4 - Added a path so that texture streaming can avoid flushing the RHI thread.
Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream
Added new PrimitiveComponent setting bSingleSampleShadowFromStationaryLights
* When enabled, shadowing of a movable component from a stationary directional light will come from the Volume Lighting Samples precomputed by Lightmass
* This provides essentially free on/off shadow receiving on dynamic objects, with a fade over time between states
* Lighting has to be rebuilt once for this to work
#rb Rolando.Caloca
Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering
UE4 - Dynamically set stream source to avoid creating a separate drawing policy for each static mesh with vertex colors.
#rb Daniel.Wright
Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data
Enabled Embree by default
#review daniel.wright
==========================
ALL CHANGELISTS
==========================
Change 2720123 on 2015/10/07 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - 'integrate' Tem'
Change 2721682 on 2015/10/08 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Eliminated a fatal error '
Change 2721815 on 2015/10/08 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - Fix crash exiti'
Change 2724755 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix Tier'
Change 2724781 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix offse'
Change 2728317 on 2015/10/14 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - hlslcc - Fix fo'
Change 2729170 on 2015/10/14 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Force Lightmass volume sample g'
Change 2732131 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed resource transition issue'
Change 2732218 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code cleanup '
Change 2733533 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Clear stencil to 0 after decals'
Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Capsule shadows * Capsule shado'
Change 2733546 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Light shaft targets are only al'
Change 2733602 on 2015/10/19 by Uriel.Doyon@uriel.doyon_office_data 'Decals not writing to Normal ca'
Change 2733627 on 2015/10/19 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix for transition ensure. '
Change 2735292 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for dark lightmap precision'
Change 2735298 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for speedtree LOD transitio'
Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data 'Basepass drawlist are now merge'
Change 2737214 on 2015/10/21 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Expanded a warning when importi'
Change 2738581 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Updated comment on stencil usag'
Change 2738583 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Changed bound but not set scene'
Change 2738584 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed skylight occlusion maps b'
Change 2738589 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmap streaming fixes * Chan'
Change 2738593 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fix from licensee for race cond'
Change 2738982 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Activating CanTickOnAnyThread f'
Change 2739032 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Fixing compiler barf with Clang'
Change 2741517 on 2015/10/26 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRindering - D3D12 - Integrat'
Change 2743790 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed texel debugging on static'
Change 2743958 on 2015/10/27 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comments '
Change 2744153 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Unity compile fix '
Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams 'Remove unused RHI methods: RHI'
Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lighting channels - each compon'
Change 2746242 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix crashes on init by swapping'
Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'First pass at separate Async Co'
Change 2746296 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Buffer label frees so we don't '
Change 2746297 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'updated comment '
Change 2746343 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment '
Change 2746347 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment '
Change 2746811 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Draw event for compute commandl'
Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Removed a lot of complexity of '
Change 2747127 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Improved game console printout '
Change 2747702 on 2015/10/30 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Bumped Lightmass StaticMesh imp'
Change 2747954 on 2015/10/30 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix SubmitDone not called TRC e'
Change 2747979 on 2015/10/30 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'polish console autocomplete tex'
Change 2750719 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Add Embree 2.7.0 for Win64 and '
Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Embree integration into Lightma'
Change 2750872 on 2015/11/02 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R'
Change 2751934 on 2015/11/03 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Disambiguate template function '
Change 2752190 on 2015/11/03 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed assert relating to '
Change 2752333 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Shader pipeline '
Change 2752655 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - Fix Materials pa'
Change 2752710 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment '
Change 2752711 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added better comment/help text '
Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added SSAO CS version, can be e'
Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmass solver quality improv'
Change 2752869 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Add shader pipel'
Change 2752882 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - hlslcc - Metal -'
Change 2752899 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'small SSAO GPU optimization mov'
Change 2752934 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor GPU optimization for SSAO'
Change 2753109 on 2015/11/03 by Uriel.Doyon@uriel.doyon_office_data 'Fixed final build '
Change 2753669 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed SM4 compiling '
Change 2754002 on 2015/11/04 by Nick.Penwarden@nickp_streams 'test change '
Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data 'Quad Complexity ViewMode (PCD3D'
Change 2754115 on 2015/11/04 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed end of frame update'
Change 2754297 on 2015/11/04 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'PS4 compile fixes #codereview U'
Change 2754405 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor SSAO ALU optimizations fi'
Change 2754512 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'adjusted clamp for cvar '
Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'improved SSAO quality (less hig'
Change 2755572 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - PS4 warning fix '
Change 2755667 on 2015/11/05 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed UE-22742, leak in t'
Change 2755722 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Remove unused co'
Change 2755814 on 2015/11/05 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R'
Change 2755935 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Rebuild static m'
Change 2756003 on 2015/11/05 by Uriel.Doyon@uriel.doyon_office_data 'Reduce the number of precompute'
Change 2756145 on 2015/11/05 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Temp fix for GPU crash #rb none'
Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Enable removing '
Change 2756435 on 2015/11/05 by Olaf.Piesche@Olaf.Piesche_roaming 'Disabling a check, to fix OR-85'
Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev 'Submitting pull request from us'
Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed the experimental r.'
Change 2757341 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Changed the RHI thread di'
Change 2757342 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed lazy uniform buffer'
Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Added a path so that text'
Change 2757500 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Add FrameSync to externalprofil'
Change 2757650 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'GBuffer should only be consider'
Change 2757665 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'UE-22816 Instruction count is n'
Change 2757834 on 2015/11/06 by Michael.Trepka@Michael.Trepka_a4202_Dev-Rendering 'Embree integration into Lightma'
Change 2757930 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix UT ensure #rb Peter.Knepley'
Change 2757931 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix Ocean ensure #rb josh.ander'
Change 2757946 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Removed invalid Lightmass asser'
Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Added new PrimitiveComponent se'
Change 2758049 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'OR-8600 CRASH: AllocationLeveli'
Change 2758059 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'r.DumpTransitionsForResource #r'
Change 2758082 on 2015/11/06 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix resource tra'
Change 2758879 on 2015/11/09 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix PSSL names f'
Change 2758911 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed accidental force di'
Change 2758968 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled single frame buffer us'
Change 2758991 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix togglerhithread crash #rb G'
Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Dynamically set stream so'
Change 2759063 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed UE-22368 CLONE - GitHub 1'
Change 2759073 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code quality improvements'
Change 2759501 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix particle ensure. '
Change 2759522 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix decals using CustomStencil.'
Change 2759610 on 2015/11/09 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed line light source shadows'
Change 2759634 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Refined GBufferA resolving when'
Change 2759657 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Fixed ResourceTransition with r'
Change 2759693 on 2015/11/09 by Rolando.Caloca@Rolando.Caloca_T4688_S 'DevRendering - Fixed global sha'
Change 2759771 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Fixed editor hit proxy renderin'
Change 2760188 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled some more deferred dec'
Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data 'Enabled Embree by default #revi'
[CL 2761339 by Nick Penwarden in Main branch]
2015-11-10 17:11:09 -05:00
// if this triggers uncomment the code in VerifyAllocationLevel() and debug the issue, we might leak memory or not release when we could
ensure ( AllocationLevelInKB = = OutWholePoolInKB ) ;
2014-03-14 14:13:41 -04:00
}
2014-04-23 19:52:11 -04:00
void FRenderTargetPool : : AddPhaseEvent ( const TCHAR * InPhaseName )
{
if ( IsEventRecordingEnabled ( ) )
{
AddDeallocEvents ( ) ;
const FString * LastName = GetLastEventPhaseName ( ) ;
if ( ! LastName | | * LastName ! = InPhaseName )
{
2014-04-23 20:00:52 -04:00
if ( CurrentEventRecordingTime )
2014-04-23 19:52:11 -04:00
{
// put a break to former data
2014-04-23 20:00:52 -04:00
+ + CurrentEventRecordingTime ;
2014-04-23 19:52:11 -04:00
}
2014-04-23 20:00:52 -04:00
FRenderTargetPoolEvent NewEvent ( InPhaseName , CurrentEventRecordingTime ) ;
2014-04-23 19:52:11 -04:00
RenderTargetPoolEvents . Add ( NewEvent ) ;
}
}
}
// helper class to get a consistent layout in multiple functions
// MaxX and Y are the output value that can be requested during or after iteration
// Examples usages:
// FRenderTargetPoolEventIterator It(RenderTargetPoolEvents, OptionalStartIndex);
// while(FRenderTargetPoolEvent* Event = It.Iterate()) {}
struct FRenderTargetPoolEventIterator
{
int32 Index ;
TArray < FRenderTargetPoolEvent > & RenderTargetPoolEvents ;
bool bLineContent ;
uint32 TotalWidth ;
int32 Y ;
// constructor
FRenderTargetPoolEventIterator ( TArray < FRenderTargetPoolEvent > & InRenderTargetPoolEvents , int32 InIndex = 0 )
: Index ( InIndex )
, RenderTargetPoolEvents ( InRenderTargetPoolEvents )
, bLineContent ( false )
, TotalWidth ( 1 )
, Y ( 0 )
{
Touch ( ) ;
}
FRenderTargetPoolEvent * operator * ( )
{
if ( Index < RenderTargetPoolEvents . Num ( ) )
{
return & RenderTargetPoolEvents [ Index ] ;
}
return 0 ;
}
// @return 0 if end was reached
FRenderTargetPoolEventIterator & operator + + ( )
{
if ( Index < RenderTargetPoolEvents . Num ( ) )
{
+ + Index ;
}
Touch ( ) ;
return * this ;
}
int32 FindClosingEventY ( ) const
{
FRenderTargetPoolEventIterator It = * this ;
const ERenderTargetPoolEventType StartType = ( * It ) - > GetEventType ( ) ;
if ( StartType = = ERTPE_Alloc )
{
int32 PoolEntryId = RenderTargetPoolEvents [ Index ] . GetPoolEntryId ( ) ;
+ + It ;
// search for next Dealloc of the same PoolEntryId
for ( ; * It ; + + It )
{
FRenderTargetPoolEvent * Event = * It ;
if ( Event - > GetEventType ( ) = = ERTPE_Dealloc & & Event - > GetPoolEntryId ( ) = = PoolEntryId )
{
break ;
}
}
}
else if ( StartType = = ERTPE_Phase )
{
+ + It ;
// search for next Phase
for ( ; * It ; + + It )
{
FRenderTargetPoolEvent * Event = * It ;
if ( Event - > GetEventType ( ) = = ERTPE_Phase )
{
break ;
}
}
}
else
{
check ( 0 ) ;
}
return It . Y ;
}
private :
void Touch ( )
{
if ( Index < RenderTargetPoolEvents . Num ( ) )
{
const FRenderTargetPoolEvent & Event = RenderTargetPoolEvents [ Index ] ;
const ERenderTargetPoolEventType Type = Event . GetEventType ( ) ;
if ( Type = = ERTPE_Alloc )
{
// for now they are all equal width
TotalWidth = FMath : : Max ( TotalWidth , Event . GetColumnX ( ) + Event . GetColumnSize ( ) ) ;
}
Y = Event . GetTimeStep ( ) ;
}
}
} ;
2014-04-23 20:00:52 -04:00
uint32 FRenderTargetPool : : ComputeEventDisplayHeight ( )
2014-04-23 19:52:11 -04:00
{
FRenderTargetPoolEventIterator It ( RenderTargetPoolEvents ) ;
for ( ; * It ; + + It )
{
}
2014-05-06 12:08:01 -04:00
return It . Y ;
2014-04-23 19:52:11 -04:00
}
const FString * FRenderTargetPool : : GetLastEventPhaseName ( )
{
// could be optimized but this is a debug view
// start from the end for better performance
for ( int32 i = RenderTargetPoolEvents . Num ( ) - 1 ; i > = 0 ; - - i )
{
const FRenderTargetPoolEvent * Event = & RenderTargetPoolEvents [ i ] ;
if ( Event - > GetEventType ( ) = = ERTPE_Phase )
{
return & Event - > GetPhaseName ( ) ;
}
}
return 0 ;
}
FRenderTargetPool : : SMemoryStats FRenderTargetPool : : ComputeView ( )
{
SMemoryStats MemoryStats ;
# if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
{
struct FRTPColumn
{
// index into the column, -1 if this is no valid column
uint32 PoolEntryId ;
// for sorting
uint64 SizeInBytes ;
// for sorting
bool bVRam ;
// default constructor
FRTPColumn ( )
: PoolEntryId ( - 1 )
, SizeInBytes ( 0 )
{
}
// constructor
FRTPColumn ( const FRenderTargetPoolEvent & Event )
: PoolEntryId ( Event . GetPoolEntryId ( ) )
, bVRam ( ( Event . GetDesc ( ) . Flags & TexCreate_FastVRAM ) ! = 0 )
{
2014-04-23 20:00:52 -04:00
SizeInBytes = Event . GetSizeInBytes ( ) ;
2014-04-23 19:52:11 -04:00
}
// sort criteria
bool operator < ( const FRTPColumn & rhs ) const
{
2014-04-23 19:58:00 -04:00
// sort VRam first (only matters on XboxOne but nice to always see it)
// sorting only useful for XboxOne if(bVRam != rhs.bVRam) return bVRam > rhs.bVRam;
2014-04-23 19:52:11 -04:00
// we want the large ones first
return SizeInBytes > rhs . SizeInBytes ;
}
} ;
TArray < FRTPColumn > Colums ;
// generate Colums
for ( int32 i = 0 , Num = RenderTargetPoolEvents . Num ( ) ; i < Num ; i + + )
{
FRenderTargetPoolEvent * Event = & RenderTargetPoolEvents [ i ] ;
if ( Event - > GetEventType ( ) = = ERTPE_Alloc )
{
uint32 PoolEntryId = Event - > GetPoolEntryId ( ) ;
if ( PoolEntryId > = ( uint32 ) Colums . Num ( ) )
{
Colums . SetNum ( PoolEntryId + 1 ) ;
}
Colums [ PoolEntryId ] = FRTPColumn ( * Event ) ;
}
}
Colums . Sort ( ) ;
{
uint32 ColumnX = 0 ;
2015-03-13 10:01:08 -04:00
for ( int32 ColumnIndex = 0 , ColumnsNum = Colums . Num ( ) ; ColumnIndex < ColumnsNum ; + + ColumnIndex )
2014-04-23 19:52:11 -04:00
{
const FRTPColumn & RTPColumn = Colums [ ColumnIndex ] ;
uint32 ColumnSize = RTPColumn . SizeInBytes ;
// hide columns that are too small to make a difference (e.g. <1 MB)
2014-04-23 20:00:52 -04:00
if ( RTPColumn . SizeInBytes < = EventRecordingSizeThreshold * 1024 )
2014-04-23 19:52:11 -04:00
{
ColumnSize = 0 ;
}
else
{
MemoryStats . DisplayedUsageInBytes + = RTPColumn . SizeInBytes ;
// give an entry some size to be more UI friendly (if we get mouse UI for zooming in we might not want that any more)
ColumnSize = FMath : : Max ( ( uint32 ) ( 1024 * 1024 ) , ColumnSize ) ;
}
2014-04-23 20:00:52 -04:00
MemoryStats . TotalColumnSize + = ColumnSize ;
2014-04-23 19:52:11 -04:00
MemoryStats . TotalUsageInBytes + = RTPColumn . SizeInBytes ;
2015-03-13 10:01:08 -04:00
for ( int32 EventIndex = 0 , PoolEventsNum = RenderTargetPoolEvents . Num ( ) ; EventIndex < PoolEventsNum ; EventIndex + + )
2014-04-23 19:52:11 -04:00
{
FRenderTargetPoolEvent * Event = & RenderTargetPoolEvents [ EventIndex ] ;
if ( Event - > GetEventType ( ) ! = ERTPE_Phase )
{
uint32 PoolEntryId = Event - > GetPoolEntryId ( ) ;
if ( RTPColumn . PoolEntryId = = PoolEntryId )
{
Event - > SetColumn ( ColumnIndex , ColumnX , ColumnSize ) ;
}
}
}
ColumnX + = ColumnSize ;
}
}
}
# endif
return MemoryStats ;
}
2014-04-23 20:01:03 -04:00
// draw a single pixel sized rectangle using 4 sub elements
2014-04-23 19:52:11 -04:00
inline void DrawBorder ( FCanvas & Canvas , const FIntRect Rect , FLinearColor Color )
{
// top
Canvas . DrawTile ( Rect . Min . X , Rect . Min . Y , Rect . Max . X - Rect . Min . X , 1 , 0 , 0 , 1 , 1 , Color ) ;
// bottom
Canvas . DrawTile ( Rect . Min . X , Rect . Max . Y - 1 , Rect . Max . X - Rect . Min . X , 1 , 0 , 0 , 1 , 1 , Color ) ;
// left
Canvas . DrawTile ( Rect . Min . X , Rect . Min . Y + 1 , 1 , Rect . Max . Y - Rect . Min . Y - 2 , 0 , 0 , 1 , 1 , Color ) ;
// right
Canvas . DrawTile ( Rect . Max . X - 1 , Rect . Min . Y + 1 , 1 , Rect . Max . Y - Rect . Min . Y - 2 , 0 , 0 , 1 , 1 , Color ) ;
}
2014-08-28 06:22:54 -04:00
void FRenderTargetPool : : PresentContent ( FRHICommandListImmediate & RHICmdList , const FViewInfo & View )
2014-04-23 19:52:11 -04:00
{
2014-06-12 07:13:34 -04:00
if ( RenderTargetPoolEvents . Num ( ) )
2014-04-23 19:52:11 -04:00
{
2014-05-06 12:08:01 -04:00
AddPhaseEvent ( TEXT ( " FrameEnd " ) ) ;
2014-04-23 19:52:11 -04:00
FIntPoint DisplayLeftTop ( 20 , 50 ) ;
// on the right we leave more space to make the mouse tooltip readable
FIntPoint DisplayExtent ( View . ViewRect . Width ( ) - DisplayLeftTop . X * 2 - 140 , View . ViewRect . Height ( ) - DisplayLeftTop . Y * 2 ) ;
// if the area is not too small
if ( DisplayExtent . X > 50 & & DisplayExtent . Y > 50 )
{
SMemoryStats MemoryStats = ComputeView ( ) ;
2014-06-12 07:13:34 -04:00
SetRenderTarget ( RHICmdList , View . Family - > RenderTarget - > GetRenderTargetTexture ( ) , FTextureRHIRef ( ) ) ;
2015-05-29 10:47:57 -04:00
RHICmdList . SetViewport ( 0 , 0 , 0.0f , FSceneRenderTargets : : Get ( RHICmdList ) . GetBufferSizeXY ( ) . X , FSceneRenderTargets : : Get ( RHICmdList ) . GetBufferSizeXY ( ) . Y , 1.0f ) ;
2014-04-23 19:52:11 -04:00
2014-06-12 07:13:34 -04:00
RHICmdList . SetBlendState ( TStaticBlendState < > : : GetRHI ( ) ) ;
RHICmdList . SetRasterizerState ( TStaticRasterizerState < > : : GetRHI ( ) ) ;
RHICmdList . SetDepthStencilState ( TStaticDepthStencilState < false , CF_Always > : : GetRHI ( ) ) ;
2014-04-23 19:52:11 -04:00
// this is a helper class for FCanvas to be able to get screen size
class FRenderTargetTemp : public FRenderTarget
{
public :
const FSceneView & View ;
FRenderTargetTemp ( const FSceneView & InView ) : View ( InView )
{
}
virtual FIntPoint GetSizeXY ( ) const
{
return View . UnscaledViewRect . Size ( ) ;
} ;
virtual const FTexture2DRHIRef & GetRenderTargetTexture ( ) const
{
return View . Family - > RenderTarget - > GetRenderTargetTexture ( ) ;
}
} TempRenderTarget ( View ) ;
2014-08-19 10:41:34 -04:00
FCanvas Canvas ( & TempRenderTarget , NULL , View . Family - > CurrentRealTime , View . Family - > CurrentWorldTime , View . Family - > DeltaWorldTime , View . GetFeatureLevel ( ) ) ;
2014-04-23 19:52:11 -04:00
// TinyFont property
const int32 FontHeight = 12 ;
FIntPoint MousePos = View . CursorPos ;
FLinearColor BackgroundColor = FLinearColor ( 0.0f , 0.0f , 0.0f , 0.7f ) ;
FLinearColor PhaseColor = FLinearColor ( 0.2f , 0.1f , 0.05f , 0.8f ) ;
FLinearColor ElementColor = FLinearColor ( 0.3f , 0.3f , 0.3f , 0.9f ) ;
FLinearColor ElementColorVRam = FLinearColor ( 0.4f , 0.25f , 0.25f , 0.9f ) ;
UTexture2D * GradientTexture = UCanvas : : StaticClass ( ) - > GetDefaultObject < UCanvas > ( ) - > GradientTexture0 ;
// background rectangle
Canvas . DrawTile ( DisplayLeftTop . X , DisplayLeftTop . Y - 1 * FontHeight - 1 , DisplayExtent . X , DisplayExtent . Y + FontHeight , 0 , 0 , 1 , 1 , BackgroundColor ) ;
{
uint32 MB = 1024 * 1024 ;
uint32 MBm1 = MB - 1 ;
FString Headline = * FString : : Printf ( TEXT ( " RenderTargetPool elements(x) over time(y) >= %dKB, Displayed/Total:%d/%dMB " ) ,
2014-04-23 20:00:52 -04:00
EventRecordingSizeThreshold ,
2014-04-23 19:52:11 -04:00
( uint32 ) ( ( MemoryStats . DisplayedUsageInBytes + MBm1 ) / MB ) ,
( uint32 ) ( ( MemoryStats . TotalUsageInBytes + MBm1 ) / MB ) ) ;
Canvas . DrawShadowedString ( DisplayLeftTop . X , DisplayLeftTop . Y - 1 * FontHeight - 1 , * Headline , GEngine - > GetTinyFont ( ) , FLinearColor ( 1 , 1 , 1 ) ) ;
}
2014-04-23 20:00:52 -04:00
uint32 EventDisplayHeight = ComputeEventDisplayHeight ( ) ;
float ScaleX = DisplayExtent . X / ( float ) MemoryStats . TotalColumnSize ;
float ScaleY = DisplayExtent . Y / ( float ) EventDisplayHeight ;
2014-04-23 19:52:11 -04:00
// 0 if none
FRenderTargetPoolEvent * HighlightedEvent = 0 ;
FIntRect HighlightedRect ;
// Phase events
for ( FRenderTargetPoolEventIterator It ( RenderTargetPoolEvents ) ; * It ; + + It )
{
FRenderTargetPoolEvent * Event = * It ;
if ( Event - > GetEventType ( ) = = ERTPE_Phase )
{
int32 Y0 = It . Y ;
int32 Y1 = It . FindClosingEventY ( ) ;
FIntPoint PixelLeftTop ( ( int32 ) ( DisplayLeftTop . X ) , ( int32 ) ( DisplayLeftTop . Y + ScaleY * Y0 ) ) ;
FIntPoint PixelRightBottom ( ( int32 ) ( DisplayLeftTop . X + DisplayExtent . X ) , ( int32 ) ( DisplayLeftTop . Y + ScaleY * Y1 ) ) ;
bool bHighlight = MousePos . X > = PixelLeftTop . X & & MousePos . X < PixelRightBottom . X & & MousePos . Y > = PixelLeftTop . Y & & MousePos . Y < = PixelRightBottom . Y ;
if ( bHighlight )
{
HighlightedEvent = Event ;
HighlightedRect = FIntRect ( PixelLeftTop , PixelRightBottom ) ;
}
// UMax is 0.9f to avoid getting some wrap texture leaking in at the bottom
Canvas . DrawTile ( PixelLeftTop . X , PixelLeftTop . Y , PixelRightBottom . X - PixelLeftTop . X , PixelRightBottom . Y - PixelLeftTop . Y , 0 , 0 , 1 , 0.9f , PhaseColor , GradientTexture - > Resource ) ;
}
}
// Alloc / Dealloc events
for ( FRenderTargetPoolEventIterator It ( RenderTargetPoolEvents ) ; * It ; + + It )
{
FRenderTargetPoolEvent * Event = * It ;
if ( Event - > GetEventType ( ) = = ERTPE_Alloc & & Event - > GetColumnSize ( ) )
{
int32 Y0 = It . Y ;
int32 Y1 = It . FindClosingEventY ( ) ;
int32 X0 = Event - > GetColumnX ( ) ;
// for now they are all equal width
int32 X1 = X0 + Event - > GetColumnSize ( ) ;
FIntPoint PixelLeftTop ( ( int32 ) ( DisplayLeftTop . X + ScaleX * X0 ) , ( int32 ) ( DisplayLeftTop . Y + ScaleY * Y0 ) ) ;
FIntPoint PixelRightBottom ( ( int32 ) ( DisplayLeftTop . X + ScaleX * X1 ) , ( int32 ) ( DisplayLeftTop . Y + ScaleY * Y1 ) ) ;
bool bHighlight = MousePos . X > = PixelLeftTop . X & & MousePos . X < PixelRightBottom . X & & MousePos . Y > = PixelLeftTop . Y & & MousePos . Y < = PixelRightBottom . Y ;
if ( bHighlight )
{
HighlightedEvent = Event ;
HighlightedRect = FIntRect ( PixelLeftTop , PixelRightBottom ) ;
}
FLinearColor Color = ElementColor ;
// Highlight EDRAM/FastVRAM usage
if ( Event - > GetDesc ( ) . Flags & TexCreate_FastVRAM )
{
Color = ElementColorVRam ;
}
Canvas . DrawTile (
PixelLeftTop . X , PixelLeftTop . Y ,
PixelRightBottom . X - PixelLeftTop . X - 1 , PixelRightBottom . Y - PixelLeftTop . Y - 1 ,
0 , 0 , 1 , 1 , Color ) ;
}
}
if ( HighlightedEvent )
{
DrawBorder ( Canvas , HighlightedRect , FLinearColor ( 0.8f , 0 , 0 , 0.5f ) ) ;
// Offset to not intersect with crosshair (in editor) or arrow (in game).
FIntPoint Pos = MousePos + FIntPoint ( 12 , 4 ) ;
if ( HighlightedEvent - > GetEventType ( ) = = ERTPE_Phase )
{
2014-05-06 15:49:36 -04:00
FString PhaseText = * FString : : Printf ( TEXT ( " Phase: %s " ) , * HighlightedEvent - > GetPhaseName ( ) ) ;
Canvas . DrawShadowedString ( Pos . X , Pos . Y + 0 * FontHeight , * PhaseText , GEngine - > GetTinyFont ( ) , FLinearColor ( 0.5f , 0.5f , 1 ) ) ;
2014-04-23 19:52:11 -04:00
}
else
{
FString SizeString = FString : : Printf ( TEXT ( " %d KB " ) , ( HighlightedEvent - > GetSizeInBytes ( ) + 1024 ) / 1024 ) ;
Canvas . DrawShadowedString ( Pos . X , Pos . Y + 0 * FontHeight , HighlightedEvent - > GetDesc ( ) . DebugName , GEngine - > GetTinyFont ( ) , FLinearColor ( 1 , 1 , 0 ) ) ;
Canvas . DrawShadowedString ( Pos . X , Pos . Y + 1 * FontHeight , * HighlightedEvent - > GetDesc ( ) . GenerateInfoString ( ) , GEngine - > GetTinyFont ( ) , FLinearColor ( 1 , 1 , 0 ) ) ;
Canvas . DrawShadowedString ( Pos . X , Pos . Y + 2 * FontHeight , * SizeString , GEngine - > GetTinyFont ( ) , FLinearColor ( 1 , 1 , 0 ) ) ;
}
}
2014-07-02 14:13:59 -04:00
Canvas . Flush_RenderThread ( RHICmdList ) ;
2014-04-23 20:00:52 -04:00
CurrentEventRecordingTime = 0 ;
RenderTargetPoolEvents . Empty ( ) ;
2014-04-23 19:52:11 -04:00
}
}
2014-06-12 07:13:34 -04:00
VisualizeTexture . PresentContent ( RHICmdList , View ) ;
2014-04-23 19:52:11 -04:00
}
void FRenderTargetPool : : AddDeallocEvents ( )
{
check ( IsInRenderingThread ( ) ) ;
bool bWorkWasDone = false ;
for ( uint32 i = 0 , Num = ( uint32 ) RenderTargetPoolEvents . Num ( ) ; i < Num ; + + i )
{
FRenderTargetPoolEvent & Event = RenderTargetPoolEvents [ i ] ;
if ( Event . NeedsDeallocEvent ( ) )
{
2014-04-23 20:00:52 -04:00
FRenderTargetPoolEvent NewEvent ( Event . GetPoolEntryId ( ) , CurrentEventRecordingTime ) ;
2014-04-23 19:52:11 -04:00
// for convenience - is actually redundant
NewEvent . SetDesc ( Event . GetDesc ( ) ) ;
RenderTargetPoolEvents . Add ( NewEvent ) ;
bWorkWasDone = true ;
}
}
if ( bWorkWasDone )
{
2014-04-23 20:00:52 -04:00
+ + CurrentEventRecordingTime ;
2014-04-23 19:52:11 -04:00
}
}
void FRenderTargetPool : : AddAllocEvent ( uint32 InPoolEntryId , FPooledRenderTarget * In )
{
check ( In ) ;
if ( IsEventRecordingEnabled ( ) )
{
AddDeallocEvents ( ) ;
check ( IsInRenderingThread ( ) ) ;
2014-04-23 20:00:52 -04:00
FRenderTargetPoolEvent NewEvent ( InPoolEntryId , CurrentEventRecordingTime + + , In ) ;
2014-04-23 19:52:11 -04:00
RenderTargetPoolEvents . Add ( NewEvent ) ;
}
}
void FRenderTargetPool : : AddAllocEventsFromCurrentState ( )
{
if ( ! IsEventRecordingEnabled ( ) )
{
return ;
}
check ( IsInRenderingThread ( ) ) ;
bool bWorkWasDone = false ;
for ( uint32 i = 0 ; i < ( uint32 ) PooledRenderTargets . Num ( ) ; + + i )
{
FPooledRenderTarget * Element = PooledRenderTargets [ i ] ;
if ( Element & & ! Element - > IsFree ( ) )
{
2014-04-23 20:00:52 -04:00
FRenderTargetPoolEvent NewEvent ( i , CurrentEventRecordingTime , Element ) ;
2014-04-23 19:52:11 -04:00
RenderTargetPoolEvents . Add ( NewEvent ) ;
bWorkWasDone = true ;
}
}
if ( bWorkWasDone )
{
2014-04-23 20:00:52 -04:00
+ + CurrentEventRecordingTime ;
2014-04-23 19:52:11 -04:00
}
}
2014-03-14 14:13:41 -04:00
void FRenderTargetPool : : TickPoolElements ( )
{
check ( IsInRenderingThread ( ) ) ;
2015-09-21 20:07:00 -04:00
WaitForTransitionFence ( ) ;
2014-03-14 14:13:41 -04:00
2014-05-16 17:29:16 -04:00
if ( bStartEventRecordingNextTick )
2014-04-23 19:52:11 -04:00
{
2014-05-16 17:29:16 -04:00
bStartEventRecordingNextTick = false ;
bEventRecordingStarted = true ;
2014-04-23 19:52:11 -04:00
}
2014-03-14 14:13:41 -04:00
uint32 MinimumPoolSizeInKB ;
{
static const auto CVar = IConsoleManager : : Get ( ) . FindTConsoleVariableDataInt ( TEXT ( " r.RenderTargetPoolMin " ) ) ;
MinimumPoolSizeInKB = FMath : : Clamp ( CVar - > GetValueOnRenderThread ( ) , 0 , 2000 ) * 1024 ;
}
2014-04-23 19:58:00 -04:00
CompactPool ( ) ;
2014-03-14 14:13:41 -04:00
for ( uint32 i = 0 ; i < ( uint32 ) PooledRenderTargets . Num ( ) ; + + i )
{
FPooledRenderTarget * Element = PooledRenderTargets [ i ] ;
2014-04-23 19:52:11 -04:00
if ( Element )
{
2015-05-29 10:47:57 -04:00
check ( ! Element - > IsSnapshot ( ) ) ;
2014-04-23 19:52:11 -04:00
Element - > OnFrameStart ( ) ;
}
2014-03-14 14:13:41 -04:00
}
2014-04-23 19:52:11 -04:00
2014-03-14 14:13:41 -04:00
// we need to release something, take the oldest ones first
while ( AllocationLevelInKB > MinimumPoolSizeInKB )
{
// -1: not set
int32 OldestElementIndex = - 1 ;
// find oldest element we can remove
2014-04-23 19:52:11 -04:00
for ( uint32 i = 0 , Num = ( uint32 ) PooledRenderTargets . Num ( ) ; i < Num ; + + i )
2014-03-14 14:13:41 -04:00
{
FPooledRenderTarget * Element = PooledRenderTargets [ i ] ;
2014-04-23 19:52:11 -04:00
if ( Element & & Element - > UnusedForNFrames > 2 )
2014-03-14 14:13:41 -04:00
{
if ( OldestElementIndex ! = - 1 )
{
if ( PooledRenderTargets [ OldestElementIndex ] - > UnusedForNFrames < Element - > UnusedForNFrames )
{
OldestElementIndex = i ;
}
}
else
{
OldestElementIndex = i ;
}
}
}
if ( OldestElementIndex ! = - 1 )
{
AllocationLevelInKB - = ComputeSizeInKB ( * PooledRenderTargets [ OldestElementIndex ] ) ;
// we assume because of reference counting the resource gets released when not needed any more
2014-04-23 19:52:11 -04:00
// we don't use Remove() to not shuffle around the elements for better transparency on RenderTargetPoolEvents
PooledRenderTargets [ OldestElementIndex ] = 0 ;
2014-03-14 14:13:41 -04:00
VerifyAllocationLevel ( ) ;
}
else
{
// There is no element we can remove but we are over budget, better we log that.
// Options:
// * Increase the pool
// * Reduce rendering features or resolution
// * Investigate allocations, order or reusing other render targets can help
// * Ignore (editor case, might start using slow memory which can be ok)
if ( ! bCurrentlyOverBudget )
{
Copying //UE4/Orion-Staging to //UE4/Main (Origin: //Orion/Dev-General @ 2904087)
==========================
MAJOR FEATURES + CHANGES
==========================
#lockdown Nick.Penwarden
Change 2903938 on 2016/03/10 by Frank.Gigliotti
Added an instance ID to FAnimMontageInstance
#CodeReview Laurent.Delayen
#RB Laurent.Delayen
#Tests PIE
Change 2903745 on 2016/03/10 by Wes.Hunt
Update Oodle TPS
#rb none
#tests none
#codereview:john.pollard
Change 2903689 on 2016/03/10 by Uriel.Doyon
New "LogHeroMaterials" console command, displaying the current state of materials and textures on the character hero.
#rb marcus.wasmer
#codereview marcus.wassmer
#tests editor, playing PC games, trying the new command
Change 2903669 on 2016/03/10 by Aaron.McLeran
OR-17180 Make stat soundcues and stat soundwaves NOT display zero volume sounds
- Change only effects debug stat commands for audio guys
#rb none
#tests played paragon with new debug stat commands, confirms doesn't show zero-volume sounds
Change 2903625 on 2016/03/10 by John.Pollard
XB1 Oodle SDK
#rb none
#tests none
#codereview Jeff.Campeau
Change 2903577 on 2016/03/10 by Ben.Marsh
Remaking latest build scripts from //UE4/Main @ 2900980.
Change 2903560 on 2016/03/10 by Ben.Marsh
Initial version of BuildGraph scripts - used to create build processes in UE4 which can be run locally or in parallel across a build farm (assuming synchronization and resource allocation implemented by a separate system). Intended to supersede GUBP.
Build graphs are declared using an XML script using syntax similar to MSBuild, ANT or NAnt, and consist of the following components:
* Tasks: Building blocks which can be executed as part of the build process. Many predefined tasks are provided (<Cook>, <Compile>, <Copy>, <Stage>, <Log>, <PakFile>, etc...), and additional tasks may be added be declaring classes derived from AutomationTool.CustomTask in other UAT modules.
* Nodes: A named sequence of tasks which is executed to produce outputs. Nodes may have input dependencies on other nodes before they can be executed. Declared with the <Node> element in scripts.
* Agent Groups: A set of nodes nodes which is executed on the same machine if running as part of a build system. Has no effect when building locally. Declared with the <Group> element in scripts.
* Triggers: Container for groups which should only be executed when explicitly triggered (using the -Trigger=<Name> or -SkipTriggers command line argument). Declared with the <Trigger> element in scripts.
* Notifiers: Specifies email recipients for failures in one or more nodes, whether they should receive notifications on warnings, and so on.
Properties can be passed in to a script on the command line, or set procedurally with the <Property Name="Foo" Value="Bar"/> syntax. Properties referenced with the $(Property Name) notation are valid within all strings, and will be expanded as macros when the script is read. If a property name is not set explicitly, it defaults to the contents of an environment variable with the same name.
Local properties, which only affect the scope of the containing XML element (node, group, etc...) are declared with the <Local Name="Foo" Value="Bar"/> element, and will override a similarly named global property for the local property's scope.
Any elements can be conditionally defined via the "If" attribute, and are largely identical to MSBuild conditions. Literals in conditions may be quoted with single (') or double (") quotes, or an unquoted sequence of letters, digits and underscore characters. All literals are considered identical regardless of how they are declared, and are considered case-insensitive for comparisons (so true equals 'True', equals "TRUE"). Available operators are "==", "!=", "And", "Or", "!", "(...)", "Exists(...)" and "HasTrailingSlash(...)". A full grammar is written up in Condition.cs.
File manipulation is done using wildcards and tags. Any attribute that accepts a list of files may consist of: a Perforce-style wildcard (matching any number of "...", "*" and "?" patterns in any location), a full path name, or a reference to a tagged collection of files, denoted by prefixing with a '#' character. Files may be added to a tag set using the <Tag> Task, which also allows performing set union/difference style operations. Each node can declare multiple outputs in the form of a list of named tags, which other nodes can then depend on.
Build graphs may be executed in parallel as part build system. To do so, the initial graph configuration is generated by running with the -Export=<Filename> argument (producing a JSON file listing the nodes and dependencies to execute). Each participating agent should be synced to the same changelist, and UAT should be re-run with the appropriate -Node=<Name> argument. Outputs from different nodes are transferred between agents via shared storage, typically a network share, the path to which can be specified on the command line using the -SharedStorageDir=<Path> argument. Note that the allocation of machines, and coordination between them, is assumed to be managed by an external system.
A schema for the known set of tasks can be generated by running UAT with the "-Schema=<FileName>" option. Generating a schema and referencing it from a BuildGraph script allows Visual Studio to validate and auto-complete elements as you type.
#rb none
#codereview Marc.Audy, Wes.Hunt, Matthew.Griffin, Richard.Fawcett
#tests local only so far, but not part of any build process yet
Change 2903539 on 2016/03/10 by John.Pollard
Improve replay playback debugging of character movement
#rb none
#tests replays
Change 2903526 on 2016/03/10 by Ben.Marsh
Remake changes from //UE4/Main without integration history, to add support for BuildGraph tasks.
#rb none
#tests none
Change 2903512 on 2016/03/10 by Dan.Youhon
Modify minimum Duration values for JumpForce and MoveToForce ability tasks so that having minimum Duration values doesn't trigger check()s
#rb None
#tests Compiles
Change 2903474 on 2016/03/10 by Marc.Audy
Fix crash if ChildActor is null
#rb None
#tests None
Change 2903314 on 2016/03/10 by Marc.Audy
Fix ParentComponent not being persisted and fixup content that was saved in the window it was broken
#rb James.Golding
#tests Selection of child actors works as expected
#jira UE-28201
Change 2903298 on 2016/03/10 by Simon.Tovey
Disabling the trails optimization.
#tests none
#rb none
#codereview Olaf.Piesche
Change 2903124 on 2016/03/10 by Robert.Manuszewski
Small refactor to pak signing to help with exe protection
#rb none
#tests none
[CL 2907678 by Andrew Grant in Main branch]
2016-03-13 18:53:13 -04:00
UE_CLOG ( IsRunningClientOnly ( ) , LogRenderTargetPool , Warning , TEXT ( " r.RenderTargetPoolMin exceeded %d/%d MB (ok in editor, bad on fixed memory platform) " ) , ( AllocationLevelInKB + 1023 ) / 1024 , MinimumPoolSizeInKB / 1024 ) ;
2014-03-14 14:13:41 -04:00
bCurrentlyOverBudget = true ;
}
// at this point we need to give up
break ;
}
/*
// confused more than it helps (often a name is used on two elements in the pool and some pool elements are not rendered to this frame)
else
{
// initial state of a render target (e.g. Velocity@0)
GRenderTargetPool . VisualizeTexture . SetCheckPoint ( Element ) ;
*/ }
if ( AllocationLevelInKB < = MinimumPoolSizeInKB )
{
if ( bCurrentlyOverBudget )
{
UE_LOG ( LogRenderTargetPool , Display , TEXT ( " r.RenderTargetPoolMin resolved %d/%d MB " ) , ( AllocationLevelInKB + 1023 ) / 1024 , MinimumPoolSizeInKB / 1024 ) ;
bCurrentlyOverBudget = false ;
}
}
2014-04-23 19:52:11 -04:00
// CompactEventArray();
AddPhaseEvent ( TEXT ( " FromLastFrame " ) ) ;
AddAllocEventsFromCurrentState ( ) ;
AddPhaseEvent ( TEXT ( " Rendering " ) ) ;
}
int32 FRenderTargetPool : : FindIndex ( IPooledRenderTarget * In ) const
{
check ( IsInRenderingThread ( ) ) ;
if ( In )
{
for ( uint32 i = 0 , Num = ( uint32 ) PooledRenderTargets . Num ( ) ; i < Num ; + + i )
{
const FPooledRenderTarget * Element = PooledRenderTargets [ i ] ;
if ( Element = = In )
{
2015-05-29 10:47:57 -04:00
check ( ! Element - > IsSnapshot ( ) ) ;
2014-04-23 19:52:11 -04:00
return i ;
}
}
}
// not found
return - 1 ;
2014-03-14 14:13:41 -04:00
}
void FRenderTargetPool : : FreeUnusedResource ( TRefCountPtr < IPooledRenderTarget > & In )
{
check ( IsInRenderingThread ( ) ) ;
2014-04-23 19:52:11 -04:00
int32 Index = FindIndex ( In ) ;
2014-03-14 14:13:41 -04:00
2014-04-23 19:52:11 -04:00
if ( Index ! = - 1 )
2014-03-14 14:13:41 -04:00
{
2014-04-23 19:52:11 -04:00
FPooledRenderTarget * Element = PooledRenderTargets [ Index ] ;
2014-03-14 14:13:41 -04:00
2014-04-23 19:52:11 -04:00
if ( Element )
2014-03-14 14:13:41 -04:00
{
2015-05-29 10:47:57 -04:00
check ( ! Element - > IsSnapshot ( ) ) ;
2014-03-14 14:13:41 -04:00
AllocationLevelInKB - = ComputeSizeInKB ( * Element ) ;
// we assume because of reference counting the resource gets released when not needed any more
2014-04-23 19:52:11 -04:00
// we don't use Remove() to not shuffle around the elements for better transparency on RenderTargetPoolEvents
2015-09-21 20:07:00 -04:00
DeferredDeleteArray . Add ( PooledRenderTargets [ Index ] ) ;
2014-04-23 19:52:11 -04:00
PooledRenderTargets [ Index ] = 0 ;
In . SafeRelease ( ) ;
VerifyAllocationLevel ( ) ;
2014-03-14 14:13:41 -04:00
}
}
}
void FRenderTargetPool : : FreeUnusedResources ( )
{
check ( IsInRenderingThread ( ) ) ;
2014-04-23 19:52:11 -04:00
for ( uint32 i = 0 , Num = ( uint32 ) PooledRenderTargets . Num ( ) ; i < Num ; + + i )
2014-03-14 14:13:41 -04:00
{
FPooledRenderTarget * Element = PooledRenderTargets [ i ] ;
2014-04-23 19:52:11 -04:00
if ( Element & & Element - > IsFree ( ) )
2014-03-14 14:13:41 -04:00
{
2015-05-29 10:47:57 -04:00
check ( ! Element - > IsSnapshot ( ) ) ;
2014-03-14 14:13:41 -04:00
AllocationLevelInKB - = ComputeSizeInKB ( * Element ) ;
// we assume because of reference counting the resource gets released when not needed any more
2014-04-23 19:52:11 -04:00
// we don't use Remove() to not shuffle around the elements for better transparency on RenderTargetPoolEvents
2015-09-21 20:07:00 -04:00
DeferredDeleteArray . Add ( PooledRenderTargets [ i ] ) ;
2014-04-23 19:52:11 -04:00
PooledRenderTargets [ i ] = 0 ;
2014-03-14 14:13:41 -04:00
}
}
VerifyAllocationLevel ( ) ;
}
void FRenderTargetPool : : DumpMemoryUsage ( FOutputDevice & OutputDevice )
{
OutputDevice . Logf ( TEXT ( " Pooled Render Targets: " ) ) ;
for ( int32 i = 0 ; i < PooledRenderTargets . Num ( ) ; + + i )
{
FPooledRenderTarget * Element = PooledRenderTargets [ i ] ;
2014-04-23 19:52:11 -04:00
if ( Element )
{
2015-05-29 10:47:57 -04:00
check ( ! Element - > IsSnapshot ( ) ) ;
2014-04-23 19:52:11 -04:00
OutputDevice . Logf (
TEXT ( " %6.3fMB %4dx%4d%s%s %2dmip(s) %s (%s) " ) ,
ComputeSizeInKB ( * Element ) / 1024.0f ,
Element - > Desc . Extent . X ,
Element - > Desc . IsCubemap ( ) ? Element - > Desc . Extent . X : Element - > Desc . Extent . Y ,
Element - > Desc . Depth > 1 ? * FString : : Printf ( TEXT ( " x%3d " ) , Element - > Desc . Depth ) : ( Element - > Desc . IsCubemap ( ) ? TEXT ( " cube " ) : TEXT ( " " ) ) ,
Element - > Desc . bIsArray ? * FString : : Printf ( TEXT ( " [%3d] " ) , Element - > Desc . ArraySize ) : TEXT ( " " ) ,
Element - > Desc . NumMips ,
Element - > Desc . DebugName ,
GPixelFormats [ Element - > Desc . Format ] . Name
) ;
}
2014-03-14 14:13:41 -04:00
}
uint32 NumTargets = 0 ;
uint32 UsedKB = 0 ;
uint32 PoolKB = 0 ;
GetStats ( NumTargets , PoolKB , UsedKB ) ;
OutputDevice . Logf ( TEXT ( " %.3fMB total, %.3fMB used, %d render targets " ) , PoolKB / 1024.f , UsedKB / 1024.f , NumTargets ) ;
}
uint32 FPooledRenderTarget : : AddRef ( ) const
{
2015-05-29 10:47:57 -04:00
if ( ! bSnapshot )
{
check ( IsInRenderingThread ( ) ) ;
return uint32 ( + + NumRefs ) ;
}
check ( NumRefs = = 1 ) ;
return 1 ;
2014-03-14 14:13:41 -04:00
}
uint32 FPooledRenderTarget : : Release ( ) const
{
2015-05-29 10:47:57 -04:00
if ( ! bSnapshot )
2014-03-14 14:13:41 -04:00
{
2015-05-29 10:47:57 -04:00
check ( IsInRenderingThread ( ) ) ;
uint32 Refs = uint32 ( - - NumRefs ) ;
if ( Refs = = 0 )
{
// better we remove const from Release()
FSceneRenderTargetItem & NonConstItem = ( FSceneRenderTargetItem & ) RenderTargetItem ;
2014-03-14 14:13:41 -04:00
2015-05-29 10:47:57 -04:00
NonConstItem . SafeRelease ( ) ;
delete this ;
}
return Refs ;
2014-03-14 14:13:41 -04:00
}
2015-05-29 10:47:57 -04:00
check ( NumRefs = = 1 ) ;
return 1 ;
2014-03-14 14:13:41 -04:00
}
uint32 FPooledRenderTarget : : GetRefCount ( ) const
{
return uint32 ( NumRefs ) ;
}
void FPooledRenderTarget : : SetDebugName ( const TCHAR * InName )
{
check ( InName ) ;
Desc . DebugName = InName ;
}
const FPooledRenderTargetDesc & FPooledRenderTarget : : GetDesc ( ) const
{
return Desc ;
}
void FRenderTargetPool : : ReleaseDynamicRHI ( )
{
check ( IsInRenderingThread ( ) ) ;
2015-09-21 20:07:00 -04:00
WaitForTransitionFence ( ) ;
2014-03-14 14:13:41 -04:00
PooledRenderTargets . Empty ( ) ;
2015-05-29 10:47:57 -04:00
if ( PooledRenderTargetSnapshots . Num ( ) )
{
DestructSnapshots ( ) ;
}
2014-03-14 14:13:41 -04:00
}
2015-05-29 10:47:57 -04:00
void FRenderTargetPool : : DestructSnapshots ( )
{
for ( auto Snapshot : PooledRenderTargetSnapshots )
{
Snapshot - > ~ FPooledRenderTarget ( ) ;
}
PooledRenderTargetSnapshots . Reset ( ) ;
}
2014-03-14 14:13:41 -04:00
// for debugging purpose
FPooledRenderTarget * FRenderTargetPool : : GetElementById ( uint32 Id ) const
{
// is used in game and render thread
if ( Id > = ( uint32 ) PooledRenderTargets . Num ( ) )
{
return 0 ;
}
return PooledRenderTargets [ Id ] ;
}
void FRenderTargetPool : : VerifyAllocationLevel ( ) const
{
/*
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main)
#lockdown ben.marsh
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream
Capsule shadows
* Capsule shadows excel at extremely soft area shadows caused by a large light source angle, but don't support accurate self-shadowing
* Artists can setup a physics asset containing Spheres and Sphyls (capsules) for a skeletal mesh that will be used to represent the mesh's occlusion
* These shapes can then be used for direct shadowing (bCastCapsuleDirectShadow) on a skeletal mesh component, whose softness depends on the light source angle / radius
* The shapes can also be used to create an indirect shadow (bCastCapsuleIndirectShadow), whose direction and softness is derived from the precomputed sky occlusion (stationary sky light) or primary indirect lighting (static sky light)
* Capsule shadowing is computed at half res and uses tiled deferred culling for efficiency - only implemented for PC SM5 + PS4 so far
* Shadowing of movable skylights is not yet supported
Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data
Basepass drawlist are now merged within a single drawlist.
Lighting policy parameters are now accessed through a uniform buffer.
Changed the global resource initialization so that InitRHI now comes before InitDynamicRHI
#codereview nick.penwarden
Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams
Remove unused RHI methods:
RHIIsDrawingViewport
RHIGpuTimeBegin
RHIGpuTimeEnd
Made default/empty versions of these calls and removed stubs from RHIs that don't use them:
RHISuspendRendering
RHIResumeRendering
RHIIsRenderingSuspended
Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream
Lighting channels - each component and light can choose from 3 channels
* Primitives output their channel mask to stencil during the base pass, the masks are copied to a texture after the base pass, deferred lighting passes compare the primitive mask against the light's mask
* Dynamic shadow casting also respects the channels
* Only works on opaque materials, direct lighting, dynamic lighting
* Not implemented for tiled deferred atm
* This will replace CastsShadowsFromCinematicObjectsOnly in the future
#rb Martin.Mittring
Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New
First pass at separate Async Compute Context
#codereview Lee.Clark,Daniel.Wright
#rb Gil.Gribb
Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering
Removed a lot of complexity of the skeletal mesh motionblur code (better for multithreading, simpler, faster) but going from one large buffer to per mesh buffers. Upload of bones only needed once.
* GPUSkinCache didn't even work before (in this branch)
* tested BasePass velocity
* tested split screen
* tested editor pause
* matinee camera cut (no need, invalidates velocity)
* tested CPU Skin? (never has motionblur)
* tested CreateSceneProxy (recreation is prevented in CreteSceneProxy unless bone count changes)
* test ES2 -featureleveles2
#rb: Rolando.Caloca
Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data
Embree integration into Lightmass
Can be enabled through Lightmass.ini [DevOptions.StaticLighting]bUseEmbree.
Also [DevOptions.StaticLighting]bVerifyEmbree will compare ray casting results.
Only usable on Win64 with this submit.
#review daniel.wright
Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering
added SSAO CS version, can be enabled with
r.AmbientOcclusion.Compute 1
Not optimized yet
#rb:Olaf.Piesche
Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream
Lightmass solver quality improvements
* IndirectLightingScale is no longer applied to photons, avoids splotchy artifacts when using small scales
* New 'Lightmass Portal' actor / component which tells the solver where to look for significant lighting. When lighting with a Static Skylight only, in a mostly indoor environment, setting up these portals is the only way to get high quality.
* Skylight bounce lighting is now much more accurate and leverages adaptive sampling
* Fixed a bug that effectively disabled adaptive sampling on high IndirectLightingQualities
* Shadow penumbras are also improved by IndirectLightingQuality
* Texel debugging is now a cvar 'r.TexelDebugging', instead of requiring a full recompile
Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data
Quad Complexity ViewMode (PCD3D_SM5 only).
Shader Complexity with Quad Overhead ViewMode (PCD3D_SM5 only). Require ShaderComplexity ViewMode & Show.Visualize.QuadOverhead
#review brian.karis
Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering
improved SSAO quality (less high frequency noise) to avoid TemporalAA smearing
Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S
DevRendering - Enable removing unused outputs on PS4 shader pipelines, disable by default removing unused on D3D (toggable with r.D3DRemoveUnusedInterpolators)
#codereview Marcus.Wassmer
Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev
Submitting pull request from user Pierdek.
Early out of particle collision module update if there are no active particles.
#github
#1614
Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering
UE4 - Fixed the experimental r.RHICmdBalanceParallelLists 2 mode and renabled it for orion.
Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering
UE4 - Added a path so that texture streaming can avoid flushing the RHI thread.
Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream
Added new PrimitiveComponent setting bSingleSampleShadowFromStationaryLights
* When enabled, shadowing of a movable component from a stationary directional light will come from the Volume Lighting Samples precomputed by Lightmass
* This provides essentially free on/off shadow receiving on dynamic objects, with a fade over time between states
* Lighting has to be rebuilt once for this to work
#rb Rolando.Caloca
Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering
UE4 - Dynamically set stream source to avoid creating a separate drawing policy for each static mesh with vertex colors.
#rb Daniel.Wright
Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data
Enabled Embree by default
#review daniel.wright
==========================
ALL CHANGELISTS
==========================
Change 2720123 on 2015/10/07 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - 'integrate' Tem'
Change 2721682 on 2015/10/08 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Eliminated a fatal error '
Change 2721815 on 2015/10/08 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - Fix crash exiti'
Change 2724755 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix Tier'
Change 2724781 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix offse'
Change 2728317 on 2015/10/14 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - hlslcc - Fix fo'
Change 2729170 on 2015/10/14 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Force Lightmass volume sample g'
Change 2732131 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed resource transition issue'
Change 2732218 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code cleanup '
Change 2733533 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Clear stencil to 0 after decals'
Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Capsule shadows * Capsule shado'
Change 2733546 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Light shaft targets are only al'
Change 2733602 on 2015/10/19 by Uriel.Doyon@uriel.doyon_office_data 'Decals not writing to Normal ca'
Change 2733627 on 2015/10/19 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix for transition ensure. '
Change 2735292 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for dark lightmap precision'
Change 2735298 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for speedtree LOD transitio'
Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data 'Basepass drawlist are now merge'
Change 2737214 on 2015/10/21 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Expanded a warning when importi'
Change 2738581 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Updated comment on stencil usag'
Change 2738583 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Changed bound but not set scene'
Change 2738584 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed skylight occlusion maps b'
Change 2738589 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmap streaming fixes * Chan'
Change 2738593 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fix from licensee for race cond'
Change 2738982 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Activating CanTickOnAnyThread f'
Change 2739032 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Fixing compiler barf with Clang'
Change 2741517 on 2015/10/26 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRindering - D3D12 - Integrat'
Change 2743790 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed texel debugging on static'
Change 2743958 on 2015/10/27 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comments '
Change 2744153 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Unity compile fix '
Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams 'Remove unused RHI methods: RHI'
Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lighting channels - each compon'
Change 2746242 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix crashes on init by swapping'
Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'First pass at separate Async Co'
Change 2746296 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Buffer label frees so we don't '
Change 2746297 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'updated comment '
Change 2746343 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment '
Change 2746347 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment '
Change 2746811 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Draw event for compute commandl'
Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Removed a lot of complexity of '
Change 2747127 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Improved game console printout '
Change 2747702 on 2015/10/30 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Bumped Lightmass StaticMesh imp'
Change 2747954 on 2015/10/30 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix SubmitDone not called TRC e'
Change 2747979 on 2015/10/30 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'polish console autocomplete tex'
Change 2750719 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Add Embree 2.7.0 for Win64 and '
Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Embree integration into Lightma'
Change 2750872 on 2015/11/02 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R'
Change 2751934 on 2015/11/03 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Disambiguate template function '
Change 2752190 on 2015/11/03 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed assert relating to '
Change 2752333 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Shader pipeline '
Change 2752655 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - Fix Materials pa'
Change 2752710 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment '
Change 2752711 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added better comment/help text '
Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added SSAO CS version, can be e'
Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmass solver quality improv'
Change 2752869 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Add shader pipel'
Change 2752882 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - hlslcc - Metal -'
Change 2752899 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'small SSAO GPU optimization mov'
Change 2752934 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor GPU optimization for SSAO'
Change 2753109 on 2015/11/03 by Uriel.Doyon@uriel.doyon_office_data 'Fixed final build '
Change 2753669 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed SM4 compiling '
Change 2754002 on 2015/11/04 by Nick.Penwarden@nickp_streams 'test change '
Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data 'Quad Complexity ViewMode (PCD3D'
Change 2754115 on 2015/11/04 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed end of frame update'
Change 2754297 on 2015/11/04 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'PS4 compile fixes #codereview U'
Change 2754405 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor SSAO ALU optimizations fi'
Change 2754512 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'adjusted clamp for cvar '
Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'improved SSAO quality (less hig'
Change 2755572 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - PS4 warning fix '
Change 2755667 on 2015/11/05 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed UE-22742, leak in t'
Change 2755722 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Remove unused co'
Change 2755814 on 2015/11/05 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R'
Change 2755935 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Rebuild static m'
Change 2756003 on 2015/11/05 by Uriel.Doyon@uriel.doyon_office_data 'Reduce the number of precompute'
Change 2756145 on 2015/11/05 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Temp fix for GPU crash #rb none'
Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Enable removing '
Change 2756435 on 2015/11/05 by Olaf.Piesche@Olaf.Piesche_roaming 'Disabling a check, to fix OR-85'
Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev 'Submitting pull request from us'
Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed the experimental r.'
Change 2757341 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Changed the RHI thread di'
Change 2757342 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed lazy uniform buffer'
Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Added a path so that text'
Change 2757500 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Add FrameSync to externalprofil'
Change 2757650 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'GBuffer should only be consider'
Change 2757665 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'UE-22816 Instruction count is n'
Change 2757834 on 2015/11/06 by Michael.Trepka@Michael.Trepka_a4202_Dev-Rendering 'Embree integration into Lightma'
Change 2757930 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix UT ensure #rb Peter.Knepley'
Change 2757931 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix Ocean ensure #rb josh.ander'
Change 2757946 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Removed invalid Lightmass asser'
Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Added new PrimitiveComponent se'
Change 2758049 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'OR-8600 CRASH: AllocationLeveli'
Change 2758059 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'r.DumpTransitionsForResource #r'
Change 2758082 on 2015/11/06 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix resource tra'
Change 2758879 on 2015/11/09 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix PSSL names f'
Change 2758911 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed accidental force di'
Change 2758968 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled single frame buffer us'
Change 2758991 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix togglerhithread crash #rb G'
Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Dynamically set stream so'
Change 2759063 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed UE-22368 CLONE - GitHub 1'
Change 2759073 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code quality improvements'
Change 2759501 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix particle ensure. '
Change 2759522 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix decals using CustomStencil.'
Change 2759610 on 2015/11/09 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed line light source shadows'
Change 2759634 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Refined GBufferA resolving when'
Change 2759657 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Fixed ResourceTransition with r'
Change 2759693 on 2015/11/09 by Rolando.Caloca@Rolando.Caloca_T4688_S 'DevRendering - Fixed global sha'
Change 2759771 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Fixed editor hit proxy renderin'
Change 2760188 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled some more deferred dec'
Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data 'Enabled Embree by default #revi'
[CL 2761339 by Nick Penwarden in Main branch]
2015-11-10 17:11:09 -05:00
// uncomment to verify internal consistency
2014-03-14 14:13:41 -04:00
uint32 OutWholeCount ;
uint32 OutWholePoolInKB ;
uint32 OutUsedInKB ;
GetStats ( OutWholeCount , OutWholePoolInKB , OutUsedInKB ) ;
*/
}
2014-04-23 19:52:11 -04:00
void FRenderTargetPool : : CompactPool ( )
{
for ( uint32 i = 0 , Num = ( uint32 ) PooledRenderTargets . Num ( ) ; i < Num ; + + i )
{
FPooledRenderTarget * Element = PooledRenderTargets [ i ] ;
if ( ! Element )
{
PooledRenderTargets . RemoveAtSwap ( i ) ;
- - Num ;
}
}
}
2014-03-14 14:13:41 -04:00
bool FPooledRenderTarget : : OnFrameStart ( )
{
2015-05-29 10:47:57 -04:00
check ( IsInRenderingThread ( ) & & ! bSnapshot ) ;
2014-03-14 14:13:41 -04:00
// If there are any references to the pooled render target other than the pool itself, then it may not be freed.
if ( ! IsFree ( ) )
{
check ( ! UnusedForNFrames ) ;
return false ;
}
+ + UnusedForNFrames ;
// this logic can be improved
if ( UnusedForNFrames > 10 )
{
// release
return true ;
}
return false ;
}
uint32 FPooledRenderTarget : : ComputeMemorySize ( ) const
{
uint32 Size = 0 ;
2015-05-29 10:47:57 -04:00
if ( ! bSnapshot )
2014-03-14 14:13:41 -04:00
{
2015-05-29 10:47:57 -04:00
if ( Desc . Is2DTexture ( ) )
2014-03-14 14:13:41 -04:00
{
2015-05-29 10:47:57 -04:00
Size + = RHIComputeMemorySize ( ( const FTexture2DRHIRef & ) RenderTargetItem . TargetableTexture ) ;
if ( RenderTargetItem . ShaderResourceTexture ! = RenderTargetItem . TargetableTexture )
{
Size + = RHIComputeMemorySize ( ( const FTexture2DRHIRef & ) RenderTargetItem . ShaderResourceTexture ) ;
}
}
else if ( Desc . Is3DTexture ( ) )
{
Size + = RHIComputeMemorySize ( ( const FTexture3DRHIRef & ) RenderTargetItem . TargetableTexture ) ;
if ( RenderTargetItem . ShaderResourceTexture ! = RenderTargetItem . TargetableTexture )
{
Size + = RHIComputeMemorySize ( ( const FTexture3DRHIRef & ) RenderTargetItem . ShaderResourceTexture ) ;
}
}
else
{
Size + = RHIComputeMemorySize ( ( const FTextureCubeRHIRef & ) RenderTargetItem . TargetableTexture ) ;
if ( RenderTargetItem . ShaderResourceTexture ! = RenderTargetItem . TargetableTexture )
{
Size + = RHIComputeMemorySize ( ( const FTextureCubeRHIRef & ) RenderTargetItem . ShaderResourceTexture ) ;
}
2014-03-14 14:13:41 -04:00
}
}
return Size ;
}
bool FPooledRenderTarget : : IsFree ( ) const
{
2016-06-20 16:57:06 -04:00
uint32 RefCount = GetRefCount ( ) ;
check ( RefCount > = 1 ) ;
2014-03-14 14:13:41 -04:00
// If the only reference to the pooled render target is from the pool, then it's unused.
2016-06-20 16:57:06 -04:00
return ! bSnapshot & & RefCount = = 1 ;
2014-03-14 14:13:41 -04:00
}