Files
UnrealEngineUWP/Engine/Source/Runtime/RenderCore/Private/RenderTargetPool.cpp

1393 lines
39 KiB
C++
Raw Normal View History

// Copyright Epic Games, Inc. All Rights Reserved.
/*=============================================================================
RenderTargetPool.cpp: Scene render target pool manager.
=============================================================================*/
#include "RenderTargetPool.h"
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3209340 on 2016/11/23 by Ben.Marsh Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h. Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms. * Every header now includes everything it needs to compile. * There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first. * There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h. * Every .cpp file includes its matching .h file first. * This helps validate that each header is including everything it needs to compile. * No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more. * You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there. * There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible. * No engine code explicitly includes a precompiled header any more. * We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies. * PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files. Tool used to generate this transform is at Engine\Source\Programs\IncludeTool. [CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
#include "RHIStaticStates.h"
#include "Misc/OutputDeviceRedirector.h"
#include "Hash/CityHash.h"
/** The global render targets pool. */
TGlobalResource<FRenderTargetPool> GRenderTargetPool;
DEFINE_LOG_CATEGORY_STATIC(LogRenderTargetPool, Warning, All);
CSV_DEFINE_CATEGORY(RenderTargetPool, !UE_SERVER);
TRefCountPtr<IPooledRenderTarget> CreateRenderTarget(FRHITexture* Texture, const TCHAR* Name)
{
check(Texture);
const FIntVector Size = Texture->GetSizeXYZ();
FPooledRenderTargetDesc Desc;
Desc.Extent = FIntPoint(Size.X, Size.Y);
Desc.ClearValue = Texture->GetClearBinding();
Desc.Format = Texture->GetFormat();
Desc.NumMips = Texture->GetNumMips();
Desc.NumSamples = Texture->GetNumSamples();
Desc.Flags = Desc.TargetableFlags = Texture->GetFlags();
Desc.bForceSharedTargetAndShaderResource = true;
Desc.AutoWritable = false;
Desc.DebugName = Name;
if (FRHITextureCube* TextureCube = Texture->GetTextureCube())
{
Desc.bIsCubemap = true;
}
else if (FRHITexture3D* Texture3D = Texture->GetTexture3D())
{
Desc.Depth = Size.Z;
}
else if (FRHITexture2DArray* TextureArray = Texture->GetTexture2DArray())
{
Desc.bIsArray = true;
Desc.ArraySize = Size.Z;
}
FSceneRenderTargetItem Item;
Item.TargetableTexture = Texture;
Item.ShaderResourceTexture = Texture;
TRefCountPtr<IPooledRenderTarget> PooledRenderTarget;
GRenderTargetPool.CreateUntrackedElement(Desc, PooledRenderTarget, Item);
return MoveTemp(PooledRenderTarget);
}
bool CacheRenderTarget(FRHITexture* Texture, const TCHAR* Name, TRefCountPtr<IPooledRenderTarget>& OutPooledRenderTarget)
{
if (!OutPooledRenderTarget || OutPooledRenderTarget->GetShaderResourceRHI() != Texture)
{
OutPooledRenderTarget = CreateRenderTarget(Texture, Name);
return true;
}
return false;
}
static uint64 GetTypeHash(FClearValueBinding Binding)
{
uint64 Hash = 0;
switch (Binding.ColorBinding)
{
case EClearBinding::EColorBound:
Hash = CityHash64((const char*)Binding.Value.Color, sizeof(Binding.Value.Color));
break;
case EClearBinding::EDepthStencilBound:
Hash = uint64(GetTypeHash(Binding.Value.DSValue.Depth)) << 32 | uint64(Binding.Value.DSValue.Stencil);
break;
}
return Hash ^ uint64(Binding.ColorBinding);
}
static uint64 GetTypeHash(FPooledRenderTargetDesc Desc)
{
constexpr uint32 HashOffset = STRUCT_OFFSET(FPooledRenderTargetDesc, Flags);
constexpr uint32 HashSize = STRUCT_OFFSET(FPooledRenderTargetDesc, PackedBits) + sizeof(FPooledRenderTargetDesc::PackedBits) - HashOffset;
static_assert(
HashSize ==
sizeof(FPooledRenderTargetDesc::Flags) +
sizeof(FPooledRenderTargetDesc::TargetableFlags) +
sizeof(FPooledRenderTargetDesc::Format) +
sizeof(FPooledRenderTargetDesc::UAVFormat) +
sizeof(FPooledRenderTargetDesc::Extent) +
sizeof(FPooledRenderTargetDesc::Depth) +
sizeof(FPooledRenderTargetDesc::ArraySize) +
sizeof(FPooledRenderTargetDesc::NumMips) +
sizeof(FPooledRenderTargetDesc::NumSamples) +
sizeof(FPooledRenderTargetDesc::PackedBits),
"FPooledRenderTarget has padding that will break the hash.");
Desc.Flags &= (~TexCreate_FastVRAM);
return CityHash64WithSeed((const char*)&Desc.Flags, HashSize, GetTypeHash(Desc.ClearValue));
}
RENDERCORE_API 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)
);
void RenderTargetPoolEvents(const TArray<FString>& Args)
{
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"));
GRenderTargetPool.EventRecordingSizeThreshold = SizeInKBThreshold;
GRenderTargetPool.bStartEventRecordingNextTick = true;
}
else
{
GRenderTargetPool.DisableEventDisplay();
UE_LOG(LogRenderTargetPool, Display, TEXT("r.DumpRenderTargetPoolEvents is now disabled, use r.DumpRenderTargetPoolEvents <SizeInKB> to enable or r.DumpRenderTargetPoolEvents ? for help"));
}
}
// CVars and commands
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)
);
Copying //UE4/Dev-Console to //UE4/Dev-Main (Source: //UE4/Dev-Console @ 3483086) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3389969 on 2017/04/12 by Guillaume.Abadie Implements FDebug::DumpStackTraceToLog() debugging utility. Change 3391579 on 2017/04/12 by Joe.Barnes Fix minor spacing issue. Change 3402629 on 2017/04/20 by Ben.Marsh Build: Remove job to populate the DDC. Trying out a new system for this. Change 3417501 on 2017/05/01 by Joe.Barnes IWYU - Missing #include files. Change 3419927 on 2017/05/02 by Joe.Barnes - Support custom LOD for shadow map generation only (r.ForceLODShadow) - New #define to expose forceLOD and forceLODShadow also in Test/Ship builds (#define EXPOSE_FORCE_LOD 1 in RenderCore.cpp). Not exposed by default. Change 3420964 on 2017/05/03 by Jonathan.Fitzpatrick Fixed null dereference of LineBatcher when using DrawDebugSphere and DrawDebugAltCone #jira UE-30213 Change 3423470 on 2017/05/04 by Luke.Thatcher [CONSOLE] [STREAMS] [^] Merging //UE4/Dev-Main (CL 3391974) to Dev-Console (//UE4/Dev-Console) - Compile errors in Switch, to be fixed after check-in. Change 3430410 on 2017/05/09 by Ben.Woodhouse Fix uninitialized local variable causing crashes in Test #jira UE-44832 Change 3430506 on 2017/05/09 by Josh.Adams - Fixed up the editor platforms' method of loading TargetSettings objects so that we don't need any manual parsing of .ini files to fill out the class defaults Change 3434035 on 2017/05/10 by Ben.Woodhouse Integrate updated FortGPUTestbed from Fortnite/Main Change 3437046 on 2017/05/12 by Joe.Barnes Fix for clang producing a warning when not all specializations of a templated function are marked FORCEINLINE. Also, switch a specialization of BlendTransform() from a function with a check to just a declaration so compiler will catch error instead of a runtime catch. Change 3437259 on 2017/05/12 by Joe.Barnes Fix for clang producing a warning when not all specializations of a templated function are marked FORCEINLINE. Also, switch a specialization of BlendTransform() from a function with a check to just a declaration so compiler will catch error instead of a runtime catch. Change 3440758 on 2017/05/16 by Ben.Woodhouse Simple threaded CSV Profiler To capture: - On the commandline, add -csvCaptureFrames=N to capture N frames from startup - On the console, use csvprofile start, csvprofile stop or csvprofile frames=N to capture a fixed number of frames - Instrument with CSV_SCOPED_STAT(statname), CSV_CUSTOM_STAT(statname,value). CSV capture is enabled in all builds except shipping - Please do not check in the instrumentation √ we don╞t want to pollute the engine with lots of additional instrumentation. We may add some minimal level of instrumentation at some point Change 3440954 on 2017/05/16 by Josh.Adams - Cleaned up some DeviceProfiles in BaseDP.ini Change 3443778 on 2017/05/17 by Ben.Woodhouse Aliasing for transient resources + new high level API Changelists integrated: 3368830 3368887 3377762 3377763 3379513 3381840 3382046 3382138 3385390 3385391 3385531 3396613 3388752 3396756 3397007 3397059 3397780 3397883 3401716 3415179 Change 3451460 on 2017/05/22 by Ben.Woodhouse Fix editor crash (NULL dereference of ScreenSpaceShadowTexture) when moving the camera around in tm-shadermodels, probably fallout from the VRAM aliasing merge. Not sure if this is the correct fix, but it prevents the crash for now Change 3451601 on 2017/05/22 by Josh.Adams - Track idle time from MaxTickRate, so that stat unit is accurate on Game: thread Change 3452025 on 2017/05/22 by Ben.Woodhouse Integrate (as edit) CL 3378734 (editor crash fix) Also add a check for null in LightFunctionRendering.cpp Change 3452389 on 2017/05/22 by Josh.Adams - Replaced POCulturePluralForms with a static array, instead of TMapBuilder (was blowing stack or similar on Switch Debug). Code courtesy of Jamie Dale. Change 3452758 on 2017/05/22 by Joe.Barnes Add FindFirstClearBit() and FindFirstSetBit() to TStaticBitArray. Change 3455889 on 2017/05/23 by Ben.Woodhouse Integrate from //UE4/Main/...@3453436 to //UE4/Dev-Console/... Change 3458654 on 2017/05/25 by Joe.Conley Attempting to fix Static Analysis warning. Change 3462710 on 2017/05/26 by Ben.Woodhouse Integrate from //UE4/Main/...@3461688 to //UE4/Dev-Console/... Change 3471711 on 2017/06/02 by Jonathan.Fitzpatrick Updating MallocProfiler to use the accessor for OnOutOfMemory delegate to conform with change made in CL 3415996. Change 3473813 on 2017/06/05 by Ben.Woodhouse Fix streaming visibility logic bug reported on UDN #jira UE-43892 Change 3475298 on 2017/06/06 by Luke.Thatcher [CONSOLE] [!] Fix RHITransitionResources crash with more than 16 textures. - Old command had a fixed sized array of 16 textures that would overflow. - New command allocates an array of texture pointers inline in the command list, so any number is supported. #jira UE-45625 Change 3476776 on 2017/06/06 by Ben.Woodhouse Integrate from //UE4/Main/...@3475908 Change 3479083 on 2017/06/07 by Ben.Woodhouse Integrate as edit CL 3467315 from dev-animphys: From Alexis Matte. Ensure SectionMap is fixed up for old entries that are no longer valid. #JIRA UE-45438 #jira UE-45735 Change 3480576 on 2017/06/08 by Ben.Woodhouse Integrate from //UE4/Main/...@3480024 to //UE4/Dev-Console/... [CL 3483258 by Luke Thatcher in Main branch]
2017-06-09 17:44:13 -04:00
static TAutoConsoleVariable<int32> CVarAllowMultipleAliasingDiscardsPerFrame(
TEXT("r.RenderTargetPool.AllowMultipleAliasingDiscardsPerFrame"),
0,
TEXT("If enabled, allows rendertargets to be discarded and reacquired in the same frame.\n")
TEXT("This should give better aliasing efficiency, but carries some RHIthread/GPU performance overhead\n")
TEXT("with some RHIs (due to additional commandlist flushes)\n")
TEXT(" 0:off (default), 1:on"),
ECVF_Cheat | ECVF_RenderThreadSafe);
Copying //UE4/Dev-Console to //UE4/Dev-Main (Source: //UE4/Dev-Console @ 3632338) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3443778 by Ben.Woodhouse Aliasing for transient resources + new high level API Changelists integrated: 3368830 3368887 3377762 3377763 3379513 3381840 3382046 3382138 3385390 3385391 3385531 3396613 3388752 3396756 3397007 3397059 3397780 3397883 3401716 3415179 Change 3576521 by Bart.Hawthorne ShooterGame - update the game instance's online mode when the LAN option is changed Change 3587252 by Ben.Woodhouse Integrate from //UE4/Main/...@3584123 to //UE4/Dev-Console/... Change 3587943 by Luke.Thatcher [CONSOLE] [+] Improved XGE shader compiler - Added support for XGE interception interface, which allows asynchronous streaming of shader tasks into XGE, and eliminates the stalling/flushing found in the old system. - Old system has been renamed "Xml interface" - Both systems are available and selectable based on r.XGEShaderCompile.Mode CVar. Overview of the new system: - New system uses an additional XGEControlWorker process to manage communication between the engine and XGE. This is simply a copy of ShaderCompileWorker.exe (the implementation is part of SCW, but XGE requires the two files to be separate, hence the duplicate). - When shader jobs arrive from the engine, the shader compiler thread spawns an instance of XGEControlWorker within an XGE context, and connects to it via named pipes. - Job command lines are fed to the control worker via the pipe, which the worker enqueues within XGE by issuing a CreateProcess call, which is intercepted. Job completion is reported back to the engine via the named pipes. - New system is preferred over the old one, and is enabled with "-xgeshadercompile" command line switch or "r.XGEShaderCompile" cvar. - The new system depends on the "XGEController" engine module. Support for which is based on the WITH_XGE_CONTROLLER #define, or -xgecontroller/-noxgecontroller command line options. #jira UECON-263 Change 3590037 by Luke.Thatcher [CONSOLE] [!] Fix compile/link errors with XGE controller module - Various unity related fixes needed. Change 3590047 by Luke.Thatcher [CONSOLE] [!] Compile XGE controller module for Editor builds only - The module should only be used in uncooked, non-monolitic binaries (i.e. the editor). Change 3594074 by Luke.Thatcher [CONSOLE] [!] Fix Linux build - case sensitive header include was wrong in XGEControllerModule.cpp Change 3596292 by Luke.Thatcher [CONSOLE] [!] Actually fix unity/nopch build errors in XGE Controller! Change 3596776 by Jonathan.Fitzpatrick cherry pick CL 3595292 cooker change which fixes a condition where DLC would always cook with all maps regardless of which maps were specified. Change 3596795 by Jonathan.Fitzpatrick Back out changelist 3596776 Change 3596816 by Jonathan.Fitzpatrick Moved the DLC map check ahead of the "no maps found" condition so that include-all-maps can be skipped if DLC maps are found. Change 3604282 by Ben.Marsh UBT: Add support for pre-build and post-build steps when using MegaXGE. Change 3606862 by Ben.Marsh Fix missing header guard warning. Change 3611644 by Ben.Woodhouse Integrate from //UE4/Main/...@3610522 to //UE4/Dev-Console/... Change 3614089 by Joe.Barnes Call GRHICommandList.LatchBypass() after variables it checks are set. #jira ue-48130 Change 3617783 by Daniel.Eldar Headers for the HDR changes (they are pre-requisites for compilation). Integrated from: //UE4/Partner-Microsoft-DX12/Engine/Source/ThirdParty/Windows/DirectX/... to //UE4/Dev-Console/Engine/Source/ThirdParty/Windows/DirectX/... #jira UECON-226 Change 3619117 by Ben.Woodhouse Integrate from //UE4/Main/...@3617655 to //UE4/Dev-Console/... Change 3619123 by Ben.Woodhouse Integrate from //UE4/Main/...@3618361 to //UE4/Dev-Console/... Change 3619603 by Stewart.Lynch Merging //Fortnite/Dev-Athena/Engine/Source/Runtime/Engine/Private/Materials/MaterialInstanceConstant.cpp to //UE4/Dev-Console/Engine/Source/Runtime/Engine/Private/Materials/MaterialInstanceConstant.cpp Changed UMaterialInstance::PostLoad(); to Super::PostLoad(); Change 3619608 by Stewart.Lynch Merging //Fortnite/Dev-Athena/Engine/Source/Runtime/... to //UE4/Dev-Console/Engine/Source/Runtime/... LLM update * made sure that all csv stat tracking is disabled if running without -LLMCSV * added new UObject scopes * increased LLM_MAX_THREAD_SCOPE_STACK_DEPTH to 128 to cope with new UObject scopes * added material scopes * changed UMaterialInstance::PostLoad(); to Super::PostLoad(); Change 3619634 by Stewart.Lynch Merging //Fortnite/Main/... to //UE4/Dev-Console/... General LLM improvements * added tracking for misc task graph tasks (moves 20MB out of Untagged) * renamed EngineTick to EngineMisc * added tracking for FName * added tracking for GC_ProcessObjectArray potential leak * renamed index & vertex buffers stat to Meshes * added hooks for MemPro to track allocations from a single category. Currently defined out. I haven't added MemPro.cpp/h. * removed AVAILABLE_PHYSICAL stat from LLM csv * csv files now include the date in the filename * fixed potential threading bug when reading stat values to csv * added lots more scopes * started changing Stat scopes to enum scopes. Stat scopes will be phased out. * added tracking of FName memory * added llm tracking for CPU symbol allocations (20MB) * added tracking for GC * fixed tracking for TransientMemoryAllocator * added tracking for networking memory * added more audio memory tracking * added tracking for blueprints * added tracking for static meshes * show on screen warning if debug memory is enabled * added tracking for particles * renamed Phys to PhysX and added more scopes * renamed Slate to UI and added more scopes * much better coverage of networking memory * improved coverage of audio Change 3619642 by Stewart.Lynch Merging //Fortnite/Main/Engine/Source/Runtime/Core/... to //UE4/Dev-Console/Engine/Source/Runtime/Core/... Windows builds were incorrectly showing the debug memory enabled warning. Made IsDebugMemoryEnabled always return false on Windows. Change 3619799 by Luke.Thatcher [CONSOLE] [-] Disable peak memory tracking in LLM. Change 3619809 by Luke.Thatcher [CONSOLE] [^] Merging CL 3580894 from //Fortnite/Main/... to //UE4/Dev-Console/... - Add Render Target Pool Stats. Use "stat rendertargetpool" to view. Change 3619928 by Luke.Thatcher [CONSOLE] [^] Enable symbol compression on symstore task (Merging CL 3606945 from //Fortnite/Main/... to //UE4/Dev-Console/...) Change 3620571 by Keith.Judge Double the size of the occlusion query buffer in D3D12. This costs 256KB of memory. We need to refactor this in future to resize according to content on demand like D3D11.x. #jira FORT-53103 #jira FORT-53119 Change 3622419 by Daniel.Eldar [General] Fix for occasional ensure to do with retriving the new cvar value. #JIRA UE-46644 Change 3622491 by Daniel.Eldar [General] Added support for scaling on stat unit and unitgraph. #JIRA UE-46644 Change 3622610 by Daniel.Eldar [General] Fixed a compilation warning Change 3624659 by Ben.Woodhouse Integrate from //UE4/Main/...@3624175 to //UE4/Dev-Console/... Change 3624678 by Ben.Woodhouse Integrate from //UE4/Main/...@3624415 to //UE4/Dev-Console/... Change 3624878 by Ben.Woodhouse Integrate as edit CLs 3611835 3611844 3616942 3617607 Descriptor heap memory fix (saves up to ~100MB). * Fix a bug where rolling over a thread-local heap immediately after switching to context-local would crash due to an uninitialized syncpoint * Add a separate value for context local heaps (LOCAL_HEAP_SIZE) and set it to a sensible value (2MB) instead of the current 16MB. This means thread local heaps will be allocated in chunks of ~2MB instead of 16MB. There can be up to 6 thread-local heaps, since they're per-context. Measured peak descriptor heap memory with LLM: 45MB (compared to 145MB previously) This improves behaviour, but this code could use a bit of a rewrite to allow it to reclaim memory better. For example, the global heap memory is almost entirely wasted currently, since when a context switches to "context local strategy" it simply throws this memory away, never to be reclaimed. Having the pools thread-local is also not a good strategy. Ideally we want a thread-safe pool allocator for descriptor heaps which is shared between all the contexts . Change 3624882 by Ben.Woodhouse Fix virtual destructor warning in D3DX12.h Change 3626419 by Stewart.Lynch Merging //Fortnite/Main/... to //UE4/Dev-Console/... LLM Update - Memory reductions, Summary page, enum scopes, refactor and cleanup of tags * Remove all static arrays and hard limits from LLM. Everything is now dynamically allocated using the internal LLM allocators. The overhead when LLM is disabled is now only 48K (was 40MB) * re-wrote LLMMap. Now stores an int32 index rather then pointer in the HashMap array. Also, changed the Values to be arrays for structs instead of structs of arrays. Means that the tag can be stored in a single byte. Changed the size of the allocation size from int64 to int32. All this takes the memory down from around 600MB to 100MB. It was 120 bytes per allocation, now 29 bytes. * changed all LLM scopes over to enums. This has a number of benefits; LLM can be enable in Test, less CPU overhead, stored in a byte (LLM overhead /= 8) * summary page for content creators where all lower-level stats are grouped under one Engine stat * renamed ELLMScopeTag enum to ELLMTag * renamed LLM_SCOPED_TAG_WITH_ENUM macro to LLM_SCOPE * removed Tracker arg from LLM_SCOPE and added LLM_PLATFORM_SCOPE macro * fixed GenericPlatformMallocCrash stat. Although it seems not be be used anymore * fixed BackupOOMMemoryPool stat (now shows in both default and platform pages) * lots of changes adding/removing/renaming tags * added LLMArray and FLLMObjectAllocator classes * disabled asset tag tracking by default because it takes up so much memory even when not used * enable LLM in all non-shipping builds. In Test the on screendisplay won't show because it uses the stats system but it till still write out the csv. * all the stat macros have been left as they were and can be enabled on the LLM_STAT_TAGS_ENABLED define. These are needed for the asset tagging. * disabled LLM_TRACK_PEAK_MEMORY because there is a problem with the way it adds the peaks for multiple threads. This needs to be fixed. * added a CVar to control the csv write interval: LLM.LLMWriteInterval * added static arrays for the enum tags setup. Easier to manage and removes need for slow switch statements. * renamed FLLMThreadStateManager to FLLMTracker to make it consistent with the enum #jira UECON-264 Change 3626906 by Joe.Barnes Fix compile errors when nativizing when a property references a sub object of a dervied type with modified default properties Change 3628045 by Stewart.Lynch Merging //Fortnite/Main/Engine/Source/Runtime/Core/... to //UE4/Dev-Console/Engine/Source/Runtime/Core/... LLM - enabled LLM on Windows * fixed crash in FLLMObjectAllocator destructor. Only happens on Windows shutdown. * changed Align to AlignArbitrary in LLMArray. Small memory saving. * clear ThreadStateAllocator in FLLMTracker::Clear(). Small memory saving * set program size to zero on windows because it isn't relevant #jira UECON-282 Change 3632279 by Ben.Woodhouse Back out changelist 3619862 #jira UE-49472 [CL 3632432 by Joe Barnes in Main branch]
2017-09-07 22:18:47 -04:00
static TAutoConsoleVariable<int32> CVarRtPoolTransientMode(
TEXT("r.RenderTargetPool.TransientAliasingMode"),
2,
TEXT("Enables transient resource aliasing for rendertargets. Used only if GSupportsTransientResourceAliasing is true.\n")
TEXT("0 : Disabled\n")
TEXT("1 : enable transient resource aliasing for fastVRam rendertargets\n")
TEXT("2 : enable transient resource aliasing for fastVRam rendertargets and those with a Transient hint. Best for memory usage - has some GPU cost (~0.2ms)\n")
TEXT("3 : enable transient resource aliasing for ALL rendertargets (not recommended)\n"),
ECVF_RenderThreadSafe);
Copying //UE4/Dev-Console to //UE4/Dev-Main (Source: //UE4/Dev-Console @ 3632338) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3443778 by Ben.Woodhouse Aliasing for transient resources + new high level API Changelists integrated: 3368830 3368887 3377762 3377763 3379513 3381840 3382046 3382138 3385390 3385391 3385531 3396613 3388752 3396756 3397007 3397059 3397780 3397883 3401716 3415179 Change 3576521 by Bart.Hawthorne ShooterGame - update the game instance's online mode when the LAN option is changed Change 3587252 by Ben.Woodhouse Integrate from //UE4/Main/...@3584123 to //UE4/Dev-Console/... Change 3587943 by Luke.Thatcher [CONSOLE] [+] Improved XGE shader compiler - Added support for XGE interception interface, which allows asynchronous streaming of shader tasks into XGE, and eliminates the stalling/flushing found in the old system. - Old system has been renamed "Xml interface" - Both systems are available and selectable based on r.XGEShaderCompile.Mode CVar. Overview of the new system: - New system uses an additional XGEControlWorker process to manage communication between the engine and XGE. This is simply a copy of ShaderCompileWorker.exe (the implementation is part of SCW, but XGE requires the two files to be separate, hence the duplicate). - When shader jobs arrive from the engine, the shader compiler thread spawns an instance of XGEControlWorker within an XGE context, and connects to it via named pipes. - Job command lines are fed to the control worker via the pipe, which the worker enqueues within XGE by issuing a CreateProcess call, which is intercepted. Job completion is reported back to the engine via the named pipes. - New system is preferred over the old one, and is enabled with "-xgeshadercompile" command line switch or "r.XGEShaderCompile" cvar. - The new system depends on the "XGEController" engine module. Support for which is based on the WITH_XGE_CONTROLLER #define, or -xgecontroller/-noxgecontroller command line options. #jira UECON-263 Change 3590037 by Luke.Thatcher [CONSOLE] [!] Fix compile/link errors with XGE controller module - Various unity related fixes needed. Change 3590047 by Luke.Thatcher [CONSOLE] [!] Compile XGE controller module for Editor builds only - The module should only be used in uncooked, non-monolitic binaries (i.e. the editor). Change 3594074 by Luke.Thatcher [CONSOLE] [!] Fix Linux build - case sensitive header include was wrong in XGEControllerModule.cpp Change 3596292 by Luke.Thatcher [CONSOLE] [!] Actually fix unity/nopch build errors in XGE Controller! Change 3596776 by Jonathan.Fitzpatrick cherry pick CL 3595292 cooker change which fixes a condition where DLC would always cook with all maps regardless of which maps were specified. Change 3596795 by Jonathan.Fitzpatrick Back out changelist 3596776 Change 3596816 by Jonathan.Fitzpatrick Moved the DLC map check ahead of the "no maps found" condition so that include-all-maps can be skipped if DLC maps are found. Change 3604282 by Ben.Marsh UBT: Add support for pre-build and post-build steps when using MegaXGE. Change 3606862 by Ben.Marsh Fix missing header guard warning. Change 3611644 by Ben.Woodhouse Integrate from //UE4/Main/...@3610522 to //UE4/Dev-Console/... Change 3614089 by Joe.Barnes Call GRHICommandList.LatchBypass() after variables it checks are set. #jira ue-48130 Change 3617783 by Daniel.Eldar Headers for the HDR changes (they are pre-requisites for compilation). Integrated from: //UE4/Partner-Microsoft-DX12/Engine/Source/ThirdParty/Windows/DirectX/... to //UE4/Dev-Console/Engine/Source/ThirdParty/Windows/DirectX/... #jira UECON-226 Change 3619117 by Ben.Woodhouse Integrate from //UE4/Main/...@3617655 to //UE4/Dev-Console/... Change 3619123 by Ben.Woodhouse Integrate from //UE4/Main/...@3618361 to //UE4/Dev-Console/... Change 3619603 by Stewart.Lynch Merging //Fortnite/Dev-Athena/Engine/Source/Runtime/Engine/Private/Materials/MaterialInstanceConstant.cpp to //UE4/Dev-Console/Engine/Source/Runtime/Engine/Private/Materials/MaterialInstanceConstant.cpp Changed UMaterialInstance::PostLoad(); to Super::PostLoad(); Change 3619608 by Stewart.Lynch Merging //Fortnite/Dev-Athena/Engine/Source/Runtime/... to //UE4/Dev-Console/Engine/Source/Runtime/... LLM update * made sure that all csv stat tracking is disabled if running without -LLMCSV * added new UObject scopes * increased LLM_MAX_THREAD_SCOPE_STACK_DEPTH to 128 to cope with new UObject scopes * added material scopes * changed UMaterialInstance::PostLoad(); to Super::PostLoad(); Change 3619634 by Stewart.Lynch Merging //Fortnite/Main/... to //UE4/Dev-Console/... General LLM improvements * added tracking for misc task graph tasks (moves 20MB out of Untagged) * renamed EngineTick to EngineMisc * added tracking for FName * added tracking for GC_ProcessObjectArray potential leak * renamed index & vertex buffers stat to Meshes * added hooks for MemPro to track allocations from a single category. Currently defined out. I haven't added MemPro.cpp/h. * removed AVAILABLE_PHYSICAL stat from LLM csv * csv files now include the date in the filename * fixed potential threading bug when reading stat values to csv * added lots more scopes * started changing Stat scopes to enum scopes. Stat scopes will be phased out. * added tracking of FName memory * added llm tracking for CPU symbol allocations (20MB) * added tracking for GC * fixed tracking for TransientMemoryAllocator * added tracking for networking memory * added more audio memory tracking * added tracking for blueprints * added tracking for static meshes * show on screen warning if debug memory is enabled * added tracking for particles * renamed Phys to PhysX and added more scopes * renamed Slate to UI and added more scopes * much better coverage of networking memory * improved coverage of audio Change 3619642 by Stewart.Lynch Merging //Fortnite/Main/Engine/Source/Runtime/Core/... to //UE4/Dev-Console/Engine/Source/Runtime/Core/... Windows builds were incorrectly showing the debug memory enabled warning. Made IsDebugMemoryEnabled always return false on Windows. Change 3619799 by Luke.Thatcher [CONSOLE] [-] Disable peak memory tracking in LLM. Change 3619809 by Luke.Thatcher [CONSOLE] [^] Merging CL 3580894 from //Fortnite/Main/... to //UE4/Dev-Console/... - Add Render Target Pool Stats. Use "stat rendertargetpool" to view. Change 3619928 by Luke.Thatcher [CONSOLE] [^] Enable symbol compression on symstore task (Merging CL 3606945 from //Fortnite/Main/... to //UE4/Dev-Console/...) Change 3620571 by Keith.Judge Double the size of the occlusion query buffer in D3D12. This costs 256KB of memory. We need to refactor this in future to resize according to content on demand like D3D11.x. #jira FORT-53103 #jira FORT-53119 Change 3622419 by Daniel.Eldar [General] Fix for occasional ensure to do with retriving the new cvar value. #JIRA UE-46644 Change 3622491 by Daniel.Eldar [General] Added support for scaling on stat unit and unitgraph. #JIRA UE-46644 Change 3622610 by Daniel.Eldar [General] Fixed a compilation warning Change 3624659 by Ben.Woodhouse Integrate from //UE4/Main/...@3624175 to //UE4/Dev-Console/... Change 3624678 by Ben.Woodhouse Integrate from //UE4/Main/...@3624415 to //UE4/Dev-Console/... Change 3624878 by Ben.Woodhouse Integrate as edit CLs 3611835 3611844 3616942 3617607 Descriptor heap memory fix (saves up to ~100MB). * Fix a bug where rolling over a thread-local heap immediately after switching to context-local would crash due to an uninitialized syncpoint * Add a separate value for context local heaps (LOCAL_HEAP_SIZE) and set it to a sensible value (2MB) instead of the current 16MB. This means thread local heaps will be allocated in chunks of ~2MB instead of 16MB. There can be up to 6 thread-local heaps, since they're per-context. Measured peak descriptor heap memory with LLM: 45MB (compared to 145MB previously) This improves behaviour, but this code could use a bit of a rewrite to allow it to reclaim memory better. For example, the global heap memory is almost entirely wasted currently, since when a context switches to "context local strategy" it simply throws this memory away, never to be reclaimed. Having the pools thread-local is also not a good strategy. Ideally we want a thread-safe pool allocator for descriptor heaps which is shared between all the contexts . Change 3624882 by Ben.Woodhouse Fix virtual destructor warning in D3DX12.h Change 3626419 by Stewart.Lynch Merging //Fortnite/Main/... to //UE4/Dev-Console/... LLM Update - Memory reductions, Summary page, enum scopes, refactor and cleanup of tags * Remove all static arrays and hard limits from LLM. Everything is now dynamically allocated using the internal LLM allocators. The overhead when LLM is disabled is now only 48K (was 40MB) * re-wrote LLMMap. Now stores an int32 index rather then pointer in the HashMap array. Also, changed the Values to be arrays for structs instead of structs of arrays. Means that the tag can be stored in a single byte. Changed the size of the allocation size from int64 to int32. All this takes the memory down from around 600MB to 100MB. It was 120 bytes per allocation, now 29 bytes. * changed all LLM scopes over to enums. This has a number of benefits; LLM can be enable in Test, less CPU overhead, stored in a byte (LLM overhead /= 8) * summary page for content creators where all lower-level stats are grouped under one Engine stat * renamed ELLMScopeTag enum to ELLMTag * renamed LLM_SCOPED_TAG_WITH_ENUM macro to LLM_SCOPE * removed Tracker arg from LLM_SCOPE and added LLM_PLATFORM_SCOPE macro * fixed GenericPlatformMallocCrash stat. Although it seems not be be used anymore * fixed BackupOOMMemoryPool stat (now shows in both default and platform pages) * lots of changes adding/removing/renaming tags * added LLMArray and FLLMObjectAllocator classes * disabled asset tag tracking by default because it takes up so much memory even when not used * enable LLM in all non-shipping builds. In Test the on screendisplay won't show because it uses the stats system but it till still write out the csv. * all the stat macros have been left as they were and can be enabled on the LLM_STAT_TAGS_ENABLED define. These are needed for the asset tagging. * disabled LLM_TRACK_PEAK_MEMORY because there is a problem with the way it adds the peaks for multiple threads. This needs to be fixed. * added a CVar to control the csv write interval: LLM.LLMWriteInterval * added static arrays for the enum tags setup. Easier to manage and removes need for slow switch statements. * renamed FLLMThreadStateManager to FLLMTracker to make it consistent with the enum #jira UECON-264 Change 3626906 by Joe.Barnes Fix compile errors when nativizing when a property references a sub object of a dervied type with modified default properties Change 3628045 by Stewart.Lynch Merging //Fortnite/Main/Engine/Source/Runtime/Core/... to //UE4/Dev-Console/Engine/Source/Runtime/Core/... LLM - enabled LLM on Windows * fixed crash in FLLMObjectAllocator destructor. Only happens on Windows shutdown. * changed Align to AlignArbitrary in LLMArray. Small memory saving. * clear ThreadStateAllocator in FLLMTracker::Clear(). Small memory saving * set program size to zero on windows because it isn't relevant #jira UECON-282 Change 3632279 by Ben.Woodhouse Back out changelist 3619862 #jira UE-49472 [CL 3632432 by Joe Barnes in Main branch]
2017-09-07 22:18:47 -04:00
bool FRenderTargetPool::IsEventRecordingEnabled() const
{
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
return bEventRecordingStarted && bEventRecordingActive;
#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();
if (!ValidPointer || ValidPointer->IsFree())
{
Pointer = 0;
return true;
}
}
}
return false;
}
static uint32 ComputeSizeInKB(FPooledRenderTarget& Element)
{
return (Element.ComputeMemorySize() + 1023) / 1024;
}
FRenderTargetPool::FRenderTargetPool()
: AllocationLevelInKB(0)
, bCurrentlyOverBudget(false)
, bStartEventRecordingNextTick(false)
, EventRecordingSizeThreshold(0)
, bEventRecordingActive(false)
, bEventRecordingStarted(false)
, CurrentEventRecordingTime(0)
#if LOG_MAX_RENDER_TARGET_POOL_USAGE
, MaxUsedRenderTargetInKB(0)
#endif
{
}
Copying //UE4/Dev-Console to //UE4/Dev-Main (Source: //UE4/Dev-Console @ 3632338) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3443778 by Ben.Woodhouse Aliasing for transient resources + new high level API Changelists integrated: 3368830 3368887 3377762 3377763 3379513 3381840 3382046 3382138 3385390 3385391 3385531 3396613 3388752 3396756 3397007 3397059 3397780 3397883 3401716 3415179 Change 3576521 by Bart.Hawthorne ShooterGame - update the game instance's online mode when the LAN option is changed Change 3587252 by Ben.Woodhouse Integrate from //UE4/Main/...@3584123 to //UE4/Dev-Console/... Change 3587943 by Luke.Thatcher [CONSOLE] [+] Improved XGE shader compiler - Added support for XGE interception interface, which allows asynchronous streaming of shader tasks into XGE, and eliminates the stalling/flushing found in the old system. - Old system has been renamed "Xml interface" - Both systems are available and selectable based on r.XGEShaderCompile.Mode CVar. Overview of the new system: - New system uses an additional XGEControlWorker process to manage communication between the engine and XGE. This is simply a copy of ShaderCompileWorker.exe (the implementation is part of SCW, but XGE requires the two files to be separate, hence the duplicate). - When shader jobs arrive from the engine, the shader compiler thread spawns an instance of XGEControlWorker within an XGE context, and connects to it via named pipes. - Job command lines are fed to the control worker via the pipe, which the worker enqueues within XGE by issuing a CreateProcess call, which is intercepted. Job completion is reported back to the engine via the named pipes. - New system is preferred over the old one, and is enabled with "-xgeshadercompile" command line switch or "r.XGEShaderCompile" cvar. - The new system depends on the "XGEController" engine module. Support for which is based on the WITH_XGE_CONTROLLER #define, or -xgecontroller/-noxgecontroller command line options. #jira UECON-263 Change 3590037 by Luke.Thatcher [CONSOLE] [!] Fix compile/link errors with XGE controller module - Various unity related fixes needed. Change 3590047 by Luke.Thatcher [CONSOLE] [!] Compile XGE controller module for Editor builds only - The module should only be used in uncooked, non-monolitic binaries (i.e. the editor). Change 3594074 by Luke.Thatcher [CONSOLE] [!] Fix Linux build - case sensitive header include was wrong in XGEControllerModule.cpp Change 3596292 by Luke.Thatcher [CONSOLE] [!] Actually fix unity/nopch build errors in XGE Controller! Change 3596776 by Jonathan.Fitzpatrick cherry pick CL 3595292 cooker change which fixes a condition where DLC would always cook with all maps regardless of which maps were specified. Change 3596795 by Jonathan.Fitzpatrick Back out changelist 3596776 Change 3596816 by Jonathan.Fitzpatrick Moved the DLC map check ahead of the "no maps found" condition so that include-all-maps can be skipped if DLC maps are found. Change 3604282 by Ben.Marsh UBT: Add support for pre-build and post-build steps when using MegaXGE. Change 3606862 by Ben.Marsh Fix missing header guard warning. Change 3611644 by Ben.Woodhouse Integrate from //UE4/Main/...@3610522 to //UE4/Dev-Console/... Change 3614089 by Joe.Barnes Call GRHICommandList.LatchBypass() after variables it checks are set. #jira ue-48130 Change 3617783 by Daniel.Eldar Headers for the HDR changes (they are pre-requisites for compilation). Integrated from: //UE4/Partner-Microsoft-DX12/Engine/Source/ThirdParty/Windows/DirectX/... to //UE4/Dev-Console/Engine/Source/ThirdParty/Windows/DirectX/... #jira UECON-226 Change 3619117 by Ben.Woodhouse Integrate from //UE4/Main/...@3617655 to //UE4/Dev-Console/... Change 3619123 by Ben.Woodhouse Integrate from //UE4/Main/...@3618361 to //UE4/Dev-Console/... Change 3619603 by Stewart.Lynch Merging //Fortnite/Dev-Athena/Engine/Source/Runtime/Engine/Private/Materials/MaterialInstanceConstant.cpp to //UE4/Dev-Console/Engine/Source/Runtime/Engine/Private/Materials/MaterialInstanceConstant.cpp Changed UMaterialInstance::PostLoad(); to Super::PostLoad(); Change 3619608 by Stewart.Lynch Merging //Fortnite/Dev-Athena/Engine/Source/Runtime/... to //UE4/Dev-Console/Engine/Source/Runtime/... LLM update * made sure that all csv stat tracking is disabled if running without -LLMCSV * added new UObject scopes * increased LLM_MAX_THREAD_SCOPE_STACK_DEPTH to 128 to cope with new UObject scopes * added material scopes * changed UMaterialInstance::PostLoad(); to Super::PostLoad(); Change 3619634 by Stewart.Lynch Merging //Fortnite/Main/... to //UE4/Dev-Console/... General LLM improvements * added tracking for misc task graph tasks (moves 20MB out of Untagged) * renamed EngineTick to EngineMisc * added tracking for FName * added tracking for GC_ProcessObjectArray potential leak * renamed index & vertex buffers stat to Meshes * added hooks for MemPro to track allocations from a single category. Currently defined out. I haven't added MemPro.cpp/h. * removed AVAILABLE_PHYSICAL stat from LLM csv * csv files now include the date in the filename * fixed potential threading bug when reading stat values to csv * added lots more scopes * started changing Stat scopes to enum scopes. Stat scopes will be phased out. * added tracking of FName memory * added llm tracking for CPU symbol allocations (20MB) * added tracking for GC * fixed tracking for TransientMemoryAllocator * added tracking for networking memory * added more audio memory tracking * added tracking for blueprints * added tracking for static meshes * show on screen warning if debug memory is enabled * added tracking for particles * renamed Phys to PhysX and added more scopes * renamed Slate to UI and added more scopes * much better coverage of networking memory * improved coverage of audio Change 3619642 by Stewart.Lynch Merging //Fortnite/Main/Engine/Source/Runtime/Core/... to //UE4/Dev-Console/Engine/Source/Runtime/Core/... Windows builds were incorrectly showing the debug memory enabled warning. Made IsDebugMemoryEnabled always return false on Windows. Change 3619799 by Luke.Thatcher [CONSOLE] [-] Disable peak memory tracking in LLM. Change 3619809 by Luke.Thatcher [CONSOLE] [^] Merging CL 3580894 from //Fortnite/Main/... to //UE4/Dev-Console/... - Add Render Target Pool Stats. Use "stat rendertargetpool" to view. Change 3619928 by Luke.Thatcher [CONSOLE] [^] Enable symbol compression on symstore task (Merging CL 3606945 from //Fortnite/Main/... to //UE4/Dev-Console/...) Change 3620571 by Keith.Judge Double the size of the occlusion query buffer in D3D12. This costs 256KB of memory. We need to refactor this in future to resize according to content on demand like D3D11.x. #jira FORT-53103 #jira FORT-53119 Change 3622419 by Daniel.Eldar [General] Fix for occasional ensure to do with retriving the new cvar value. #JIRA UE-46644 Change 3622491 by Daniel.Eldar [General] Added support for scaling on stat unit and unitgraph. #JIRA UE-46644 Change 3622610 by Daniel.Eldar [General] Fixed a compilation warning Change 3624659 by Ben.Woodhouse Integrate from //UE4/Main/...@3624175 to //UE4/Dev-Console/... Change 3624678 by Ben.Woodhouse Integrate from //UE4/Main/...@3624415 to //UE4/Dev-Console/... Change 3624878 by Ben.Woodhouse Integrate as edit CLs 3611835 3611844 3616942 3617607 Descriptor heap memory fix (saves up to ~100MB). * Fix a bug where rolling over a thread-local heap immediately after switching to context-local would crash due to an uninitialized syncpoint * Add a separate value for context local heaps (LOCAL_HEAP_SIZE) and set it to a sensible value (2MB) instead of the current 16MB. This means thread local heaps will be allocated in chunks of ~2MB instead of 16MB. There can be up to 6 thread-local heaps, since they're per-context. Measured peak descriptor heap memory with LLM: 45MB (compared to 145MB previously) This improves behaviour, but this code could use a bit of a rewrite to allow it to reclaim memory better. For example, the global heap memory is almost entirely wasted currently, since when a context switches to "context local strategy" it simply throws this memory away, never to be reclaimed. Having the pools thread-local is also not a good strategy. Ideally we want a thread-safe pool allocator for descriptor heaps which is shared between all the contexts . Change 3624882 by Ben.Woodhouse Fix virtual destructor warning in D3DX12.h Change 3626419 by Stewart.Lynch Merging //Fortnite/Main/... to //UE4/Dev-Console/... LLM Update - Memory reductions, Summary page, enum scopes, refactor and cleanup of tags * Remove all static arrays and hard limits from LLM. Everything is now dynamically allocated using the internal LLM allocators. The overhead when LLM is disabled is now only 48K (was 40MB) * re-wrote LLMMap. Now stores an int32 index rather then pointer in the HashMap array. Also, changed the Values to be arrays for structs instead of structs of arrays. Means that the tag can be stored in a single byte. Changed the size of the allocation size from int64 to int32. All this takes the memory down from around 600MB to 100MB. It was 120 bytes per allocation, now 29 bytes. * changed all LLM scopes over to enums. This has a number of benefits; LLM can be enable in Test, less CPU overhead, stored in a byte (LLM overhead /= 8) * summary page for content creators where all lower-level stats are grouped under one Engine stat * renamed ELLMScopeTag enum to ELLMTag * renamed LLM_SCOPED_TAG_WITH_ENUM macro to LLM_SCOPE * removed Tracker arg from LLM_SCOPE and added LLM_PLATFORM_SCOPE macro * fixed GenericPlatformMallocCrash stat. Although it seems not be be used anymore * fixed BackupOOMMemoryPool stat (now shows in both default and platform pages) * lots of changes adding/removing/renaming tags * added LLMArray and FLLMObjectAllocator classes * disabled asset tag tracking by default because it takes up so much memory even when not used * enable LLM in all non-shipping builds. In Test the on screendisplay won't show because it uses the stats system but it till still write out the csv. * all the stat macros have been left as they were and can be enabled on the LLM_STAT_TAGS_ENABLED define. These are needed for the asset tagging. * disabled LLM_TRACK_PEAK_MEMORY because there is a problem with the way it adds the peaks for multiple threads. This needs to be fixed. * added a CVar to control the csv write interval: LLM.LLMWriteInterval * added static arrays for the enum tags setup. Easier to manage and removes need for slow switch statements. * renamed FLLMThreadStateManager to FLLMTracker to make it consistent with the enum #jira UECON-264 Change 3626906 by Joe.Barnes Fix compile errors when nativizing when a property references a sub object of a dervied type with modified default properties Change 3628045 by Stewart.Lynch Merging //Fortnite/Main/Engine/Source/Runtime/Core/... to //UE4/Dev-Console/Engine/Source/Runtime/Core/... LLM - enabled LLM on Windows * fixed crash in FLLMObjectAllocator destructor. Only happens on Windows shutdown. * changed Align to AlignArbitrary in LLMArray. Small memory saving. * clear ThreadStateAllocator in FLLMTracker::Clear(). Small memory saving * set program size to zero on windows because it isn't relevant #jira UECON-282 Change 3632279 by Ben.Woodhouse Back out changelist 3619862 #jira UE-49472 [CL 3632432 by Joe Barnes in Main branch]
2017-09-07 22:18:47 -04:00
// Logic for determining whether to make a rendertarget transient
bool FRenderTargetPool::DoesTargetNeedTransienceOverride(ETextureCreateFlags Flags, ERenderTargetTransience TransienceHint)
Copying //UE4/Dev-Console to //UE4/Dev-Main (Source: //UE4/Dev-Console @ 3632338) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3443778 by Ben.Woodhouse Aliasing for transient resources + new high level API Changelists integrated: 3368830 3368887 3377762 3377763 3379513 3381840 3382046 3382138 3385390 3385391 3385531 3396613 3388752 3396756 3397007 3397059 3397780 3397883 3401716 3415179 Change 3576521 by Bart.Hawthorne ShooterGame - update the game instance's online mode when the LAN option is changed Change 3587252 by Ben.Woodhouse Integrate from //UE4/Main/...@3584123 to //UE4/Dev-Console/... Change 3587943 by Luke.Thatcher [CONSOLE] [+] Improved XGE shader compiler - Added support for XGE interception interface, which allows asynchronous streaming of shader tasks into XGE, and eliminates the stalling/flushing found in the old system. - Old system has been renamed "Xml interface" - Both systems are available and selectable based on r.XGEShaderCompile.Mode CVar. Overview of the new system: - New system uses an additional XGEControlWorker process to manage communication between the engine and XGE. This is simply a copy of ShaderCompileWorker.exe (the implementation is part of SCW, but XGE requires the two files to be separate, hence the duplicate). - When shader jobs arrive from the engine, the shader compiler thread spawns an instance of XGEControlWorker within an XGE context, and connects to it via named pipes. - Job command lines are fed to the control worker via the pipe, which the worker enqueues within XGE by issuing a CreateProcess call, which is intercepted. Job completion is reported back to the engine via the named pipes. - New system is preferred over the old one, and is enabled with "-xgeshadercompile" command line switch or "r.XGEShaderCompile" cvar. - The new system depends on the "XGEController" engine module. Support for which is based on the WITH_XGE_CONTROLLER #define, or -xgecontroller/-noxgecontroller command line options. #jira UECON-263 Change 3590037 by Luke.Thatcher [CONSOLE] [!] Fix compile/link errors with XGE controller module - Various unity related fixes needed. Change 3590047 by Luke.Thatcher [CONSOLE] [!] Compile XGE controller module for Editor builds only - The module should only be used in uncooked, non-monolitic binaries (i.e. the editor). Change 3594074 by Luke.Thatcher [CONSOLE] [!] Fix Linux build - case sensitive header include was wrong in XGEControllerModule.cpp Change 3596292 by Luke.Thatcher [CONSOLE] [!] Actually fix unity/nopch build errors in XGE Controller! Change 3596776 by Jonathan.Fitzpatrick cherry pick CL 3595292 cooker change which fixes a condition where DLC would always cook with all maps regardless of which maps were specified. Change 3596795 by Jonathan.Fitzpatrick Back out changelist 3596776 Change 3596816 by Jonathan.Fitzpatrick Moved the DLC map check ahead of the "no maps found" condition so that include-all-maps can be skipped if DLC maps are found. Change 3604282 by Ben.Marsh UBT: Add support for pre-build and post-build steps when using MegaXGE. Change 3606862 by Ben.Marsh Fix missing header guard warning. Change 3611644 by Ben.Woodhouse Integrate from //UE4/Main/...@3610522 to //UE4/Dev-Console/... Change 3614089 by Joe.Barnes Call GRHICommandList.LatchBypass() after variables it checks are set. #jira ue-48130 Change 3617783 by Daniel.Eldar Headers for the HDR changes (they are pre-requisites for compilation). Integrated from: //UE4/Partner-Microsoft-DX12/Engine/Source/ThirdParty/Windows/DirectX/... to //UE4/Dev-Console/Engine/Source/ThirdParty/Windows/DirectX/... #jira UECON-226 Change 3619117 by Ben.Woodhouse Integrate from //UE4/Main/...@3617655 to //UE4/Dev-Console/... Change 3619123 by Ben.Woodhouse Integrate from //UE4/Main/...@3618361 to //UE4/Dev-Console/... Change 3619603 by Stewart.Lynch Merging //Fortnite/Dev-Athena/Engine/Source/Runtime/Engine/Private/Materials/MaterialInstanceConstant.cpp to //UE4/Dev-Console/Engine/Source/Runtime/Engine/Private/Materials/MaterialInstanceConstant.cpp Changed UMaterialInstance::PostLoad(); to Super::PostLoad(); Change 3619608 by Stewart.Lynch Merging //Fortnite/Dev-Athena/Engine/Source/Runtime/... to //UE4/Dev-Console/Engine/Source/Runtime/... LLM update * made sure that all csv stat tracking is disabled if running without -LLMCSV * added new UObject scopes * increased LLM_MAX_THREAD_SCOPE_STACK_DEPTH to 128 to cope with new UObject scopes * added material scopes * changed UMaterialInstance::PostLoad(); to Super::PostLoad(); Change 3619634 by Stewart.Lynch Merging //Fortnite/Main/... to //UE4/Dev-Console/... General LLM improvements * added tracking for misc task graph tasks (moves 20MB out of Untagged) * renamed EngineTick to EngineMisc * added tracking for FName * added tracking for GC_ProcessObjectArray potential leak * renamed index & vertex buffers stat to Meshes * added hooks for MemPro to track allocations from a single category. Currently defined out. I haven't added MemPro.cpp/h. * removed AVAILABLE_PHYSICAL stat from LLM csv * csv files now include the date in the filename * fixed potential threading bug when reading stat values to csv * added lots more scopes * started changing Stat scopes to enum scopes. Stat scopes will be phased out. * added tracking of FName memory * added llm tracking for CPU symbol allocations (20MB) * added tracking for GC * fixed tracking for TransientMemoryAllocator * added tracking for networking memory * added more audio memory tracking * added tracking for blueprints * added tracking for static meshes * show on screen warning if debug memory is enabled * added tracking for particles * renamed Phys to PhysX and added more scopes * renamed Slate to UI and added more scopes * much better coverage of networking memory * improved coverage of audio Change 3619642 by Stewart.Lynch Merging //Fortnite/Main/Engine/Source/Runtime/Core/... to //UE4/Dev-Console/Engine/Source/Runtime/Core/... Windows builds were incorrectly showing the debug memory enabled warning. Made IsDebugMemoryEnabled always return false on Windows. Change 3619799 by Luke.Thatcher [CONSOLE] [-] Disable peak memory tracking in LLM. Change 3619809 by Luke.Thatcher [CONSOLE] [^] Merging CL 3580894 from //Fortnite/Main/... to //UE4/Dev-Console/... - Add Render Target Pool Stats. Use "stat rendertargetpool" to view. Change 3619928 by Luke.Thatcher [CONSOLE] [^] Enable symbol compression on symstore task (Merging CL 3606945 from //Fortnite/Main/... to //UE4/Dev-Console/...) Change 3620571 by Keith.Judge Double the size of the occlusion query buffer in D3D12. This costs 256KB of memory. We need to refactor this in future to resize according to content on demand like D3D11.x. #jira FORT-53103 #jira FORT-53119 Change 3622419 by Daniel.Eldar [General] Fix for occasional ensure to do with retriving the new cvar value. #JIRA UE-46644 Change 3622491 by Daniel.Eldar [General] Added support for scaling on stat unit and unitgraph. #JIRA UE-46644 Change 3622610 by Daniel.Eldar [General] Fixed a compilation warning Change 3624659 by Ben.Woodhouse Integrate from //UE4/Main/...@3624175 to //UE4/Dev-Console/... Change 3624678 by Ben.Woodhouse Integrate from //UE4/Main/...@3624415 to //UE4/Dev-Console/... Change 3624878 by Ben.Woodhouse Integrate as edit CLs 3611835 3611844 3616942 3617607 Descriptor heap memory fix (saves up to ~100MB). * Fix a bug where rolling over a thread-local heap immediately after switching to context-local would crash due to an uninitialized syncpoint * Add a separate value for context local heaps (LOCAL_HEAP_SIZE) and set it to a sensible value (2MB) instead of the current 16MB. This means thread local heaps will be allocated in chunks of ~2MB instead of 16MB. There can be up to 6 thread-local heaps, since they're per-context. Measured peak descriptor heap memory with LLM: 45MB (compared to 145MB previously) This improves behaviour, but this code could use a bit of a rewrite to allow it to reclaim memory better. For example, the global heap memory is almost entirely wasted currently, since when a context switches to "context local strategy" it simply throws this memory away, never to be reclaimed. Having the pools thread-local is also not a good strategy. Ideally we want a thread-safe pool allocator for descriptor heaps which is shared between all the contexts . Change 3624882 by Ben.Woodhouse Fix virtual destructor warning in D3DX12.h Change 3626419 by Stewart.Lynch Merging //Fortnite/Main/... to //UE4/Dev-Console/... LLM Update - Memory reductions, Summary page, enum scopes, refactor and cleanup of tags * Remove all static arrays and hard limits from LLM. Everything is now dynamically allocated using the internal LLM allocators. The overhead when LLM is disabled is now only 48K (was 40MB) * re-wrote LLMMap. Now stores an int32 index rather then pointer in the HashMap array. Also, changed the Values to be arrays for structs instead of structs of arrays. Means that the tag can be stored in a single byte. Changed the size of the allocation size from int64 to int32. All this takes the memory down from around 600MB to 100MB. It was 120 bytes per allocation, now 29 bytes. * changed all LLM scopes over to enums. This has a number of benefits; LLM can be enable in Test, less CPU overhead, stored in a byte (LLM overhead /= 8) * summary page for content creators where all lower-level stats are grouped under one Engine stat * renamed ELLMScopeTag enum to ELLMTag * renamed LLM_SCOPED_TAG_WITH_ENUM macro to LLM_SCOPE * removed Tracker arg from LLM_SCOPE and added LLM_PLATFORM_SCOPE macro * fixed GenericPlatformMallocCrash stat. Although it seems not be be used anymore * fixed BackupOOMMemoryPool stat (now shows in both default and platform pages) * lots of changes adding/removing/renaming tags * added LLMArray and FLLMObjectAllocator classes * disabled asset tag tracking by default because it takes up so much memory even when not used * enable LLM in all non-shipping builds. In Test the on screendisplay won't show because it uses the stats system but it till still write out the csv. * all the stat macros have been left as they were and can be enabled on the LLM_STAT_TAGS_ENABLED define. These are needed for the asset tagging. * disabled LLM_TRACK_PEAK_MEMORY because there is a problem with the way it adds the peaks for multiple threads. This needs to be fixed. * added a CVar to control the csv write interval: LLM.LLMWriteInterval * added static arrays for the enum tags setup. Easier to manage and removes need for slow switch statements. * renamed FLLMThreadStateManager to FLLMTracker to make it consistent with the enum #jira UECON-264 Change 3626906 by Joe.Barnes Fix compile errors when nativizing when a property references a sub object of a dervied type with modified default properties Change 3628045 by Stewart.Lynch Merging //Fortnite/Main/Engine/Source/Runtime/Core/... to //UE4/Dev-Console/Engine/Source/Runtime/Core/... LLM - enabled LLM on Windows * fixed crash in FLLMObjectAllocator destructor. Only happens on Windows shutdown. * changed Align to AlignArbitrary in LLMArray. Small memory saving. * clear ThreadStateAllocator in FLLMTracker::Clear(). Small memory saving * set program size to zero on windows because it isn't relevant #jira UECON-282 Change 3632279 by Ben.Woodhouse Back out changelist 3619862 #jira UE-49472 [CL 3632432 by Joe Barnes in Main branch]
2017-09-07 22:18:47 -04:00
{
if (!GSupportsTransientResourceAliasing)
{
return false;
}
int32 AliasingMode = CVarRtPoolTransientMode.GetValueOnRenderThread();
// We only override transience if aliasing is supported and enabled, the format is suitable, and the target is not already transient
if (AliasingMode > 0 && EnumHasAnyFlags(Flags, TexCreate_RenderTargetable | TexCreate_DepthStencilTargetable | TexCreate_UAV) && !EnumHasAnyFlags(Flags, TexCreate_Transient))
Copying //UE4/Dev-Console to //UE4/Dev-Main (Source: //UE4/Dev-Console @ 3632338) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3443778 by Ben.Woodhouse Aliasing for transient resources + new high level API Changelists integrated: 3368830 3368887 3377762 3377763 3379513 3381840 3382046 3382138 3385390 3385391 3385531 3396613 3388752 3396756 3397007 3397059 3397780 3397883 3401716 3415179 Change 3576521 by Bart.Hawthorne ShooterGame - update the game instance's online mode when the LAN option is changed Change 3587252 by Ben.Woodhouse Integrate from //UE4/Main/...@3584123 to //UE4/Dev-Console/... Change 3587943 by Luke.Thatcher [CONSOLE] [+] Improved XGE shader compiler - Added support for XGE interception interface, which allows asynchronous streaming of shader tasks into XGE, and eliminates the stalling/flushing found in the old system. - Old system has been renamed "Xml interface" - Both systems are available and selectable based on r.XGEShaderCompile.Mode CVar. Overview of the new system: - New system uses an additional XGEControlWorker process to manage communication between the engine and XGE. This is simply a copy of ShaderCompileWorker.exe (the implementation is part of SCW, but XGE requires the two files to be separate, hence the duplicate). - When shader jobs arrive from the engine, the shader compiler thread spawns an instance of XGEControlWorker within an XGE context, and connects to it via named pipes. - Job command lines are fed to the control worker via the pipe, which the worker enqueues within XGE by issuing a CreateProcess call, which is intercepted. Job completion is reported back to the engine via the named pipes. - New system is preferred over the old one, and is enabled with "-xgeshadercompile" command line switch or "r.XGEShaderCompile" cvar. - The new system depends on the "XGEController" engine module. Support for which is based on the WITH_XGE_CONTROLLER #define, or -xgecontroller/-noxgecontroller command line options. #jira UECON-263 Change 3590037 by Luke.Thatcher [CONSOLE] [!] Fix compile/link errors with XGE controller module - Various unity related fixes needed. Change 3590047 by Luke.Thatcher [CONSOLE] [!] Compile XGE controller module for Editor builds only - The module should only be used in uncooked, non-monolitic binaries (i.e. the editor). Change 3594074 by Luke.Thatcher [CONSOLE] [!] Fix Linux build - case sensitive header include was wrong in XGEControllerModule.cpp Change 3596292 by Luke.Thatcher [CONSOLE] [!] Actually fix unity/nopch build errors in XGE Controller! Change 3596776 by Jonathan.Fitzpatrick cherry pick CL 3595292 cooker change which fixes a condition where DLC would always cook with all maps regardless of which maps were specified. Change 3596795 by Jonathan.Fitzpatrick Back out changelist 3596776 Change 3596816 by Jonathan.Fitzpatrick Moved the DLC map check ahead of the "no maps found" condition so that include-all-maps can be skipped if DLC maps are found. Change 3604282 by Ben.Marsh UBT: Add support for pre-build and post-build steps when using MegaXGE. Change 3606862 by Ben.Marsh Fix missing header guard warning. Change 3611644 by Ben.Woodhouse Integrate from //UE4/Main/...@3610522 to //UE4/Dev-Console/... Change 3614089 by Joe.Barnes Call GRHICommandList.LatchBypass() after variables it checks are set. #jira ue-48130 Change 3617783 by Daniel.Eldar Headers for the HDR changes (they are pre-requisites for compilation). Integrated from: //UE4/Partner-Microsoft-DX12/Engine/Source/ThirdParty/Windows/DirectX/... to //UE4/Dev-Console/Engine/Source/ThirdParty/Windows/DirectX/... #jira UECON-226 Change 3619117 by Ben.Woodhouse Integrate from //UE4/Main/...@3617655 to //UE4/Dev-Console/... Change 3619123 by Ben.Woodhouse Integrate from //UE4/Main/...@3618361 to //UE4/Dev-Console/... Change 3619603 by Stewart.Lynch Merging //Fortnite/Dev-Athena/Engine/Source/Runtime/Engine/Private/Materials/MaterialInstanceConstant.cpp to //UE4/Dev-Console/Engine/Source/Runtime/Engine/Private/Materials/MaterialInstanceConstant.cpp Changed UMaterialInstance::PostLoad(); to Super::PostLoad(); Change 3619608 by Stewart.Lynch Merging //Fortnite/Dev-Athena/Engine/Source/Runtime/... to //UE4/Dev-Console/Engine/Source/Runtime/... LLM update * made sure that all csv stat tracking is disabled if running without -LLMCSV * added new UObject scopes * increased LLM_MAX_THREAD_SCOPE_STACK_DEPTH to 128 to cope with new UObject scopes * added material scopes * changed UMaterialInstance::PostLoad(); to Super::PostLoad(); Change 3619634 by Stewart.Lynch Merging //Fortnite/Main/... to //UE4/Dev-Console/... General LLM improvements * added tracking for misc task graph tasks (moves 20MB out of Untagged) * renamed EngineTick to EngineMisc * added tracking for FName * added tracking for GC_ProcessObjectArray potential leak * renamed index & vertex buffers stat to Meshes * added hooks for MemPro to track allocations from a single category. Currently defined out. I haven't added MemPro.cpp/h. * removed AVAILABLE_PHYSICAL stat from LLM csv * csv files now include the date in the filename * fixed potential threading bug when reading stat values to csv * added lots more scopes * started changing Stat scopes to enum scopes. Stat scopes will be phased out. * added tracking of FName memory * added llm tracking for CPU symbol allocations (20MB) * added tracking for GC * fixed tracking for TransientMemoryAllocator * added tracking for networking memory * added more audio memory tracking * added tracking for blueprints * added tracking for static meshes * show on screen warning if debug memory is enabled * added tracking for particles * renamed Phys to PhysX and added more scopes * renamed Slate to UI and added more scopes * much better coverage of networking memory * improved coverage of audio Change 3619642 by Stewart.Lynch Merging //Fortnite/Main/Engine/Source/Runtime/Core/... to //UE4/Dev-Console/Engine/Source/Runtime/Core/... Windows builds were incorrectly showing the debug memory enabled warning. Made IsDebugMemoryEnabled always return false on Windows. Change 3619799 by Luke.Thatcher [CONSOLE] [-] Disable peak memory tracking in LLM. Change 3619809 by Luke.Thatcher [CONSOLE] [^] Merging CL 3580894 from //Fortnite/Main/... to //UE4/Dev-Console/... - Add Render Target Pool Stats. Use "stat rendertargetpool" to view. Change 3619928 by Luke.Thatcher [CONSOLE] [^] Enable symbol compression on symstore task (Merging CL 3606945 from //Fortnite/Main/... to //UE4/Dev-Console/...) Change 3620571 by Keith.Judge Double the size of the occlusion query buffer in D3D12. This costs 256KB of memory. We need to refactor this in future to resize according to content on demand like D3D11.x. #jira FORT-53103 #jira FORT-53119 Change 3622419 by Daniel.Eldar [General] Fix for occasional ensure to do with retriving the new cvar value. #JIRA UE-46644 Change 3622491 by Daniel.Eldar [General] Added support for scaling on stat unit and unitgraph. #JIRA UE-46644 Change 3622610 by Daniel.Eldar [General] Fixed a compilation warning Change 3624659 by Ben.Woodhouse Integrate from //UE4/Main/...@3624175 to //UE4/Dev-Console/... Change 3624678 by Ben.Woodhouse Integrate from //UE4/Main/...@3624415 to //UE4/Dev-Console/... Change 3624878 by Ben.Woodhouse Integrate as edit CLs 3611835 3611844 3616942 3617607 Descriptor heap memory fix (saves up to ~100MB). * Fix a bug where rolling over a thread-local heap immediately after switching to context-local would crash due to an uninitialized syncpoint * Add a separate value for context local heaps (LOCAL_HEAP_SIZE) and set it to a sensible value (2MB) instead of the current 16MB. This means thread local heaps will be allocated in chunks of ~2MB instead of 16MB. There can be up to 6 thread-local heaps, since they're per-context. Measured peak descriptor heap memory with LLM: 45MB (compared to 145MB previously) This improves behaviour, but this code could use a bit of a rewrite to allow it to reclaim memory better. For example, the global heap memory is almost entirely wasted currently, since when a context switches to "context local strategy" it simply throws this memory away, never to be reclaimed. Having the pools thread-local is also not a good strategy. Ideally we want a thread-safe pool allocator for descriptor heaps which is shared between all the contexts . Change 3624882 by Ben.Woodhouse Fix virtual destructor warning in D3DX12.h Change 3626419 by Stewart.Lynch Merging //Fortnite/Main/... to //UE4/Dev-Console/... LLM Update - Memory reductions, Summary page, enum scopes, refactor and cleanup of tags * Remove all static arrays and hard limits from LLM. Everything is now dynamically allocated using the internal LLM allocators. The overhead when LLM is disabled is now only 48K (was 40MB) * re-wrote LLMMap. Now stores an int32 index rather then pointer in the HashMap array. Also, changed the Values to be arrays for structs instead of structs of arrays. Means that the tag can be stored in a single byte. Changed the size of the allocation size from int64 to int32. All this takes the memory down from around 600MB to 100MB. It was 120 bytes per allocation, now 29 bytes. * changed all LLM scopes over to enums. This has a number of benefits; LLM can be enable in Test, less CPU overhead, stored in a byte (LLM overhead /= 8) * summary page for content creators where all lower-level stats are grouped under one Engine stat * renamed ELLMScopeTag enum to ELLMTag * renamed LLM_SCOPED_TAG_WITH_ENUM macro to LLM_SCOPE * removed Tracker arg from LLM_SCOPE and added LLM_PLATFORM_SCOPE macro * fixed GenericPlatformMallocCrash stat. Although it seems not be be used anymore * fixed BackupOOMMemoryPool stat (now shows in both default and platform pages) * lots of changes adding/removing/renaming tags * added LLMArray and FLLMObjectAllocator classes * disabled asset tag tracking by default because it takes up so much memory even when not used * enable LLM in all non-shipping builds. In Test the on screendisplay won't show because it uses the stats system but it till still write out the csv. * all the stat macros have been left as they were and can be enabled on the LLM_STAT_TAGS_ENABLED define. These are needed for the asset tagging. * disabled LLM_TRACK_PEAK_MEMORY because there is a problem with the way it adds the peaks for multiple threads. This needs to be fixed. * added a CVar to control the csv write interval: LLM.LLMWriteInterval * added static arrays for the enum tags setup. Easier to manage and removes need for slow switch statements. * renamed FLLMThreadStateManager to FLLMTracker to make it consistent with the enum #jira UECON-264 Change 3626906 by Joe.Barnes Fix compile errors when nativizing when a property references a sub object of a dervied type with modified default properties Change 3628045 by Stewart.Lynch Merging //Fortnite/Main/Engine/Source/Runtime/Core/... to //UE4/Dev-Console/Engine/Source/Runtime/Core/... LLM - enabled LLM on Windows * fixed crash in FLLMObjectAllocator destructor. Only happens on Windows shutdown. * changed Align to AlignArbitrary in LLMArray. Small memory saving. * clear ThreadStateAllocator in FLLMTracker::Clear(). Small memory saving * set program size to zero on windows because it isn't relevant #jira UECON-282 Change 3632279 by Ben.Woodhouse Back out changelist 3619862 #jira UE-49472 [CL 3632432 by Joe Barnes in Main branch]
2017-09-07 22:18:47 -04:00
{
if (AliasingMode == 1)
{
// Mode 1: Only make FastVRAM rendertargets transient
if (EnumHasAnyFlags(Flags, TexCreate_FastVRAM))
Copying //UE4/Dev-Console to //UE4/Dev-Main (Source: //UE4/Dev-Console @ 3632338) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3443778 by Ben.Woodhouse Aliasing for transient resources + new high level API Changelists integrated: 3368830 3368887 3377762 3377763 3379513 3381840 3382046 3382138 3385390 3385391 3385531 3396613 3388752 3396756 3397007 3397059 3397780 3397883 3401716 3415179 Change 3576521 by Bart.Hawthorne ShooterGame - update the game instance's online mode when the LAN option is changed Change 3587252 by Ben.Woodhouse Integrate from //UE4/Main/...@3584123 to //UE4/Dev-Console/... Change 3587943 by Luke.Thatcher [CONSOLE] [+] Improved XGE shader compiler - Added support for XGE interception interface, which allows asynchronous streaming of shader tasks into XGE, and eliminates the stalling/flushing found in the old system. - Old system has been renamed "Xml interface" - Both systems are available and selectable based on r.XGEShaderCompile.Mode CVar. Overview of the new system: - New system uses an additional XGEControlWorker process to manage communication between the engine and XGE. This is simply a copy of ShaderCompileWorker.exe (the implementation is part of SCW, but XGE requires the two files to be separate, hence the duplicate). - When shader jobs arrive from the engine, the shader compiler thread spawns an instance of XGEControlWorker within an XGE context, and connects to it via named pipes. - Job command lines are fed to the control worker via the pipe, which the worker enqueues within XGE by issuing a CreateProcess call, which is intercepted. Job completion is reported back to the engine via the named pipes. - New system is preferred over the old one, and is enabled with "-xgeshadercompile" command line switch or "r.XGEShaderCompile" cvar. - The new system depends on the "XGEController" engine module. Support for which is based on the WITH_XGE_CONTROLLER #define, or -xgecontroller/-noxgecontroller command line options. #jira UECON-263 Change 3590037 by Luke.Thatcher [CONSOLE] [!] Fix compile/link errors with XGE controller module - Various unity related fixes needed. Change 3590047 by Luke.Thatcher [CONSOLE] [!] Compile XGE controller module for Editor builds only - The module should only be used in uncooked, non-monolitic binaries (i.e. the editor). Change 3594074 by Luke.Thatcher [CONSOLE] [!] Fix Linux build - case sensitive header include was wrong in XGEControllerModule.cpp Change 3596292 by Luke.Thatcher [CONSOLE] [!] Actually fix unity/nopch build errors in XGE Controller! Change 3596776 by Jonathan.Fitzpatrick cherry pick CL 3595292 cooker change which fixes a condition where DLC would always cook with all maps regardless of which maps were specified. Change 3596795 by Jonathan.Fitzpatrick Back out changelist 3596776 Change 3596816 by Jonathan.Fitzpatrick Moved the DLC map check ahead of the "no maps found" condition so that include-all-maps can be skipped if DLC maps are found. Change 3604282 by Ben.Marsh UBT: Add support for pre-build and post-build steps when using MegaXGE. Change 3606862 by Ben.Marsh Fix missing header guard warning. Change 3611644 by Ben.Woodhouse Integrate from //UE4/Main/...@3610522 to //UE4/Dev-Console/... Change 3614089 by Joe.Barnes Call GRHICommandList.LatchBypass() after variables it checks are set. #jira ue-48130 Change 3617783 by Daniel.Eldar Headers for the HDR changes (they are pre-requisites for compilation). Integrated from: //UE4/Partner-Microsoft-DX12/Engine/Source/ThirdParty/Windows/DirectX/... to //UE4/Dev-Console/Engine/Source/ThirdParty/Windows/DirectX/... #jira UECON-226 Change 3619117 by Ben.Woodhouse Integrate from //UE4/Main/...@3617655 to //UE4/Dev-Console/... Change 3619123 by Ben.Woodhouse Integrate from //UE4/Main/...@3618361 to //UE4/Dev-Console/... Change 3619603 by Stewart.Lynch Merging //Fortnite/Dev-Athena/Engine/Source/Runtime/Engine/Private/Materials/MaterialInstanceConstant.cpp to //UE4/Dev-Console/Engine/Source/Runtime/Engine/Private/Materials/MaterialInstanceConstant.cpp Changed UMaterialInstance::PostLoad(); to Super::PostLoad(); Change 3619608 by Stewart.Lynch Merging //Fortnite/Dev-Athena/Engine/Source/Runtime/... to //UE4/Dev-Console/Engine/Source/Runtime/... LLM update * made sure that all csv stat tracking is disabled if running without -LLMCSV * added new UObject scopes * increased LLM_MAX_THREAD_SCOPE_STACK_DEPTH to 128 to cope with new UObject scopes * added material scopes * changed UMaterialInstance::PostLoad(); to Super::PostLoad(); Change 3619634 by Stewart.Lynch Merging //Fortnite/Main/... to //UE4/Dev-Console/... General LLM improvements * added tracking for misc task graph tasks (moves 20MB out of Untagged) * renamed EngineTick to EngineMisc * added tracking for FName * added tracking for GC_ProcessObjectArray potential leak * renamed index & vertex buffers stat to Meshes * added hooks for MemPro to track allocations from a single category. Currently defined out. I haven't added MemPro.cpp/h. * removed AVAILABLE_PHYSICAL stat from LLM csv * csv files now include the date in the filename * fixed potential threading bug when reading stat values to csv * added lots more scopes * started changing Stat scopes to enum scopes. Stat scopes will be phased out. * added tracking of FName memory * added llm tracking for CPU symbol allocations (20MB) * added tracking for GC * fixed tracking for TransientMemoryAllocator * added tracking for networking memory * added more audio memory tracking * added tracking for blueprints * added tracking for static meshes * show on screen warning if debug memory is enabled * added tracking for particles * renamed Phys to PhysX and added more scopes * renamed Slate to UI and added more scopes * much better coverage of networking memory * improved coverage of audio Change 3619642 by Stewart.Lynch Merging //Fortnite/Main/Engine/Source/Runtime/Core/... to //UE4/Dev-Console/Engine/Source/Runtime/Core/... Windows builds were incorrectly showing the debug memory enabled warning. Made IsDebugMemoryEnabled always return false on Windows. Change 3619799 by Luke.Thatcher [CONSOLE] [-] Disable peak memory tracking in LLM. Change 3619809 by Luke.Thatcher [CONSOLE] [^] Merging CL 3580894 from //Fortnite/Main/... to //UE4/Dev-Console/... - Add Render Target Pool Stats. Use "stat rendertargetpool" to view. Change 3619928 by Luke.Thatcher [CONSOLE] [^] Enable symbol compression on symstore task (Merging CL 3606945 from //Fortnite/Main/... to //UE4/Dev-Console/...) Change 3620571 by Keith.Judge Double the size of the occlusion query buffer in D3D12. This costs 256KB of memory. We need to refactor this in future to resize according to content on demand like D3D11.x. #jira FORT-53103 #jira FORT-53119 Change 3622419 by Daniel.Eldar [General] Fix for occasional ensure to do with retriving the new cvar value. #JIRA UE-46644 Change 3622491 by Daniel.Eldar [General] Added support for scaling on stat unit and unitgraph. #JIRA UE-46644 Change 3622610 by Daniel.Eldar [General] Fixed a compilation warning Change 3624659 by Ben.Woodhouse Integrate from //UE4/Main/...@3624175 to //UE4/Dev-Console/... Change 3624678 by Ben.Woodhouse Integrate from //UE4/Main/...@3624415 to //UE4/Dev-Console/... Change 3624878 by Ben.Woodhouse Integrate as edit CLs 3611835 3611844 3616942 3617607 Descriptor heap memory fix (saves up to ~100MB). * Fix a bug where rolling over a thread-local heap immediately after switching to context-local would crash due to an uninitialized syncpoint * Add a separate value for context local heaps (LOCAL_HEAP_SIZE) and set it to a sensible value (2MB) instead of the current 16MB. This means thread local heaps will be allocated in chunks of ~2MB instead of 16MB. There can be up to 6 thread-local heaps, since they're per-context. Measured peak descriptor heap memory with LLM: 45MB (compared to 145MB previously) This improves behaviour, but this code could use a bit of a rewrite to allow it to reclaim memory better. For example, the global heap memory is almost entirely wasted currently, since when a context switches to "context local strategy" it simply throws this memory away, never to be reclaimed. Having the pools thread-local is also not a good strategy. Ideally we want a thread-safe pool allocator for descriptor heaps which is shared between all the contexts . Change 3624882 by Ben.Woodhouse Fix virtual destructor warning in D3DX12.h Change 3626419 by Stewart.Lynch Merging //Fortnite/Main/... to //UE4/Dev-Console/... LLM Update - Memory reductions, Summary page, enum scopes, refactor and cleanup of tags * Remove all static arrays and hard limits from LLM. Everything is now dynamically allocated using the internal LLM allocators. The overhead when LLM is disabled is now only 48K (was 40MB) * re-wrote LLMMap. Now stores an int32 index rather then pointer in the HashMap array. Also, changed the Values to be arrays for structs instead of structs of arrays. Means that the tag can be stored in a single byte. Changed the size of the allocation size from int64 to int32. All this takes the memory down from around 600MB to 100MB. It was 120 bytes per allocation, now 29 bytes. * changed all LLM scopes over to enums. This has a number of benefits; LLM can be enable in Test, less CPU overhead, stored in a byte (LLM overhead /= 8) * summary page for content creators where all lower-level stats are grouped under one Engine stat * renamed ELLMScopeTag enum to ELLMTag * renamed LLM_SCOPED_TAG_WITH_ENUM macro to LLM_SCOPE * removed Tracker arg from LLM_SCOPE and added LLM_PLATFORM_SCOPE macro * fixed GenericPlatformMallocCrash stat. Although it seems not be be used anymore * fixed BackupOOMMemoryPool stat (now shows in both default and platform pages) * lots of changes adding/removing/renaming tags * added LLMArray and FLLMObjectAllocator classes * disabled asset tag tracking by default because it takes up so much memory even when not used * enable LLM in all non-shipping builds. In Test the on screendisplay won't show because it uses the stats system but it till still write out the csv. * all the stat macros have been left as they were and can be enabled on the LLM_STAT_TAGS_ENABLED define. These are needed for the asset tagging. * disabled LLM_TRACK_PEAK_MEMORY because there is a problem with the way it adds the peaks for multiple threads. This needs to be fixed. * added a CVar to control the csv write interval: LLM.LLMWriteInterval * added static arrays for the enum tags setup. Easier to manage and removes need for slow switch statements. * renamed FLLMThreadStateManager to FLLMTracker to make it consistent with the enum #jira UECON-264 Change 3626906 by Joe.Barnes Fix compile errors when nativizing when a property references a sub object of a dervied type with modified default properties Change 3628045 by Stewart.Lynch Merging //Fortnite/Main/Engine/Source/Runtime/Core/... to //UE4/Dev-Console/Engine/Source/Runtime/Core/... LLM - enabled LLM on Windows * fixed crash in FLLMObjectAllocator destructor. Only happens on Windows shutdown. * changed Align to AlignArbitrary in LLMArray. Small memory saving. * clear ThreadStateAllocator in FLLMTracker::Clear(). Small memory saving * set program size to zero on windows because it isn't relevant #jira UECON-282 Change 3632279 by Ben.Woodhouse Back out changelist 3619862 #jira UE-49472 [CL 3632432 by Joe Barnes in Main branch]
2017-09-07 22:18:47 -04:00
{
return true;
}
}
else if (AliasingMode == 2)
{
// Mode 2: Make fastvram and ERenderTargetTransience::Transient rendertargets transient
if (EnumHasAnyFlags(Flags, TexCreate_FastVRAM) || TransienceHint == ERenderTargetTransience::Transient)
Copying //UE4/Dev-Console to //UE4/Dev-Main (Source: //UE4/Dev-Console @ 3632338) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3443778 by Ben.Woodhouse Aliasing for transient resources + new high level API Changelists integrated: 3368830 3368887 3377762 3377763 3379513 3381840 3382046 3382138 3385390 3385391 3385531 3396613 3388752 3396756 3397007 3397059 3397780 3397883 3401716 3415179 Change 3576521 by Bart.Hawthorne ShooterGame - update the game instance's online mode when the LAN option is changed Change 3587252 by Ben.Woodhouse Integrate from //UE4/Main/...@3584123 to //UE4/Dev-Console/... Change 3587943 by Luke.Thatcher [CONSOLE] [+] Improved XGE shader compiler - Added support for XGE interception interface, which allows asynchronous streaming of shader tasks into XGE, and eliminates the stalling/flushing found in the old system. - Old system has been renamed "Xml interface" - Both systems are available and selectable based on r.XGEShaderCompile.Mode CVar. Overview of the new system: - New system uses an additional XGEControlWorker process to manage communication between the engine and XGE. This is simply a copy of ShaderCompileWorker.exe (the implementation is part of SCW, but XGE requires the two files to be separate, hence the duplicate). - When shader jobs arrive from the engine, the shader compiler thread spawns an instance of XGEControlWorker within an XGE context, and connects to it via named pipes. - Job command lines are fed to the control worker via the pipe, which the worker enqueues within XGE by issuing a CreateProcess call, which is intercepted. Job completion is reported back to the engine via the named pipes. - New system is preferred over the old one, and is enabled with "-xgeshadercompile" command line switch or "r.XGEShaderCompile" cvar. - The new system depends on the "XGEController" engine module. Support for which is based on the WITH_XGE_CONTROLLER #define, or -xgecontroller/-noxgecontroller command line options. #jira UECON-263 Change 3590037 by Luke.Thatcher [CONSOLE] [!] Fix compile/link errors with XGE controller module - Various unity related fixes needed. Change 3590047 by Luke.Thatcher [CONSOLE] [!] Compile XGE controller module for Editor builds only - The module should only be used in uncooked, non-monolitic binaries (i.e. the editor). Change 3594074 by Luke.Thatcher [CONSOLE] [!] Fix Linux build - case sensitive header include was wrong in XGEControllerModule.cpp Change 3596292 by Luke.Thatcher [CONSOLE] [!] Actually fix unity/nopch build errors in XGE Controller! Change 3596776 by Jonathan.Fitzpatrick cherry pick CL 3595292 cooker change which fixes a condition where DLC would always cook with all maps regardless of which maps were specified. Change 3596795 by Jonathan.Fitzpatrick Back out changelist 3596776 Change 3596816 by Jonathan.Fitzpatrick Moved the DLC map check ahead of the "no maps found" condition so that include-all-maps can be skipped if DLC maps are found. Change 3604282 by Ben.Marsh UBT: Add support for pre-build and post-build steps when using MegaXGE. Change 3606862 by Ben.Marsh Fix missing header guard warning. Change 3611644 by Ben.Woodhouse Integrate from //UE4/Main/...@3610522 to //UE4/Dev-Console/... Change 3614089 by Joe.Barnes Call GRHICommandList.LatchBypass() after variables it checks are set. #jira ue-48130 Change 3617783 by Daniel.Eldar Headers for the HDR changes (they are pre-requisites for compilation). Integrated from: //UE4/Partner-Microsoft-DX12/Engine/Source/ThirdParty/Windows/DirectX/... to //UE4/Dev-Console/Engine/Source/ThirdParty/Windows/DirectX/... #jira UECON-226 Change 3619117 by Ben.Woodhouse Integrate from //UE4/Main/...@3617655 to //UE4/Dev-Console/... Change 3619123 by Ben.Woodhouse Integrate from //UE4/Main/...@3618361 to //UE4/Dev-Console/... Change 3619603 by Stewart.Lynch Merging //Fortnite/Dev-Athena/Engine/Source/Runtime/Engine/Private/Materials/MaterialInstanceConstant.cpp to //UE4/Dev-Console/Engine/Source/Runtime/Engine/Private/Materials/MaterialInstanceConstant.cpp Changed UMaterialInstance::PostLoad(); to Super::PostLoad(); Change 3619608 by Stewart.Lynch Merging //Fortnite/Dev-Athena/Engine/Source/Runtime/... to //UE4/Dev-Console/Engine/Source/Runtime/... LLM update * made sure that all csv stat tracking is disabled if running without -LLMCSV * added new UObject scopes * increased LLM_MAX_THREAD_SCOPE_STACK_DEPTH to 128 to cope with new UObject scopes * added material scopes * changed UMaterialInstance::PostLoad(); to Super::PostLoad(); Change 3619634 by Stewart.Lynch Merging //Fortnite/Main/... to //UE4/Dev-Console/... General LLM improvements * added tracking for misc task graph tasks (moves 20MB out of Untagged) * renamed EngineTick to EngineMisc * added tracking for FName * added tracking for GC_ProcessObjectArray potential leak * renamed index & vertex buffers stat to Meshes * added hooks for MemPro to track allocations from a single category. Currently defined out. I haven't added MemPro.cpp/h. * removed AVAILABLE_PHYSICAL stat from LLM csv * csv files now include the date in the filename * fixed potential threading bug when reading stat values to csv * added lots more scopes * started changing Stat scopes to enum scopes. Stat scopes will be phased out. * added tracking of FName memory * added llm tracking for CPU symbol allocations (20MB) * added tracking for GC * fixed tracking for TransientMemoryAllocator * added tracking for networking memory * added more audio memory tracking * added tracking for blueprints * added tracking for static meshes * show on screen warning if debug memory is enabled * added tracking for particles * renamed Phys to PhysX and added more scopes * renamed Slate to UI and added more scopes * much better coverage of networking memory * improved coverage of audio Change 3619642 by Stewart.Lynch Merging //Fortnite/Main/Engine/Source/Runtime/Core/... to //UE4/Dev-Console/Engine/Source/Runtime/Core/... Windows builds were incorrectly showing the debug memory enabled warning. Made IsDebugMemoryEnabled always return false on Windows. Change 3619799 by Luke.Thatcher [CONSOLE] [-] Disable peak memory tracking in LLM. Change 3619809 by Luke.Thatcher [CONSOLE] [^] Merging CL 3580894 from //Fortnite/Main/... to //UE4/Dev-Console/... - Add Render Target Pool Stats. Use "stat rendertargetpool" to view. Change 3619928 by Luke.Thatcher [CONSOLE] [^] Enable symbol compression on symstore task (Merging CL 3606945 from //Fortnite/Main/... to //UE4/Dev-Console/...) Change 3620571 by Keith.Judge Double the size of the occlusion query buffer in D3D12. This costs 256KB of memory. We need to refactor this in future to resize according to content on demand like D3D11.x. #jira FORT-53103 #jira FORT-53119 Change 3622419 by Daniel.Eldar [General] Fix for occasional ensure to do with retriving the new cvar value. #JIRA UE-46644 Change 3622491 by Daniel.Eldar [General] Added support for scaling on stat unit and unitgraph. #JIRA UE-46644 Change 3622610 by Daniel.Eldar [General] Fixed a compilation warning Change 3624659 by Ben.Woodhouse Integrate from //UE4/Main/...@3624175 to //UE4/Dev-Console/... Change 3624678 by Ben.Woodhouse Integrate from //UE4/Main/...@3624415 to //UE4/Dev-Console/... Change 3624878 by Ben.Woodhouse Integrate as edit CLs 3611835 3611844 3616942 3617607 Descriptor heap memory fix (saves up to ~100MB). * Fix a bug where rolling over a thread-local heap immediately after switching to context-local would crash due to an uninitialized syncpoint * Add a separate value for context local heaps (LOCAL_HEAP_SIZE) and set it to a sensible value (2MB) instead of the current 16MB. This means thread local heaps will be allocated in chunks of ~2MB instead of 16MB. There can be up to 6 thread-local heaps, since they're per-context. Measured peak descriptor heap memory with LLM: 45MB (compared to 145MB previously) This improves behaviour, but this code could use a bit of a rewrite to allow it to reclaim memory better. For example, the global heap memory is almost entirely wasted currently, since when a context switches to "context local strategy" it simply throws this memory away, never to be reclaimed. Having the pools thread-local is also not a good strategy. Ideally we want a thread-safe pool allocator for descriptor heaps which is shared between all the contexts . Change 3624882 by Ben.Woodhouse Fix virtual destructor warning in D3DX12.h Change 3626419 by Stewart.Lynch Merging //Fortnite/Main/... to //UE4/Dev-Console/... LLM Update - Memory reductions, Summary page, enum scopes, refactor and cleanup of tags * Remove all static arrays and hard limits from LLM. Everything is now dynamically allocated using the internal LLM allocators. The overhead when LLM is disabled is now only 48K (was 40MB) * re-wrote LLMMap. Now stores an int32 index rather then pointer in the HashMap array. Also, changed the Values to be arrays for structs instead of structs of arrays. Means that the tag can be stored in a single byte. Changed the size of the allocation size from int64 to int32. All this takes the memory down from around 600MB to 100MB. It was 120 bytes per allocation, now 29 bytes. * changed all LLM scopes over to enums. This has a number of benefits; LLM can be enable in Test, less CPU overhead, stored in a byte (LLM overhead /= 8) * summary page for content creators where all lower-level stats are grouped under one Engine stat * renamed ELLMScopeTag enum to ELLMTag * renamed LLM_SCOPED_TAG_WITH_ENUM macro to LLM_SCOPE * removed Tracker arg from LLM_SCOPE and added LLM_PLATFORM_SCOPE macro * fixed GenericPlatformMallocCrash stat. Although it seems not be be used anymore * fixed BackupOOMMemoryPool stat (now shows in both default and platform pages) * lots of changes adding/removing/renaming tags * added LLMArray and FLLMObjectAllocator classes * disabled asset tag tracking by default because it takes up so much memory even when not used * enable LLM in all non-shipping builds. In Test the on screendisplay won't show because it uses the stats system but it till still write out the csv. * all the stat macros have been left as they were and can be enabled on the LLM_STAT_TAGS_ENABLED define. These are needed for the asset tagging. * disabled LLM_TRACK_PEAK_MEMORY because there is a problem with the way it adds the peaks for multiple threads. This needs to be fixed. * added a CVar to control the csv write interval: LLM.LLMWriteInterval * added static arrays for the enum tags setup. Easier to manage and removes need for slow switch statements. * renamed FLLMThreadStateManager to FLLMTracker to make it consistent with the enum #jira UECON-264 Change 3626906 by Joe.Barnes Fix compile errors when nativizing when a property references a sub object of a dervied type with modified default properties Change 3628045 by Stewart.Lynch Merging //Fortnite/Main/Engine/Source/Runtime/Core/... to //UE4/Dev-Console/Engine/Source/Runtime/Core/... LLM - enabled LLM on Windows * fixed crash in FLLMObjectAllocator destructor. Only happens on Windows shutdown. * changed Align to AlignArbitrary in LLMArray. Small memory saving. * clear ThreadStateAllocator in FLLMTracker::Clear(). Small memory saving * set program size to zero on windows because it isn't relevant #jira UECON-282 Change 3632279 by Ben.Woodhouse Back out changelist 3619862 #jira UE-49472 [CL 3632432 by Joe Barnes in Main branch]
2017-09-07 22:18:47 -04:00
{
return true;
}
}
else if (AliasingMode == 3)
{
// Mode 3 : All rendertargets are transient
return true;
}
}
return false;
}
TRefCountPtr<FPooledRenderTarget> FRenderTargetPool::FindFreeElementForRDG(
FRHICommandList& RHICmdList,
const FRDGTextureDesc& Desc,
const TCHAR* Name)
{
checkf(!EnumHasAnyFlags(Desc.Flags, TexCreate_Transient), TEXT("RDG does not support the render target pool transient API"));
return FindFreeElementInternal(RHICmdList, Translate(Desc), Name);
}
TRefCountPtr<FPooledRenderTarget> FRenderTargetPool::FindFreeElementInternal(
FRHICommandList& RHICmdList,
const FPooledRenderTargetDesc& Desc,
const TCHAR* InDebugName)
{
const int32 AliasingMode = CVarRtPoolTransientMode.GetValueOnRenderThread();
FPooledRenderTarget* Found = 0;
uint32 FoundIndex = -1;
bool bReusingExistingTarget = false;
const uint64 DescHash = GetTypeHash(Desc);
// try to find a suitable element in the pool
{
const bool bSupportsFastVRAM = FPlatformMemory::SupportsFastVRAMMemory();
//don't spend time doing 2 passes if the platform doesn't support fastvram
Copying //UE4/Dev-Console to //UE4/Dev-Main (Source: //UE4/Dev-Console @ 3483086) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3389969 on 2017/04/12 by Guillaume.Abadie Implements FDebug::DumpStackTraceToLog() debugging utility. Change 3391579 on 2017/04/12 by Joe.Barnes Fix minor spacing issue. Change 3402629 on 2017/04/20 by Ben.Marsh Build: Remove job to populate the DDC. Trying out a new system for this. Change 3417501 on 2017/05/01 by Joe.Barnes IWYU - Missing #include files. Change 3419927 on 2017/05/02 by Joe.Barnes - Support custom LOD for shadow map generation only (r.ForceLODShadow) - New #define to expose forceLOD and forceLODShadow also in Test/Ship builds (#define EXPOSE_FORCE_LOD 1 in RenderCore.cpp). Not exposed by default. Change 3420964 on 2017/05/03 by Jonathan.Fitzpatrick Fixed null dereference of LineBatcher when using DrawDebugSphere and DrawDebugAltCone #jira UE-30213 Change 3423470 on 2017/05/04 by Luke.Thatcher [CONSOLE] [STREAMS] [^] Merging //UE4/Dev-Main (CL 3391974) to Dev-Console (//UE4/Dev-Console) - Compile errors in Switch, to be fixed after check-in. Change 3430410 on 2017/05/09 by Ben.Woodhouse Fix uninitialized local variable causing crashes in Test #jira UE-44832 Change 3430506 on 2017/05/09 by Josh.Adams - Fixed up the editor platforms' method of loading TargetSettings objects so that we don't need any manual parsing of .ini files to fill out the class defaults Change 3434035 on 2017/05/10 by Ben.Woodhouse Integrate updated FortGPUTestbed from Fortnite/Main Change 3437046 on 2017/05/12 by Joe.Barnes Fix for clang producing a warning when not all specializations of a templated function are marked FORCEINLINE. Also, switch a specialization of BlendTransform() from a function with a check to just a declaration so compiler will catch error instead of a runtime catch. Change 3437259 on 2017/05/12 by Joe.Barnes Fix for clang producing a warning when not all specializations of a templated function are marked FORCEINLINE. Also, switch a specialization of BlendTransform() from a function with a check to just a declaration so compiler will catch error instead of a runtime catch. Change 3440758 on 2017/05/16 by Ben.Woodhouse Simple threaded CSV Profiler To capture: - On the commandline, add -csvCaptureFrames=N to capture N frames from startup - On the console, use csvprofile start, csvprofile stop or csvprofile frames=N to capture a fixed number of frames - Instrument with CSV_SCOPED_STAT(statname), CSV_CUSTOM_STAT(statname,value). CSV capture is enabled in all builds except shipping - Please do not check in the instrumentation √ we don╞t want to pollute the engine with lots of additional instrumentation. We may add some minimal level of instrumentation at some point Change 3440954 on 2017/05/16 by Josh.Adams - Cleaned up some DeviceProfiles in BaseDP.ini Change 3443778 on 2017/05/17 by Ben.Woodhouse Aliasing for transient resources + new high level API Changelists integrated: 3368830 3368887 3377762 3377763 3379513 3381840 3382046 3382138 3385390 3385391 3385531 3396613 3388752 3396756 3397007 3397059 3397780 3397883 3401716 3415179 Change 3451460 on 2017/05/22 by Ben.Woodhouse Fix editor crash (NULL dereference of ScreenSpaceShadowTexture) when moving the camera around in tm-shadermodels, probably fallout from the VRAM aliasing merge. Not sure if this is the correct fix, but it prevents the crash for now Change 3451601 on 2017/05/22 by Josh.Adams - Track idle time from MaxTickRate, so that stat unit is accurate on Game: thread Change 3452025 on 2017/05/22 by Ben.Woodhouse Integrate (as edit) CL 3378734 (editor crash fix) Also add a check for null in LightFunctionRendering.cpp Change 3452389 on 2017/05/22 by Josh.Adams - Replaced POCulturePluralForms with a static array, instead of TMapBuilder (was blowing stack or similar on Switch Debug). Code courtesy of Jamie Dale. Change 3452758 on 2017/05/22 by Joe.Barnes Add FindFirstClearBit() and FindFirstSetBit() to TStaticBitArray. Change 3455889 on 2017/05/23 by Ben.Woodhouse Integrate from //UE4/Main/...@3453436 to //UE4/Dev-Console/... Change 3458654 on 2017/05/25 by Joe.Conley Attempting to fix Static Analysis warning. Change 3462710 on 2017/05/26 by Ben.Woodhouse Integrate from //UE4/Main/...@3461688 to //UE4/Dev-Console/... Change 3471711 on 2017/06/02 by Jonathan.Fitzpatrick Updating MallocProfiler to use the accessor for OnOutOfMemory delegate to conform with change made in CL 3415996. Change 3473813 on 2017/06/05 by Ben.Woodhouse Fix streaming visibility logic bug reported on UDN #jira UE-43892 Change 3475298 on 2017/06/06 by Luke.Thatcher [CONSOLE] [!] Fix RHITransitionResources crash with more than 16 textures. - Old command had a fixed sized array of 16 textures that would overflow. - New command allocates an array of texture pointers inline in the command list, so any number is supported. #jira UE-45625 Change 3476776 on 2017/06/06 by Ben.Woodhouse Integrate from //UE4/Main/...@3475908 Change 3479083 on 2017/06/07 by Ben.Woodhouse Integrate as edit CL 3467315 from dev-animphys: From Alexis Matte. Ensure SectionMap is fixed up for old entries that are no longer valid. #JIRA UE-45438 #jira UE-45735 Change 3480576 on 2017/06/08 by Ben.Woodhouse Integrate from //UE4/Main/...@3480024 to //UE4/Dev-Console/... [CL 3483258 by Luke Thatcher in Main branch]
2017-06-09 17:44:13 -04:00
uint32 PassCount = 1;
if (AliasingMode == 0)
{
if (EnumHasAnyFlags(Desc.Flags, TexCreate_FastVRAM) && bSupportsFastVRAM)
{
PassCount = 2;
}
Copying //UE4/Dev-Console to //UE4/Dev-Main (Source: //UE4/Dev-Console @ 3483086) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3389969 on 2017/04/12 by Guillaume.Abadie Implements FDebug::DumpStackTraceToLog() debugging utility. Change 3391579 on 2017/04/12 by Joe.Barnes Fix minor spacing issue. Change 3402629 on 2017/04/20 by Ben.Marsh Build: Remove job to populate the DDC. Trying out a new system for this. Change 3417501 on 2017/05/01 by Joe.Barnes IWYU - Missing #include files. Change 3419927 on 2017/05/02 by Joe.Barnes - Support custom LOD for shadow map generation only (r.ForceLODShadow) - New #define to expose forceLOD and forceLODShadow also in Test/Ship builds (#define EXPOSE_FORCE_LOD 1 in RenderCore.cpp). Not exposed by default. Change 3420964 on 2017/05/03 by Jonathan.Fitzpatrick Fixed null dereference of LineBatcher when using DrawDebugSphere and DrawDebugAltCone #jira UE-30213 Change 3423470 on 2017/05/04 by Luke.Thatcher [CONSOLE] [STREAMS] [^] Merging //UE4/Dev-Main (CL 3391974) to Dev-Console (//UE4/Dev-Console) - Compile errors in Switch, to be fixed after check-in. Change 3430410 on 2017/05/09 by Ben.Woodhouse Fix uninitialized local variable causing crashes in Test #jira UE-44832 Change 3430506 on 2017/05/09 by Josh.Adams - Fixed up the editor platforms' method of loading TargetSettings objects so that we don't need any manual parsing of .ini files to fill out the class defaults Change 3434035 on 2017/05/10 by Ben.Woodhouse Integrate updated FortGPUTestbed from Fortnite/Main Change 3437046 on 2017/05/12 by Joe.Barnes Fix for clang producing a warning when not all specializations of a templated function are marked FORCEINLINE. Also, switch a specialization of BlendTransform() from a function with a check to just a declaration so compiler will catch error instead of a runtime catch. Change 3437259 on 2017/05/12 by Joe.Barnes Fix for clang producing a warning when not all specializations of a templated function are marked FORCEINLINE. Also, switch a specialization of BlendTransform() from a function with a check to just a declaration so compiler will catch error instead of a runtime catch. Change 3440758 on 2017/05/16 by Ben.Woodhouse Simple threaded CSV Profiler To capture: - On the commandline, add -csvCaptureFrames=N to capture N frames from startup - On the console, use csvprofile start, csvprofile stop or csvprofile frames=N to capture a fixed number of frames - Instrument with CSV_SCOPED_STAT(statname), CSV_CUSTOM_STAT(statname,value). CSV capture is enabled in all builds except shipping - Please do not check in the instrumentation √ we don╞t want to pollute the engine with lots of additional instrumentation. We may add some minimal level of instrumentation at some point Change 3440954 on 2017/05/16 by Josh.Adams - Cleaned up some DeviceProfiles in BaseDP.ini Change 3443778 on 2017/05/17 by Ben.Woodhouse Aliasing for transient resources + new high level API Changelists integrated: 3368830 3368887 3377762 3377763 3379513 3381840 3382046 3382138 3385390 3385391 3385531 3396613 3388752 3396756 3397007 3397059 3397780 3397883 3401716 3415179 Change 3451460 on 2017/05/22 by Ben.Woodhouse Fix editor crash (NULL dereference of ScreenSpaceShadowTexture) when moving the camera around in tm-shadermodels, probably fallout from the VRAM aliasing merge. Not sure if this is the correct fix, but it prevents the crash for now Change 3451601 on 2017/05/22 by Josh.Adams - Track idle time from MaxTickRate, so that stat unit is accurate on Game: thread Change 3452025 on 2017/05/22 by Ben.Woodhouse Integrate (as edit) CL 3378734 (editor crash fix) Also add a check for null in LightFunctionRendering.cpp Change 3452389 on 2017/05/22 by Josh.Adams - Replaced POCulturePluralForms with a static array, instead of TMapBuilder (was blowing stack or similar on Switch Debug). Code courtesy of Jamie Dale. Change 3452758 on 2017/05/22 by Joe.Barnes Add FindFirstClearBit() and FindFirstSetBit() to TStaticBitArray. Change 3455889 on 2017/05/23 by Ben.Woodhouse Integrate from //UE4/Main/...@3453436 to //UE4/Dev-Console/... Change 3458654 on 2017/05/25 by Joe.Conley Attempting to fix Static Analysis warning. Change 3462710 on 2017/05/26 by Ben.Woodhouse Integrate from //UE4/Main/...@3461688 to //UE4/Dev-Console/... Change 3471711 on 2017/06/02 by Jonathan.Fitzpatrick Updating MallocProfiler to use the accessor for OnOutOfMemory delegate to conform with change made in CL 3415996. Change 3473813 on 2017/06/05 by Ben.Woodhouse Fix streaming visibility logic bug reported on UDN #jira UE-43892 Change 3475298 on 2017/06/06 by Luke.Thatcher [CONSOLE] [!] Fix RHITransitionResources crash with more than 16 textures. - Old command had a fixed sized array of 16 textures that would overflow. - New command allocates an array of texture pointers inline in the command list, so any number is supported. #jira UE-45625 Change 3476776 on 2017/06/06 by Ben.Woodhouse Integrate from //UE4/Main/...@3475908 Change 3479083 on 2017/06/07 by Ben.Woodhouse Integrate as edit CL 3467315 from dev-animphys: From Alexis Matte. Ensure SectionMap is fixed up for old entries that are no longer valid. #JIRA UE-45438 #jira UE-45735 Change 3480576 on 2017/06/08 by Ben.Woodhouse Integrate from //UE4/Main/...@3480024 to //UE4/Dev-Console/... [CL 3483258 by Luke Thatcher in Main branch]
2017-06-09 17:44:13 -04:00
}
bool bAllowMultipleDiscards = (CVarAllowMultipleAliasingDiscardsPerFrame.GetValueOnRenderThread() != 0);
// first we try exact, if that fails we try without TexCreate_FastVRAM
// (easily we can run out of VRam, if this search becomes a performance problem we can optimize or we should use less TexCreate_FastVRAM)
for (uint32 Pass = 0; Pass < PassCount; ++Pass)
{
bool bExactMatch = (Pass == 0) && bSupportsFastVRAM;
for (uint32 Index = 0, Num = (uint32)PooledRenderTargets.Num(); Index < Num; ++Index)
{
if (PooledRenderTargetHashes[Index] == DescHash)
{
FPooledRenderTarget* Element = PooledRenderTargets[Index];
checkf(Element, TEXT("Hash was not cleared from the list."));
checkf(Element->GetDesc().Compare(Desc, false), TEXT("Invalid hash or collision when attempting to allocate %s"), Element->GetDesc().DebugName);
if (!Element->IsFree())
Copying //UE4/Dev-Console to //UE4/Dev-Main (Source: //UE4/Dev-Console @ 3483086) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3389969 on 2017/04/12 by Guillaume.Abadie Implements FDebug::DumpStackTraceToLog() debugging utility. Change 3391579 on 2017/04/12 by Joe.Barnes Fix minor spacing issue. Change 3402629 on 2017/04/20 by Ben.Marsh Build: Remove job to populate the DDC. Trying out a new system for this. Change 3417501 on 2017/05/01 by Joe.Barnes IWYU - Missing #include files. Change 3419927 on 2017/05/02 by Joe.Barnes - Support custom LOD for shadow map generation only (r.ForceLODShadow) - New #define to expose forceLOD and forceLODShadow also in Test/Ship builds (#define EXPOSE_FORCE_LOD 1 in RenderCore.cpp). Not exposed by default. Change 3420964 on 2017/05/03 by Jonathan.Fitzpatrick Fixed null dereference of LineBatcher when using DrawDebugSphere and DrawDebugAltCone #jira UE-30213 Change 3423470 on 2017/05/04 by Luke.Thatcher [CONSOLE] [STREAMS] [^] Merging //UE4/Dev-Main (CL 3391974) to Dev-Console (//UE4/Dev-Console) - Compile errors in Switch, to be fixed after check-in. Change 3430410 on 2017/05/09 by Ben.Woodhouse Fix uninitialized local variable causing crashes in Test #jira UE-44832 Change 3430506 on 2017/05/09 by Josh.Adams - Fixed up the editor platforms' method of loading TargetSettings objects so that we don't need any manual parsing of .ini files to fill out the class defaults Change 3434035 on 2017/05/10 by Ben.Woodhouse Integrate updated FortGPUTestbed from Fortnite/Main Change 3437046 on 2017/05/12 by Joe.Barnes Fix for clang producing a warning when not all specializations of a templated function are marked FORCEINLINE. Also, switch a specialization of BlendTransform() from a function with a check to just a declaration so compiler will catch error instead of a runtime catch. Change 3437259 on 2017/05/12 by Joe.Barnes Fix for clang producing a warning when not all specializations of a templated function are marked FORCEINLINE. Also, switch a specialization of BlendTransform() from a function with a check to just a declaration so compiler will catch error instead of a runtime catch. Change 3440758 on 2017/05/16 by Ben.Woodhouse Simple threaded CSV Profiler To capture: - On the commandline, add -csvCaptureFrames=N to capture N frames from startup - On the console, use csvprofile start, csvprofile stop or csvprofile frames=N to capture a fixed number of frames - Instrument with CSV_SCOPED_STAT(statname), CSV_CUSTOM_STAT(statname,value). CSV capture is enabled in all builds except shipping - Please do not check in the instrumentation √ we don╞t want to pollute the engine with lots of additional instrumentation. We may add some minimal level of instrumentation at some point Change 3440954 on 2017/05/16 by Josh.Adams - Cleaned up some DeviceProfiles in BaseDP.ini Change 3443778 on 2017/05/17 by Ben.Woodhouse Aliasing for transient resources + new high level API Changelists integrated: 3368830 3368887 3377762 3377763 3379513 3381840 3382046 3382138 3385390 3385391 3385531 3396613 3388752 3396756 3397007 3397059 3397780 3397883 3401716 3415179 Change 3451460 on 2017/05/22 by Ben.Woodhouse Fix editor crash (NULL dereference of ScreenSpaceShadowTexture) when moving the camera around in tm-shadermodels, probably fallout from the VRAM aliasing merge. Not sure if this is the correct fix, but it prevents the crash for now Change 3451601 on 2017/05/22 by Josh.Adams - Track idle time from MaxTickRate, so that stat unit is accurate on Game: thread Change 3452025 on 2017/05/22 by Ben.Woodhouse Integrate (as edit) CL 3378734 (editor crash fix) Also add a check for null in LightFunctionRendering.cpp Change 3452389 on 2017/05/22 by Josh.Adams - Replaced POCulturePluralForms with a static array, instead of TMapBuilder (was blowing stack or similar on Switch Debug). Code courtesy of Jamie Dale. Change 3452758 on 2017/05/22 by Joe.Barnes Add FindFirstClearBit() and FindFirstSetBit() to TStaticBitArray. Change 3455889 on 2017/05/23 by Ben.Woodhouse Integrate from //UE4/Main/...@3453436 to //UE4/Dev-Console/... Change 3458654 on 2017/05/25 by Joe.Conley Attempting to fix Static Analysis warning. Change 3462710 on 2017/05/26 by Ben.Woodhouse Integrate from //UE4/Main/...@3461688 to //UE4/Dev-Console/... Change 3471711 on 2017/06/02 by Jonathan.Fitzpatrick Updating MallocProfiler to use the accessor for OnOutOfMemory delegate to conform with change made in CL 3415996. Change 3473813 on 2017/06/05 by Ben.Woodhouse Fix streaming visibility logic bug reported on UDN #jira UE-43892 Change 3475298 on 2017/06/06 by Luke.Thatcher [CONSOLE] [!] Fix RHITransitionResources crash with more than 16 textures. - Old command had a fixed sized array of 16 textures that would overflow. - New command allocates an array of texture pointers inline in the command list, so any number is supported. #jira UE-45625 Change 3476776 on 2017/06/06 by Ben.Woodhouse Integrate from //UE4/Main/...@3475908 Change 3479083 on 2017/06/07 by Ben.Woodhouse Integrate as edit CL 3467315 from dev-animphys: From Alexis Matte. Ensure SectionMap is fixed up for old entries that are no longer valid. #JIRA UE-45438 #jira UE-45735 Change 3480576 on 2017/06/08 by Ben.Woodhouse Integrate from //UE4/Main/...@3480024 to //UE4/Dev-Console/... [CL 3483258 by Luke Thatcher in Main branch]
2017-06-09 17:44:13 -04:00
{
continue;
Copying //UE4/Dev-Console to //UE4/Dev-Main (Source: //UE4/Dev-Console @ 3483086) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3389969 on 2017/04/12 by Guillaume.Abadie Implements FDebug::DumpStackTraceToLog() debugging utility. Change 3391579 on 2017/04/12 by Joe.Barnes Fix minor spacing issue. Change 3402629 on 2017/04/20 by Ben.Marsh Build: Remove job to populate the DDC. Trying out a new system for this. Change 3417501 on 2017/05/01 by Joe.Barnes IWYU - Missing #include files. Change 3419927 on 2017/05/02 by Joe.Barnes - Support custom LOD for shadow map generation only (r.ForceLODShadow) - New #define to expose forceLOD and forceLODShadow also in Test/Ship builds (#define EXPOSE_FORCE_LOD 1 in RenderCore.cpp). Not exposed by default. Change 3420964 on 2017/05/03 by Jonathan.Fitzpatrick Fixed null dereference of LineBatcher when using DrawDebugSphere and DrawDebugAltCone #jira UE-30213 Change 3423470 on 2017/05/04 by Luke.Thatcher [CONSOLE] [STREAMS] [^] Merging //UE4/Dev-Main (CL 3391974) to Dev-Console (//UE4/Dev-Console) - Compile errors in Switch, to be fixed after check-in. Change 3430410 on 2017/05/09 by Ben.Woodhouse Fix uninitialized local variable causing crashes in Test #jira UE-44832 Change 3430506 on 2017/05/09 by Josh.Adams - Fixed up the editor platforms' method of loading TargetSettings objects so that we don't need any manual parsing of .ini files to fill out the class defaults Change 3434035 on 2017/05/10 by Ben.Woodhouse Integrate updated FortGPUTestbed from Fortnite/Main Change 3437046 on 2017/05/12 by Joe.Barnes Fix for clang producing a warning when not all specializations of a templated function are marked FORCEINLINE. Also, switch a specialization of BlendTransform() from a function with a check to just a declaration so compiler will catch error instead of a runtime catch. Change 3437259 on 2017/05/12 by Joe.Barnes Fix for clang producing a warning when not all specializations of a templated function are marked FORCEINLINE. Also, switch a specialization of BlendTransform() from a function with a check to just a declaration so compiler will catch error instead of a runtime catch. Change 3440758 on 2017/05/16 by Ben.Woodhouse Simple threaded CSV Profiler To capture: - On the commandline, add -csvCaptureFrames=N to capture N frames from startup - On the console, use csvprofile start, csvprofile stop or csvprofile frames=N to capture a fixed number of frames - Instrument with CSV_SCOPED_STAT(statname), CSV_CUSTOM_STAT(statname,value). CSV capture is enabled in all builds except shipping - Please do not check in the instrumentation √ we don╞t want to pollute the engine with lots of additional instrumentation. We may add some minimal level of instrumentation at some point Change 3440954 on 2017/05/16 by Josh.Adams - Cleaned up some DeviceProfiles in BaseDP.ini Change 3443778 on 2017/05/17 by Ben.Woodhouse Aliasing for transient resources + new high level API Changelists integrated: 3368830 3368887 3377762 3377763 3379513 3381840 3382046 3382138 3385390 3385391 3385531 3396613 3388752 3396756 3397007 3397059 3397780 3397883 3401716 3415179 Change 3451460 on 2017/05/22 by Ben.Woodhouse Fix editor crash (NULL dereference of ScreenSpaceShadowTexture) when moving the camera around in tm-shadermodels, probably fallout from the VRAM aliasing merge. Not sure if this is the correct fix, but it prevents the crash for now Change 3451601 on 2017/05/22 by Josh.Adams - Track idle time from MaxTickRate, so that stat unit is accurate on Game: thread Change 3452025 on 2017/05/22 by Ben.Woodhouse Integrate (as edit) CL 3378734 (editor crash fix) Also add a check for null in LightFunctionRendering.cpp Change 3452389 on 2017/05/22 by Josh.Adams - Replaced POCulturePluralForms with a static array, instead of TMapBuilder (was blowing stack or similar on Switch Debug). Code courtesy of Jamie Dale. Change 3452758 on 2017/05/22 by Joe.Barnes Add FindFirstClearBit() and FindFirstSetBit() to TStaticBitArray. Change 3455889 on 2017/05/23 by Ben.Woodhouse Integrate from //UE4/Main/...@3453436 to //UE4/Dev-Console/... Change 3458654 on 2017/05/25 by Joe.Conley Attempting to fix Static Analysis warning. Change 3462710 on 2017/05/26 by Ben.Woodhouse Integrate from //UE4/Main/...@3461688 to //UE4/Dev-Console/... Change 3471711 on 2017/06/02 by Jonathan.Fitzpatrick Updating MallocProfiler to use the accessor for OnOutOfMemory delegate to conform with change made in CL 3415996. Change 3473813 on 2017/06/05 by Ben.Woodhouse Fix streaming visibility logic bug reported on UDN #jira UE-43892 Change 3475298 on 2017/06/06 by Luke.Thatcher [CONSOLE] [!] Fix RHITransitionResources crash with more than 16 textures. - Old command had a fixed sized array of 16 textures that would overflow. - New command allocates an array of texture pointers inline in the command list, so any number is supported. #jira UE-45625 Change 3476776 on 2017/06/06 by Ben.Woodhouse Integrate from //UE4/Main/...@3475908 Change 3479083 on 2017/06/07 by Ben.Woodhouse Integrate as edit CL 3467315 from dev-animphys: From Alexis Matte. Ensure SectionMap is fixed up for old entries that are no longer valid. #JIRA UE-45438 #jira UE-45735 Change 3480576 on 2017/06/08 by Ben.Woodhouse Integrate from //UE4/Main/...@3480024 to //UE4/Dev-Console/... [CL 3483258 by Luke Thatcher in Main branch]
2017-06-09 17:44:13 -04:00
}
if (EnumHasAnyFlags(Desc.Flags, TexCreate_Transient) && bAllowMultipleDiscards == false && Element->HasBeenDiscardedThisFrame())
{
// We can't re-use transient resources if they've already been discarded this frame
continue;
}
const FPooledRenderTargetDesc& ElementDesc = Element->GetDesc();
if (bExactMatch && ElementDesc.Flags != Desc.Flags)
{
continue;
}
Found = Element;
FoundIndex = Index;
bReusingExistingTarget = true;
goto Done;
}
}
}
}
Copying //UE4/Dev-Console to //UE4/Dev-Main (Source: //UE4/Dev-Console @ 3378220) #lockdown Nick.Penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 3301794 on 2017/02/14 by Josh.Adams Fixed a crash with clothing on platforms that don't support NV_CLOTH Change 3302696 on 2017/02/14 by Chad.Garyet adding dev-console json Change 3306418 on 2017/02/16 by Ben.Woodhouse Fix prepass/basepass zfighting, caused by bad vertex welding in depth-only indexbuffer. Requires bumping the staticmesh DDC key Duplicated from Fortnite/Main CL 3302965 #jira UE-34332 Change 3308922 on 2017/02/17 by Josh.Adams - Disabled the game analytics anon usage data sent to Epic on the console platforms Change 3311506 on 2017/02/20 by Keith.Judge Replicate fix for FD3D12UniqueDescriptorTable leak in async compute contexts from another branch. Change 3313445 on 2017/02/20 by Josh.Adams - Various Vulkan fixes: - Compiles in Linux - Many cubemap bugs squashed - Changed the scratch reflection cubemap clear to SetRenderTargestsAndClear, instead of SetRenderTarget() / Clear() - Added compute fences Change 3314916 on 2017/02/21 by Josh.Adams - Fixed an issue with 4 and 8 vertex instanced particles using the wrong VertexFactory objects (D3D didn't even need separate VFs due to the VertexDecl updating the stride at draw call time) Change 3315398 on 2017/02/21 by Ben.Woodhouse Fix GPUTestbed packaging Change 3316340 on 2017/02/22 by Ben.Woodhouse Duplicate hotfix from Release-4.15: CL 3316322 Fix for GPU Cubemap copy crash - Guard for invalid indices before marking cubemap indices as removed #jira UE-42165 Change 3317345 on 2017/02/22 by Ben.Woodhouse Integrate from //UE4/Main/...@3316239 Change 3319186 on 2017/02/23 by Josh.Adams Added /VIRTUALIZEDIRECTX option to XgConsole for XGE shader compiling to work on remote machines without DX installed Change 3323514 on 2017/02/27 by Chad.Garyet adding populate ddc for dev-console, removing RDU agent type Change 3335889 on 2017/03/07 by Luke.Thatcher [CONSOLE] [STREAMS] [^] Merge //UE4/Main (CL 3335229) to //UE4/Dev-Console #tests Build Win64 Editor, run QAGame editor, Launch on PS4. Change 3336550 on 2017/03/07 by Ben.Woodhouse Duplicate CL 3336456 #jira UE-42468 Fix a bug in the rendertargetpool handling of fastVRAM targets, reported on UDN Change 3340385 on 2017/03/09 by Ben.Woodhouse Optimized fastVRAM layout and configurability. CVars can be configured based title rendering requirements and resolution With these changes, we try to store the GBuffer in Fast VRAM if possible. Transient/non perf critical surfaces are now disabled by default In content w/ dynamic lighting @ 900p we see a 1.8ms gain. In RenderTestMap QAGame @ 1080p we see 0.4ms gains (further improvements may be possible with additional tweaking). Change 3355982 on 2017/03/21 by Ben.Woodhouse Duplicate from CL 3354688: Fix async SSAO not actually running asynchronously. This was because bHZBBeforeBasePass was set to false even though we had a full prepass (EDepthDrawingMode::DDM_AllOpaque), so we didn't process it until after the basepass. This saved 0.6ms in GPUTestbed Change 3356166 on 2017/03/21 by Ben.Woodhouse Duplicate from 3347033 Subsurface postprocess optimization, courtesy of Mike O'Connor at Iron Galaxy Studios. Add a branch to reduce bandwidth. Halved the cost of the setup pass according to PIX (0.3ms to 0.15ms) Change 3360243 on 2017/03/23 by Luke.Thatcher [CONSOLE] [STREAMS] [^] Merge //UE4/Main (CL 3358685) to //UE4/Dev-Console #tests Build Win64 Editor, run FortGPUTestbed editor, Launch on PS4. Change 3365746 on 2017/03/27 by Joe.Barnes - Handle NULL source data. - Log failed surround conversion. Change 3368022 on 2017/03/28 by Ben.Woodhouse Cherry pick reflection capture hotfix from release-4.15 CL 3365830: Fixed reflection capture crash when repeatedly adding/removing captures Previously we used an array of indices (CubemapIndicesRemovedSinceLastRealloc) to keep track of indices which had been removed, however this caused issues when those indices were reused by subsequent allocations before the array was reallocated The new method uses a simple bitfield to track usage (one bit per cubemap slot index). Also fixed order(N^2) index search in the index allocator - now just a fast bit scan #jira UE-42165 #jira UE-42911 Change 3371568 on 2017/03/30 by Luke.Thatcher [CONSOLE] [STREAMS] [^] Merging //UE4/Dev-Main (CL 3371054) to Dev-Console (//UE4/Dev-Console) Change 3372780 on 2017/03/30 by Joe.Barnes Add support for multi-channel ADPCM encoding. Format based on game side ADPCM decompressor. Change 3374847 on 2017/03/31 by Ben.Woodhouse Fix shipping warning #jira UE-43522 Change 3376442 on 2017/04/03 by Ben.Woodhouse Fix FortGPUTestbed animnotify cook errors (delete the offending animnotifies) [CL 3378288 by Luke Thatcher in Main branch]
2017-04-04 09:10:29 -04:00
Done:
if (!Found)
{
TRACE_CPUPROFILER_EVENT_SCOPE(FRenderTargetPool::CreateTexture);
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
Copying //UE4/Dev-Console to //UE4/Dev-Main (Source: //UE4/Dev-Console @ 3483086) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3389969 on 2017/04/12 by Guillaume.Abadie Implements FDebug::DumpStackTraceToLog() debugging utility. Change 3391579 on 2017/04/12 by Joe.Barnes Fix minor spacing issue. Change 3402629 on 2017/04/20 by Ben.Marsh Build: Remove job to populate the DDC. Trying out a new system for this. Change 3417501 on 2017/05/01 by Joe.Barnes IWYU - Missing #include files. Change 3419927 on 2017/05/02 by Joe.Barnes - Support custom LOD for shadow map generation only (r.ForceLODShadow) - New #define to expose forceLOD and forceLODShadow also in Test/Ship builds (#define EXPOSE_FORCE_LOD 1 in RenderCore.cpp). Not exposed by default. Change 3420964 on 2017/05/03 by Jonathan.Fitzpatrick Fixed null dereference of LineBatcher when using DrawDebugSphere and DrawDebugAltCone #jira UE-30213 Change 3423470 on 2017/05/04 by Luke.Thatcher [CONSOLE] [STREAMS] [^] Merging //UE4/Dev-Main (CL 3391974) to Dev-Console (//UE4/Dev-Console) - Compile errors in Switch, to be fixed after check-in. Change 3430410 on 2017/05/09 by Ben.Woodhouse Fix uninitialized local variable causing crashes in Test #jira UE-44832 Change 3430506 on 2017/05/09 by Josh.Adams - Fixed up the editor platforms' method of loading TargetSettings objects so that we don't need any manual parsing of .ini files to fill out the class defaults Change 3434035 on 2017/05/10 by Ben.Woodhouse Integrate updated FortGPUTestbed from Fortnite/Main Change 3437046 on 2017/05/12 by Joe.Barnes Fix for clang producing a warning when not all specializations of a templated function are marked FORCEINLINE. Also, switch a specialization of BlendTransform() from a function with a check to just a declaration so compiler will catch error instead of a runtime catch. Change 3437259 on 2017/05/12 by Joe.Barnes Fix for clang producing a warning when not all specializations of a templated function are marked FORCEINLINE. Also, switch a specialization of BlendTransform() from a function with a check to just a declaration so compiler will catch error instead of a runtime catch. Change 3440758 on 2017/05/16 by Ben.Woodhouse Simple threaded CSV Profiler To capture: - On the commandline, add -csvCaptureFrames=N to capture N frames from startup - On the console, use csvprofile start, csvprofile stop or csvprofile frames=N to capture a fixed number of frames - Instrument with CSV_SCOPED_STAT(statname), CSV_CUSTOM_STAT(statname,value). CSV capture is enabled in all builds except shipping - Please do not check in the instrumentation √ we don╞t want to pollute the engine with lots of additional instrumentation. We may add some minimal level of instrumentation at some point Change 3440954 on 2017/05/16 by Josh.Adams - Cleaned up some DeviceProfiles in BaseDP.ini Change 3443778 on 2017/05/17 by Ben.Woodhouse Aliasing for transient resources + new high level API Changelists integrated: 3368830 3368887 3377762 3377763 3379513 3381840 3382046 3382138 3385390 3385391 3385531 3396613 3388752 3396756 3397007 3397059 3397780 3397883 3401716 3415179 Change 3451460 on 2017/05/22 by Ben.Woodhouse Fix editor crash (NULL dereference of ScreenSpaceShadowTexture) when moving the camera around in tm-shadermodels, probably fallout from the VRAM aliasing merge. Not sure if this is the correct fix, but it prevents the crash for now Change 3451601 on 2017/05/22 by Josh.Adams - Track idle time from MaxTickRate, so that stat unit is accurate on Game: thread Change 3452025 on 2017/05/22 by Ben.Woodhouse Integrate (as edit) CL 3378734 (editor crash fix) Also add a check for null in LightFunctionRendering.cpp Change 3452389 on 2017/05/22 by Josh.Adams - Replaced POCulturePluralForms with a static array, instead of TMapBuilder (was blowing stack or similar on Switch Debug). Code courtesy of Jamie Dale. Change 3452758 on 2017/05/22 by Joe.Barnes Add FindFirstClearBit() and FindFirstSetBit() to TStaticBitArray. Change 3455889 on 2017/05/23 by Ben.Woodhouse Integrate from //UE4/Main/...@3453436 to //UE4/Dev-Console/... Change 3458654 on 2017/05/25 by Joe.Conley Attempting to fix Static Analysis warning. Change 3462710 on 2017/05/26 by Ben.Woodhouse Integrate from //UE4/Main/...@3461688 to //UE4/Dev-Console/... Change 3471711 on 2017/06/02 by Jonathan.Fitzpatrick Updating MallocProfiler to use the accessor for OnOutOfMemory delegate to conform with change made in CL 3415996. Change 3473813 on 2017/06/05 by Ben.Woodhouse Fix streaming visibility logic bug reported on UDN #jira UE-43892 Change 3475298 on 2017/06/06 by Luke.Thatcher [CONSOLE] [!] Fix RHITransitionResources crash with more than 16 textures. - Old command had a fixed sized array of 16 textures that would overflow. - New command allocates an array of texture pointers inline in the command list, so any number is supported. #jira UE-45625 Change 3476776 on 2017/06/06 by Ben.Woodhouse Integrate from //UE4/Main/...@3475908 Change 3479083 on 2017/06/07 by Ben.Woodhouse Integrate as edit CL 3467315 from dev-animphys: From Alexis Matte. Ensure SectionMap is fixed up for old entries that are no longer valid. #JIRA UE-45438 #jira UE-45735 Change 3480576 on 2017/06/08 by Ben.Woodhouse Integrate from //UE4/Main/...@3480024 to //UE4/Dev-Console/... [CL 3483258 by Luke Thatcher in Main branch]
2017-06-09 17:44:13 -04:00
Found = new FPooledRenderTarget(Desc, this);
PooledRenderTargets.Add(Found);
PooledRenderTargetHashes.Add(DescHash);
// TexCreate_UAV should be used on Desc.TargetableFlags
check(!EnumHasAnyFlags(Desc.Flags, TexCreate_UAV));
FRHIResourceCreateInfo CreateInfo(InDebugName, Desc.ClearValue);
if (EnumHasAnyFlags(Desc.TargetableFlags, TexCreate_RenderTargetable | TexCreate_DepthStencilTargetable | TexCreate_UAV))
{
// Only create resources if we're not asked to defer creation.
if (Desc.Is2DTexture())
{
Copying //UE4/Dev-VR to //UE4/Dev-Main (Source: //UE4/Dev-VR @ 3145687) #lockdown Nick.Penwarden #rb Merge ========================== MAJOR FEATURES + CHANGES ========================== Change 3094167 on 2016/08/18 by Jeff.Fisher UEVR-97 Morpheus HMD tracking needs to wait until HMD is fully tracked. -Morpheus CALIBRATING/NOT_TRACKED tracking state hmd orientation update disabled and delegates added to present instructions to the user. This behavior is controlled by morpheus ini setting bDisableHMDOrientationUntilHMDHasBeenTracked, but defaulted to true to avoid subtly bad user experiences. #review-3094106 @chad.taylor #jira UEVR-97 Change 3104799 on 2016/08/29 by Jeff.Fisher UEVR-178 Morpheus HMD Black crescents -Switched reprojection frame time for 60/120 mode from 120hz to 60hz so we much better predict where the hmd will be pointing when the frame we are about to render is actually displayed, and are run off the edge of it less often and less severely. This makes the black crescent artifacts only just visible during very fast head turning. The kWrapModeMirror change, which will be submitted separately, makes the left and right crescents invisible to me. -Renamed the functions for setting the prediction info in the PS4Tracker. -Added render frame parameters to sony reprojection functions, these can help with debugging reprojection. -Added commented out sce call to get the reprojection debug data. Not allowed to submit an executable that calls it, but its nice to at least know where one can put it. May improve this later. -Wrapped PS4Tracker->Synchronize call in a check that the tracker handle is valid, because I managed to get it called when it wasn't (probably during hmd power off testing, but I don't remember now). It should be fine to not do it if the tracker is not functioning. #review-3104780 chad.taylor #jira UEVR-178 Change 3108423 on 2016/08/31 by Jeff.Fisher Morpheus Config Improvements. -UEVR-138 Morpheus HMD reprojection wrap mode config setting -Can now switch between wrap mode Mirror and ClampToBorder. Mirror is the default. -Made bDisableHMDOrientationUntilHMDHasBeenTracked editable in UE4Editor project settings. -Using generic project setting for bStartInVR, removed the morpheus specific one. #jira UEVR-138 #review-3106999 @nick.whiting Change 3111231 on 2016/09/01 by Jeff.Fisher Fixed bStartInVR ini setting. -Initial implementation worked via a generic EnableStereo call, which worked, but happened after the hmd setup dialog, which is not what I wanted. -Also fixed a tracking frame mismatch assert that hit when I powered the hmd off once, causing it to lose tracking. Its ok that it doesn't update in that circumstance. #review-3111211 @ryan.vance Change 3115196 on 2016/09/06 by Keli.Hlodversson #jira UEVR-128 Map move controller Select button to Invalid, as it is always handled by the system Change 3116425 on 2016/09/07 by Chad.Taylor PSVR: stereo layers implementation Change 3116593 on 2016/09/07 by Jeff.Fisher UEVR-126 Morpheus HMD connect dialog cancel reactions -VR only apps can't allow the player to cancel out of the hmd setup dialog, so lets just pop the dialog up again (sony were ok with a licencee doing this) if an ini setting says to do that. -VR/2D apps might want to switch to 2d if the player cancels out of the hmd setup dialog, so there is an ini setting for that. -A delegate only implementation is also provided for apps that want to do something else. This leaves the game rendering in VR mode, and fires the delegate. -Refactored to better separate successful HMD acquisition from stereo rendering. This was necessary to support the delegate only option on startup. If you start in vr mode with your hmd off and cancel the dialog stereo rendering now starts with default values for the hmd hardware stats (as read from my pvt) instead of crashing trying to use uninitialized data. When an hmd is connected its values will be read. -Refactored to ensure reprojection starts immediately when we call StartReprojection. #jira UEVR-126 #review-3116221 Change 3116754 on 2016/09/07 by Keli.Hlodversson bPixelDensityAdaptive is a bool and not a float property Change 3117692 on 2016/09/08 by Jeff.Fisher UEVR-135 Morpheus HMD recent feature error reporting UEVR-173 2DVR flexibility (UTexture) -Error log for sceHmdReprojectionSetOutputMinColor failure. -Made the parameter for 2dVR a UTexture* instead of a UTexture2D*, so it can be a rendertarget, etc. -Added error logs for missing texture, invalid texture, wrong texture format to 2DVR. #jira UEVR-135 #jira UEVR-173 #review-3116955 @keli.hloedversson Change 3117990 on 2016/09/08 by Jeff.Fisher UEVR-127 Morpheus HMD removal reaction -Added VRHeadsetPutOnHead and VRHeadsetRemovedFromHead delegates, and implemented them for Morpheus. #jira UEVR-127 #review-3117968 @keli.hlodversson Change 3120198 on 2016/09/09 by Jeff.Fisher MorpheusReprojector frame complete wait error log -Now log a warning if the sceKernalWaitEqueue returns an error. It not a problem if this happens rarely, but something is very broken if it starts happening continuously. Change 3121754 on 2016/09/12 by Keli.Hlodversson #jira UE-21878 - Also emit VR initialization analytics events in the editor. Change 3122311 on 2016/09/12 by Nick.Whiting Merging fix for Adreno devices rendering black from 4.13.1 Change 3123057 on 2016/09/13 by Keli.Hlodversson #jira UE-30097 Use the current value of r.ScreenPercentage on Occulus Rift if it's explicitly set. * If the SetBy part of the flags for the console var is SetBy_Constructor, then ignore the value. * If it's SetBy_Scalability, then ignore it if it equals 100 * Else, call SetScreenPercentage using the current value The obsolete HMD SCREENPERCENTAGE console command is still available and will override the setting until r.ScreenPercentage is modified the next time. Change 3123200 on 2016/09/13 by Chad.Taylor PS4 Stereo Layer double buffering. Since the overlays are reprojected at 120hz but rendered at 60hz we need to render to a separate buffer than the one being used by reprojection. Change 3125845 on 2016/09/14 by Keli.Hlodversson #jira UE-33996 Add hmd=<name> command line option to allow overriding which HMD module is used. Renamed GetModulePriorityKeyName to simply GetModuleKeyName, as this name is now also used to match against the command line options. Change 3127293 on 2016/09/15 by Jeff.Fisher UEVR-225 Morpheus HMD top and bottom black crescents -The hidden and visible area meshes for morpheus were too restrictive. Nudged them out a bit, no black crescents at the top and bottom of the screen. We are rendering a few more pixels now though. #review-3127145 @ryan.vance #jira UEVR-225 Change 3130635 on 2016/09/19 by Jeff.Fisher UEVR-226 Morpheus HMD mirrored fill wrong on outer edges -The setting was never being used, leaving the wrap mode at 0 aka kWrapModeWrap. -Refactored how the setting is applied so it works, and is less convoluted. #jira UEVR-226 #review-3129403 Change 3131615 on 2016/09/19 by Keli.Hlodversson #jira UE-29341. Update Chaperone bounds when SteamVR tells us they have changed Change 3136527 on 2016/09/22 by Keli.Hlodversson Don't depend on the current state of the VR subsystem when exiting PIE mode to decide whether the main window should be restored. Instead always restore it if it was minimized at the start. Change 3136652 on 2016/09/22 by Keli.Hlodversson Allow shutting down Steam VR subsystem without shutting down the Steam VR plugin completely in response to quitting from the SteamVR overlay. Enabling stereo rendering again will reinitialize SteamVR. This is useful when using PIE in VR mode as it allows entereing it again without restarting the editor. Also fixes crashes by first disabinge stereo rendering a short while before shutting down the VR subsystem. #jira UE-35940 Change 3138901 on 2016/09/23 by Ryan.Vance Merging 3138521 using OdinToDevVR to bring over temporary forward lighting ISR changes for 4.14 Change 3141614 on 2016/09/27 by Keli.Hlodversson Implement GetNumOfTrackingSensors and GetTrackingSensorProperties on SteamVR. #jira UE-32994 Change 3141948 on 2016/09/27 by Jeff.Fisher UEVR-242 Is AddControllerYawInput not allowed when morpheus is enabled? -Indeed it did not work. Looks like morpheus would not accumulate the yaw, so it would be reset every frame. I made the implementation of ApplyHmdRotation very similar to the one used for occulus (also similar to other platforms) to fix this. #jira UEVR-242 #review-3141933 keli.hlodversson Change 3143484 on 2016/09/28 by Nick.Whiting Integrating Oculus 1.8 SDK support, includes support for cylinder and cubemap stereo layers Change 3143517 on 2016/09/28 by Chad.Taylor Merging PS4Tracker fixes from Release-4.13 into Dev-VR Change 3143805 on 2016/09/28 by Keli.Hlodversson #jira UE-36478 Workaround to make world to meters scale apply correctly to Occulus controllers while running in PIE Change 3143943 on 2016/09/28 by Nick.Whiting Merging latest drop from OSVR Change 3144221 on 2016/09/28 by Keli.Hlodversson Implement GetTrackingSensorProperties on PS4 #jira UE-32994 Change 3144352 on 2016/09/28 by Ryan.Vance Initial implementation of mobile multi-view. This is non-functioning and requires a lot more work, but enough of the framework exists to make the 4.14 branch for an experimental release. Change 3144585 on 2016/09/29 by Jeff.Fisher UEVR-14 PSVR Support for 90Hz to 90Hz, and 120Hz to 120Hz -Enum setting added for the three frame sequences. -90Hz mode is trying to run camera updates at 90hz, but they can only run at 60 so every third one fails. This works, but its dubious. -Feature marked as experimental for now because of that 90hz tracking issue, and the lack of testing. -Defaulting to 60/120. #jira UEVR-14 #review-3143486 chad.taylor nick.whiting Change 3145263 on 2016/09/29 by Nick.Whiting Fix for constructor initialization order in StereoLayerComponent, which threw a warning on Clang Change 3145536 on 2016/09/29 by Nick.Whiting Fixes for project files to prevent mystery pop up from CAPI Change 3145663 on 2016/09/29 by Keli.Hlodversson PSVR: Make sure the camera orientation returned from GetTrackingSensorProperties points in the right direction. Change 3145670 on 2016/09/29 by Keli.Hlodversson For some reason the orientation of the Oculus tracking sensor is reported as pointing backwards. This flips it around to face front Change 3145687 on 2016/09/29 by Chad.Taylor VR splash screen support [CL 3146243 by Nick Whiting in Main branch]
2016-09-30 01:16:13 -04:00
if (!Desc.IsArray())
{
RHICreateTargetableShaderResource2D(
Desc.Extent.X,
Desc.Extent.Y,
Desc.Format,
Desc.NumMips,
Desc.Flags,
Desc.TargetableFlags,
Desc.bForceSeparateTargetAndShaderResource,
Desc.bForceSharedTargetAndShaderResource,
Copying //UE4/Dev-VR to //UE4/Dev-Main (Source: //UE4/Dev-VR @ 3145687) #lockdown Nick.Penwarden #rb Merge ========================== MAJOR FEATURES + CHANGES ========================== Change 3094167 on 2016/08/18 by Jeff.Fisher UEVR-97 Morpheus HMD tracking needs to wait until HMD is fully tracked. -Morpheus CALIBRATING/NOT_TRACKED tracking state hmd orientation update disabled and delegates added to present instructions to the user. This behavior is controlled by morpheus ini setting bDisableHMDOrientationUntilHMDHasBeenTracked, but defaulted to true to avoid subtly bad user experiences. #review-3094106 @chad.taylor #jira UEVR-97 Change 3104799 on 2016/08/29 by Jeff.Fisher UEVR-178 Morpheus HMD Black crescents -Switched reprojection frame time for 60/120 mode from 120hz to 60hz so we much better predict where the hmd will be pointing when the frame we are about to render is actually displayed, and are run off the edge of it less often and less severely. This makes the black crescent artifacts only just visible during very fast head turning. The kWrapModeMirror change, which will be submitted separately, makes the left and right crescents invisible to me. -Renamed the functions for setting the prediction info in the PS4Tracker. -Added render frame parameters to sony reprojection functions, these can help with debugging reprojection. -Added commented out sce call to get the reprojection debug data. Not allowed to submit an executable that calls it, but its nice to at least know where one can put it. May improve this later. -Wrapped PS4Tracker->Synchronize call in a check that the tracker handle is valid, because I managed to get it called when it wasn't (probably during hmd power off testing, but I don't remember now). It should be fine to not do it if the tracker is not functioning. #review-3104780 chad.taylor #jira UEVR-178 Change 3108423 on 2016/08/31 by Jeff.Fisher Morpheus Config Improvements. -UEVR-138 Morpheus HMD reprojection wrap mode config setting -Can now switch between wrap mode Mirror and ClampToBorder. Mirror is the default. -Made bDisableHMDOrientationUntilHMDHasBeenTracked editable in UE4Editor project settings. -Using generic project setting for bStartInVR, removed the morpheus specific one. #jira UEVR-138 #review-3106999 @nick.whiting Change 3111231 on 2016/09/01 by Jeff.Fisher Fixed bStartInVR ini setting. -Initial implementation worked via a generic EnableStereo call, which worked, but happened after the hmd setup dialog, which is not what I wanted. -Also fixed a tracking frame mismatch assert that hit when I powered the hmd off once, causing it to lose tracking. Its ok that it doesn't update in that circumstance. #review-3111211 @ryan.vance Change 3115196 on 2016/09/06 by Keli.Hlodversson #jira UEVR-128 Map move controller Select button to Invalid, as it is always handled by the system Change 3116425 on 2016/09/07 by Chad.Taylor PSVR: stereo layers implementation Change 3116593 on 2016/09/07 by Jeff.Fisher UEVR-126 Morpheus HMD connect dialog cancel reactions -VR only apps can't allow the player to cancel out of the hmd setup dialog, so lets just pop the dialog up again (sony were ok with a licencee doing this) if an ini setting says to do that. -VR/2D apps might want to switch to 2d if the player cancels out of the hmd setup dialog, so there is an ini setting for that. -A delegate only implementation is also provided for apps that want to do something else. This leaves the game rendering in VR mode, and fires the delegate. -Refactored to better separate successful HMD acquisition from stereo rendering. This was necessary to support the delegate only option on startup. If you start in vr mode with your hmd off and cancel the dialog stereo rendering now starts with default values for the hmd hardware stats (as read from my pvt) instead of crashing trying to use uninitialized data. When an hmd is connected its values will be read. -Refactored to ensure reprojection starts immediately when we call StartReprojection. #jira UEVR-126 #review-3116221 Change 3116754 on 2016/09/07 by Keli.Hlodversson bPixelDensityAdaptive is a bool and not a float property Change 3117692 on 2016/09/08 by Jeff.Fisher UEVR-135 Morpheus HMD recent feature error reporting UEVR-173 2DVR flexibility (UTexture) -Error log for sceHmdReprojectionSetOutputMinColor failure. -Made the parameter for 2dVR a UTexture* instead of a UTexture2D*, so it can be a rendertarget, etc. -Added error logs for missing texture, invalid texture, wrong texture format to 2DVR. #jira UEVR-135 #jira UEVR-173 #review-3116955 @keli.hloedversson Change 3117990 on 2016/09/08 by Jeff.Fisher UEVR-127 Morpheus HMD removal reaction -Added VRHeadsetPutOnHead and VRHeadsetRemovedFromHead delegates, and implemented them for Morpheus. #jira UEVR-127 #review-3117968 @keli.hlodversson Change 3120198 on 2016/09/09 by Jeff.Fisher MorpheusReprojector frame complete wait error log -Now log a warning if the sceKernalWaitEqueue returns an error. It not a problem if this happens rarely, but something is very broken if it starts happening continuously. Change 3121754 on 2016/09/12 by Keli.Hlodversson #jira UE-21878 - Also emit VR initialization analytics events in the editor. Change 3122311 on 2016/09/12 by Nick.Whiting Merging fix for Adreno devices rendering black from 4.13.1 Change 3123057 on 2016/09/13 by Keli.Hlodversson #jira UE-30097 Use the current value of r.ScreenPercentage on Occulus Rift if it's explicitly set. * If the SetBy part of the flags for the console var is SetBy_Constructor, then ignore the value. * If it's SetBy_Scalability, then ignore it if it equals 100 * Else, call SetScreenPercentage using the current value The obsolete HMD SCREENPERCENTAGE console command is still available and will override the setting until r.ScreenPercentage is modified the next time. Change 3123200 on 2016/09/13 by Chad.Taylor PS4 Stereo Layer double buffering. Since the overlays are reprojected at 120hz but rendered at 60hz we need to render to a separate buffer than the one being used by reprojection. Change 3125845 on 2016/09/14 by Keli.Hlodversson #jira UE-33996 Add hmd=<name> command line option to allow overriding which HMD module is used. Renamed GetModulePriorityKeyName to simply GetModuleKeyName, as this name is now also used to match against the command line options. Change 3127293 on 2016/09/15 by Jeff.Fisher UEVR-225 Morpheus HMD top and bottom black crescents -The hidden and visible area meshes for morpheus were too restrictive. Nudged them out a bit, no black crescents at the top and bottom of the screen. We are rendering a few more pixels now though. #review-3127145 @ryan.vance #jira UEVR-225 Change 3130635 on 2016/09/19 by Jeff.Fisher UEVR-226 Morpheus HMD mirrored fill wrong on outer edges -The setting was never being used, leaving the wrap mode at 0 aka kWrapModeWrap. -Refactored how the setting is applied so it works, and is less convoluted. #jira UEVR-226 #review-3129403 Change 3131615 on 2016/09/19 by Keli.Hlodversson #jira UE-29341. Update Chaperone bounds when SteamVR tells us they have changed Change 3136527 on 2016/09/22 by Keli.Hlodversson Don't depend on the current state of the VR subsystem when exiting PIE mode to decide whether the main window should be restored. Instead always restore it if it was minimized at the start. Change 3136652 on 2016/09/22 by Keli.Hlodversson Allow shutting down Steam VR subsystem without shutting down the Steam VR plugin completely in response to quitting from the SteamVR overlay. Enabling stereo rendering again will reinitialize SteamVR. This is useful when using PIE in VR mode as it allows entereing it again without restarting the editor. Also fixes crashes by first disabinge stereo rendering a short while before shutting down the VR subsystem. #jira UE-35940 Change 3138901 on 2016/09/23 by Ryan.Vance Merging 3138521 using OdinToDevVR to bring over temporary forward lighting ISR changes for 4.14 Change 3141614 on 2016/09/27 by Keli.Hlodversson Implement GetNumOfTrackingSensors and GetTrackingSensorProperties on SteamVR. #jira UE-32994 Change 3141948 on 2016/09/27 by Jeff.Fisher UEVR-242 Is AddControllerYawInput not allowed when morpheus is enabled? -Indeed it did not work. Looks like morpheus would not accumulate the yaw, so it would be reset every frame. I made the implementation of ApplyHmdRotation very similar to the one used for occulus (also similar to other platforms) to fix this. #jira UEVR-242 #review-3141933 keli.hlodversson Change 3143484 on 2016/09/28 by Nick.Whiting Integrating Oculus 1.8 SDK support, includes support for cylinder and cubemap stereo layers Change 3143517 on 2016/09/28 by Chad.Taylor Merging PS4Tracker fixes from Release-4.13 into Dev-VR Change 3143805 on 2016/09/28 by Keli.Hlodversson #jira UE-36478 Workaround to make world to meters scale apply correctly to Occulus controllers while running in PIE Change 3143943 on 2016/09/28 by Nick.Whiting Merging latest drop from OSVR Change 3144221 on 2016/09/28 by Keli.Hlodversson Implement GetTrackingSensorProperties on PS4 #jira UE-32994 Change 3144352 on 2016/09/28 by Ryan.Vance Initial implementation of mobile multi-view. This is non-functioning and requires a lot more work, but enough of the framework exists to make the 4.14 branch for an experimental release. Change 3144585 on 2016/09/29 by Jeff.Fisher UEVR-14 PSVR Support for 90Hz to 90Hz, and 120Hz to 120Hz -Enum setting added for the three frame sequences. -90Hz mode is trying to run camera updates at 90hz, but they can only run at 60 so every third one fails. This works, but its dubious. -Feature marked as experimental for now because of that 90hz tracking issue, and the lack of testing. -Defaulting to 60/120. #jira UEVR-14 #review-3143486 chad.taylor nick.whiting Change 3145263 on 2016/09/29 by Nick.Whiting Fix for constructor initialization order in StereoLayerComponent, which threw a warning on Clang Change 3145536 on 2016/09/29 by Nick.Whiting Fixes for project files to prevent mystery pop up from CAPI Change 3145663 on 2016/09/29 by Keli.Hlodversson PSVR: Make sure the camera orientation returned from GetTrackingSensorProperties points in the right direction. Change 3145670 on 2016/09/29 by Keli.Hlodversson For some reason the orientation of the Oculus tracking sensor is reported as pointing backwards. This flips it around to face front Change 3145687 on 2016/09/29 by Chad.Taylor VR splash screen support [CL 3146243 by Nick Whiting in Main branch]
2016-09-30 01:16:13 -04:00
CreateInfo,
(FTexture2DRHIRef&)Found->RenderTargetItem.TargetableTexture,
(FTexture2DRHIRef&)Found->RenderTargetItem.ShaderResourceTexture,
Desc.NumSamples
);
Copying //UE4/Dev-VR to //UE4/Dev-Main (Source: //UE4/Dev-VR @ 3145687) #lockdown Nick.Penwarden #rb Merge ========================== MAJOR FEATURES + CHANGES ========================== Change 3094167 on 2016/08/18 by Jeff.Fisher UEVR-97 Morpheus HMD tracking needs to wait until HMD is fully tracked. -Morpheus CALIBRATING/NOT_TRACKED tracking state hmd orientation update disabled and delegates added to present instructions to the user. This behavior is controlled by morpheus ini setting bDisableHMDOrientationUntilHMDHasBeenTracked, but defaulted to true to avoid subtly bad user experiences. #review-3094106 @chad.taylor #jira UEVR-97 Change 3104799 on 2016/08/29 by Jeff.Fisher UEVR-178 Morpheus HMD Black crescents -Switched reprojection frame time for 60/120 mode from 120hz to 60hz so we much better predict where the hmd will be pointing when the frame we are about to render is actually displayed, and are run off the edge of it less often and less severely. This makes the black crescent artifacts only just visible during very fast head turning. The kWrapModeMirror change, which will be submitted separately, makes the left and right crescents invisible to me. -Renamed the functions for setting the prediction info in the PS4Tracker. -Added render frame parameters to sony reprojection functions, these can help with debugging reprojection. -Added commented out sce call to get the reprojection debug data. Not allowed to submit an executable that calls it, but its nice to at least know where one can put it. May improve this later. -Wrapped PS4Tracker->Synchronize call in a check that the tracker handle is valid, because I managed to get it called when it wasn't (probably during hmd power off testing, but I don't remember now). It should be fine to not do it if the tracker is not functioning. #review-3104780 chad.taylor #jira UEVR-178 Change 3108423 on 2016/08/31 by Jeff.Fisher Morpheus Config Improvements. -UEVR-138 Morpheus HMD reprojection wrap mode config setting -Can now switch between wrap mode Mirror and ClampToBorder. Mirror is the default. -Made bDisableHMDOrientationUntilHMDHasBeenTracked editable in UE4Editor project settings. -Using generic project setting for bStartInVR, removed the morpheus specific one. #jira UEVR-138 #review-3106999 @nick.whiting Change 3111231 on 2016/09/01 by Jeff.Fisher Fixed bStartInVR ini setting. -Initial implementation worked via a generic EnableStereo call, which worked, but happened after the hmd setup dialog, which is not what I wanted. -Also fixed a tracking frame mismatch assert that hit when I powered the hmd off once, causing it to lose tracking. Its ok that it doesn't update in that circumstance. #review-3111211 @ryan.vance Change 3115196 on 2016/09/06 by Keli.Hlodversson #jira UEVR-128 Map move controller Select button to Invalid, as it is always handled by the system Change 3116425 on 2016/09/07 by Chad.Taylor PSVR: stereo layers implementation Change 3116593 on 2016/09/07 by Jeff.Fisher UEVR-126 Morpheus HMD connect dialog cancel reactions -VR only apps can't allow the player to cancel out of the hmd setup dialog, so lets just pop the dialog up again (sony were ok with a licencee doing this) if an ini setting says to do that. -VR/2D apps might want to switch to 2d if the player cancels out of the hmd setup dialog, so there is an ini setting for that. -A delegate only implementation is also provided for apps that want to do something else. This leaves the game rendering in VR mode, and fires the delegate. -Refactored to better separate successful HMD acquisition from stereo rendering. This was necessary to support the delegate only option on startup. If you start in vr mode with your hmd off and cancel the dialog stereo rendering now starts with default values for the hmd hardware stats (as read from my pvt) instead of crashing trying to use uninitialized data. When an hmd is connected its values will be read. -Refactored to ensure reprojection starts immediately when we call StartReprojection. #jira UEVR-126 #review-3116221 Change 3116754 on 2016/09/07 by Keli.Hlodversson bPixelDensityAdaptive is a bool and not a float property Change 3117692 on 2016/09/08 by Jeff.Fisher UEVR-135 Morpheus HMD recent feature error reporting UEVR-173 2DVR flexibility (UTexture) -Error log for sceHmdReprojectionSetOutputMinColor failure. -Made the parameter for 2dVR a UTexture* instead of a UTexture2D*, so it can be a rendertarget, etc. -Added error logs for missing texture, invalid texture, wrong texture format to 2DVR. #jira UEVR-135 #jira UEVR-173 #review-3116955 @keli.hloedversson Change 3117990 on 2016/09/08 by Jeff.Fisher UEVR-127 Morpheus HMD removal reaction -Added VRHeadsetPutOnHead and VRHeadsetRemovedFromHead delegates, and implemented them for Morpheus. #jira UEVR-127 #review-3117968 @keli.hlodversson Change 3120198 on 2016/09/09 by Jeff.Fisher MorpheusReprojector frame complete wait error log -Now log a warning if the sceKernalWaitEqueue returns an error. It not a problem if this happens rarely, but something is very broken if it starts happening continuously. Change 3121754 on 2016/09/12 by Keli.Hlodversson #jira UE-21878 - Also emit VR initialization analytics events in the editor. Change 3122311 on 2016/09/12 by Nick.Whiting Merging fix for Adreno devices rendering black from 4.13.1 Change 3123057 on 2016/09/13 by Keli.Hlodversson #jira UE-30097 Use the current value of r.ScreenPercentage on Occulus Rift if it's explicitly set. * If the SetBy part of the flags for the console var is SetBy_Constructor, then ignore the value. * If it's SetBy_Scalability, then ignore it if it equals 100 * Else, call SetScreenPercentage using the current value The obsolete HMD SCREENPERCENTAGE console command is still available and will override the setting until r.ScreenPercentage is modified the next time. Change 3123200 on 2016/09/13 by Chad.Taylor PS4 Stereo Layer double buffering. Since the overlays are reprojected at 120hz but rendered at 60hz we need to render to a separate buffer than the one being used by reprojection. Change 3125845 on 2016/09/14 by Keli.Hlodversson #jira UE-33996 Add hmd=<name> command line option to allow overriding which HMD module is used. Renamed GetModulePriorityKeyName to simply GetModuleKeyName, as this name is now also used to match against the command line options. Change 3127293 on 2016/09/15 by Jeff.Fisher UEVR-225 Morpheus HMD top and bottom black crescents -The hidden and visible area meshes for morpheus were too restrictive. Nudged them out a bit, no black crescents at the top and bottom of the screen. We are rendering a few more pixels now though. #review-3127145 @ryan.vance #jira UEVR-225 Change 3130635 on 2016/09/19 by Jeff.Fisher UEVR-226 Morpheus HMD mirrored fill wrong on outer edges -The setting was never being used, leaving the wrap mode at 0 aka kWrapModeWrap. -Refactored how the setting is applied so it works, and is less convoluted. #jira UEVR-226 #review-3129403 Change 3131615 on 2016/09/19 by Keli.Hlodversson #jira UE-29341. Update Chaperone bounds when SteamVR tells us they have changed Change 3136527 on 2016/09/22 by Keli.Hlodversson Don't depend on the current state of the VR subsystem when exiting PIE mode to decide whether the main window should be restored. Instead always restore it if it was minimized at the start. Change 3136652 on 2016/09/22 by Keli.Hlodversson Allow shutting down Steam VR subsystem without shutting down the Steam VR plugin completely in response to quitting from the SteamVR overlay. Enabling stereo rendering again will reinitialize SteamVR. This is useful when using PIE in VR mode as it allows entereing it again without restarting the editor. Also fixes crashes by first disabinge stereo rendering a short while before shutting down the VR subsystem. #jira UE-35940 Change 3138901 on 2016/09/23 by Ryan.Vance Merging 3138521 using OdinToDevVR to bring over temporary forward lighting ISR changes for 4.14 Change 3141614 on 2016/09/27 by Keli.Hlodversson Implement GetNumOfTrackingSensors and GetTrackingSensorProperties on SteamVR. #jira UE-32994 Change 3141948 on 2016/09/27 by Jeff.Fisher UEVR-242 Is AddControllerYawInput not allowed when morpheus is enabled? -Indeed it did not work. Looks like morpheus would not accumulate the yaw, so it would be reset every frame. I made the implementation of ApplyHmdRotation very similar to the one used for occulus (also similar to other platforms) to fix this. #jira UEVR-242 #review-3141933 keli.hlodversson Change 3143484 on 2016/09/28 by Nick.Whiting Integrating Oculus 1.8 SDK support, includes support for cylinder and cubemap stereo layers Change 3143517 on 2016/09/28 by Chad.Taylor Merging PS4Tracker fixes from Release-4.13 into Dev-VR Change 3143805 on 2016/09/28 by Keli.Hlodversson #jira UE-36478 Workaround to make world to meters scale apply correctly to Occulus controllers while running in PIE Change 3143943 on 2016/09/28 by Nick.Whiting Merging latest drop from OSVR Change 3144221 on 2016/09/28 by Keli.Hlodversson Implement GetTrackingSensorProperties on PS4 #jira UE-32994 Change 3144352 on 2016/09/28 by Ryan.Vance Initial implementation of mobile multi-view. This is non-functioning and requires a lot more work, but enough of the framework exists to make the 4.14 branch for an experimental release. Change 3144585 on 2016/09/29 by Jeff.Fisher UEVR-14 PSVR Support for 90Hz to 90Hz, and 120Hz to 120Hz -Enum setting added for the three frame sequences. -90Hz mode is trying to run camera updates at 90hz, but they can only run at 60 so every third one fails. This works, but its dubious. -Feature marked as experimental for now because of that 90hz tracking issue, and the lack of testing. -Defaulting to 60/120. #jira UEVR-14 #review-3143486 chad.taylor nick.whiting Change 3145263 on 2016/09/29 by Nick.Whiting Fix for constructor initialization order in StereoLayerComponent, which threw a warning on Clang Change 3145536 on 2016/09/29 by Nick.Whiting Fixes for project files to prevent mystery pop up from CAPI Change 3145663 on 2016/09/29 by Keli.Hlodversson PSVR: Make sure the camera orientation returned from GetTrackingSensorProperties points in the right direction. Change 3145670 on 2016/09/29 by Keli.Hlodversson For some reason the orientation of the Oculus tracking sensor is reported as pointing backwards. This flips it around to face front Change 3145687 on 2016/09/29 by Chad.Taylor VR splash screen support [CL 3146243 by Nick Whiting in Main branch]
2016-09-30 01:16:13 -04:00
}
else
{
RHICreateTargetableShaderResource2DArray(
Desc.Extent.X,
Desc.Extent.Y,
Desc.ArraySize,
Desc.Format,
Desc.NumMips,
Desc.Flags,
Desc.TargetableFlags,
Desc.bForceSeparateTargetAndShaderResource,
Desc.bForceSharedTargetAndShaderResource,
Copying //UE4/Dev-VR to //UE4/Dev-Main (Source: //UE4/Dev-VR @ 3145687) #lockdown Nick.Penwarden #rb Merge ========================== MAJOR FEATURES + CHANGES ========================== Change 3094167 on 2016/08/18 by Jeff.Fisher UEVR-97 Morpheus HMD tracking needs to wait until HMD is fully tracked. -Morpheus CALIBRATING/NOT_TRACKED tracking state hmd orientation update disabled and delegates added to present instructions to the user. This behavior is controlled by morpheus ini setting bDisableHMDOrientationUntilHMDHasBeenTracked, but defaulted to true to avoid subtly bad user experiences. #review-3094106 @chad.taylor #jira UEVR-97 Change 3104799 on 2016/08/29 by Jeff.Fisher UEVR-178 Morpheus HMD Black crescents -Switched reprojection frame time for 60/120 mode from 120hz to 60hz so we much better predict where the hmd will be pointing when the frame we are about to render is actually displayed, and are run off the edge of it less often and less severely. This makes the black crescent artifacts only just visible during very fast head turning. The kWrapModeMirror change, which will be submitted separately, makes the left and right crescents invisible to me. -Renamed the functions for setting the prediction info in the PS4Tracker. -Added render frame parameters to sony reprojection functions, these can help with debugging reprojection. -Added commented out sce call to get the reprojection debug data. Not allowed to submit an executable that calls it, but its nice to at least know where one can put it. May improve this later. -Wrapped PS4Tracker->Synchronize call in a check that the tracker handle is valid, because I managed to get it called when it wasn't (probably during hmd power off testing, but I don't remember now). It should be fine to not do it if the tracker is not functioning. #review-3104780 chad.taylor #jira UEVR-178 Change 3108423 on 2016/08/31 by Jeff.Fisher Morpheus Config Improvements. -UEVR-138 Morpheus HMD reprojection wrap mode config setting -Can now switch between wrap mode Mirror and ClampToBorder. Mirror is the default. -Made bDisableHMDOrientationUntilHMDHasBeenTracked editable in UE4Editor project settings. -Using generic project setting for bStartInVR, removed the morpheus specific one. #jira UEVR-138 #review-3106999 @nick.whiting Change 3111231 on 2016/09/01 by Jeff.Fisher Fixed bStartInVR ini setting. -Initial implementation worked via a generic EnableStereo call, which worked, but happened after the hmd setup dialog, which is not what I wanted. -Also fixed a tracking frame mismatch assert that hit when I powered the hmd off once, causing it to lose tracking. Its ok that it doesn't update in that circumstance. #review-3111211 @ryan.vance Change 3115196 on 2016/09/06 by Keli.Hlodversson #jira UEVR-128 Map move controller Select button to Invalid, as it is always handled by the system Change 3116425 on 2016/09/07 by Chad.Taylor PSVR: stereo layers implementation Change 3116593 on 2016/09/07 by Jeff.Fisher UEVR-126 Morpheus HMD connect dialog cancel reactions -VR only apps can't allow the player to cancel out of the hmd setup dialog, so lets just pop the dialog up again (sony were ok with a licencee doing this) if an ini setting says to do that. -VR/2D apps might want to switch to 2d if the player cancels out of the hmd setup dialog, so there is an ini setting for that. -A delegate only implementation is also provided for apps that want to do something else. This leaves the game rendering in VR mode, and fires the delegate. -Refactored to better separate successful HMD acquisition from stereo rendering. This was necessary to support the delegate only option on startup. If you start in vr mode with your hmd off and cancel the dialog stereo rendering now starts with default values for the hmd hardware stats (as read from my pvt) instead of crashing trying to use uninitialized data. When an hmd is connected its values will be read. -Refactored to ensure reprojection starts immediately when we call StartReprojection. #jira UEVR-126 #review-3116221 Change 3116754 on 2016/09/07 by Keli.Hlodversson bPixelDensityAdaptive is a bool and not a float property Change 3117692 on 2016/09/08 by Jeff.Fisher UEVR-135 Morpheus HMD recent feature error reporting UEVR-173 2DVR flexibility (UTexture) -Error log for sceHmdReprojectionSetOutputMinColor failure. -Made the parameter for 2dVR a UTexture* instead of a UTexture2D*, so it can be a rendertarget, etc. -Added error logs for missing texture, invalid texture, wrong texture format to 2DVR. #jira UEVR-135 #jira UEVR-173 #review-3116955 @keli.hloedversson Change 3117990 on 2016/09/08 by Jeff.Fisher UEVR-127 Morpheus HMD removal reaction -Added VRHeadsetPutOnHead and VRHeadsetRemovedFromHead delegates, and implemented them for Morpheus. #jira UEVR-127 #review-3117968 @keli.hlodversson Change 3120198 on 2016/09/09 by Jeff.Fisher MorpheusReprojector frame complete wait error log -Now log a warning if the sceKernalWaitEqueue returns an error. It not a problem if this happens rarely, but something is very broken if it starts happening continuously. Change 3121754 on 2016/09/12 by Keli.Hlodversson #jira UE-21878 - Also emit VR initialization analytics events in the editor. Change 3122311 on 2016/09/12 by Nick.Whiting Merging fix for Adreno devices rendering black from 4.13.1 Change 3123057 on 2016/09/13 by Keli.Hlodversson #jira UE-30097 Use the current value of r.ScreenPercentage on Occulus Rift if it's explicitly set. * If the SetBy part of the flags for the console var is SetBy_Constructor, then ignore the value. * If it's SetBy_Scalability, then ignore it if it equals 100 * Else, call SetScreenPercentage using the current value The obsolete HMD SCREENPERCENTAGE console command is still available and will override the setting until r.ScreenPercentage is modified the next time. Change 3123200 on 2016/09/13 by Chad.Taylor PS4 Stereo Layer double buffering. Since the overlays are reprojected at 120hz but rendered at 60hz we need to render to a separate buffer than the one being used by reprojection. Change 3125845 on 2016/09/14 by Keli.Hlodversson #jira UE-33996 Add hmd=<name> command line option to allow overriding which HMD module is used. Renamed GetModulePriorityKeyName to simply GetModuleKeyName, as this name is now also used to match against the command line options. Change 3127293 on 2016/09/15 by Jeff.Fisher UEVR-225 Morpheus HMD top and bottom black crescents -The hidden and visible area meshes for morpheus were too restrictive. Nudged them out a bit, no black crescents at the top and bottom of the screen. We are rendering a few more pixels now though. #review-3127145 @ryan.vance #jira UEVR-225 Change 3130635 on 2016/09/19 by Jeff.Fisher UEVR-226 Morpheus HMD mirrored fill wrong on outer edges -The setting was never being used, leaving the wrap mode at 0 aka kWrapModeWrap. -Refactored how the setting is applied so it works, and is less convoluted. #jira UEVR-226 #review-3129403 Change 3131615 on 2016/09/19 by Keli.Hlodversson #jira UE-29341. Update Chaperone bounds when SteamVR tells us they have changed Change 3136527 on 2016/09/22 by Keli.Hlodversson Don't depend on the current state of the VR subsystem when exiting PIE mode to decide whether the main window should be restored. Instead always restore it if it was minimized at the start. Change 3136652 on 2016/09/22 by Keli.Hlodversson Allow shutting down Steam VR subsystem without shutting down the Steam VR plugin completely in response to quitting from the SteamVR overlay. Enabling stereo rendering again will reinitialize SteamVR. This is useful when using PIE in VR mode as it allows entereing it again without restarting the editor. Also fixes crashes by first disabinge stereo rendering a short while before shutting down the VR subsystem. #jira UE-35940 Change 3138901 on 2016/09/23 by Ryan.Vance Merging 3138521 using OdinToDevVR to bring over temporary forward lighting ISR changes for 4.14 Change 3141614 on 2016/09/27 by Keli.Hlodversson Implement GetNumOfTrackingSensors and GetTrackingSensorProperties on SteamVR. #jira UE-32994 Change 3141948 on 2016/09/27 by Jeff.Fisher UEVR-242 Is AddControllerYawInput not allowed when morpheus is enabled? -Indeed it did not work. Looks like morpheus would not accumulate the yaw, so it would be reset every frame. I made the implementation of ApplyHmdRotation very similar to the one used for occulus (also similar to other platforms) to fix this. #jira UEVR-242 #review-3141933 keli.hlodversson Change 3143484 on 2016/09/28 by Nick.Whiting Integrating Oculus 1.8 SDK support, includes support for cylinder and cubemap stereo layers Change 3143517 on 2016/09/28 by Chad.Taylor Merging PS4Tracker fixes from Release-4.13 into Dev-VR Change 3143805 on 2016/09/28 by Keli.Hlodversson #jira UE-36478 Workaround to make world to meters scale apply correctly to Occulus controllers while running in PIE Change 3143943 on 2016/09/28 by Nick.Whiting Merging latest drop from OSVR Change 3144221 on 2016/09/28 by Keli.Hlodversson Implement GetTrackingSensorProperties on PS4 #jira UE-32994 Change 3144352 on 2016/09/28 by Ryan.Vance Initial implementation of mobile multi-view. This is non-functioning and requires a lot more work, but enough of the framework exists to make the 4.14 branch for an experimental release. Change 3144585 on 2016/09/29 by Jeff.Fisher UEVR-14 PSVR Support for 90Hz to 90Hz, and 120Hz to 120Hz -Enum setting added for the three frame sequences. -90Hz mode is trying to run camera updates at 90hz, but they can only run at 60 so every third one fails. This works, but its dubious. -Feature marked as experimental for now because of that 90hz tracking issue, and the lack of testing. -Defaulting to 60/120. #jira UEVR-14 #review-3143486 chad.taylor nick.whiting Change 3145263 on 2016/09/29 by Nick.Whiting Fix for constructor initialization order in StereoLayerComponent, which threw a warning on Clang Change 3145536 on 2016/09/29 by Nick.Whiting Fixes for project files to prevent mystery pop up from CAPI Change 3145663 on 2016/09/29 by Keli.Hlodversson PSVR: Make sure the camera orientation returned from GetTrackingSensorProperties points in the right direction. Change 3145670 on 2016/09/29 by Keli.Hlodversson For some reason the orientation of the Oculus tracking sensor is reported as pointing backwards. This flips it around to face front Change 3145687 on 2016/09/29 by Chad.Taylor VR splash screen support [CL 3146243 by Nick Whiting in Main branch]
2016-09-30 01:16:13 -04:00
CreateInfo,
(FTexture2DArrayRHIRef&)Found->RenderTargetItem.TargetableTexture,
(FTexture2DArrayRHIRef&)Found->RenderTargetItem.ShaderResourceTexture,
Desc.NumSamples
);
}
if (RHISupportsRenderTargetWriteMask(GMaxRHIShaderPlatform) && Desc.bCreateRenderTargetWriteMask)
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
{
Found->RenderTargetItem.RTWriteMaskSRV = RHICreateShaderResourceViewWriteMask((FTexture2DRHIRef&)Found->RenderTargetItem.TargetableTexture);
}
if (Desc.bCreateRenderTargetFmask)
{
Found->RenderTargetItem.FmaskSRV = RHICreateShaderResourceViewFMask((FTexture2DRHIRef&)Found->RenderTargetItem.TargetableTexture);
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
}
}
else if (Desc.Is3DTexture())
{
Found->RenderTargetItem.ShaderResourceTexture = RHICreateTexture3D(
Desc.Extent.X,
Desc.Extent.Y,
Desc.Depth,
Desc.Format,
Desc.NumMips,
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3388261) #lockdown Nick.Penwarden #rb None ========================== MAJOR FEATURES + CHANGES ========================== Change 3358140 on 2017/03/22 by Rolando.Caloca DR - Fix copy to cube face - Compile fix when using dump layer - Add new error enum Change 3358301 on 2017/03/22 by Mitchell.Wilson Initial check in of LODs in InfiltratorForward. First pass on optimization in level. Adding a visibility track for SceneCapture2D in tunnel section. Change 3358477 on 2017/03/22 by Mitchell.Wilson Updating Skeletal Mesh DPW_Robot_Export to resolve screen size being too low for LOD1. Cleaned up LOD1 which was showing some visible popping when transitioning. Change 3358529 on 2017/03/22 by Mark.Satterthwaite Globally disable clang's "constant-logical-operand" warning when running under Distcc - it is much easier and less invasive than constantly fixing the code. Change 3358745 on 2017/03/22 by Mark.Satterthwaite Disable another warning (parentheses-equality) under Distcc because again the separation of preprocessing from compilation means it turns up where it isn't expected. Change 3358837 on 2017/03/22 by Joe.Graf Merge of pull request #3214 for the RenderDocPlugin #CodeReview: matt.kuhlenschmidt, marcus.wassmer #rb: marcus.wassmer Change 3359112 on 2017/03/22 by Ben.Salem Update perf monitor to include frame time by default. Also, use only game/PIE world timers when in editor, instead of all worlds combined. #tests Ran several Showdown test runs with plugin! Change 3359363 on 2017/03/22 by Joe.Graf First pass at non-unity & no pch compilation Change 3359449 on 2017/03/22 by Joe.Graf Added missing null check when exporting a EXR on Linux (UE-40268) #CodeReview: dmitry.rekman #rb: n/a Change 3360349 on 2017/03/23 by Guillaume.Abadie Fixes TAA's AA_FORCE_ALPHA_CLAMP causing DOF layouts. #jira UE-42920 Change 3360405 on 2017/03/23 by Marcus.Wassmer Better method for detecting Kepler Change 3360718 on 2017/03/23 by Daniel.Wright Planar reflections handle views smaller than the render target in a general way * Fixes planar reflections with adaptive pixel density (ViewFamily size larger than actual views combined) * Planar reflections are now supported in splitscreen Change 3360758 on 2017/03/23 by Daniel.Wright [Copy] Added new light property bCastVolumetricShadow, which defaults to true for directional and sky lights, but false for point / spot lights as supporting volumetric fog shadowing has significant GPU overhead Change 3360762 on 2017/03/23 by Daniel.Wright [Copy] Texture flags are now properly routed to RHICreateTexture3D from the render target pool Change 3360768 on 2017/03/23 by Daniel.Wright [Copy] Disabled GPUProfiler histogram by default, controlled by r.ProfileGPU.ShowEventHistogram Change 3360770 on 2017/03/23 by Daniel.Wright [Copy] Disabled fast clears on CustomDepth, saves .2ms on xbox Change 3360771 on 2017/03/23 by Daniel.Wright [Copy] Particle lights no longer force tiled deferred lighting. Tiled deferred lighting is only used if enough unshadowed lights + particle lights are on screen. Saves 1.5ms Xbox with one particle light. Change 3360774 on 2017/03/23 by Daniel.Wright [Copy] Distance field cvar comments Change 3360782 on 2017/03/23 by Daniel.Wright [Copy] Disabled selection color on Volume materials Change 3360795 on 2017/03/23 by Daniel.Wright [Copy] Volume materials now specify Albedo and Extinction, which is more intuitive than Scattering and Absorption. Albedo is [0-1] reflectance, while Extinction is a world space density. Change 3360799 on 2017/03/23 by Daniel.Wright [Copy] Cinematic scalability levels get 2x volumetric fog resolution in x and y Change 3360806 on 2017/03/23 by Daniel.Wright [Copy] Fixed volumetric fog being offset when viewport min is not 0 Change 3360809 on 2017/03/23 by Daniel.Wright [Copy] Volumetric fog now adds a bias to the inverse squared light falloff denominator, prevents extreme aliasing from the hotspot. Can be controlled with r.VolumetricFog.InverseSquaredLightDistanceBiasScale. Change 3361651 on 2017/03/23 by Brian.Karis Higher quality sharp SSR at quality 4 Change 3361678 on 2017/03/23 by Brian.Karis Fresnel darkens diffuse for clearcoat. Change 3361683 on 2017/03/23 by Brian.Karis Fixed SSR artifact Change 3361691 on 2017/03/23 by Brian.Karis Chagned min roughness limit Change 3361707 on 2017/03/23 by Brian.Karis Added inverse film tone map Change 3361726 on 2017/03/23 by Brian.Karis Better precision inverse Change 3361758 on 2017/03/23 by Brian.Karis Material flag normal curvature to roughness is no longer forward only. Change 3361765 on 2017/03/23 by Brian.Karis Update ACES Change 3361774 on 2017/03/23 by Brian.Karis Cleaned up alpha support and disabled screen edge clipping. Change 3362478 on 2017/03/24 by Guillaume.Abadie Cherry pick 3316084's PostProcessing.cpp: Fixes a bug in Circle DOF where the apply pass was no longer using the downres DOF's TAA output. #author Brian.Karis #jira UE-42920 Change 3362738 on 2017/03/24 by Rolando.Caloca DR - Hide scene capture on IF Change 3362890 on 2017/03/24 by Guillaume.Abadie Renames r.SceneAlpha to r.PostProcessing.PropagateAlpha Change 3363665 on 2017/03/24 by Mark.Satterthwaite PR #3414: Add command line option "-noheartbeatthread" to disable heart beat thread (Contributed by JeffRous) Change 3363866 on 2017/03/24 by Arne.Schober DR - Updated NVAPI #RB Marcus.Wassmer Change 3364300 on 2017/03/24 by Brian.Karis SSR use dynamic velocity Change 3364372 on 2017/03/24 by Brian.Karis Fix changing off axis projection velocities. Change 3364373 on 2017/03/24 by Brian.Karis Enabled velocity drawing in scene captures Change 3365531 on 2017/03/27 by Guillaume.Abadie Computes the material's screen position material expression directly from the pixel shader SvPosition Change 3365764 on 2017/03/27 by Chris.Bunner Lowering severity of crash for missing values in scalability.ini. #jira UE-41331 Change 3365916 on 2017/03/27 by Guillaume.Abadie Exposes the viewport offset within the view property material expression Change 3365979 on 2017/03/27 by Brian.Karis Fixed skylight intensity from double applying Change 3365987 on 2017/03/27 by Brian.Karis Stopped post process indirect lighting intensity from scaling skylight reflections Change 3365991 on 2017/03/27 by Brian.Karis Fix for static analysis Change 3366028 on 2017/03/27 by Daniel.Wright Volumetric fog supports static shadowing from Stationary lights * Using bilinear on static shadowmap depths + 1 PCF to smooth out results Change 3366029 on 2017/03/27 by Daniel.Wright Static shadow depth maps for Stationary point and spot lights are 2x higher res by default (4x more texels), which is more appropriate for volumetric fog Change 3366055 on 2017/03/27 by Guillaume.Abadie Cherry picks 3251469: Implements scene capture component's CaptureSortPriority to control GPU execution order in order to manage inter dependencies. Change 3366447 on 2017/03/27 by Simon.Tourangeau Fix IES light profile importer. - Bug in the LM-63-1986 format importer. Change 3366836 on 2017/03/27 by Brian.Karis ClearUAV now supports int types Change 3367435 on 2017/03/28 by Benjamin.Hyder Submitting Decal Automation map for initial approval Change 3367572 on 2017/03/28 by Chris.Bunner Changed ClampedPow {max(abs(x),0.00001)} to PositiveClampedPow {max(x,0)} to give more expected results to Power node in material graphs. #jira UE-42989 Change 3367756 on 2017/03/28 by Olaf.Piesche Niagara material usage flags Change 3367835 on 2017/03/28 by Marcus.Wassmer Fix crash when TileRenderer runs before anything else. Make explicit behavior when rendering at a time when there is no valid scene. Change 3367837 on 2017/03/28 by Marcus.Wassmer Missed a file. Change 3367838 on 2017/03/28 by Richard.Wallis Updated items from original shelved version by Mark Satt: - Added MetalBackend.cpp to change main function string to have an initial crc + code length zero's **Description below taken from Mark Satt's original verison of this in CL3343280** Updated for Dev-Rendering's PSOs & integrates Richard's work on RHI shader libraries. Replace the FShaderCache's cook-time binary shader cache with Dmitriy Dyomin's standalone FShaderCodeLibrary that saves all shader byte-code arrays to files named by the FSHAHash. This de-duplicates shaders so we only ever store the byte code once. Includes optional support for generating a platform specific library file - which Metal implements to provide a single Metal library. The platform-native implementation can perform more de-duplication and in the case of Metal has lower file overheads and will compress more efficiently. - All of the support code for the FShaderCache's cook caching is gone, which affects all platforms. The FShaderCodeLibrary is currently supported by Cook-By-The-Book but can be used with iterate or child cookers - only DLC cooking requires further work. - With further modifications it should be possible to support Cook-on-the-Fly as well (output directories would be needed in FShaderCodeLibrary::InitForCooking) and the file-access pattern should be changed to use async. IO so that Material loading is not considered complete until all required byte-code arrays are loaded into the FShaderCodeLibrary. - For Metal archiving shaders this way will compile with debug information and the FShaderCodeLibrary, with some help from extensions to IShaderFormat, will save the debug information out into separate files during cooking - these can then be used to debug the game without having to locally recompile, recook & repackage but the shipped byte-code is stripped. Global shader caches are also subject to de-duplication in the library in order to support Metal's shader stripping. - File Move operations need to respect the 'Replace' flag - for FShaderCodeLibrary to work we need Move to be atomic. - This bumps the object version and will cause all content to recook. - Native library support is optional - only Metal currently implements one, but so could Vulkan and D3D12. For Metal the big advantages are further de-duplication where different materials generate the same MetalSL text but a different FSHAHash, that the single Metal library has lower overhead and that as a single file it all compresses far better (esp. with LZMA - 5x smaller). Change 3367854 on 2017/03/28 by Mark.Satterthwaite Don't track or record draw call resources for non-OpenGL shader platforms in the shader-cache as it is unnecessary and makes it slower on the CPU than it needs to be. Change 3367877 on 2017/03/28 by Brian.Karis Fixed linux build hopefully Change 3368001 on 2017/03/28 by Mark.Satterthwaite Compile fixes from Richard's checkin caused by not having visibility to all platforms from my original shelves. Change 3368019 on 2017/03/28 by Mark.Satterthwaite And another fix for Windows compilation of MetalShaderFormat. Change 3368042 on 2017/03/28 by Mark.Satterthwaite And a couple of simpler MSVC errors. Change 3368271 on 2017/03/28 by Mark.Satterthwaite Make SceneRenderTargets compile again. Change 3368691 on 2017/03/28 by Daniel.Wright [Copy from BenW] Renamed r.Shadow.MaxCSMShadowResolution to r.Shadow.MaxCSMResolution to match scalability inis Change 3369689 on 2017/03/29 by Marcus.Wassmer Fix non editor compile for now Change 3369862 on 2017/03/29 by Marcus.Wassmer Get the rest of the things compiling again. Change 3369896 on 2017/03/29 by Chris.Bunner Enabling AMD HDR support by default. #jira UE-42113 Change 3370535 on 2017/03/29 by Marcus.Wassmer DR - Fix template explicit instantiation for ClearUAV permutations #RB Brian.Karis, Arne.Schober Change 3370704 on 2017/03/29 by Rolando.Caloca DR - Rewrote GPU Skin Cache - Per section buffers - Limited memory per non-editor worlds (control with r.SkinCache.SceneMemoryLimitInMB) Copied from 3370529 Change 3371389 on 2017/03/30 by Richard.Wallis Remove temp working directories after archive packages built. Change 3371641 on 2017/03/30 by Rolando.Caloca DR - Copy 3371640 (fix mem leak) Change 3372436 on 2017/03/30 by Uriel.Doyon Added flags in UPrimitiveComponent to keep track of its state in the streaming manager. This allows to avoid unnecessary callback and processing in begin destroy reattach and being destroy logic. Removed the limitation of only processing UMeshComponent when handling spawed primitive. This releases the level manager from having to manage dynamic primitives. This improves performance by not having to manage dynamic references in the level manager. Primitives managed as dynamic now have a callback when ever their proxy is udpated, handling many cases automatically where previously a manual callback to notify would have been required. Fixed an issue where primitives with no reference to streaming textures would loose they dynamic state because of lack of references in the streamer. Change 3372740 on 2017/03/30 by Chris.Bunner [Experimental] Partial compute post process pipeline (r.PostProcess.PreferCompute). StencilSceneTexture added to deferred list. A few known issues to be fixed in a follow-up CL. Change 3372765 on 2017/03/30 by Uriel.Doyon Disabled concurrent call to NotifyPrimitiveUpdated while we don't have a safe concurrent update Change 3372979 on 2017/03/30 by Richard.Hinckley #jira UE-43501 The stencil buffer can now use single-channel bitmasks that ignore depth. This makes it possible to detect overlaps between stencil objects. Change 3373053 on 2017/03/30 by Simon.Tourangeau LPV Fade support - mostly integrated from CL 2959511 Change 3373272 on 2017/03/30 by Uriel.Doyon Added support for the concurrent update of dynamic primitives by the streaming manager. Change 3373450 on 2017/03/30 by Rolando.Caloca DR - FNT - Fix bad data for odd texcoord channels used on skin cache passthrough factory Copy 3373364 #jira UE-43492 Change 3373470 on 2017/03/30 by Marcus.Wassmer Nvidia Aftermath support Change 3374187 on 2017/03/31 by Chris.Bunner Volume texture support for CombineLUTs/Tonemap compute pass. Refactored common param code to shared sub-class in CombineLUTs and Tonemap PS/CS. Skip compute post process out-of-bounds writes. Unsigned type conversion fixes. Trimmed compute post process shader inputs. Change 3374233 on 2017/03/31 by Chris.Bunner Removed several redundant post process compute fences and resource transitions. Added testing CVar to force compute post processes to async (r.PostProcess.ForceAsyncDispatch). Change 3374412 on 2017/03/31 by Rolando.Caloca DR - Fix static analysis Change 3374544 on 2017/03/31 by Richard.Wallis FShaderCache Parallel-Context-Aware Merged with FShaderCache Single Library. Future Work - This was done before Engine PSO were in so this now needs a refector in the recording and playback on pipeline states instead an emulate PSO in OpenGL Driver. - Remove FShaderCacheState and replace the logic with FGraphicsPipelineStateInitializer which should be able to record from the RHI current pipeline state - This would reduce the Locking required as it's naturally per thread/context and only the final record would need a lock Change 3374588 on 2017/03/31 by Richard.Wallis Windows Compile Fixes Change 3374810 on 2017/03/31 by Benjamin.Hyder updating recommended GPU drivers Change 3375207 on 2017/03/31 by Rolando.Caloca DR - vk - Fixed swapchain format selection for some Linux platforms Change 3375248 on 2017/03/31 by Rolando.Caloca DR - vk - Prefer D32S8 Change 3375495 on 2017/03/31 by Rolando.Caloca DR - vk - Update to sdk 1.0.42.2 Change 3375496 on 2017/03/31 by Rolando.Caloca DR - Force compiling with updated Vulkan SDK Change 3375636 on 2017/03/31 by Mark.Satterthwaite Copying Metal improvements from task stream, with some modifications: - Off-by-default implementations for MTLFence & MTLHeap, including some small changes to the RHI interface for parallel contexts. - Support for Apple's Instruments "Points of Interest" tool. - Consolidation of some Mac & iOS compiler, memory and thread handling code. - Fixes for Metal not having implicit buffer SRV typecasting for DistanceField effects. - Improvements to the internal FMetalDebug layer, still off by default. - Limited support for Xcode automatic code-signing for iOS/tvOS. - Minimisation of render-target changes in some rendering code, esp. SceneOcclusion, DBufferDecals. - Added RHISetResourceAliasability_RenderThread to FDynamicRHI for RHIs to implement simple render-target aliasing. - Added FApplePlatformObject, a custom block allocator for Objective-C types (with NSZombie support) which is now used in MetalRHI to decrease allocation costs of Objective-C types. - Smattering of lesser fixes. Change 3375654 on 2017/03/31 by Mark.Satterthwaite Incremental Windows build fix. Change 3375656 on 2017/04/01 by Mark.Satterthwaite Correct extern declaration, including the module export macro which Mac unhelpfully doesn't enforce (for now...). Change 3375797 on 2017/04/01 by Mark.Satterthwaite Nullability qualifiers to fix Mac build-farm compilation: perversely this is not a problem for local builds... Change 3375798 on 2017/04/01 by Mark.Satterthwaite Fix the first mis-merge in ParticleGpuSimulation - these changes clearly weren't properly resolved in the task-stream. Change 3375835 on 2017/04/01 by Mark.Satterthwaite Try again with nullability and fix the occlusion changes as the PSO work wasn't merged correctly. Change 3376143 on 2017/04/02 by Mark.Satterthwaite Switch back to flat dSYMs for Dev-Rendering - they don't work with Instruments etc. but they are required by our build system. Change 3376324 on 2017/04/03 by Chris.Bunner Fixed cvar re-registration log spam and flagged a testing-only cvar as such. Change 3376726 on 2017/04/03 by Benjamin.Hyder Submitting initial HDR test map (WIP) Change 3376756 on 2017/04/03 by Guillaume.Abadie Fixes scene captures ordering's backward compatibility. Before, 2d scene captures were rendered before cube scene captures. The CaptureSortPriority broke backward compatibility by settings this new member to 0 in the USceneCaptureComponent's constructor. Since it is a higher come first policy, this CL set the default of this value to 1 in USceneCaptureComponent2D's constructor. Change 3377378 on 2017/04/03 by Arne.Schober DR - Fix ShaderRecompiling over and over again #RB Chris.Bunner Change 3377512 on 2017/04/03 by Daniel.Wright [Copy] Fixed profilegpu in d3d12 - initialize FLongGPUTaskPS when it is safe to do so, and fixed FSlateRHIRenderer's incorrect usage of draw events Change 3377518 on 2017/04/03 by Daniel.Wright [Copy] Distance field atlas coalesces updates to reduce RHIUpdateTexture3D memory overhead on d3d12 Change 3377526 on 2017/04/03 by Daniel.Wright [Copy] "Ran out of GPU queries!" log only happens once Change 3377535 on 2017/04/03 by Daniel.Wright [Copy] Fixed unreferenced local variable Change 3377539 on 2017/04/03 by Daniel.Wright [Copy] Xbox One RHIGetResourceInfo takes ESRAM into account - fixes render target pool 'VRamInKB request failed' messages Change 3377546 on 2017/04/03 by Daniel.Wright [Copy] Added r.LightMaxDrawDistanceScale for local light scalability Change 3377553 on 2017/04/03 by Daniel.Wright [Copy] Removed NEW_ESRAM_ALLOCATOR define and old unused path Change 3377560 on 2017/04/03 by Daniel.Wright [Copy] Fixed two d3d12 refcounting bugs causing -norhithread crashes Change 3377565 on 2017/04/03 by Daniel.Wright [Copy] Fixed Xbox One deleting GPU resources before the GPU is done reading from them (GRHINeedsExtraDeletionLatency was false) Change 3377572 on 2017/04/03 by Daniel.Wright [Copy] Disabled point / spot lights with MaxDrawDistance on LowPC Change 3377586 on 2017/04/03 by Daniel.Wright Fixed compile error Change 3377699 on 2017/04/03 by David.Hill FFT Code. Moved over from raven and refactored #review-3374589 @guillaume.abadie Change 3377910 on 2017/04/03 by David.Hill GPU FFT: Fix Linux Build adding a missing template<> to an IMPLEMENT_SHADER_TYPE Change 3378751 on 2017/04/04 by Marcus.Wassmer HQ particle lights now spawn attached to the same socket as their parent module. Change 3378819 on 2017/04/04 by Richard.Wallis Should be no need to protect shader cache against RHI thread now. Change 3378823 on 2017/04/04 by Richard.Wallis FRHIShaderLibrary Opaque Type - Base FRHIShaderLibrary has no Create*Shader functions and is passed to Overloaded RHICreate*Shader functions instead of creation directly through the library. - Assumed that only Native libraries will end up in the RHICreate*Shader functions. - ShaderCache and ShaderCode Libraries now inherit from a common factory interface. Change 3378883 on 2017/04/04 by Arne.Schober DR - Fix DCC build Change 3378885 on 2017/04/04 by Richard.Wallis Metal resource cast compile fix post merge. Change 3378946 on 2017/04/04 by Chris.Bunner SM4 assert fix. Change 3378953 on 2017/04/04 by Chris.Bunner Fixed type-correctness on legacy BreakMA material nodes and set more flexible formats to global attributes which should result in much more forgiving graphs for users. Allowed material nodes to opt out of mask-based pin coloration. #tests Compiled most Paragon materials + QAGame test maps. #jira UE-39885 Change 3379189 on 2017/04/04 by Arne.Schober DR - Fix aftermath staging Change 3379229 on 2017/04/04 by Arne.Schober DR - Fix missing include Change 3379374 on 2017/04/04 by Mark.Satterthwaite Revert an accidentally merged change in MacPlatformProcess that relies on further changes from the Metal task stream. Change 3379505 on 2017/04/04 by Rolando.Caloca DR - Fix mismatched interpolators Change 3379539 on 2017/04/04 by Mark.Satterthwaite No FFT for any hlslcc platform - the IR for one or more RWTexture2D isn't quite right... #jira UE-43626 Change 3379561 on 2017/04/04 by Rolando.Caloca DR - Fix root signature issues on D3D12 PC Change 3379590 on 2017/04/04 by Mark.Satterthwaite Back out changelist 3379539 & change the shader slightly instead, the HLSLCC library generates bogus IR when you have an inout RWTexture. #jira UE-43626 Change 3379917 on 2017/04/04 by Uriel.Doyon Fix to input mismatch Change 3380578 on 2017/04/05 by Chris.Bunner Shader type fixes. #jira UE-43652 Change 3380639 on 2017/04/05 by Rolando.Caloca DR - Expose GetOrCreate PSO and document Change 3380821 on 2017/04/05 by Guillaume.Abadie Fixes a crash in USceneCaptureComponent::UpdateDeferredCaptures() #jira UE-43642 Change 3381092 on 2017/04/05 by Guillaume.Abadie Cherry pick 3362517: Implements TAA's scene color unpremultiplication from alpha channel to reduce DOF alpha channel temporal ghosting. This CL take the oportunity to transform AA_ALPHA to an compile time enumeration, and add a basic TAA compile time configuration validation to improve readability of the different TAA passes' configurations. Change 3381300 on 2017/04/05 by Mark.Satterthwaite Quick fix for changes to MetalRHI's render-thread safe texture creation not correctly handling AVFoundation video player handing us an IOSurface. #jira UE-43597 Change 3381359 on 2017/04/05 by Guillaume.Abadie Back out changelist 3381092 Change 3381421 on 2017/04/05 by Mark.Satterthwaite Amended CL #3380995 from Richard Wallis to address crash in the Material Editor under the validation layer - when there are no textures bound the default pass descriptor assigns store actions, which means we can't override them with our deferred store actions. #jira UE-43689 Change 3381422 on 2017/04/05 by Mark.Satterthwaite Absolute time queries can't be batched in Metal but I also can't rely on them being started with a call to BeginQuery - only EndQuery. #jira UE-43691 Change 3381503 on 2017/04/05 by Daniel.Wright More intuitive controls for Volumetric Fog * Removed ScatteringScale / AbsorptionScale on Exponential Height Fog and added Albedo / Extinction * InscatteringColorCubemap is now supported by Volumetric Fog * Particle lights have a default VolumetricScatteringIntensity of 0 to avoid trailing * Tweaked GVolumetricFogDepthDistributionScale better for nearby details * Volume Materials have twice the interpolators available Change 3381527 on 2017/04/05 by Mark.Satterthwaite Disable Private GPU storage for PVRTC texture formats on iOS Metal - these require more changes to the blit-encoder usage as PVRTC has strange requirements. Change 3381671 on 2017/04/05 by Mark.Satterthwaite Better error message for failure to compile shaders remotely from PC for Metal. Change 3381769 on 2017/04/05 by Rolando.Caloca DR - Added lock texture array 2d on Vulkan Change 3382003 on 2017/04/05 by Mark.Satterthwaite Remove the automatic Metal aliasing/re-use when releasing some resource types as it doesn't work as intended. Change 3382030 on 2017/04/05 by Zachary.Wilson Fix compiling Metal text shaders from PC broken in merge from task stream. #submitter mark.satterthwaite #jira UE-43652 Change 3382880 on 2017/04/06 by Mark.Satterthwaite Michael Trepka's CL #3379927: VolumetricFogVoxelization implementation for Mac Change 3383315 on 2017/04/06 by Mark.Satterthwaite Partially revert CL #3382003 - the emulated Metal heaps require invoking makeAliasable in order to reclaim memory. #jira UE-43739 Change 3384639 on 2017/04/07 by Marcus.Wassmer Move ShaderResource version bump to RenderingObjectVersion Change 3384704 on 2017/04/07 by Mark.Satterthwaite Compile fix for merge. Change 3384933 on 2017/04/07 by Rolando.Caloca DR - Fix skin cache crash with BP (copy 3384714) Change 3385104 on 2017/04/07 by Mark.Satterthwaite Fix MetalRHI's abs(int2) handling - it can't be translated to fabs(int2) as that won't compile. Also rebuild hlslcc for my sanity. #jira UE-43783 Change 3385105 on 2017/04/07 by Mark.Satterthwaite Force a shader rebuild to ensure that everybody picks up the fix for #jira UE-43783 #jira UE-43783 Change 3385118 on 2017/04/07 by Arne.Schober DR - [OR-37359] - Fix disapearing Decals when StencilLod Fade is enabled #RB none Change 3385149 on 2017/04/07 by Marcus.Wassmer Fix skincache motion blur Change 3385189 on 2017/04/07 by Rolando.Caloca DR - Fix swapchain format for editor on Vulkan Change 3385287 on 2017/04/07 by Mark.Satterthwaite Enable SM5 on Intel as of 10.12.4 and later. Change 3385347 on 2017/04/07 by Rolando.Caloca DR - Temp fix for GL4 corruption on editor #jira UE-43785 Change 3385363 on 2017/04/07 by Rolando.Caloca DR - Actually fix all win platforms for GL bug #jira UE-43785 Change 3385557 on 2017/04/07 by Arne.Schober DR - [UE-43205] - Fix mesh paint #RB none Change 3385608 on 2017/04/07 by Daniel.Wright Fixed SampleCmp being used on a non-depth texture, causing a d3d error Change 3385980 on 2017/04/10 by Rolando.Caloca DR - Remove transition functions RHIClearColor* RHIClearDepthStencilTexture Change 3386042 on 2017/04/10 by Rolando.Caloca DR - Fix metal merge issue Change 3386157 on 2017/04/10 by Rolando.Caloca DR - Remove VS2013 libs generation off hlslcc & glslang (to match main) Change 3386356 on 2017/04/10 by Chris.Bunner Resolving merge errors. Change 3386414 on 2017/04/10 by Chris.Bunner Resolved merge issue in RendererScene.cpp. Change 3386700 on 2017/04/10 by Mark.Satterthwaite Silence documentation warnings. Change 3387178 on 2017/04/10 by Chris.Bunner Removed invalid mask correction on MakeMA material nodes. Change 3388177 on 2017/04/11 by Marcus.Wassmer Disable ensure that is no longer relevant now that we bind clear colors on texture creation Change 3388261 on 2017/04/11 by Chris.Bunner Static analysis fix. [CL 3388266 by Chris Bunner in Main branch]
2017-04-11 10:32:07 -04:00
Desc.Flags | Desc.TargetableFlags,
CreateInfo);
// 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,
CreateInfo,
(FTextureCubeRHIRef&)Found->RenderTargetItem.TargetableTexture,
(FTextureCubeRHIRef&)Found->RenderTargetItem.ShaderResourceTexture
);
}
else
{
RHICreateTargetableShaderResourceCube(
Desc.Extent.X,
Desc.Format,
Desc.NumMips,
Desc.Flags,
Desc.TargetableFlags,
false,
CreateInfo,
(FTextureCubeRHIRef&)Found->RenderTargetItem.TargetableTexture,
(FTextureCubeRHIRef&)Found->RenderTargetItem.ShaderResourceTexture
);
}
}
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
RHIBindDebugLabelName(Found->RenderTargetItem.TargetableTexture, InDebugName);
#endif
}
else
{
if (Desc.Is2DTexture())
{
// this is useful to get a CPU lockable texture through the same interface
if (!Desc.IsArray())
{
Found->RenderTargetItem.ShaderResourceTexture = RHICreateTexture2D(
Desc.Extent.X,
Desc.Extent.Y,
Desc.Format,
Desc.NumMips,
Desc.NumSamples,
Desc.Flags,
CreateInfo);
}
else
{
Found->RenderTargetItem.ShaderResourceTexture = RHICreateTexture2DArray(
Desc.Extent.X,
Desc.Extent.Y,
Desc.ArraySize,
Desc.Format,
Desc.NumMips,
Desc.NumSamples,
Desc.Flags,
CreateInfo);
}
}
else if (Desc.Is3DTexture())
{
Found->RenderTargetItem.ShaderResourceTexture = RHICreateTexture3D(
Desc.Extent.X,
Desc.Extent.Y,
Desc.Depth,
Desc.Format,
Desc.NumMips,
Desc.Flags,
CreateInfo);
}
else
{
check(Desc.IsCubemap());
if (Desc.IsArray())
{
FTextureCubeRHIRef CubeTexture = RHICreateTextureCubeArray(Desc.Extent.X, Desc.ArraySize, Desc.Format, Desc.NumMips, Desc.Flags | Desc.TargetableFlags | TexCreate_ShaderResource, CreateInfo);
Found->RenderTargetItem.TargetableTexture = Found->RenderTargetItem.ShaderResourceTexture = CubeTexture;
}
else
{
FTextureCubeRHIRef CubeTexture = RHICreateTextureCube(Desc.Extent.X, Desc.Format, Desc.NumMips, Desc.Flags | Desc.TargetableFlags | TexCreate_ShaderResource, CreateInfo);
Found->RenderTargetItem.TargetableTexture = Found->RenderTargetItem.ShaderResourceTexture = CubeTexture;
}
}
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
RHIBindDebugLabelName(Found->RenderTargetItem.ShaderResourceTexture, InDebugName);
#endif
}
if (EnumHasAnyFlags(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.
check(GMaxRHIFeatureLevel >= ERHIFeatureLevel::SM5 || GMaxRHIFeatureLevel == ERHIFeatureLevel::ES3_1);
if (GRHISupportsUAVFormatAliasing)
{
EPixelFormat AliasFormat = Desc.UAVFormat != PF_Unknown
? Desc.UAVFormat
: Desc.Format;
Found->RenderTargetItem.UAV = RHICreateUnorderedAccessView(Found->RenderTargetItem.TargetableTexture, 0, AliasFormat);
}
else
{
checkf(Desc.UAVFormat == PF_Unknown || Desc.UAVFormat == Desc.Format, TEXT("UAV aliasing is not supported by the current RHI."));
Found->RenderTargetItem.UAV = RHICreateUnorderedAccessView(Found->RenderTargetItem.TargetableTexture, 0);
}
}
AllocationLevelInKB += ComputeSizeInKB(*Found);
FoundIndex = PooledRenderTargets.Num() - 1;
Found->Desc.DebugName = InDebugName;
}
check(Found->IsFree());
Found->Desc.DebugName = InDebugName;
Found->UnusedForNFrames = 0;
AddAllocEvent(FoundIndex, Found);
Copying //UE4/Dev-Console to //UE4/Dev-Main (Source: //UE4/Dev-Console @ 3483086) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3389969 on 2017/04/12 by Guillaume.Abadie Implements FDebug::DumpStackTraceToLog() debugging utility. Change 3391579 on 2017/04/12 by Joe.Barnes Fix minor spacing issue. Change 3402629 on 2017/04/20 by Ben.Marsh Build: Remove job to populate the DDC. Trying out a new system for this. Change 3417501 on 2017/05/01 by Joe.Barnes IWYU - Missing #include files. Change 3419927 on 2017/05/02 by Joe.Barnes - Support custom LOD for shadow map generation only (r.ForceLODShadow) - New #define to expose forceLOD and forceLODShadow also in Test/Ship builds (#define EXPOSE_FORCE_LOD 1 in RenderCore.cpp). Not exposed by default. Change 3420964 on 2017/05/03 by Jonathan.Fitzpatrick Fixed null dereference of LineBatcher when using DrawDebugSphere and DrawDebugAltCone #jira UE-30213 Change 3423470 on 2017/05/04 by Luke.Thatcher [CONSOLE] [STREAMS] [^] Merging //UE4/Dev-Main (CL 3391974) to Dev-Console (//UE4/Dev-Console) - Compile errors in Switch, to be fixed after check-in. Change 3430410 on 2017/05/09 by Ben.Woodhouse Fix uninitialized local variable causing crashes in Test #jira UE-44832 Change 3430506 on 2017/05/09 by Josh.Adams - Fixed up the editor platforms' method of loading TargetSettings objects so that we don't need any manual parsing of .ini files to fill out the class defaults Change 3434035 on 2017/05/10 by Ben.Woodhouse Integrate updated FortGPUTestbed from Fortnite/Main Change 3437046 on 2017/05/12 by Joe.Barnes Fix for clang producing a warning when not all specializations of a templated function are marked FORCEINLINE. Also, switch a specialization of BlendTransform() from a function with a check to just a declaration so compiler will catch error instead of a runtime catch. Change 3437259 on 2017/05/12 by Joe.Barnes Fix for clang producing a warning when not all specializations of a templated function are marked FORCEINLINE. Also, switch a specialization of BlendTransform() from a function with a check to just a declaration so compiler will catch error instead of a runtime catch. Change 3440758 on 2017/05/16 by Ben.Woodhouse Simple threaded CSV Profiler To capture: - On the commandline, add -csvCaptureFrames=N to capture N frames from startup - On the console, use csvprofile start, csvprofile stop or csvprofile frames=N to capture a fixed number of frames - Instrument with CSV_SCOPED_STAT(statname), CSV_CUSTOM_STAT(statname,value). CSV capture is enabled in all builds except shipping - Please do not check in the instrumentation √ we don╞t want to pollute the engine with lots of additional instrumentation. We may add some minimal level of instrumentation at some point Change 3440954 on 2017/05/16 by Josh.Adams - Cleaned up some DeviceProfiles in BaseDP.ini Change 3443778 on 2017/05/17 by Ben.Woodhouse Aliasing for transient resources + new high level API Changelists integrated: 3368830 3368887 3377762 3377763 3379513 3381840 3382046 3382138 3385390 3385391 3385531 3396613 3388752 3396756 3397007 3397059 3397780 3397883 3401716 3415179 Change 3451460 on 2017/05/22 by Ben.Woodhouse Fix editor crash (NULL dereference of ScreenSpaceShadowTexture) when moving the camera around in tm-shadermodels, probably fallout from the VRAM aliasing merge. Not sure if this is the correct fix, but it prevents the crash for now Change 3451601 on 2017/05/22 by Josh.Adams - Track idle time from MaxTickRate, so that stat unit is accurate on Game: thread Change 3452025 on 2017/05/22 by Ben.Woodhouse Integrate (as edit) CL 3378734 (editor crash fix) Also add a check for null in LightFunctionRendering.cpp Change 3452389 on 2017/05/22 by Josh.Adams - Replaced POCulturePluralForms with a static array, instead of TMapBuilder (was blowing stack or similar on Switch Debug). Code courtesy of Jamie Dale. Change 3452758 on 2017/05/22 by Joe.Barnes Add FindFirstClearBit() and FindFirstSetBit() to TStaticBitArray. Change 3455889 on 2017/05/23 by Ben.Woodhouse Integrate from //UE4/Main/...@3453436 to //UE4/Dev-Console/... Change 3458654 on 2017/05/25 by Joe.Conley Attempting to fix Static Analysis warning. Change 3462710 on 2017/05/26 by Ben.Woodhouse Integrate from //UE4/Main/...@3461688 to //UE4/Dev-Console/... Change 3471711 on 2017/06/02 by Jonathan.Fitzpatrick Updating MallocProfiler to use the accessor for OnOutOfMemory delegate to conform with change made in CL 3415996. Change 3473813 on 2017/06/05 by Ben.Woodhouse Fix streaming visibility logic bug reported on UDN #jira UE-43892 Change 3475298 on 2017/06/06 by Luke.Thatcher [CONSOLE] [!] Fix RHITransitionResources crash with more than 16 textures. - Old command had a fixed sized array of 16 textures that would overflow. - New command allocates an array of texture pointers inline in the command list, so any number is supported. #jira UE-45625 Change 3476776 on 2017/06/06 by Ben.Woodhouse Integrate from //UE4/Main/...@3475908 Change 3479083 on 2017/06/07 by Ben.Woodhouse Integrate as edit CL 3467315 from dev-animphys: From Alexis Matte. Ensure SectionMap is fixed up for old entries that are no longer valid. #JIRA UE-45438 #jira UE-45735 Change 3480576 on 2017/06/08 by Ben.Woodhouse Integrate from //UE4/Main/...@3480024 to //UE4/Dev-Console/... [CL 3483258 by Luke Thatcher in Main branch]
2017-06-09 17:44:13 -04:00
uint32 OriginalNumRefs = Found->GetRefCount();
// assign to the reference counted variable
TRefCountPtr<FPooledRenderTarget> Result = Found;
check(!Found->IsFree());
// Only referenced by the pool, map the physical pages
if (Found->IsTransient() && OriginalNumRefs == 1 && Found->GetRenderTargetItem().TargetableTexture != nullptr)
Copying //UE4/Dev-Console to //UE4/Dev-Main (Source: //UE4/Dev-Console @ 3483086) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3389969 on 2017/04/12 by Guillaume.Abadie Implements FDebug::DumpStackTraceToLog() debugging utility. Change 3391579 on 2017/04/12 by Joe.Barnes Fix minor spacing issue. Change 3402629 on 2017/04/20 by Ben.Marsh Build: Remove job to populate the DDC. Trying out a new system for this. Change 3417501 on 2017/05/01 by Joe.Barnes IWYU - Missing #include files. Change 3419927 on 2017/05/02 by Joe.Barnes - Support custom LOD for shadow map generation only (r.ForceLODShadow) - New #define to expose forceLOD and forceLODShadow also in Test/Ship builds (#define EXPOSE_FORCE_LOD 1 in RenderCore.cpp). Not exposed by default. Change 3420964 on 2017/05/03 by Jonathan.Fitzpatrick Fixed null dereference of LineBatcher when using DrawDebugSphere and DrawDebugAltCone #jira UE-30213 Change 3423470 on 2017/05/04 by Luke.Thatcher [CONSOLE] [STREAMS] [^] Merging //UE4/Dev-Main (CL 3391974) to Dev-Console (//UE4/Dev-Console) - Compile errors in Switch, to be fixed after check-in. Change 3430410 on 2017/05/09 by Ben.Woodhouse Fix uninitialized local variable causing crashes in Test #jira UE-44832 Change 3430506 on 2017/05/09 by Josh.Adams - Fixed up the editor platforms' method of loading TargetSettings objects so that we don't need any manual parsing of .ini files to fill out the class defaults Change 3434035 on 2017/05/10 by Ben.Woodhouse Integrate updated FortGPUTestbed from Fortnite/Main Change 3437046 on 2017/05/12 by Joe.Barnes Fix for clang producing a warning when not all specializations of a templated function are marked FORCEINLINE. Also, switch a specialization of BlendTransform() from a function with a check to just a declaration so compiler will catch error instead of a runtime catch. Change 3437259 on 2017/05/12 by Joe.Barnes Fix for clang producing a warning when not all specializations of a templated function are marked FORCEINLINE. Also, switch a specialization of BlendTransform() from a function with a check to just a declaration so compiler will catch error instead of a runtime catch. Change 3440758 on 2017/05/16 by Ben.Woodhouse Simple threaded CSV Profiler To capture: - On the commandline, add -csvCaptureFrames=N to capture N frames from startup - On the console, use csvprofile start, csvprofile stop or csvprofile frames=N to capture a fixed number of frames - Instrument with CSV_SCOPED_STAT(statname), CSV_CUSTOM_STAT(statname,value). CSV capture is enabled in all builds except shipping - Please do not check in the instrumentation √ we don╞t want to pollute the engine with lots of additional instrumentation. We may add some minimal level of instrumentation at some point Change 3440954 on 2017/05/16 by Josh.Adams - Cleaned up some DeviceProfiles in BaseDP.ini Change 3443778 on 2017/05/17 by Ben.Woodhouse Aliasing for transient resources + new high level API Changelists integrated: 3368830 3368887 3377762 3377763 3379513 3381840 3382046 3382138 3385390 3385391 3385531 3396613 3388752 3396756 3397007 3397059 3397780 3397883 3401716 3415179 Change 3451460 on 2017/05/22 by Ben.Woodhouse Fix editor crash (NULL dereference of ScreenSpaceShadowTexture) when moving the camera around in tm-shadermodels, probably fallout from the VRAM aliasing merge. Not sure if this is the correct fix, but it prevents the crash for now Change 3451601 on 2017/05/22 by Josh.Adams - Track idle time from MaxTickRate, so that stat unit is accurate on Game: thread Change 3452025 on 2017/05/22 by Ben.Woodhouse Integrate (as edit) CL 3378734 (editor crash fix) Also add a check for null in LightFunctionRendering.cpp Change 3452389 on 2017/05/22 by Josh.Adams - Replaced POCulturePluralForms with a static array, instead of TMapBuilder (was blowing stack or similar on Switch Debug). Code courtesy of Jamie Dale. Change 3452758 on 2017/05/22 by Joe.Barnes Add FindFirstClearBit() and FindFirstSetBit() to TStaticBitArray. Change 3455889 on 2017/05/23 by Ben.Woodhouse Integrate from //UE4/Main/...@3453436 to //UE4/Dev-Console/... Change 3458654 on 2017/05/25 by Joe.Conley Attempting to fix Static Analysis warning. Change 3462710 on 2017/05/26 by Ben.Woodhouse Integrate from //UE4/Main/...@3461688 to //UE4/Dev-Console/... Change 3471711 on 2017/06/02 by Jonathan.Fitzpatrick Updating MallocProfiler to use the accessor for OnOutOfMemory delegate to conform with change made in CL 3415996. Change 3473813 on 2017/06/05 by Ben.Woodhouse Fix streaming visibility logic bug reported on UDN #jira UE-43892 Change 3475298 on 2017/06/06 by Luke.Thatcher [CONSOLE] [!] Fix RHITransitionResources crash with more than 16 textures. - Old command had a fixed sized array of 16 textures that would overflow. - New command allocates an array of texture pointers inline in the command list, so any number is supported. #jira UE-45625 Change 3476776 on 2017/06/06 by Ben.Woodhouse Integrate from //UE4/Main/...@3475908 Change 3479083 on 2017/06/07 by Ben.Woodhouse Integrate as edit CL 3467315 from dev-animphys: From Alexis Matte. Ensure SectionMap is fixed up for old entries that are no longer valid. #JIRA UE-45438 #jira UE-45735 Change 3480576 on 2017/06/08 by Ben.Woodhouse Integrate from //UE4/Main/...@3480024 to //UE4/Dev-Console/... [CL 3483258 by Luke Thatcher in Main branch]
2017-06-09 17:44:13 -04:00
{
RHIAcquireTransientResource(Found->GetRenderTargetItem().TargetableTexture);
Copying //UE4/Dev-Console to //UE4/Dev-Main (Source: //UE4/Dev-Console @ 3483086) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3389969 on 2017/04/12 by Guillaume.Abadie Implements FDebug::DumpStackTraceToLog() debugging utility. Change 3391579 on 2017/04/12 by Joe.Barnes Fix minor spacing issue. Change 3402629 on 2017/04/20 by Ben.Marsh Build: Remove job to populate the DDC. Trying out a new system for this. Change 3417501 on 2017/05/01 by Joe.Barnes IWYU - Missing #include files. Change 3419927 on 2017/05/02 by Joe.Barnes - Support custom LOD for shadow map generation only (r.ForceLODShadow) - New #define to expose forceLOD and forceLODShadow also in Test/Ship builds (#define EXPOSE_FORCE_LOD 1 in RenderCore.cpp). Not exposed by default. Change 3420964 on 2017/05/03 by Jonathan.Fitzpatrick Fixed null dereference of LineBatcher when using DrawDebugSphere and DrawDebugAltCone #jira UE-30213 Change 3423470 on 2017/05/04 by Luke.Thatcher [CONSOLE] [STREAMS] [^] Merging //UE4/Dev-Main (CL 3391974) to Dev-Console (//UE4/Dev-Console) - Compile errors in Switch, to be fixed after check-in. Change 3430410 on 2017/05/09 by Ben.Woodhouse Fix uninitialized local variable causing crashes in Test #jira UE-44832 Change 3430506 on 2017/05/09 by Josh.Adams - Fixed up the editor platforms' method of loading TargetSettings objects so that we don't need any manual parsing of .ini files to fill out the class defaults Change 3434035 on 2017/05/10 by Ben.Woodhouse Integrate updated FortGPUTestbed from Fortnite/Main Change 3437046 on 2017/05/12 by Joe.Barnes Fix for clang producing a warning when not all specializations of a templated function are marked FORCEINLINE. Also, switch a specialization of BlendTransform() from a function with a check to just a declaration so compiler will catch error instead of a runtime catch. Change 3437259 on 2017/05/12 by Joe.Barnes Fix for clang producing a warning when not all specializations of a templated function are marked FORCEINLINE. Also, switch a specialization of BlendTransform() from a function with a check to just a declaration so compiler will catch error instead of a runtime catch. Change 3440758 on 2017/05/16 by Ben.Woodhouse Simple threaded CSV Profiler To capture: - On the commandline, add -csvCaptureFrames=N to capture N frames from startup - On the console, use csvprofile start, csvprofile stop or csvprofile frames=N to capture a fixed number of frames - Instrument with CSV_SCOPED_STAT(statname), CSV_CUSTOM_STAT(statname,value). CSV capture is enabled in all builds except shipping - Please do not check in the instrumentation √ we don╞t want to pollute the engine with lots of additional instrumentation. We may add some minimal level of instrumentation at some point Change 3440954 on 2017/05/16 by Josh.Adams - Cleaned up some DeviceProfiles in BaseDP.ini Change 3443778 on 2017/05/17 by Ben.Woodhouse Aliasing for transient resources + new high level API Changelists integrated: 3368830 3368887 3377762 3377763 3379513 3381840 3382046 3382138 3385390 3385391 3385531 3396613 3388752 3396756 3397007 3397059 3397780 3397883 3401716 3415179 Change 3451460 on 2017/05/22 by Ben.Woodhouse Fix editor crash (NULL dereference of ScreenSpaceShadowTexture) when moving the camera around in tm-shadermodels, probably fallout from the VRAM aliasing merge. Not sure if this is the correct fix, but it prevents the crash for now Change 3451601 on 2017/05/22 by Josh.Adams - Track idle time from MaxTickRate, so that stat unit is accurate on Game: thread Change 3452025 on 2017/05/22 by Ben.Woodhouse Integrate (as edit) CL 3378734 (editor crash fix) Also add a check for null in LightFunctionRendering.cpp Change 3452389 on 2017/05/22 by Josh.Adams - Replaced POCulturePluralForms with a static array, instead of TMapBuilder (was blowing stack or similar on Switch Debug). Code courtesy of Jamie Dale. Change 3452758 on 2017/05/22 by Joe.Barnes Add FindFirstClearBit() and FindFirstSetBit() to TStaticBitArray. Change 3455889 on 2017/05/23 by Ben.Woodhouse Integrate from //UE4/Main/...@3453436 to //UE4/Dev-Console/... Change 3458654 on 2017/05/25 by Joe.Conley Attempting to fix Static Analysis warning. Change 3462710 on 2017/05/26 by Ben.Woodhouse Integrate from //UE4/Main/...@3461688 to //UE4/Dev-Console/... Change 3471711 on 2017/06/02 by Jonathan.Fitzpatrick Updating MallocProfiler to use the accessor for OnOutOfMemory delegate to conform with change made in CL 3415996. Change 3473813 on 2017/06/05 by Ben.Woodhouse Fix streaming visibility logic bug reported on UDN #jira UE-43892 Change 3475298 on 2017/06/06 by Luke.Thatcher [CONSOLE] [!] Fix RHITransitionResources crash with more than 16 textures. - Old command had a fixed sized array of 16 textures that would overflow. - New command allocates an array of texture pointers inline in the command list, so any number is supported. #jira UE-45625 Change 3476776 on 2017/06/06 by Ben.Woodhouse Integrate from //UE4/Main/...@3475908 Change 3479083 on 2017/06/07 by Ben.Woodhouse Integrate as edit CL 3467315 from dev-animphys: From Alexis Matte. Ensure SectionMap is fixed up for old entries that are no longer valid. #JIRA UE-45438 #jira UE-45735 Change 3480576 on 2017/06/08 by Ben.Woodhouse Integrate from //UE4/Main/...@3480024 to //UE4/Dev-Console/... [CL 3483258 by Luke Thatcher in Main branch]
2017-06-09 17:44:13 -04:00
}
// Transient RTs have to be targettable
check(!EnumHasAnyFlags(Desc.Flags, TexCreate_Transient) || Found->GetRenderTargetItem().TargetableTexture != nullptr);
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
if (Found->GetRenderTargetItem().TargetableTexture)
{
RHIBindDebugLabelName(Found->GetRenderTargetItem().TargetableTexture, InDebugName);
}
#endif
return MoveTemp(Result);
}
bool FRenderTargetPool::FindFreeElement(
FRHICommandList& RHICmdList,
const FPooledRenderTargetDesc& InputDesc,
TRefCountPtr<IPooledRenderTarget>& Out,
const TCHAR* InDebugName,
ERenderTargetTransience TransienceHint)
{
check(IsInRenderingThread());
if (!InputDesc.IsValid())
{
// no need to do anything
return true;
}
// Querying a render target that have no mip levels makes no sens.
check(InputDesc.NumMips > 0);
// Make sure if requesting a depth format that the clear value is correct
ensure(!(InputDesc.Flags & TexCreate_DepthStencilTargetable) || (InputDesc.ClearValue.ColorBinding == EClearBinding::ENoneBound || InputDesc.ClearValue.ColorBinding == EClearBinding::EDepthStencilBound));
// TexCreate_FastVRAM should be used on Desc.Flags
ensure(!EnumHasAnyFlags(InputDesc.TargetableFlags, TexCreate_FastVRAM));
// If we're doing aliasing, we may need to override Transient flags, depending on the input format and mode
FPooledRenderTargetDesc ModifiedDesc;
bool bMakeTransient = DoesTargetNeedTransienceOverride(InputDesc.Flags | InputDesc.TargetableFlags, TransienceHint);
if (bMakeTransient)
{
ModifiedDesc = InputDesc;
ModifiedDesc.Flags |= TexCreate_Transient;
}
// Override the descriptor if necessary
const FPooledRenderTargetDesc& Desc = bMakeTransient ? ModifiedDesc : InputDesc;
// if we can keep the current one, do that
if (Out)
{
FPooledRenderTarget* Current = (FPooledRenderTarget*)Out.GetReference();
const bool bExactMatch = true;
if (Out->GetDesc().Compare(Desc, bExactMatch))
{
// we can reuse the same, but the debug name might have changed
Current->Desc.DebugName = InDebugName;
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
if (Current->GetRenderTargetItem().TargetableTexture)
{
RHIBindDebugLabelName(Current->GetRenderTargetItem().TargetableTexture, InDebugName);
}
#endif
check(!Out->IsFree());
return true;
}
else
{
// release old reference, it might free a RT we can use
Out = 0;
if (Current->IsFree())
{
AllocationLevelInKB -= ComputeSizeInKB(*Current);
int32 Index = FindIndex(Current);
check(Index >= 0);
FreeElementAtIndex(Index);
}
}
}
TRefCountPtr<FPooledRenderTarget> Result = FindFreeElementInternal(RHICmdList, Desc, InDebugName);
// Reset RDG state back to an unknown default. The resource is being handed off to a user outside of RDG, so the state is no longer valid.
{
FRDGPooledTexture* TargetableTexture = Result->TargetableTexture;
FRDGPooledTexture* ShaderResourceTexture = Result->ShaderResourceTexture;
if (TargetableTexture)
{
checkf(!TargetableTexture->GetOwner(), TEXT("Allocated a pooled render target that is currently owned by RDG texture %s."), TargetableTexture->GetOwner()->Name);
TargetableTexture->Reset();
}
if (ShaderResourceTexture && ShaderResourceTexture != TargetableTexture)
{
checkf(!ShaderResourceTexture->GetOwner(), TEXT("Allocated a pooled render target that is currently owned by RDG texture %s."), ShaderResourceTexture->GetOwner()->Name);
ShaderResourceTexture->Reset();
}
}
Out = Result;
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
Copying //UE4/Dev-Console to //UE4/Dev-Main (Source: //UE4/Dev-Console @ 3483086) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3389969 on 2017/04/12 by Guillaume.Abadie Implements FDebug::DumpStackTraceToLog() debugging utility. Change 3391579 on 2017/04/12 by Joe.Barnes Fix minor spacing issue. Change 3402629 on 2017/04/20 by Ben.Marsh Build: Remove job to populate the DDC. Trying out a new system for this. Change 3417501 on 2017/05/01 by Joe.Barnes IWYU - Missing #include files. Change 3419927 on 2017/05/02 by Joe.Barnes - Support custom LOD for shadow map generation only (r.ForceLODShadow) - New #define to expose forceLOD and forceLODShadow also in Test/Ship builds (#define EXPOSE_FORCE_LOD 1 in RenderCore.cpp). Not exposed by default. Change 3420964 on 2017/05/03 by Jonathan.Fitzpatrick Fixed null dereference of LineBatcher when using DrawDebugSphere and DrawDebugAltCone #jira UE-30213 Change 3423470 on 2017/05/04 by Luke.Thatcher [CONSOLE] [STREAMS] [^] Merging //UE4/Dev-Main (CL 3391974) to Dev-Console (//UE4/Dev-Console) - Compile errors in Switch, to be fixed after check-in. Change 3430410 on 2017/05/09 by Ben.Woodhouse Fix uninitialized local variable causing crashes in Test #jira UE-44832 Change 3430506 on 2017/05/09 by Josh.Adams - Fixed up the editor platforms' method of loading TargetSettings objects so that we don't need any manual parsing of .ini files to fill out the class defaults Change 3434035 on 2017/05/10 by Ben.Woodhouse Integrate updated FortGPUTestbed from Fortnite/Main Change 3437046 on 2017/05/12 by Joe.Barnes Fix for clang producing a warning when not all specializations of a templated function are marked FORCEINLINE. Also, switch a specialization of BlendTransform() from a function with a check to just a declaration so compiler will catch error instead of a runtime catch. Change 3437259 on 2017/05/12 by Joe.Barnes Fix for clang producing a warning when not all specializations of a templated function are marked FORCEINLINE. Also, switch a specialization of BlendTransform() from a function with a check to just a declaration so compiler will catch error instead of a runtime catch. Change 3440758 on 2017/05/16 by Ben.Woodhouse Simple threaded CSV Profiler To capture: - On the commandline, add -csvCaptureFrames=N to capture N frames from startup - On the console, use csvprofile start, csvprofile stop or csvprofile frames=N to capture a fixed number of frames - Instrument with CSV_SCOPED_STAT(statname), CSV_CUSTOM_STAT(statname,value). CSV capture is enabled in all builds except shipping - Please do not check in the instrumentation √ we don╞t want to pollute the engine with lots of additional instrumentation. We may add some minimal level of instrumentation at some point Change 3440954 on 2017/05/16 by Josh.Adams - Cleaned up some DeviceProfiles in BaseDP.ini Change 3443778 on 2017/05/17 by Ben.Woodhouse Aliasing for transient resources + new high level API Changelists integrated: 3368830 3368887 3377762 3377763 3379513 3381840 3382046 3382138 3385390 3385391 3385531 3396613 3388752 3396756 3397007 3397059 3397780 3397883 3401716 3415179 Change 3451460 on 2017/05/22 by Ben.Woodhouse Fix editor crash (NULL dereference of ScreenSpaceShadowTexture) when moving the camera around in tm-shadermodels, probably fallout from the VRAM aliasing merge. Not sure if this is the correct fix, but it prevents the crash for now Change 3451601 on 2017/05/22 by Josh.Adams - Track idle time from MaxTickRate, so that stat unit is accurate on Game: thread Change 3452025 on 2017/05/22 by Ben.Woodhouse Integrate (as edit) CL 3378734 (editor crash fix) Also add a check for null in LightFunctionRendering.cpp Change 3452389 on 2017/05/22 by Josh.Adams - Replaced POCulturePluralForms with a static array, instead of TMapBuilder (was blowing stack or similar on Switch Debug). Code courtesy of Jamie Dale. Change 3452758 on 2017/05/22 by Joe.Barnes Add FindFirstClearBit() and FindFirstSetBit() to TStaticBitArray. Change 3455889 on 2017/05/23 by Ben.Woodhouse Integrate from //UE4/Main/...@3453436 to //UE4/Dev-Console/... Change 3458654 on 2017/05/25 by Joe.Conley Attempting to fix Static Analysis warning. Change 3462710 on 2017/05/26 by Ben.Woodhouse Integrate from //UE4/Main/...@3461688 to //UE4/Dev-Console/... Change 3471711 on 2017/06/02 by Jonathan.Fitzpatrick Updating MallocProfiler to use the accessor for OnOutOfMemory delegate to conform with change made in CL 3415996. Change 3473813 on 2017/06/05 by Ben.Woodhouse Fix streaming visibility logic bug reported on UDN #jira UE-43892 Change 3475298 on 2017/06/06 by Luke.Thatcher [CONSOLE] [!] Fix RHITransitionResources crash with more than 16 textures. - Old command had a fixed sized array of 16 textures that would overflow. - New command allocates an array of texture pointers inline in the command list, so any number is supported. #jira UE-45625 Change 3476776 on 2017/06/06 by Ben.Woodhouse Integrate from //UE4/Main/...@3475908 Change 3479083 on 2017/06/07 by Ben.Woodhouse Integrate as edit CL 3467315 from dev-animphys: From Alexis Matte. Ensure SectionMap is fixed up for old entries that are no longer valid. #JIRA UE-45438 #jira UE-45735 Change 3480576 on 2017/06/08 by Ben.Woodhouse Integrate from //UE4/Main/...@3480024 to //UE4/Dev-Console/... [CL 3483258 by Luke Thatcher in Main branch]
2017-06-09 17:44:13 -04:00
FPooledRenderTarget* Found = new FPooledRenderTarget(Desc, NULL);
Found->RenderTargetItem = Item;
// assign to the reference counted variable
Out = Found;
}
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];
if (Element)
{
uint32 SizeInKB = ComputeSizeInKB(*Element);
OutWholePoolInKB += SizeInKB;
if (!Element->IsFree())
{
OutUsedInKB += SizeInKB;
}
}
}
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);
}
void FRenderTargetPool::AddPhaseEvent(const TCHAR* InPhaseName)
{
if (IsEventRecordingEnabled())
{
AddDeallocEvents();
const FString* LastName = GetLastEventPhaseName();
if (!LastName || *LastName != InPhaseName)
{
if (CurrentEventRecordingTime)
{
// put a break to former data
++CurrentEventRecordingTime;
}
FRenderTargetPoolEvent NewEvent(InPhaseName, CurrentEventRecordingTime);
RenderTargetPoolEvents.Add(NewEvent);
}
}
}
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
{
FString Name;
// 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)
: Name(Event.GetDesc().DebugName)
, PoolEntryId(Event.GetPoolEntryId())
, bVRam(EnumHasAnyFlags(Event.GetDesc().Flags, TexCreate_FastVRAM))
{
SizeInBytes = Event.GetSizeInBytes();
}
// sort criteria
bool operator < (const FRTPColumn& RHS) const
{
if (SizeInBytes == RHS.SizeInBytes)
{
return Name < RHS.Name;
}
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.StableSort();
{
uint32 ColumnX = 0;
for (int32 ColumnIndex = 0, ColumnsNum = Colums.Num(); ColumnIndex < ColumnsNum; ++ColumnIndex)
{
const FRTPColumn& RTPColumn = Colums[ColumnIndex];
uint32 ColumnSize = RTPColumn.SizeInBytes;
// hide columns that are too small to make a difference (e.g. <1 MB)
if (RTPColumn.SizeInBytes <= EventRecordingSizeThreshold * 1024)
{
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);
}
MemoryStats.TotalColumnSize += ColumnSize;
MemoryStats.TotalUsageInBytes += RTPColumn.SizeInBytes;
for (int32 EventIndex = 0, PoolEventsNum = RenderTargetPoolEvents.Num(); EventIndex < PoolEventsNum; EventIndex++)
{
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;
}
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())
{
FRenderTargetPoolEvent NewEvent(Event.GetPoolEntryId(), CurrentEventRecordingTime);
// for convenience - is actually redundant
NewEvent.SetDesc(Event.GetDesc());
RenderTargetPoolEvents.Add(NewEvent);
bWorkWasDone = true;
}
}
if (bWorkWasDone)
{
++CurrentEventRecordingTime;
}
}
void FRenderTargetPool::AddAllocEvent(uint32 InPoolEntryId, FPooledRenderTarget* In)
{
check(In);
if (IsEventRecordingEnabled())
{
AddDeallocEvents();
check(IsInRenderingThread());
FRenderTargetPoolEvent NewEvent(InPoolEntryId, CurrentEventRecordingTime++, In);
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())
{
FRenderTargetPoolEvent NewEvent(i, CurrentEventRecordingTime, Element);
RenderTargetPoolEvents.Add(NewEvent);
bWorkWasDone = true;
}
}
if (bWorkWasDone)
{
++CurrentEventRecordingTime;
}
}
void FRenderTargetPool::TickPoolElements()
{
uint32 DeferredAllocationLevelInKB = 0;
for (FPooledRenderTarget* Element : DeferredDeleteArray)
{
DeferredAllocationLevelInKB += ComputeSizeInKB(*Element);
}
check(IsInRenderingThread());
DeferredDeleteArray.Reset();
if (bStartEventRecordingNextTick)
{
bStartEventRecordingNextTick = false;
bEventRecordingStarted = true;
}
uint32 MinimumPoolSizeInKB;
{
static const auto CVar = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.RenderTargetPoolMin"));
MinimumPoolSizeInKB = FMath::Clamp(CVar->GetValueOnRenderThread(), 0, 2000) * 1024;
}
CompactPool();
uint32 UnusedAllocationLevelInKB = 0;
for (uint32 i = 0; i < (uint32)PooledRenderTargets.Num(); ++i)
{
FPooledRenderTarget* Element = PooledRenderTargets[i];
if (Element)
{
Element->OnFrameStart();
if (Element->UnusedForNFrames > 2)
{
UnusedAllocationLevelInKB += ComputeSizeInKB(*Element);
}
}
}
uint32 TotalFrameUsageInKb = AllocationLevelInKB + DeferredAllocationLevelInKB ;
#if LOG_MAX_RENDER_TARGET_POOL_USAGE
if (TotalFrameUsageInKb > MaxUsedRenderTargetInKB)
{
MaxUsedRenderTargetInKB = TotalFrameUsageInKb;
if (MaxUsedRenderTargetInKB > MinimumPoolSizeInKB)
{
DumpMemoryUsage(*GLog);
}
}
#endif
CSV_CUSTOM_STAT(RenderTargetPool, UnusedMB, UnusedAllocationLevelInKB / 1024.0f, ECsvCustomStatOp::Set);
CSV_CUSTOM_STAT(RenderTargetPool, PeakUsedMB, (TotalFrameUsageInKb - UnusedAllocationLevelInKB) / 1024.f, ECsvCustomStatOp::Set);
// 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
for (uint32 i = 0, Num = (uint32)PooledRenderTargets.Num(); i < Num; ++i)
{
FPooledRenderTarget* Element = PooledRenderTargets[i];
if (Element && Element->UnusedForNFrames > 2)
{
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
// we don't use Remove() to not shuffle around the elements for better transparency on RenderTargetPoolEvents
FreeElementAtIndex(OldestElementIndex);
}
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)
{
UE_CLOG(IsRunningClientOnly() && MinimumPoolSizeInKB != 0, LogRenderTargetPool, Warning, TEXT("r.RenderTargetPoolMin exceeded %d/%d MB (ok in editor, bad on fixed memory platform)"), (AllocationLevelInKB + 1023) / 1024, MinimumPoolSizeInKB / 1024);
bCurrentlyOverBudget = true;
}
// at this point we need to give up
break;
}
}
if (AllocationLevelInKB <= MinimumPoolSizeInKB)
{
if (bCurrentlyOverBudget)
{
UE_CLOG(MinimumPoolSizeInKB != 0, LogRenderTargetPool, Display, TEXT("r.RenderTargetPoolMin resolved %d/%d MB"), (AllocationLevelInKB + 1023) / 1024, MinimumPoolSizeInKB / 1024);
bCurrentlyOverBudget = false;
}
}
AddPhaseEvent(TEXT("FromLastFrame"));
AddAllocEventsFromCurrentState();
AddPhaseEvent(TEXT("Rendering"));
Copying //UE4/Dev-Console to //UE4/Dev-Main (Source: //UE4/Dev-Console @ 3632338) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3443778 by Ben.Woodhouse Aliasing for transient resources + new high level API Changelists integrated: 3368830 3368887 3377762 3377763 3379513 3381840 3382046 3382138 3385390 3385391 3385531 3396613 3388752 3396756 3397007 3397059 3397780 3397883 3401716 3415179 Change 3576521 by Bart.Hawthorne ShooterGame - update the game instance's online mode when the LAN option is changed Change 3587252 by Ben.Woodhouse Integrate from //UE4/Main/...@3584123 to //UE4/Dev-Console/... Change 3587943 by Luke.Thatcher [CONSOLE] [+] Improved XGE shader compiler - Added support for XGE interception interface, which allows asynchronous streaming of shader tasks into XGE, and eliminates the stalling/flushing found in the old system. - Old system has been renamed "Xml interface" - Both systems are available and selectable based on r.XGEShaderCompile.Mode CVar. Overview of the new system: - New system uses an additional XGEControlWorker process to manage communication between the engine and XGE. This is simply a copy of ShaderCompileWorker.exe (the implementation is part of SCW, but XGE requires the two files to be separate, hence the duplicate). - When shader jobs arrive from the engine, the shader compiler thread spawns an instance of XGEControlWorker within an XGE context, and connects to it via named pipes. - Job command lines are fed to the control worker via the pipe, which the worker enqueues within XGE by issuing a CreateProcess call, which is intercepted. Job completion is reported back to the engine via the named pipes. - New system is preferred over the old one, and is enabled with "-xgeshadercompile" command line switch or "r.XGEShaderCompile" cvar. - The new system depends on the "XGEController" engine module. Support for which is based on the WITH_XGE_CONTROLLER #define, or -xgecontroller/-noxgecontroller command line options. #jira UECON-263 Change 3590037 by Luke.Thatcher [CONSOLE] [!] Fix compile/link errors with XGE controller module - Various unity related fixes needed. Change 3590047 by Luke.Thatcher [CONSOLE] [!] Compile XGE controller module for Editor builds only - The module should only be used in uncooked, non-monolitic binaries (i.e. the editor). Change 3594074 by Luke.Thatcher [CONSOLE] [!] Fix Linux build - case sensitive header include was wrong in XGEControllerModule.cpp Change 3596292 by Luke.Thatcher [CONSOLE] [!] Actually fix unity/nopch build errors in XGE Controller! Change 3596776 by Jonathan.Fitzpatrick cherry pick CL 3595292 cooker change which fixes a condition where DLC would always cook with all maps regardless of which maps were specified. Change 3596795 by Jonathan.Fitzpatrick Back out changelist 3596776 Change 3596816 by Jonathan.Fitzpatrick Moved the DLC map check ahead of the "no maps found" condition so that include-all-maps can be skipped if DLC maps are found. Change 3604282 by Ben.Marsh UBT: Add support for pre-build and post-build steps when using MegaXGE. Change 3606862 by Ben.Marsh Fix missing header guard warning. Change 3611644 by Ben.Woodhouse Integrate from //UE4/Main/...@3610522 to //UE4/Dev-Console/... Change 3614089 by Joe.Barnes Call GRHICommandList.LatchBypass() after variables it checks are set. #jira ue-48130 Change 3617783 by Daniel.Eldar Headers for the HDR changes (they are pre-requisites for compilation). Integrated from: //UE4/Partner-Microsoft-DX12/Engine/Source/ThirdParty/Windows/DirectX/... to //UE4/Dev-Console/Engine/Source/ThirdParty/Windows/DirectX/... #jira UECON-226 Change 3619117 by Ben.Woodhouse Integrate from //UE4/Main/...@3617655 to //UE4/Dev-Console/... Change 3619123 by Ben.Woodhouse Integrate from //UE4/Main/...@3618361 to //UE4/Dev-Console/... Change 3619603 by Stewart.Lynch Merging //Fortnite/Dev-Athena/Engine/Source/Runtime/Engine/Private/Materials/MaterialInstanceConstant.cpp to //UE4/Dev-Console/Engine/Source/Runtime/Engine/Private/Materials/MaterialInstanceConstant.cpp Changed UMaterialInstance::PostLoad(); to Super::PostLoad(); Change 3619608 by Stewart.Lynch Merging //Fortnite/Dev-Athena/Engine/Source/Runtime/... to //UE4/Dev-Console/Engine/Source/Runtime/... LLM update * made sure that all csv stat tracking is disabled if running without -LLMCSV * added new UObject scopes * increased LLM_MAX_THREAD_SCOPE_STACK_DEPTH to 128 to cope with new UObject scopes * added material scopes * changed UMaterialInstance::PostLoad(); to Super::PostLoad(); Change 3619634 by Stewart.Lynch Merging //Fortnite/Main/... to //UE4/Dev-Console/... General LLM improvements * added tracking for misc task graph tasks (moves 20MB out of Untagged) * renamed EngineTick to EngineMisc * added tracking for FName * added tracking for GC_ProcessObjectArray potential leak * renamed index & vertex buffers stat to Meshes * added hooks for MemPro to track allocations from a single category. Currently defined out. I haven't added MemPro.cpp/h. * removed AVAILABLE_PHYSICAL stat from LLM csv * csv files now include the date in the filename * fixed potential threading bug when reading stat values to csv * added lots more scopes * started changing Stat scopes to enum scopes. Stat scopes will be phased out. * added tracking of FName memory * added llm tracking for CPU symbol allocations (20MB) * added tracking for GC * fixed tracking for TransientMemoryAllocator * added tracking for networking memory * added more audio memory tracking * added tracking for blueprints * added tracking for static meshes * show on screen warning if debug memory is enabled * added tracking for particles * renamed Phys to PhysX and added more scopes * renamed Slate to UI and added more scopes * much better coverage of networking memory * improved coverage of audio Change 3619642 by Stewart.Lynch Merging //Fortnite/Main/Engine/Source/Runtime/Core/... to //UE4/Dev-Console/Engine/Source/Runtime/Core/... Windows builds were incorrectly showing the debug memory enabled warning. Made IsDebugMemoryEnabled always return false on Windows. Change 3619799 by Luke.Thatcher [CONSOLE] [-] Disable peak memory tracking in LLM. Change 3619809 by Luke.Thatcher [CONSOLE] [^] Merging CL 3580894 from //Fortnite/Main/... to //UE4/Dev-Console/... - Add Render Target Pool Stats. Use "stat rendertargetpool" to view. Change 3619928 by Luke.Thatcher [CONSOLE] [^] Enable symbol compression on symstore task (Merging CL 3606945 from //Fortnite/Main/... to //UE4/Dev-Console/...) Change 3620571 by Keith.Judge Double the size of the occlusion query buffer in D3D12. This costs 256KB of memory. We need to refactor this in future to resize according to content on demand like D3D11.x. #jira FORT-53103 #jira FORT-53119 Change 3622419 by Daniel.Eldar [General] Fix for occasional ensure to do with retriving the new cvar value. #JIRA UE-46644 Change 3622491 by Daniel.Eldar [General] Added support for scaling on stat unit and unitgraph. #JIRA UE-46644 Change 3622610 by Daniel.Eldar [General] Fixed a compilation warning Change 3624659 by Ben.Woodhouse Integrate from //UE4/Main/...@3624175 to //UE4/Dev-Console/... Change 3624678 by Ben.Woodhouse Integrate from //UE4/Main/...@3624415 to //UE4/Dev-Console/... Change 3624878 by Ben.Woodhouse Integrate as edit CLs 3611835 3611844 3616942 3617607 Descriptor heap memory fix (saves up to ~100MB). * Fix a bug where rolling over a thread-local heap immediately after switching to context-local would crash due to an uninitialized syncpoint * Add a separate value for context local heaps (LOCAL_HEAP_SIZE) and set it to a sensible value (2MB) instead of the current 16MB. This means thread local heaps will be allocated in chunks of ~2MB instead of 16MB. There can be up to 6 thread-local heaps, since they're per-context. Measured peak descriptor heap memory with LLM: 45MB (compared to 145MB previously) This improves behaviour, but this code could use a bit of a rewrite to allow it to reclaim memory better. For example, the global heap memory is almost entirely wasted currently, since when a context switches to "context local strategy" it simply throws this memory away, never to be reclaimed. Having the pools thread-local is also not a good strategy. Ideally we want a thread-safe pool allocator for descriptor heaps which is shared between all the contexts . Change 3624882 by Ben.Woodhouse Fix virtual destructor warning in D3DX12.h Change 3626419 by Stewart.Lynch Merging //Fortnite/Main/... to //UE4/Dev-Console/... LLM Update - Memory reductions, Summary page, enum scopes, refactor and cleanup of tags * Remove all static arrays and hard limits from LLM. Everything is now dynamically allocated using the internal LLM allocators. The overhead when LLM is disabled is now only 48K (was 40MB) * re-wrote LLMMap. Now stores an int32 index rather then pointer in the HashMap array. Also, changed the Values to be arrays for structs instead of structs of arrays. Means that the tag can be stored in a single byte. Changed the size of the allocation size from int64 to int32. All this takes the memory down from around 600MB to 100MB. It was 120 bytes per allocation, now 29 bytes. * changed all LLM scopes over to enums. This has a number of benefits; LLM can be enable in Test, less CPU overhead, stored in a byte (LLM overhead /= 8) * summary page for content creators where all lower-level stats are grouped under one Engine stat * renamed ELLMScopeTag enum to ELLMTag * renamed LLM_SCOPED_TAG_WITH_ENUM macro to LLM_SCOPE * removed Tracker arg from LLM_SCOPE and added LLM_PLATFORM_SCOPE macro * fixed GenericPlatformMallocCrash stat. Although it seems not be be used anymore * fixed BackupOOMMemoryPool stat (now shows in both default and platform pages) * lots of changes adding/removing/renaming tags * added LLMArray and FLLMObjectAllocator classes * disabled asset tag tracking by default because it takes up so much memory even when not used * enable LLM in all non-shipping builds. In Test the on screendisplay won't show because it uses the stats system but it till still write out the csv. * all the stat macros have been left as they were and can be enabled on the LLM_STAT_TAGS_ENABLED define. These are needed for the asset tagging. * disabled LLM_TRACK_PEAK_MEMORY because there is a problem with the way it adds the peaks for multiple threads. This needs to be fixed. * added a CVar to control the csv write interval: LLM.LLMWriteInterval * added static arrays for the enum tags setup. Easier to manage and removes need for slow switch statements. * renamed FLLMThreadStateManager to FLLMTracker to make it consistent with the enum #jira UECON-264 Change 3626906 by Joe.Barnes Fix compile errors when nativizing when a property references a sub object of a dervied type with modified default properties Change 3628045 by Stewart.Lynch Merging //Fortnite/Main/Engine/Source/Runtime/Core/... to //UE4/Dev-Console/Engine/Source/Runtime/Core/... LLM - enabled LLM on Windows * fixed crash in FLLMObjectAllocator destructor. Only happens on Windows shutdown. * changed Align to AlignArbitrary in LLMArray. Small memory saving. * clear ThreadStateAllocator in FLLMTracker::Clear(). Small memory saving * set program size to zero on windows because it isn't relevant #jira UECON-282 Change 3632279 by Ben.Woodhouse Back out changelist 3619862 #jira UE-49472 [CL 3632432 by Joe Barnes in Main branch]
2017-09-07 22:18:47 -04:00
#if STATS
uint32 Count, SizeKB, UsedKB;
GetStats(Count, SizeKB, UsedKB);
CSV_CUSTOM_STAT_GLOBAL(RenderTargetPoolSize, float(SizeKB) / 1024.0f, ECsvCustomStatOp::Set);
CSV_CUSTOM_STAT_GLOBAL(RenderTargetPoolUsed, float(UsedKB) / 1024.0f, ECsvCustomStatOp::Set);
CSV_CUSTOM_STAT_GLOBAL(RenderTargetPoolCount, int32(Count), ECsvCustomStatOp::Set);
Copying //UE4/Dev-Console to //UE4/Dev-Main (Source: //UE4/Dev-Console @ 3632338) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3443778 by Ben.Woodhouse Aliasing for transient resources + new high level API Changelists integrated: 3368830 3368887 3377762 3377763 3379513 3381840 3382046 3382138 3385390 3385391 3385531 3396613 3388752 3396756 3397007 3397059 3397780 3397883 3401716 3415179 Change 3576521 by Bart.Hawthorne ShooterGame - update the game instance's online mode when the LAN option is changed Change 3587252 by Ben.Woodhouse Integrate from //UE4/Main/...@3584123 to //UE4/Dev-Console/... Change 3587943 by Luke.Thatcher [CONSOLE] [+] Improved XGE shader compiler - Added support for XGE interception interface, which allows asynchronous streaming of shader tasks into XGE, and eliminates the stalling/flushing found in the old system. - Old system has been renamed "Xml interface" - Both systems are available and selectable based on r.XGEShaderCompile.Mode CVar. Overview of the new system: - New system uses an additional XGEControlWorker process to manage communication between the engine and XGE. This is simply a copy of ShaderCompileWorker.exe (the implementation is part of SCW, but XGE requires the two files to be separate, hence the duplicate). - When shader jobs arrive from the engine, the shader compiler thread spawns an instance of XGEControlWorker within an XGE context, and connects to it via named pipes. - Job command lines are fed to the control worker via the pipe, which the worker enqueues within XGE by issuing a CreateProcess call, which is intercepted. Job completion is reported back to the engine via the named pipes. - New system is preferred over the old one, and is enabled with "-xgeshadercompile" command line switch or "r.XGEShaderCompile" cvar. - The new system depends on the "XGEController" engine module. Support for which is based on the WITH_XGE_CONTROLLER #define, or -xgecontroller/-noxgecontroller command line options. #jira UECON-263 Change 3590037 by Luke.Thatcher [CONSOLE] [!] Fix compile/link errors with XGE controller module - Various unity related fixes needed. Change 3590047 by Luke.Thatcher [CONSOLE] [!] Compile XGE controller module for Editor builds only - The module should only be used in uncooked, non-monolitic binaries (i.e. the editor). Change 3594074 by Luke.Thatcher [CONSOLE] [!] Fix Linux build - case sensitive header include was wrong in XGEControllerModule.cpp Change 3596292 by Luke.Thatcher [CONSOLE] [!] Actually fix unity/nopch build errors in XGE Controller! Change 3596776 by Jonathan.Fitzpatrick cherry pick CL 3595292 cooker change which fixes a condition where DLC would always cook with all maps regardless of which maps were specified. Change 3596795 by Jonathan.Fitzpatrick Back out changelist 3596776 Change 3596816 by Jonathan.Fitzpatrick Moved the DLC map check ahead of the "no maps found" condition so that include-all-maps can be skipped if DLC maps are found. Change 3604282 by Ben.Marsh UBT: Add support for pre-build and post-build steps when using MegaXGE. Change 3606862 by Ben.Marsh Fix missing header guard warning. Change 3611644 by Ben.Woodhouse Integrate from //UE4/Main/...@3610522 to //UE4/Dev-Console/... Change 3614089 by Joe.Barnes Call GRHICommandList.LatchBypass() after variables it checks are set. #jira ue-48130 Change 3617783 by Daniel.Eldar Headers for the HDR changes (they are pre-requisites for compilation). Integrated from: //UE4/Partner-Microsoft-DX12/Engine/Source/ThirdParty/Windows/DirectX/... to //UE4/Dev-Console/Engine/Source/ThirdParty/Windows/DirectX/... #jira UECON-226 Change 3619117 by Ben.Woodhouse Integrate from //UE4/Main/...@3617655 to //UE4/Dev-Console/... Change 3619123 by Ben.Woodhouse Integrate from //UE4/Main/...@3618361 to //UE4/Dev-Console/... Change 3619603 by Stewart.Lynch Merging //Fortnite/Dev-Athena/Engine/Source/Runtime/Engine/Private/Materials/MaterialInstanceConstant.cpp to //UE4/Dev-Console/Engine/Source/Runtime/Engine/Private/Materials/MaterialInstanceConstant.cpp Changed UMaterialInstance::PostLoad(); to Super::PostLoad(); Change 3619608 by Stewart.Lynch Merging //Fortnite/Dev-Athena/Engine/Source/Runtime/... to //UE4/Dev-Console/Engine/Source/Runtime/... LLM update * made sure that all csv stat tracking is disabled if running without -LLMCSV * added new UObject scopes * increased LLM_MAX_THREAD_SCOPE_STACK_DEPTH to 128 to cope with new UObject scopes * added material scopes * changed UMaterialInstance::PostLoad(); to Super::PostLoad(); Change 3619634 by Stewart.Lynch Merging //Fortnite/Main/... to //UE4/Dev-Console/... General LLM improvements * added tracking for misc task graph tasks (moves 20MB out of Untagged) * renamed EngineTick to EngineMisc * added tracking for FName * added tracking for GC_ProcessObjectArray potential leak * renamed index & vertex buffers stat to Meshes * added hooks for MemPro to track allocations from a single category. Currently defined out. I haven't added MemPro.cpp/h. * removed AVAILABLE_PHYSICAL stat from LLM csv * csv files now include the date in the filename * fixed potential threading bug when reading stat values to csv * added lots more scopes * started changing Stat scopes to enum scopes. Stat scopes will be phased out. * added tracking of FName memory * added llm tracking for CPU symbol allocations (20MB) * added tracking for GC * fixed tracking for TransientMemoryAllocator * added tracking for networking memory * added more audio memory tracking * added tracking for blueprints * added tracking for static meshes * show on screen warning if debug memory is enabled * added tracking for particles * renamed Phys to PhysX and added more scopes * renamed Slate to UI and added more scopes * much better coverage of networking memory * improved coverage of audio Change 3619642 by Stewart.Lynch Merging //Fortnite/Main/Engine/Source/Runtime/Core/... to //UE4/Dev-Console/Engine/Source/Runtime/Core/... Windows builds were incorrectly showing the debug memory enabled warning. Made IsDebugMemoryEnabled always return false on Windows. Change 3619799 by Luke.Thatcher [CONSOLE] [-] Disable peak memory tracking in LLM. Change 3619809 by Luke.Thatcher [CONSOLE] [^] Merging CL 3580894 from //Fortnite/Main/... to //UE4/Dev-Console/... - Add Render Target Pool Stats. Use "stat rendertargetpool" to view. Change 3619928 by Luke.Thatcher [CONSOLE] [^] Enable symbol compression on symstore task (Merging CL 3606945 from //Fortnite/Main/... to //UE4/Dev-Console/...) Change 3620571 by Keith.Judge Double the size of the occlusion query buffer in D3D12. This costs 256KB of memory. We need to refactor this in future to resize according to content on demand like D3D11.x. #jira FORT-53103 #jira FORT-53119 Change 3622419 by Daniel.Eldar [General] Fix for occasional ensure to do with retriving the new cvar value. #JIRA UE-46644 Change 3622491 by Daniel.Eldar [General] Added support for scaling on stat unit and unitgraph. #JIRA UE-46644 Change 3622610 by Daniel.Eldar [General] Fixed a compilation warning Change 3624659 by Ben.Woodhouse Integrate from //UE4/Main/...@3624175 to //UE4/Dev-Console/... Change 3624678 by Ben.Woodhouse Integrate from //UE4/Main/...@3624415 to //UE4/Dev-Console/... Change 3624878 by Ben.Woodhouse Integrate as edit CLs 3611835 3611844 3616942 3617607 Descriptor heap memory fix (saves up to ~100MB). * Fix a bug where rolling over a thread-local heap immediately after switching to context-local would crash due to an uninitialized syncpoint * Add a separate value for context local heaps (LOCAL_HEAP_SIZE) and set it to a sensible value (2MB) instead of the current 16MB. This means thread local heaps will be allocated in chunks of ~2MB instead of 16MB. There can be up to 6 thread-local heaps, since they're per-context. Measured peak descriptor heap memory with LLM: 45MB (compared to 145MB previously) This improves behaviour, but this code could use a bit of a rewrite to allow it to reclaim memory better. For example, the global heap memory is almost entirely wasted currently, since when a context switches to "context local strategy" it simply throws this memory away, never to be reclaimed. Having the pools thread-local is also not a good strategy. Ideally we want a thread-safe pool allocator for descriptor heaps which is shared between all the contexts . Change 3624882 by Ben.Woodhouse Fix virtual destructor warning in D3DX12.h Change 3626419 by Stewart.Lynch Merging //Fortnite/Main/... to //UE4/Dev-Console/... LLM Update - Memory reductions, Summary page, enum scopes, refactor and cleanup of tags * Remove all static arrays and hard limits from LLM. Everything is now dynamically allocated using the internal LLM allocators. The overhead when LLM is disabled is now only 48K (was 40MB) * re-wrote LLMMap. Now stores an int32 index rather then pointer in the HashMap array. Also, changed the Values to be arrays for structs instead of structs of arrays. Means that the tag can be stored in a single byte. Changed the size of the allocation size from int64 to int32. All this takes the memory down from around 600MB to 100MB. It was 120 bytes per allocation, now 29 bytes. * changed all LLM scopes over to enums. This has a number of benefits; LLM can be enable in Test, less CPU overhead, stored in a byte (LLM overhead /= 8) * summary page for content creators where all lower-level stats are grouped under one Engine stat * renamed ELLMScopeTag enum to ELLMTag * renamed LLM_SCOPED_TAG_WITH_ENUM macro to LLM_SCOPE * removed Tracker arg from LLM_SCOPE and added LLM_PLATFORM_SCOPE macro * fixed GenericPlatformMallocCrash stat. Although it seems not be be used anymore * fixed BackupOOMMemoryPool stat (now shows in both default and platform pages) * lots of changes adding/removing/renaming tags * added LLMArray and FLLMObjectAllocator classes * disabled asset tag tracking by default because it takes up so much memory even when not used * enable LLM in all non-shipping builds. In Test the on screendisplay won't show because it uses the stats system but it till still write out the csv. * all the stat macros have been left as they were and can be enabled on the LLM_STAT_TAGS_ENABLED define. These are needed for the asset tagging. * disabled LLM_TRACK_PEAK_MEMORY because there is a problem with the way it adds the peaks for multiple threads. This needs to be fixed. * added a CVar to control the csv write interval: LLM.LLMWriteInterval * added static arrays for the enum tags setup. Easier to manage and removes need for slow switch statements. * renamed FLLMThreadStateManager to FLLMTracker to make it consistent with the enum #jira UECON-264 Change 3626906 by Joe.Barnes Fix compile errors when nativizing when a property references a sub object of a dervied type with modified default properties Change 3628045 by Stewart.Lynch Merging //Fortnite/Main/Engine/Source/Runtime/Core/... to //UE4/Dev-Console/Engine/Source/Runtime/Core/... LLM - enabled LLM on Windows * fixed crash in FLLMObjectAllocator destructor. Only happens on Windows shutdown. * changed Align to AlignArbitrary in LLMArray. Small memory saving. * clear ThreadStateAllocator in FLLMTracker::Clear(). Small memory saving * set program size to zero on windows because it isn't relevant #jira UECON-282 Change 3632279 by Ben.Woodhouse Back out changelist 3619862 #jira UE-49472 [CL 3632432 by Joe Barnes in Main branch]
2017-09-07 22:18:47 -04:00
SET_MEMORY_STAT(STAT_RenderTargetPoolSize, int64(SizeKB) * 1024ll);
SET_MEMORY_STAT(STAT_RenderTargetPoolUsed, int64(UsedKB) * 1024ll);
SET_DWORD_STAT(STAT_RenderTargetPoolCount, Count);
#endif // STATS
}
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)
{
return i;
}
}
}
// not found
return -1;
}
void FRenderTargetPool::FreeElementAtIndex(int32 Index)
{
// we don't use Remove() to not shuffle around the elements for better transparency on RenderTargetPoolEvents
PooledRenderTargets[Index] = 0;
PooledRenderTargetHashes[Index] = 0;
}
void FRenderTargetPool::FreeUnusedResource(TRefCountPtr<IPooledRenderTarget>& In)
{
check(IsInRenderingThread());
int32 Index = FindIndex(In);
if (Index != -1)
{
FPooledRenderTarget* Element = PooledRenderTargets[Index];
// Ref count will always be at least 2
ensure(Element->GetRefCount() >= 2);
In = nullptr;
if (Element->IsFree())
{
AllocationLevelInKB -= ComputeSizeInKB(*Element);
// we assume because of reference counting the resource gets released when not needed any more
DeferredDeleteArray.Add(PooledRenderTargets[Index]);
FreeElementAtIndex(Index);
}
}
}
void FRenderTargetPool::FreeUnusedResources()
{
check(IsInRenderingThread());
for (uint32 i = 0, Num = (uint32)PooledRenderTargets.Num(); i < Num; ++i)
{
FPooledRenderTarget* Element = PooledRenderTargets[i];
if (Element && Element->IsFree())
{
AllocationLevelInKB -= ComputeSizeInKB(*Element);
// we assume because of reference counting the resource gets released when not needed any more
// we don't use Remove() to not shuffle around the elements for better transparency on RenderTargetPoolEvents
DeferredDeleteArray.Add(PooledRenderTargets[i]);
FreeElementAtIndex(i);
}
}
#if LOG_MAX_RENDER_TARGET_POOL_USAGE
MaxUsedRenderTargetInKB = 0;
#endif
}
void FRenderTargetPool::DumpMemoryUsage(FOutputDevice& OutputDevice)
{
uint32 UnusedAllocationInKB = 0;
OutputDevice.Logf(TEXT("Pooled Render Targets:"));
for (int32 i = 0; i < PooledRenderTargets.Num(); ++i)
{
FPooledRenderTarget* Element = PooledRenderTargets[i];
if (Element)
{
uint32 ElementAllocationInKB = ComputeSizeInKB(*Element);
if (Element->UnusedForNFrames > 2)
{
UnusedAllocationInKB += ElementAllocationInKB;
}
OutputDevice.Logf(
TEXT(" %6.3fMB %4dx%4d%s%s %2dmip(s) %s (%s) %s %s Unused frames: %d"),
ElementAllocationInKB / 1024.0f,
Element->Desc.Extent.X,
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3154632) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3122543 on 2016/09/13 by Ben.Woodhouse Override HasOcclusion for Widget3DComponentProxy to detect if the material is has depth testing enabled. #jira UE-35878 Change 3122544 on 2016/09/13 by Ben.Woodhouse Shadow stencil optimisation with cvar (enabled by default) Avoids redundant clearing the stencil buffer for per-object and pre shadows by zeroing the stencil during testing, following discussion on UDN. This means we don't benefit from Hi Stencil on GCN for the shadow projection draw calls, but it's still faster in all the cases I could find, including for the player character where the bounding box is quite large. (Note: early stencil still works fine, according to PIX) Shadow projection GPU time profiling : Test map with 35 characters, stationary directional light - 4ms-2ms on XB1 - 2.5ms to 0.9ms on PC (r9-390X) - 3ms-2ms on PS4 Paragon PS4 (roughly 20% reduced - from ~0.39ms) Change 3122687 on 2016/09/13 by Rolando.Caloca DR - vk - Fix ES31 crash Change 3122691 on 2016/09/13 by Rolando.Caloca DR - vk - Fixes for SDK 1.0.26.0 Change 3122778 on 2016/09/13 by Rolando.Caloca DR - vk - Fix number of layers on barrier Change 3122921 on 2016/09/13 by Rolando.Caloca DR - vk - Fix ES3.1 Change 3122925 on 2016/09/13 by Ben.Woodhouse Fix sky lighting issue with skin and re-enable non-checkerboard lighting by default (fallout from lightaccumulator refactor) #jira UE-35904 Change 3123016 on 2016/09/13 by Chris.Bunner Fixed adaptive tessellation, broken by CL 3089208 refactor. #jira UE-35341 Change 3123079 on 2016/09/13 by Rolando.Caloca DR - vk - Force StoreOp store instead of DontCare everywhere (temporarily) Change 3123503 on 2016/09/13 by David.Hill #jira UE-25623 converted a check() to checkf() to include better diagnostic information. Change 3123617 on 2016/09/13 by Guillaume.Abadie Fixes artifact when the camera direction is almost parallel to a wide plane with SSR. #jira UE-35128 Change 3123743 on 2016/09/13 by Brian.Karis Separate mesh reduction interfaces for static and skeletal. Zero bad tangents from input mesh. Change 3125378 on 2016/09/14 by Arne.Schober DR - [UE-34481] - Extract all the State which is necessary to execute the DebugTextDrawingDelegate from the SceneProxy into its own Helpers to be drawn to the canvas later on. The issue was that the SceneProxys are only owned by the RT after their creation and the GT should avoid reading from or writing state to them. Change 3125527 on 2016/09/14 by Arne.Schober DR - [UE-34481] - Fix UT build and mac Change 3125741 on 2016/09/14 by Rolando.Caloca DR - Extra debug mode for tracking down SCW crashes (r.DumpSCWQueuedJobs=1) Change 3125763 on 2016/09/14 by Rolando.Caloca DR - vk - Added new Renderpass cache - Fix buffer barrier warning Change 3125769 on 2016/09/14 by Rolando.Caloca DR - Renamed cvar to r.DumpSCWQueuedJobs Change 3125771 on 2016/09/14 by Rolando.Caloca DR - Added support for SV_ClipDistance on GL3 & 4 Change 3125792 on 2016/09/14 by Arne.Schober DR - [UE-34481] - Fix Odin and PS4 Change 3125880 on 2016/09/14 by Arne.Schober DR - [UE-34481] - Fix Fortnite Change 3125968 on 2016/09/14 by Brian.Karis Removed comment Change 3126315 on 2016/09/15 by Ben.Woodhouse GPU profiler robustness - Change stat gathering update to handle multiple views and non-scenerenderer stats (such Slate) properly - Simplify gathering logic - Fix race condition where we could read back queries before they're submitted on the RHI thread. - Fix for movie player stat gathering - disable gathering outside of the main engine tick #jira UE-35975 Change 3126792 on 2016/09/15 by Rolando.Caloca DR - vk - Release render pass cache Change 3126804 on 2016/09/15 by Rolando.Caloca DR - vk - Fix UpdateTexture2D() #jira UE-34151 Change 3126884 on 2016/09/15 by Rolando.Caloca DR - vk - Compile fix Change 3126953 on 2016/09/15 by Rolando.Caloca DR - Enable GPU capture when running OpenGL under RenderDoc - Will also set the memory mode to non coherent so not to kill performance on RenderDoc Change 3126966 on 2016/09/15 by Rolando.Caloca DR - Allow cooking for Vulkan SM4 to help with packaging Change 3127082 on 2016/09/15 by Guillaume.Abadie Wraps up contact shadows for release fixing different artifacts and handling correctly their screen space length. #jira UE-35367, UE-33602, UE-33603, UE-33604 #review-3125887 @brian.karis Change 3127130 on 2016/09/15 by Mark.Satterthwaite Add overloads to as* functions in hlslcc - HLSL allows you to call these on variables of the same type, in which case it simply returns the existing value but we had only defined the float<->u/int conversions, so hlslcc added implicit casts that broke such cases (i.e. asuint(uint) -> floatBitsToUint(float(uint))). This change defines the missing overloads as returns with regular casts. #jira FORT-25869 #jira UE-34263 Change 3127475 on 2016/09/15 by Rolando.Caloca DR - vk - Debug dump Change 3128131 on 2016/09/16 by Ben.Woodhouse (Integrated from //UE4/Private-Partner-NREAL/...) Alpha output support for postprocess materials (optional via a parameter) Needed for end of frame compositing. Could be used to pass intermediate data from one blendable postprocess to another (e.g edge detection) Change 3128135 on 2016/09/16 by Ben.Woodhouse GPU profiler (PS4) - remove bubbles between commandlist submissions from query times Use r.ps4.AdjustRenderQueryTimestamps cvar to enable/disable (defaults to on) Also fixes some potential precision issues with unit GPU timing Change 3128247 on 2016/09/16 by Rolando.Caloca DR - vk - Cache framebuffers Change 3128593 on 2016/09/16 by Rolando.Caloca DR - vk - Fix for crash loading map #jira UE-36072 Change 3128759 on 2016/09/16 by Mark.Satterthwaite Back out changelist 3127130 - its causing a build failure in FPostProcessVelocityScatterVS because hlslcc is picking the wrong as_* overload. Change 3130236 on 2016/09/19 by Chris.Bunner Exposed full SceneCaptureComponent classes instead of select methods. #jira UE-35996 Change 3130388 on 2016/09/19 by Rolando.Caloca DR - Avoid crash when adding dynamic primitives #jira UE-35327 Change 3130393 on 2016/09/19 by Marc.Olano Improve vector noise tooltips & documentation Change 3130547 on 2016/09/19 by Ben.Woodhouse Fix for ensure fail when initializing point light shadowmaps. This came about because cubemap rendertargets always have Extents of (Resolution, 0). The Y component was implicitly used to determine if it was a cubemap, which is odd... The fix was to make the definition explicit via a flag and initialize both the X and Y parameters. I suspect the ensure started happening recently due to a more recent change, but fixing the underlying logic seems like the correct fix. #jira UE-35837 Change 3130578 on 2016/09/19 by Daniel.Wright Workaround OpenGL/NVidia bug with non-power-of-2 textures by disabling CSM atlassing if we're using OpenGL Change 3130682 on 2016/09/19 by Rolando.Caloca DR - Better fix for UE-35327 #jira UE-35327 Change 3130767 on 2016/09/19 by Uriel.Doyon Better handling of color array in VisualizeComplexity code to prevent assert. #jira UE-29332 Change 3130965 on 2016/09/19 by Arne.Schober DR - [UE-35679] - the crash was caused by the Resource of the UTexture being Null. And one of the Kismet Nodes calling a function on that resource. The solution was to disable that call from Kismet when only cooking. Change 3130967 on 2016/09/19 by Chris.Bunner Hid redundant texture sampler properties from texture object parameter. Hid redundant texture property input on texture parameter nodes. Fixed copy-paste error in expression texture parameter docs. #jira UE-32724 Change 3131118 on 2016/09/19 by Mark.Satterthwaite Second attempt - this time with the correct input types. Add overloads to as* functions in hlslcc - HLSL allows you to call these on variables of the same type, in which case it simply returns the existing value but we had only defined the float<->u/int conversions, so hlslcc added implicit casts that broke such cases (i.e. asuint(uint) -> floatBitsToUint(float(uint))). This change defines the missing overloads as returns with regular casts. #jira FORT-25869 #jira UE-34263 Change 3131153 on 2016/09/19 by Rolando.Caloca DR - Fix recompute normals when triangles have a LHS tangent basis Integrate from 3028634 - Also make meshes that don't have morphs be able to run through the recompute normals path #jira UE-35472 Change 3131228 on 2016/09/19 by Mark.Satterthwaite Duplicate CL #3114668: Always disable asynchronous shader compilation for the global shader map on Metal as some of them are needed very early. #jira UE-35240 Change 3131246 on 2016/09/19 by Rolando.Caloca DR - Shrink gpu skinning permutations Change 3131261 on 2016/09/19 by Mark.Satterthwaite Fix Metal validation failures due to particle rendering not binding buffers to all buffer inputs declared in the shader. ContentExamples Effects no longer aborts complaining that the particle system didn't bind a required buffer. Change 3131265 on 2016/09/19 by Mark.Satterthwaite Fix FMetalDynamicRHI::RHIReadSurfaceData for shared textures on iOS. Change 3131271 on 2016/09/19 by Mark.Satterthwaite Use private memory for the Metal stencil SRV workaround needed on El Capitan. Change 3131273 on 2016/09/19 by Mark.Satterthwaite Disable the lazy-encoder construction in Metal for AMD - there is a situation that causes the lazy construction to perform a clear that isn't wanted and so far this hasn't been tracked down and fixed. Until then, this will render correctly. Change 3131280 on 2016/09/19 by Mark.Satterthwaite For GLSL interpolation mode flags must come before storage mode flags and you can't redeclare the system variable gl_Layer to use a differing interpolation mode. Change 3131283 on 2016/09/19 by Mark.Satterthwaite Change the ShaderCache to not cache resource bindings in the draw states for shader platforms that don't care - reduces the number of draw states considered significantly without reducing effectiveness. We can support ShaderCache with Metal SM5 but not the RHI thread enabled so change when we enable it and make sure we load the binary shader cache. Change 3131402 on 2016/09/19 by Rolando.Caloca DR - Disambiguate callstack #jira UE-34415 Change 3131469 on 2016/09/19 by Rolando.Caloca DR - vk - Check if we can allocate descriptors off a pool Change 3131482 on 2016/09/19 by Rolando.Caloca DR - vk - Remove unused var Change 3131506 on 2016/09/19 by Mark.Satterthwaite With permission from Josh.A & Michael.T, deprecate Mac OpenGL support. For now this just means visibly warning users with message boxes - but in a future release OpenGL support will be removed from macOS. Change 3131536 on 2016/09/19 by Rolando.Caloca DR - vk - Compile fix Change 3131564 on 2016/09/19 by Rolando.Caloca DR - vk - Submit Hint - Disable framebuffer recycling as its causing a hang Change 3131625 on 2016/09/19 by Mark.Satterthwaite Inside MetalRHI add an optional cache for disposed texture objects so we may reuse them - controlled by CVAR rhi.Metal.TextureCacheMode which must be set prior to running as it can't be changed at runtime. Settings: 0 = off, 1 (default) = will attempt to reuse private memory texture objects within the frame they are released otherwise they are disposed of as before. Setting 2 extends the caching to all textures - though Managed/Shared textures cannot be reused until after the frame in which they were released has been processed on the GPU. In this mode id<MTLTexture> objects are never returned to the OS so in order to conserve VRAM calls to setPurgeableState are made to allow the driver to reclaim unusued memory if required. Change 3131630 on 2016/09/19 by Mark.Satterthwaite More statistics in Metal added to track down where performance was going in a particular project but which may be more generally useful. Change 3131955 on 2016/09/20 by Gil.Gribb Merging //UE4/Dev-Main@3129758 to Dev-Rendering (//UE4/Dev-Rendering) Change 3131978 on 2016/09/20 by Gil.Gribb CIS fix Change 3132584 on 2016/09/20 by Ben.Woodhouse Add some additional checks to help track down a rare crash with terrain rendering and shader recompiling #jira UE-35937 Change 3132696 on 2016/09/20 by Mark.Satterthwaite Use set*Bytes to handle uploading buffers < 4Kb when available - this is faster than lots of small Metal buffers and reduces the amount of GPU heap fragmentation. Where the API feature isn't available or hasn't been tested yet we'll use another ring-buffer inside the MetalCommandEncoder to emulate it. Change 3132772 on 2016/09/20 by Mark.Satterthwaite Rework Metal's handling of RHISetStreamSource calls that override the stride of vertex declarations to be much more efficient. Change 3132870 on 2016/09/20 by Ben.Woodhouse Fix mac compile error Change 3133049 on 2016/09/20 by Brian.Karis Changed light source shapes in reflection captures to use alpha Change 3133057 on 2016/09/20 by Brian.Karis Alphaed out on spot light cone as well. Change 3133263 on 2016/09/20 by Rolando.Caloca DR - vk - Debug names for objects Change 3133292 on 2016/09/20 by Rolando.Caloca DR - vk - Fix SRGB upload/formats Change 3133395 on 2016/09/20 by Rolando.Caloca DR - vk - SM5 fixes Change 3134026 on 2016/09/21 by Gil.Gribb Merging //UE4/Dev-Main@3133983 to Dev-Rendering (//UE4/Dev-Rendering) Change 3134663 on 2016/09/21 by Chris.Bunner Merging Dev-MaterialLayers to Dev-Rendering, CL 3134208. Initial material attribute extensibility changes. #jira UE-34347 Change 3134730 on 2016/09/21 by Arne.Schober DR - [UE-34481] - Fix minor brokenness found by Gil Change 3134792 on 2016/09/21 by Chris.Bunner Fixed compile errors for non-editor builds. Change 3135214 on 2016/09/21 by Rolando.Caloca DR - vk - Fix visualize texture - Dump memory when OOM (to track leaks) Change 3135225 on 2016/09/21 by Rolando.Caloca DR - vk - Ensure on exit if mem leak - Update fences if running wait for idle Change 3135672 on 2016/09/22 by Gil.Gribb Merging //UE4/Dev-Main@3135568 to Dev-Rendering (//UE4/Dev-Rendering) Change 3135793 on 2016/09/22 by Rolando.Caloca DR - vk - Set dynamic state after binding pipeline or on a fresh cmd buffer Change 3135816 on 2016/09/22 by Rolando.Caloca DR - Add names for d3d on renderdoc Change 3135894 on 2016/09/22 by Chris.Bunner Fixed initialization order warning. Change 3136024 on 2016/09/22 by Rolando.Caloca DR - vk - Fix stencil faces Change 3136042 on 2016/09/22 by Marcus.Wassmer Fix compile error Change 3136046 on 2016/09/22 by Chris.Bunner Renamed material for PostTonemapHDRColor visualization to reflect actual usage. Change 3136308 on 2016/09/22 by Uriel.Doyon Changed how the component relative rotation is computed, in order to have more consistency after blueprint rescript. #jira UE-36094 Change 3136798 on 2016/09/22 by Chris.Bunner Gather object references from stereo view state in USceneCaptureComponent. This matches behavior of other classes such as ULocalPlayer. Change 3137092 on 2016/09/22 by Rolando.Caloca DR - vk - Rename pipeline to gfx pipeline Change 3137263 on 2016/09/22 by Mark.Satterthwaite Duplicate CL #3135157: Fix one cause of Metal crashes loading into a zone - the PlanarReflection shader code needs to always set the IsStereoParameter so that the shader can perform the if-test without causing an invalid GPU access. #jira FORT-30061 Change 3137265 on 2016/09/22 by Mark.Satterthwaite Duplicate CL #3135169: Correct Metal texture creation for AVF media framework - we can't provide a render-targetable version of the texture without blitting. The native texture we get is a GPU copy that can be made CPU accessible (i.e. it is not tiled). Change 3137266 on 2016/09/22 by Mark.Satterthwaite Duplicate CL #3135237: Metal validation layer fix: under Metal if there are no reads from the vertex stage-in buffers we should use the Empty vertex declaration, not the filter declaration, otherwise we have to bind a redundant vertex stream buffer to silence the validation layer. Change 3137268 on 2016/09/22 by Mark.Satterthwaite Duplicate CL #3136033: To fix the Fortnite login screen force Nvidia Macs to use the set*Bytes API for small buffer updates even on El Capitan. We can't do this globally as Intel didn't implement these functions until macOS Sierra. Fix GPU selection code in MetalRHI to confirm everything is working. #jira FORT-30385 Change 3137269 on 2016/09/22 by Mark.Satterthwaite Duplicate CL #3137164: Add stats to track exactly how many command buffers are allocated and committed each frame to work out why Fortnite on AMD is hanging, which turns out to be because each texture update/reallocation ends up in its own command-buffer. This needs to be rethought to pack these into fewer command buffers with the same synchronisation requirements to minimise command-buffer splits but for now we'll just make the default sufficiently large that we shouldn't see the hang until the work is done. Also ensure that command-buffer failure is always fatal - there is no way to recover or continue if a command-buffer fails. #jira FORT-30377 Change 3137606 on 2016/09/23 by Gil.Gribb Merging //UE4/Dev-Main@3137560 to Dev-Rendering (//UE4/Dev-Rendering) Change 3137936 on 2016/09/23 by Rolando.Caloca DR - Split RHICmdList clear into color & ds in prep for changes Change 3138346 on 2016/09/23 by Rolando.Caloca DR - vk - Some renaming and splitting classes in prep for compute Change 3138628 on 2016/09/23 by Rolando.Caloca DR - vk - Fix mem leak on framebuffers Change 3138721 on 2016/09/23 by Daniel.Wright Better comment for r.DefaultFeature.AntiAliasing Change 3138722 on 2016/09/23 by Daniel.Wright Fixed assert from decals with MSAA due to binding the Scene Depth Texture instead of surface Change 3138723 on 2016/09/23 by Daniel.Wright Corrected GC doc Change 3138892 on 2016/09/23 by Daniel.Wright Fixed instanced static meshes being unbuilt after a lighting build if you ever cancelled a previous lighting build Change 3138905 on 2016/09/23 by Daniel.Wright "Optimizations" -> "Optimization Viewmodes" Change 3138939 on 2016/09/23 by Daniel.Wright Disabled the stationary light overlap viewmode with forward shading Change 3139710 on 2016/09/26 by Rolando.Caloca DR - Rename and added texture RHIClearDepthStencil -> RHIClearDepthStencilTexture Change 3139820 on 2016/09/26 by Rolando.Caloca DR - Remove prefix from shader frequency strings Change 3139828 on 2016/09/26 by Marcus.Wassmer Add SetShaderValue() specialization for bools on AsyncCompute commandlists to match the Gfx specialization. Change 3139840 on 2016/09/26 by Benjamin.Hyder Adding VectorNoise Examples to TM-Noise map Change 3139862 on 2016/09/26 by Rolando.Caloca DR - Better log to track down crash #jira UE-36271 Change 3140142 on 2016/09/26 by Rolando.Caloca DR - Fix clang warning Change 3140145 on 2016/09/26 by Rolando.Caloca DR - Rename RHIClearColor(MRT) to RHIClearColorTextures and pass textures as parameters Change 3140360 on 2016/09/26 by Daniel.Wright Lighting Scenarios and lightmaps moved to separate package * Levels can be marked as lighting scenarios (eg Day, Night). Lighting is built separately for each lighting scenario with actors / lights in all other scenario levels hidden. Only one lighting scenario level should be visible at a time in game, and its lightmaps will be applied to the world. * Most outputs of the lighting build now go into a separate _BuiltData package. This improves level Save and AutoSave times as the separate package will only be dirtied after lighting rebuilds. * If a lighting scenario is present, all lightmaps are placed inside it's _BuiltData package. This means that only the currently loaded lighting scenario's lightmaps will be loaded (Day or Night, but not both). This also means that lightmaps for a streaming level will not be streamed with it. * For backwards compatibility, existing lightmaps are moved to a new _BuiltData package on load. * Reflection captures and precomputed visibility were not moved to the separate package. Reflection captures are force updated on load of a lighting scenario level, which can increase load times. Change 3140361 on 2016/09/26 by Daniel.Wright Lighting Scenarios UI Change 3140582 on 2016/09/26 by Mark.Satterthwaite Duplicate CL #3140166 Fix the video playback in Fortnite - bind our shader resource texture as the render-target texture as for some reason the playback code expects it there, even though we could never provide one. #jira FORT-30551 Change 3140584 on 2016/09/26 by Mark.Satterthwaite Duplicate CL #3140131: Fix crash under the validation layer & Nvidia's El Capitan (10.11) drivers when distance field particle collisions are used without any scene distance fields available - bind the black volume texture when that is the case to avoid bad access on the GPU. #jira FORT-30622 Change 3140586 on 2016/09/26 by Mark.Satterthwaite Duplicate CL #3140450: Fix launching the game on Intel GPUs by disabling Tiled Reflections on Intel for macOS Sierra like we did for El Capitan as there's currently a driver bug to means it doesn't work properly. #jira FORT-30649 Change 3140594 on 2016/09/26 by Zabir.Hoque Fix benchmark shaders register bindings. TEXCOORD0 was bound to register 1 in VS and then register 0 in PS. DX12 treats this a PSO creation failuer unlike DX11 this was an error. Change 3140601 on 2016/09/26 by Marcus.Wassmer New 'Cinematic' Scalability level. Remove unused 'new' motionblur CVAR Change 3140602 on 2016/09/26 by Zabir.Hoque CreateTexture3D on XB1 DX11 was leaking ESRAM by reserving it but not allocating to it. #Tests: Fix was tested by licensee (GearBox). Change 3140622 on 2016/09/26 by Rolando.Caloca DR - vk - More prep for sm5 Change 3140765 on 2016/09/26 by Rolando.Caloca DR - Fix ensure from bad clear depth surface Change 3141251 on 2016/09/27 by Rolando.Caloca DR - vk - Rename & cleanup Change 3141394 on 2016/09/27 by Rolando.Caloca DR - vk - Compute pipeline state Change 3141463 on 2016/09/27 by Mark.Satterthwaite Fix the include order to avoid compile errors on Mac. Change 3141529 on 2016/09/27 by Gil.Gribb Merging //UE4/Dev-Main@3139632 to Dev-Rendering (//UE4/Dev-Rendering) Change 3141830 on 2016/09/27 by zachary.wilson Adding testing content for lighting scenarios to collaborate with Ben Change 3141941 on 2016/09/27 by Olaf.Piesche Speculative fix for UE-34815; have yet to repro this but there's really only so many things it could be. I currently don't see how the sim resources could go away after queueing, so I'm replacing the check with an ensure and null checking the resource pointer. Change 3142035 on 2016/09/27 by Olaf.Piesche Fix compiler error from silly leftover bit of code. Change 3142065 on 2016/09/27 by Benjamin.Hyder Updating Lighting Scenario map Change 3142262 on 2016/09/27 by Mark.Satterthwaite Change Apple RHI initialisation to select the first compatible shader platform to decide which RHI to initialise. Internally in MetalRHI we must gracefully fallback to a lower feature-level when this initial selection is not available on the current device/OS, in which case we need to validate that the selected shader platform was actually packaged. The order of initialisation is different per-platform: On Mac: Order of initialisation is the order listed in TargetedRHIs .ini specifications. On iOS/tvOS: Order is explicit: Metal MRT > Metal ES 3.1 > OpenGL ES 2 #jira UE-35749 Change 3142292 on 2016/09/27 by Rolando.Caloca DR - hlslcc - Fix for warning X3206: implicit truncation of vector type causing error #jira UE-31438 Change 3142397 on 2016/09/27 by Mark.Satterthwaite Update hlslcc for Mac including RCO's changes in CL #3142292. #jira UE-31438 Change 3142438 on 2016/09/27 by Daniel.Wright UMapBuildDataRegistry's created for legacy lightmap data are placed in the map package, which avoids problems with cooking Change 3142452 on 2016/09/27 by Rolando.Caloca DR - Proper support for int defines Change 3142519 on 2016/09/27 by Arne.Schober DR - [UE-33438] - Added a Project Setting to enable Skincache Shader Permuations. The Default value for the Skincache mode was changed to enabled. The reasoning behind this was that it will be auto disabled when Skincache Shaders are disabled, and runtime toggle is a debuging feature that mainly programmers are dealing with. The Recompute Tangents option in the Skinned Mesh is now automatically grayed out when no Skincache Shader Permuations are available. Change 3142537 on 2016/09/27 by Daniel.Wright Fixed r.ScreenPercentage with MSAA - a scissor rect was being setup during the resolve and not reset Change 3142691 on 2016/09/27 by Daniel.Wright Disabled renaming of legacy ULightmap2D's to the separate package since UMapBuildDataRegistry is no longer put in a separate package for legacy content Change 3142711 on 2016/09/27 by Daniel.Wright GComponentsWithLegacyLightmaps entries get handled by USceneComponent::AddReferencedObjects, fixes a crash when you open a map directly from the content browser Change 3142712 on 2016/09/27 by Daniel.Wright Separate category for ParticleCutout properties Change 3142762 on 2016/09/27 by Uriel.Doyon Added per static mesh and per skeletal mesh UV density data. The data is now saved and available in cooked builds. The density are computed by the engine but can be overridden by the user in the material tabs. Texture streaming intermediate component data is now per material instead of per lod-section. New ViewModeParam in FSceneViewFamily allowing context specific param per viewmode. This is currently used to show which UV channel and which texture index is being shown in the texture streaming accuracy viewmodes. This replaces r.Streaming.AnalysisIndex Renamed texture streaming viewmodes: MeshTexCoordSizeAccuracy -> MeshUVDensityAccuracy MaterialTexCoordScalesAccuracy -> MaterialTextureScaleAccuracy MaterialTexCoordScalesAnalysis -> OutputMaterialTextureScales Improved UV density computation and viewmode. LightmapUVDensity is now computed separately from UVChannel Density. Fixed texture streaming for instanced static mesh component and derived types. Change 3143464 on 2016/09/28 by Daniel.Wright Removed 'experimental' from forward shading setting Change 3143508 on 2016/09/28 by Chris.Bunner Added component type handling to FoldedMath and Length material expressions. #jira UE-36304 Change 3143557 on 2016/09/28 by Rolando.Caloca DR - Back out changelist 3142292 Change 3143563 on 2016/09/28 by Rolando.Caloca DR - vk - Force hlslcc re-link Change 3143648 on 2016/09/28 by Daniel.Wright Moved GetMeshMapBuildData to UStaticMeshComponent since FStaticMeshComponentLODInfo::OwningComponent can't be initialized reliably in the case of SpawnActor off of a blueprint default that has LODData entries already. Change 3143661 on 2016/09/28 by Chris.Bunner Warning fix. Change 3143723 on 2016/09/28 by Daniel.Wright DumpUnbuiltLightIteractions after lighting build for debugging Change 3143822 on 2016/09/28 by Arne.Schober DR - Refactoring of the ViewMatrices. Moved the Derived Matrices into the FViewMatrix struct. Made all members private do emphasize the static constness of that struct after creation. Renamed the heavy weight members on this struct to Compute*. Methods that modify The ViewMatrices have been renamed to Hack* to discurage their use in the future until a better solution for those problems is found. The ViewMatrix modification is especially misleading because it only changes the State of the ViewMatrices to read their Position from the Material Editior as if coming from the Lightsource (mainly for manual bilboards) as well as doing someting similar to generate CPU bilboards for shadows. Change 3143860 on 2016/09/28 by Benjamin.Hyder Updating TM-Noise map to include 3d noise examples Change 3143939 on 2016/09/28 by Rolando.Caloca DR - vk - Better debugging of submissions - Added r.Vulkan.IgnoreCPUReads to help track down hangs on some ihvs Change 3144006 on 2016/09/28 by Brian.Karis Fixed PixelError not being set correctly with LOD groups. Removed unneeded Simplygon references. Mesh reduction module can now be chosen by name with r.MeshReductionModule Change 3144026 on 2016/09/28 by Benjamin.Hyder Updating QA-Effects map to correct numbering issue Change 3144098 on 2016/09/28 by Arne.Schober DR - ViewMatrices Refactoring - Fix UT Change 3144158 on 2016/09/28 by Rolando.Caloca DR - Undo splitting RHI command context Change 3144952 on 2016/09/29 by Rolando.Caloca DR - vk - Missing swapchain flag Change 3145064 on 2016/09/29 by Olaf.Piesche #jira UE-36091 Pulling range update for vector distributions even when UDist is not dirty; some content has a lookup table and a clean dist, but the range values have not been baked; always pulling them should be safe and not significantly costly. Change 3145354 on 2016/09/29 by Benjamin.Hyder Updating Tm-ContactShadows Change 3145485 on 2016/09/29 by Daniel.Wright Made SeamlessTravelLoadCallback handle legacy lightmaps Change 3145527 on 2016/09/29 by Daniel.Wright Don't clear legacy lightmap annotations on each map - fixes lighting unbuilt when doing seamless travel Change 3145530 on 2016/09/29 by Simon.Tovey UE-36188 - Editor crash when updating hierarchical instance static mesh component Dirtied render state rather than unsafe update of bounds. Change 3145608 on 2016/09/29 by Gil.Gribb Attempt to fix a random compiler error under win32 Change 3145749 on 2016/09/29 by Uriel.Doyon Fix for static analysis warning Change 3146091 on 2016/09/29 by Zabir.Hoque RHI Interface changes to support PSO based APIs Change 3146092 on 2016/09/29 by Zabir.Hoque D3D12 RHI support for PSO based APIs. Change 3146590 on 2016/09/30 by Gil.Gribb Merging //UE4/Dev-Main@3146520 to Dev-Rendering (//UE4/Dev-Rendering) Change 3146731 on 2016/09/30 by Rolando.Caloca DR - Fix merge conflicts Change 3146778 on 2016/09/30 by Rolando.Caloca DR - More integration compile fixes Change 3146790 on 2016/09/30 by Rolando.Caloca DR - Integration fix Change 3146849 on 2016/09/30 by Rolando.Caloca DR - Final integration fix Change 3146899 on 2016/09/30 by Daniel.Wright Static analysis fix for dereferencing World Change 3147020 on 2016/09/30 by Rolando.Caloca DR - vk - Fix depth issue on AMD cards - Added VULKAN_KEEP_CREATE_INFO to help debugging creation - Added num color attachments to pipeline key Change 3147034 on 2016/09/30 by Rolando.Caloca DR - Fix Kite crash where shader pipelines were optimizing non-tessellation pipelines #jira UE-36277 #jira UE-36500 Change 3147080 on 2016/09/30 by Rolando.Caloca DR - vk - Disable debug info by default Change 3147082 on 2016/09/30 by Chris.Bunner Allow tessellation to be used with DrawTile calls by swapping fixed mesh to triangle list. #jira UE-36491 Change 3147388 on 2016/09/30 by Chris.Bunner Blacklisted Nvidia driver 372.70 as it has known stability issues skewing our top crashes list. Also updated recommended version numbers. #jira UE-35288 Change 3147394 on 2016/09/30 by Chris.Bunner Additional logging for rare error. #jira UE-35812 Change 3147459 on 2016/09/30 by Rolando.Caloca DR - vk - Some more srgb formats Change 3147537 on 2016/09/30 by Rolando.Caloca DR - vk - Standarize srgb flag like D3D11 - Minor FVulkanShader cleanup Change 3147620 on 2016/09/30 by Olaf.Piesche #jira UE=34486 particle component tick function task can be invalid during pause; add check Change 3148028 on 2016/10/01 by Daniel.Wright Renamed RenderingSettings.cpp to match header Change 3148059 on 2016/10/01 by Daniel.Wright Disabled reparenting in the profiler which is disorienting Change 3148067 on 2016/10/01 by Daniel.Wright Support for ReflectionEnvironment and light type show flags with ForwardShading Change 3148069 on 2016/10/01 by Daniel.Wright Added CapsuleIndirectShadowMinVisibility to SkinnedMeshComponent, so artists have control over indirect capsule shadow darkness without changing cvars Change 3148072 on 2016/10/01 by Daniel.Wright Added a rendering setting to disable the new lightmap mixing behavior, where smooth surfaces don't have any mixing. r.ReflectionEnvironmentLightmapMixBasedOnRoughness Change 3148073 on 2016/10/01 by Daniel.Wright r.VertexFoggingForOpaque only affects forward shading - manual copy of Ben's fix from Orion stream Change 3148074 on 2016/10/01 by Daniel.Wright Enabled planar reflection receiving on the material used for the preview of a APlanarReflection Change 3148084 on 2016/10/01 by Daniel.Wright Fixed reflections on Surface TranslucencyVolume in deferred Change 3148085 on 2016/10/01 by Daniel.Wright Fixed planar reflection composite being done too many times in stereo deferred Change 3148086 on 2016/10/01 by Daniel.Wright Clamp IndirectLightingQuality to 1 in preview builds - keeps preview useful even with IndirectLightingQuality jacked up to 10. Change 3148107 on 2016/10/01 by Daniel.Wright CIS fix Change 3148113 on 2016/10/01 by Daniel.Wright Translucency lighting modes for forward shading * Per-vertex modes use GetSimpleDynamicLighting since they can't support specular anyway Change 3148306 on 2016/10/02 by Rolando.Caloca DR - vk - Fix for some NV drivers on Win10 Change 3148307 on 2016/10/02 by Rolando.Caloca DR - vk - Compute pipeline Change 3148358 on 2016/10/02 by Rolando.Caloca DR - vk - Consolidate and renumber enum for binding types Change 3148396 on 2016/10/03 by Rolando.Caloca DR - vk - Warning fix Change 3148697 on 2016/10/03 by Benjamin.Hyder Submitting M_Chromebal after enabling planar reflectionsl Change 3148799 on 2016/10/03 by Rolando.Caloca DR - vk - static analysis fix Change 3148934 on 2016/10/03 by Chris.Bunner Added pre-skinned local position material graph node, vertex shader only. Change 3148994 on 2016/10/03 by Chris.Bunner Added missing header file. Change 3149085 on 2016/10/03 by Daniel.Wright Support for ReflectionEnvironment show flag in base pass reflections without any shader overhead Change 3149095 on 2016/10/03 by Rolando.Caloca DR - vk - Disable new render passes Change 3149125 on 2016/10/03 by Rolando.Caloca DR - vk - Fix for multiple memory types Change 3149181 on 2016/10/03 by Rolando.Caloca DR - Better message when missing pipelines Change 3149215 on 2016/10/03 by Rolando.Caloca DR - RHIClearColor -> RHIClearColorTexture #tests Orion Editor run match on Agora_P Change 3149288 on 2016/10/03 by Chris.Bunner Added PreTonemapHDRColor for buffer visualization and target output. #jira UE-36333 Change 3149402 on 2016/10/03 by Daniel.Wright Light attenuation buffer is now multisampled, fixes preshadows with MSAA (depth testing failed during stencil pass) but adds a resolve (.12ms at VR res) Change 3149403 on 2016/10/03 by Daniel.Wright Forward lighting supports lighting channels Change 3149574 on 2016/10/03 by Marcus.Wassmer PR #2817: Ansel/Photography system (Contributed by adamnv) Modified to become a plugin Change 3149615 on 2016/10/03 by Rolando.Caloca DR - vk - Fix PF_G16R16 which fixes reflections Change 3149639 on 2016/10/03 by Olaf.Piesche Adding more ensures to catch NaNs occasionally appearing in particle locations early Change 3149745 on 2016/10/03 by Uriel.Doyon Moved UVDensity computation in the staticmesh DDC. Change 3149749 on 2016/10/03 by Daniel.Wright Fixed lightmaps on BSP, which was fallout from Lighting Scenarios backwards compatibility Change 3149755 on 2016/10/03 by Benjamin.Hyder Checking in built lighting for QA-postprocessing Change 3149758 on 2016/10/03 by Benjamin.Hyder re-submitting built lighting for QA-PostProcessing Change 3149940 on 2016/10/04 by Gil.Gribb Merging //UE4/Dev-Main@3149754 to Dev-Rendering (//UE4/Dev-Rendering) Change 3150098 on 2016/10/04 by Marcus.Wassmer Fix some clang and win32 errors Change 3150323 on 2016/10/04 by Rolando.Caloca DR - vk - Static analysis fix Change 3150456 on 2016/10/04 by Daniel.Wright Revert temp logs Change 3150731 on 2016/10/04 by Daniel.Wright Static lights now add a dummy map build data entry for their ULightComponent::IsPrecomputedLightingValid Change 3150795 on 2016/10/04 by Marcus.Wassmer Fix RHIClearUAV and Drawindirect bugs on PS4. Also fix PS4 compile error from bad merge. Change 3151065 on 2016/10/04 by Ben.Marsh Merging //UE4/Dev-Main to Dev-Rendering (//UE4/Dev-Rendering) Change 3151134 on 2016/10/04 by Brian.Karis Fixed corrupt mesh generation from quadric simplifier due to uninitialized color array. Change 3151201 on 2016/10/04 by Marcus.Wassmer Nvidia approved icon for ansel plugin. Change 3151240 on 2016/10/04 by Marcus.Wassmer Fix string concat build error. Change 3151258 on 2016/10/04 by Ben.Marsh Fix compile error. Change 3151290 on 2016/10/04 by Marcus.Wassmer Bumping static mesh DDC key to hopefully fix distancefield crashes after brian's quadric simplifier fix. Change 3152104 on 2016/10/05 by Chris.Bunner Workaround for legacy BreakMA material node invalid component masks. #jira UE-36832 Change 3152130 on 2016/10/05 by Ben.Woodhouse Fix issue with skylight SH and fast semantics on DX11. We need to clear the cube scratch textures before writing to them to avoid issues when reading them back for mip downsampling #jira UE-35890 Change 3152240 on 2016/10/05 by Rolando.Caloca DR - Fix for missing gizmo colors #jira UE-36515 Change 3152338 on 2016/10/05 by Daniel.Wright Hopeful fix for FDistanceFieldVolumeTexture assert in the cooker Change 3152833 on 2016/10/05 by Brian.Karis Improved precision of quadrics. Fixes bad triangles on large meshes Change 3153376 on 2016/10/06 by Rolando.Caloca DR - Fix for SM4 missing pipelines fallout Change 3153650 on 2016/10/06 by Gil.Gribb Merging //UE4/Dev-Main@3153068 to Dev-Rendering (//UE4/Dev-Rendering) Change 3153656 on 2016/10/06 by Uriel.Doyon Fixed main integration compilation issues. Some of the Mesh UVDensity UI is temporary disabled. Change 3153725 on 2016/10/06 by Uriel.Doyon Fixed crash when source data is missing for lightmaps #jira UE-36157 Change 3153998 on 2016/10/06 by Gil.Gribb Merging //UE4/Dev-Main to Dev-Rendering@3153705 (//UE4/Dev-Rendering) Change 3154056 on 2016/10/06 by Marcus.Wassmer Fix compile errors from merge. Also restore some light scencario code Change 3154176 on 2016/10/06 by Marcus.Wassmer Fix deprecation warning Change 3154252 on 2016/10/06 by Marcus.Wassmer Fix more deprecation warnings Change 3154632 on 2016/10/07 by Chris.Bunner Fix for incorrect re-entrant detection with a function called twice in a row. The function input Preview expression is overridden when the function is called to link it into the caller graph, but it was restored too late for chained calls to the same function. #jira UE-37002 [CL 3154728 by Gil Gribb in Main branch]
2016-10-07 10:20:36 -04:00
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,
Copying //UE4/Dev-Console to //UE4/Dev-Main (Source: //UE4/Dev-Console @ 3632338) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3443778 by Ben.Woodhouse Aliasing for transient resources + new high level API Changelists integrated: 3368830 3368887 3377762 3377763 3379513 3381840 3382046 3382138 3385390 3385391 3385531 3396613 3388752 3396756 3397007 3397059 3397780 3397883 3401716 3415179 Change 3576521 by Bart.Hawthorne ShooterGame - update the game instance's online mode when the LAN option is changed Change 3587252 by Ben.Woodhouse Integrate from //UE4/Main/...@3584123 to //UE4/Dev-Console/... Change 3587943 by Luke.Thatcher [CONSOLE] [+] Improved XGE shader compiler - Added support for XGE interception interface, which allows asynchronous streaming of shader tasks into XGE, and eliminates the stalling/flushing found in the old system. - Old system has been renamed "Xml interface" - Both systems are available and selectable based on r.XGEShaderCompile.Mode CVar. Overview of the new system: - New system uses an additional XGEControlWorker process to manage communication between the engine and XGE. This is simply a copy of ShaderCompileWorker.exe (the implementation is part of SCW, but XGE requires the two files to be separate, hence the duplicate). - When shader jobs arrive from the engine, the shader compiler thread spawns an instance of XGEControlWorker within an XGE context, and connects to it via named pipes. - Job command lines are fed to the control worker via the pipe, which the worker enqueues within XGE by issuing a CreateProcess call, which is intercepted. Job completion is reported back to the engine via the named pipes. - New system is preferred over the old one, and is enabled with "-xgeshadercompile" command line switch or "r.XGEShaderCompile" cvar. - The new system depends on the "XGEController" engine module. Support for which is based on the WITH_XGE_CONTROLLER #define, or -xgecontroller/-noxgecontroller command line options. #jira UECON-263 Change 3590037 by Luke.Thatcher [CONSOLE] [!] Fix compile/link errors with XGE controller module - Various unity related fixes needed. Change 3590047 by Luke.Thatcher [CONSOLE] [!] Compile XGE controller module for Editor builds only - The module should only be used in uncooked, non-monolitic binaries (i.e. the editor). Change 3594074 by Luke.Thatcher [CONSOLE] [!] Fix Linux build - case sensitive header include was wrong in XGEControllerModule.cpp Change 3596292 by Luke.Thatcher [CONSOLE] [!] Actually fix unity/nopch build errors in XGE Controller! Change 3596776 by Jonathan.Fitzpatrick cherry pick CL 3595292 cooker change which fixes a condition where DLC would always cook with all maps regardless of which maps were specified. Change 3596795 by Jonathan.Fitzpatrick Back out changelist 3596776 Change 3596816 by Jonathan.Fitzpatrick Moved the DLC map check ahead of the "no maps found" condition so that include-all-maps can be skipped if DLC maps are found. Change 3604282 by Ben.Marsh UBT: Add support for pre-build and post-build steps when using MegaXGE. Change 3606862 by Ben.Marsh Fix missing header guard warning. Change 3611644 by Ben.Woodhouse Integrate from //UE4/Main/...@3610522 to //UE4/Dev-Console/... Change 3614089 by Joe.Barnes Call GRHICommandList.LatchBypass() after variables it checks are set. #jira ue-48130 Change 3617783 by Daniel.Eldar Headers for the HDR changes (they are pre-requisites for compilation). Integrated from: //UE4/Partner-Microsoft-DX12/Engine/Source/ThirdParty/Windows/DirectX/... to //UE4/Dev-Console/Engine/Source/ThirdParty/Windows/DirectX/... #jira UECON-226 Change 3619117 by Ben.Woodhouse Integrate from //UE4/Main/...@3617655 to //UE4/Dev-Console/... Change 3619123 by Ben.Woodhouse Integrate from //UE4/Main/...@3618361 to //UE4/Dev-Console/... Change 3619603 by Stewart.Lynch Merging //Fortnite/Dev-Athena/Engine/Source/Runtime/Engine/Private/Materials/MaterialInstanceConstant.cpp to //UE4/Dev-Console/Engine/Source/Runtime/Engine/Private/Materials/MaterialInstanceConstant.cpp Changed UMaterialInstance::PostLoad(); to Super::PostLoad(); Change 3619608 by Stewart.Lynch Merging //Fortnite/Dev-Athena/Engine/Source/Runtime/... to //UE4/Dev-Console/Engine/Source/Runtime/... LLM update * made sure that all csv stat tracking is disabled if running without -LLMCSV * added new UObject scopes * increased LLM_MAX_THREAD_SCOPE_STACK_DEPTH to 128 to cope with new UObject scopes * added material scopes * changed UMaterialInstance::PostLoad(); to Super::PostLoad(); Change 3619634 by Stewart.Lynch Merging //Fortnite/Main/... to //UE4/Dev-Console/... General LLM improvements * added tracking for misc task graph tasks (moves 20MB out of Untagged) * renamed EngineTick to EngineMisc * added tracking for FName * added tracking for GC_ProcessObjectArray potential leak * renamed index & vertex buffers stat to Meshes * added hooks for MemPro to track allocations from a single category. Currently defined out. I haven't added MemPro.cpp/h. * removed AVAILABLE_PHYSICAL stat from LLM csv * csv files now include the date in the filename * fixed potential threading bug when reading stat values to csv * added lots more scopes * started changing Stat scopes to enum scopes. Stat scopes will be phased out. * added tracking of FName memory * added llm tracking for CPU symbol allocations (20MB) * added tracking for GC * fixed tracking for TransientMemoryAllocator * added tracking for networking memory * added more audio memory tracking * added tracking for blueprints * added tracking for static meshes * show on screen warning if debug memory is enabled * added tracking for particles * renamed Phys to PhysX and added more scopes * renamed Slate to UI and added more scopes * much better coverage of networking memory * improved coverage of audio Change 3619642 by Stewart.Lynch Merging //Fortnite/Main/Engine/Source/Runtime/Core/... to //UE4/Dev-Console/Engine/Source/Runtime/Core/... Windows builds were incorrectly showing the debug memory enabled warning. Made IsDebugMemoryEnabled always return false on Windows. Change 3619799 by Luke.Thatcher [CONSOLE] [-] Disable peak memory tracking in LLM. Change 3619809 by Luke.Thatcher [CONSOLE] [^] Merging CL 3580894 from //Fortnite/Main/... to //UE4/Dev-Console/... - Add Render Target Pool Stats. Use "stat rendertargetpool" to view. Change 3619928 by Luke.Thatcher [CONSOLE] [^] Enable symbol compression on symstore task (Merging CL 3606945 from //Fortnite/Main/... to //UE4/Dev-Console/...) Change 3620571 by Keith.Judge Double the size of the occlusion query buffer in D3D12. This costs 256KB of memory. We need to refactor this in future to resize according to content on demand like D3D11.x. #jira FORT-53103 #jira FORT-53119 Change 3622419 by Daniel.Eldar [General] Fix for occasional ensure to do with retriving the new cvar value. #JIRA UE-46644 Change 3622491 by Daniel.Eldar [General] Added support for scaling on stat unit and unitgraph. #JIRA UE-46644 Change 3622610 by Daniel.Eldar [General] Fixed a compilation warning Change 3624659 by Ben.Woodhouse Integrate from //UE4/Main/...@3624175 to //UE4/Dev-Console/... Change 3624678 by Ben.Woodhouse Integrate from //UE4/Main/...@3624415 to //UE4/Dev-Console/... Change 3624878 by Ben.Woodhouse Integrate as edit CLs 3611835 3611844 3616942 3617607 Descriptor heap memory fix (saves up to ~100MB). * Fix a bug where rolling over a thread-local heap immediately after switching to context-local would crash due to an uninitialized syncpoint * Add a separate value for context local heaps (LOCAL_HEAP_SIZE) and set it to a sensible value (2MB) instead of the current 16MB. This means thread local heaps will be allocated in chunks of ~2MB instead of 16MB. There can be up to 6 thread-local heaps, since they're per-context. Measured peak descriptor heap memory with LLM: 45MB (compared to 145MB previously) This improves behaviour, but this code could use a bit of a rewrite to allow it to reclaim memory better. For example, the global heap memory is almost entirely wasted currently, since when a context switches to "context local strategy" it simply throws this memory away, never to be reclaimed. Having the pools thread-local is also not a good strategy. Ideally we want a thread-safe pool allocator for descriptor heaps which is shared between all the contexts . Change 3624882 by Ben.Woodhouse Fix virtual destructor warning in D3DX12.h Change 3626419 by Stewart.Lynch Merging //Fortnite/Main/... to //UE4/Dev-Console/... LLM Update - Memory reductions, Summary page, enum scopes, refactor and cleanup of tags * Remove all static arrays and hard limits from LLM. Everything is now dynamically allocated using the internal LLM allocators. The overhead when LLM is disabled is now only 48K (was 40MB) * re-wrote LLMMap. Now stores an int32 index rather then pointer in the HashMap array. Also, changed the Values to be arrays for structs instead of structs of arrays. Means that the tag can be stored in a single byte. Changed the size of the allocation size from int64 to int32. All this takes the memory down from around 600MB to 100MB. It was 120 bytes per allocation, now 29 bytes. * changed all LLM scopes over to enums. This has a number of benefits; LLM can be enable in Test, less CPU overhead, stored in a byte (LLM overhead /= 8) * summary page for content creators where all lower-level stats are grouped under one Engine stat * renamed ELLMScopeTag enum to ELLMTag * renamed LLM_SCOPED_TAG_WITH_ENUM macro to LLM_SCOPE * removed Tracker arg from LLM_SCOPE and added LLM_PLATFORM_SCOPE macro * fixed GenericPlatformMallocCrash stat. Although it seems not be be used anymore * fixed BackupOOMMemoryPool stat (now shows in both default and platform pages) * lots of changes adding/removing/renaming tags * added LLMArray and FLLMObjectAllocator classes * disabled asset tag tracking by default because it takes up so much memory even when not used * enable LLM in all non-shipping builds. In Test the on screendisplay won't show because it uses the stats system but it till still write out the csv. * all the stat macros have been left as they were and can be enabled on the LLM_STAT_TAGS_ENABLED define. These are needed for the asset tagging. * disabled LLM_TRACK_PEAK_MEMORY because there is a problem with the way it adds the peaks for multiple threads. This needs to be fixed. * added a CVar to control the csv write interval: LLM.LLMWriteInterval * added static arrays for the enum tags setup. Easier to manage and removes need for slow switch statements. * renamed FLLMThreadStateManager to FLLMTracker to make it consistent with the enum #jira UECON-264 Change 3626906 by Joe.Barnes Fix compile errors when nativizing when a property references a sub object of a dervied type with modified default properties Change 3628045 by Stewart.Lynch Merging //Fortnite/Main/Engine/Source/Runtime/Core/... to //UE4/Dev-Console/Engine/Source/Runtime/Core/... LLM - enabled LLM on Windows * fixed crash in FLLMObjectAllocator destructor. Only happens on Windows shutdown. * changed Align to AlignArbitrary in LLMArray. Small memory saving. * clear ThreadStateAllocator in FLLMTracker::Clear(). Small memory saving * set program size to zero on windows because it isn't relevant #jira UECON-282 Change 3632279 by Ben.Woodhouse Back out changelist 3619862 #jira UE-49472 [CL 3632432 by Joe Barnes in Main branch]
2017-09-07 22:18:47 -04:00
GPixelFormats[Element->Desc.Format].Name,
Element->IsTransient() ? TEXT("(transient)") : TEXT(""),
GSupportsTransientResourceAliasing ? *FString::Printf(TEXT("Frames since last discard: %d"), GFrameNumberRenderThread - Element->FrameNumberLastDiscard) : TEXT(""),
Element->UnusedForNFrames
);
}
}
uint32 NumTargets = 0;
uint32 UsedKB = 0;
uint32 PoolKB = 0;
GetStats(NumTargets, PoolKB, UsedKB);
OutputDevice.Logf(TEXT("%.3fMB total, %.3fMB used, %.3fMB unused, %d render targets"), PoolKB / 1024.f, UsedKB / 1024.f, UnusedAllocationInKB / 1024.f, NumTargets);
uint32 DeferredTotal = 0;
OutputDevice.Logf(TEXT("Deferred Render Targets:"));
for (int32 i = 0; i < DeferredDeleteArray.Num(); ++i)
{
FPooledRenderTarget* Element = DeferredDeleteArray[i];
if (Element)
{
OutputDevice.Logf(
TEXT(" %6.3fMB %4dx%4d%s%s %2dmip(s) %s (%s) %s %s"),
ComputeSizeInKB(*Element) / 1024.0f,
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,
Element->IsTransient() ? TEXT("(transient)") : TEXT(""),
GSupportsTransientResourceAliasing ? *FString::Printf(TEXT("Frames since last discard: %d"), GFrameNumberRenderThread - Element->FrameNumberLastDiscard) : TEXT("")
);
uint32 SizeInKB = ComputeSizeInKB(*Element);
DeferredTotal += SizeInKB;
}
}
OutputDevice.Logf(TEXT("%.3fMB Deferred total"), DeferredTotal / 1024.f);
}
void FPooledRenderTarget::InitRDG()
{
check(RenderTargetItem.ShaderResourceTexture);
if (RenderTargetItem.TargetableTexture)
{
TargetableTexture = new FRDGPooledTexture(RenderTargetItem.TargetableTexture, Translate(Desc, ERenderTargetTexture::Targetable));
}
if (RenderTargetItem.ShaderResourceTexture != RenderTargetItem.TargetableTexture)
{
ShaderResourceTexture = new FRDGPooledTexture(RenderTargetItem.ShaderResourceTexture, Translate(Desc, ERenderTargetTexture::ShaderResource));
}
else
{
ShaderResourceTexture = TargetableTexture;
}
}
uint32 FPooledRenderTarget::AddRef() const
{
check(IsInRenderingThread());
return uint32(++NumRefs);
}
Copying //UE4/Dev-Console to //UE4/Dev-Main (Source: //UE4/Dev-Console @ 3483086) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3389969 on 2017/04/12 by Guillaume.Abadie Implements FDebug::DumpStackTraceToLog() debugging utility. Change 3391579 on 2017/04/12 by Joe.Barnes Fix minor spacing issue. Change 3402629 on 2017/04/20 by Ben.Marsh Build: Remove job to populate the DDC. Trying out a new system for this. Change 3417501 on 2017/05/01 by Joe.Barnes IWYU - Missing #include files. Change 3419927 on 2017/05/02 by Joe.Barnes - Support custom LOD for shadow map generation only (r.ForceLODShadow) - New #define to expose forceLOD and forceLODShadow also in Test/Ship builds (#define EXPOSE_FORCE_LOD 1 in RenderCore.cpp). Not exposed by default. Change 3420964 on 2017/05/03 by Jonathan.Fitzpatrick Fixed null dereference of LineBatcher when using DrawDebugSphere and DrawDebugAltCone #jira UE-30213 Change 3423470 on 2017/05/04 by Luke.Thatcher [CONSOLE] [STREAMS] [^] Merging //UE4/Dev-Main (CL 3391974) to Dev-Console (//UE4/Dev-Console) - Compile errors in Switch, to be fixed after check-in. Change 3430410 on 2017/05/09 by Ben.Woodhouse Fix uninitialized local variable causing crashes in Test #jira UE-44832 Change 3430506 on 2017/05/09 by Josh.Adams - Fixed up the editor platforms' method of loading TargetSettings objects so that we don't need any manual parsing of .ini files to fill out the class defaults Change 3434035 on 2017/05/10 by Ben.Woodhouse Integrate updated FortGPUTestbed from Fortnite/Main Change 3437046 on 2017/05/12 by Joe.Barnes Fix for clang producing a warning when not all specializations of a templated function are marked FORCEINLINE. Also, switch a specialization of BlendTransform() from a function with a check to just a declaration so compiler will catch error instead of a runtime catch. Change 3437259 on 2017/05/12 by Joe.Barnes Fix for clang producing a warning when not all specializations of a templated function are marked FORCEINLINE. Also, switch a specialization of BlendTransform() from a function with a check to just a declaration so compiler will catch error instead of a runtime catch. Change 3440758 on 2017/05/16 by Ben.Woodhouse Simple threaded CSV Profiler To capture: - On the commandline, add -csvCaptureFrames=N to capture N frames from startup - On the console, use csvprofile start, csvprofile stop or csvprofile frames=N to capture a fixed number of frames - Instrument with CSV_SCOPED_STAT(statname), CSV_CUSTOM_STAT(statname,value). CSV capture is enabled in all builds except shipping - Please do not check in the instrumentation √ we don╞t want to pollute the engine with lots of additional instrumentation. We may add some minimal level of instrumentation at some point Change 3440954 on 2017/05/16 by Josh.Adams - Cleaned up some DeviceProfiles in BaseDP.ini Change 3443778 on 2017/05/17 by Ben.Woodhouse Aliasing for transient resources + new high level API Changelists integrated: 3368830 3368887 3377762 3377763 3379513 3381840 3382046 3382138 3385390 3385391 3385531 3396613 3388752 3396756 3397007 3397059 3397780 3397883 3401716 3415179 Change 3451460 on 2017/05/22 by Ben.Woodhouse Fix editor crash (NULL dereference of ScreenSpaceShadowTexture) when moving the camera around in tm-shadermodels, probably fallout from the VRAM aliasing merge. Not sure if this is the correct fix, but it prevents the crash for now Change 3451601 on 2017/05/22 by Josh.Adams - Track idle time from MaxTickRate, so that stat unit is accurate on Game: thread Change 3452025 on 2017/05/22 by Ben.Woodhouse Integrate (as edit) CL 3378734 (editor crash fix) Also add a check for null in LightFunctionRendering.cpp Change 3452389 on 2017/05/22 by Josh.Adams - Replaced POCulturePluralForms with a static array, instead of TMapBuilder (was blowing stack or similar on Switch Debug). Code courtesy of Jamie Dale. Change 3452758 on 2017/05/22 by Joe.Barnes Add FindFirstClearBit() and FindFirstSetBit() to TStaticBitArray. Change 3455889 on 2017/05/23 by Ben.Woodhouse Integrate from //UE4/Main/...@3453436 to //UE4/Dev-Console/... Change 3458654 on 2017/05/25 by Joe.Conley Attempting to fix Static Analysis warning. Change 3462710 on 2017/05/26 by Ben.Woodhouse Integrate from //UE4/Main/...@3461688 to //UE4/Dev-Console/... Change 3471711 on 2017/06/02 by Jonathan.Fitzpatrick Updating MallocProfiler to use the accessor for OnOutOfMemory delegate to conform with change made in CL 3415996. Change 3473813 on 2017/06/05 by Ben.Woodhouse Fix streaming visibility logic bug reported on UDN #jira UE-43892 Change 3475298 on 2017/06/06 by Luke.Thatcher [CONSOLE] [!] Fix RHITransitionResources crash with more than 16 textures. - Old command had a fixed sized array of 16 textures that would overflow. - New command allocates an array of texture pointers inline in the command list, so any number is supported. #jira UE-45625 Change 3476776 on 2017/06/06 by Ben.Woodhouse Integrate from //UE4/Main/...@3475908 Change 3479083 on 2017/06/07 by Ben.Woodhouse Integrate as edit CL 3467315 from dev-animphys: From Alexis Matte. Ensure SectionMap is fixed up for old entries that are no longer valid. #JIRA UE-45438 #jira UE-45735 Change 3480576 on 2017/06/08 by Ben.Woodhouse Integrate from //UE4/Main/...@3480024 to //UE4/Dev-Console/... [CL 3483258 by Luke Thatcher in Main branch]
2017-06-09 17:44:13 -04:00
uint32 FPooledRenderTarget::Release()
{
checkf(IsInRenderingThread(), TEXT("Tried to delete on non-render thread, PooledRT %s %s"), Desc.DebugName ? Desc.DebugName : TEXT("<Unnamed>"), *Desc.GenerateInfoString());
uint32 Refs = uint32(--NumRefs);
if (Refs == 0)
{
RenderTargetItem.SafeRelease();
delete this;
}
else if (Refs == 1 && RenderTargetPool && IsTransient())
{
if (RenderTargetItem.TargetableTexture)
{
RHIDiscardTransientResource(RenderTargetItem.TargetableTexture);
}
FrameNumberLastDiscard = GFrameNumberRenderThread;
}
return Refs;
}
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());
DeferredDeleteArray.Empty();
PooledRenderTargets.Empty();
}
// 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::CompactPool()
{
for (uint32 i = 0, Num = (uint32)PooledRenderTargets.Num(); i < Num; )
{
FPooledRenderTarget* Element = PooledRenderTargets[i];
if (!Element)
{
PooledRenderTargets.RemoveAtSwap(i);
PooledRenderTargetHashes.RemoveAtSwap(i);
--Num;
}
else
{
++i;
}
}
}
bool FPooledRenderTarget::OnFrameStart()
{
check(IsInRenderingThread());
// 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;
if (!IsTransient())
{
if (Desc.Is2DTexture())
{
Size += RHIComputeMemorySize(RenderTargetItem.TargetableTexture);
if (RenderTargetItem.ShaderResourceTexture != RenderTargetItem.TargetableTexture)
{
Size += RHIComputeMemorySize(RenderTargetItem.ShaderResourceTexture);
}
}
else if (Desc.Is3DTexture())
{
Size += RHIComputeMemorySize(RenderTargetItem.TargetableTexture);
if (RenderTargetItem.ShaderResourceTexture != RenderTargetItem.TargetableTexture)
{
Size += RHIComputeMemorySize(RenderTargetItem.ShaderResourceTexture);
}
}
else
{
Size += RHIComputeMemorySize(RenderTargetItem.TargetableTexture);
if (RenderTargetItem.ShaderResourceTexture != RenderTargetItem.TargetableTexture)
{
Size += RHIComputeMemorySize(RenderTargetItem.ShaderResourceTexture);
}
}
}
return Size;
}
bool FPooledRenderTarget::IsFree() const
{
uint32 RefCount = GetRefCount();
check(RefCount >= 1);
// If the only reference to the pooled render target is from the pool, then it's unused.
return RefCount == 1;
}