Files
UnrealEngineUWP/Engine/Source/Runtime/Renderer/Private/PostProcess/RenderingCompositionGraph.cpp

1121 lines
34 KiB
C++
Raw Normal View History

// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
/*=============================================================================
RenderingCompositionGraph.cpp: Scene pass order and dependency system.
=============================================================================*/
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 "PostProcess/RenderingCompositionGraph.h"
#include "HAL/FileManager.h"
#include "Misc/Paths.h"
#include "Async/Async.h"
#include "EngineGlobals.h"
#include "Engine/Engine.h"
#include "PostProcess/RenderTargetPool.h"
#include "RendererModule.h"
#include "HighResScreenshot.h"
#include "IHeadMountedDisplay.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 "PostProcess/SceneRenderTargets.h"
#include "SceneRendering.h"
void ExecuteCompositionGraphDebug();
static TAutoConsoleVariable<int32> CVarCompositionGraphOrder(
TEXT("r.CompositionGraphOrder"),
1,
TEXT("Defines in which order the nodes in the CompositionGraph are executed (affects postprocess and some lighting).\n")
TEXT("Option 1 provides more control, which can be useful for preserving ESRAM, avoid GPU sync, cluster up compute shaders for performance and control AsyncCompute.\n")
TEXT(" 0: tree order starting with the root, first all inputs then dependencies (classic UE4, unconnected nodes are not getting executed)\n")
TEXT(" 1: RegisterPass() call order, unless the dependencies (input and additional) require a different order (might become new default as it provides more control, executes all registered nodes)"),
ECVF_RenderThreadSafe);
#if !UE_BUILD_SHIPPING
FAutoConsoleCommand CmdCompositionGraphDebug(
TEXT("r.CompositionGraphDebug"),
TEXT("Execute this command to get a single frame dump of the composition graph of one frame (post processing and lighting)."),
FConsoleCommandDelegate::CreateStatic(ExecuteCompositionGraphDebug)
);
#endif
// render thread, 0:off, >0 next n frames should be debugged
uint32 GDebugCompositionGraphFrames = 0;
class FGMLFileWriter
{
public:
// constructor
FGMLFileWriter()
: GMLFile(0)
{
}
void OpenGMLFile(const TCHAR* Name)
{
#if !UE_BUILD_SHIPPING
// todo: do we need to create the directory?
FString FilePath = FPaths::ScreenShotDir() + TEXT("/") + Name + TEXT(".gml");
GMLFile = IFileManager::Get().CreateDebugFileWriter(*FilePath);
#endif
}
void CloseGMLFile()
{
#if !UE_BUILD_SHIPPING
if(GMLFile)
{
delete GMLFile;
GMLFile = 0;
}
#endif
}
// .GML file is to visualize the post processing graph as a 2d graph
void WriteLine(const char* Line)
{
#if !UE_BUILD_SHIPPING
if(GMLFile)
{
GMLFile->Serialize((void*)Line, FCStringAnsi::Strlen(Line));
GMLFile->Serialize((void*)"\r\n", 2);
}
#endif
}
private:
FArchive* GMLFile;
};
FGMLFileWriter GGMLFileWriter;
bool ShouldDebugCompositionGraph()
{
#if !UE_BUILD_SHIPPING
return GDebugCompositionGraphFrames > 0;
#else
return false;
#endif
}
void Test()
{
struct ObjectSize4
{
void SetBaseValues(){}
static FName GetFName()
{
static const FName Name(TEXT("ObjectSize4"));
return Name;
}
uint8 Data[4];
};
MS_ALIGN(16) struct ObjectAligned16
{
void SetBaseValues(){}
static FName GetFName()
{
static const FName Name(TEXT("ObjectAligned16"));
return Name;
}
uint8 Data[16];
} GCC_ALIGN(16);
// https://udn.unrealengine.com/questions/274066/fblendablemanager-returning-wrong-or-misaligned-da.html
FBlendableManager Manager;
Manager.GetSingleFinalData<ObjectSize4>();
ObjectAligned16& AlignedData = Manager.GetSingleFinalData<ObjectAligned16>();
check((reinterpret_cast<ptrdiff_t>(&AlignedData) & 16) == 0);
}
void ExecuteCompositionGraphDebug()
{
ENQUEUE_UNIQUE_RENDER_COMMAND(
StartDebugCompositionGraph,
{
GDebugCompositionGraphFrames = 1;
Test();
}
);
}
// main thread
void CompositionGraph_OnStartFrame()
{
#if !UE_BUILD_SHIPPING
ENQUEUE_UNIQUE_RENDER_COMMAND(
DebugCompositionGraphDec,
{
if(GDebugCompositionGraphFrames)
{
--GDebugCompositionGraphFrames;
}
}
);
#endif
}
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 2998063) #lockdown nick.penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 2981877 on 2016/05/18 by Rolando.Caloca DR - Fix some PVS warnings - Removed 'uniform' as a keyword on hlslcc as it's ignored/causes issues/doesn't really optimize #jira UE-30996 Change 2981966 on 2016/05/18 by Rolando.Caloca DR - Fix OpenGL crash quitting editor #jira UE-25549 Change 2982072 on 2016/05/18 by Uriel.Doyon Fixed a "Build Texture Streaming" crash related to custom outputs. Fixed issue with debug view mode and translucent primitives Fix bug with visibility that made some texture low res. Enabled per instance visibility in the texture streaming order (in game only). Improved InvestigateTexture Logs. Tweaked the mip computations from screen size. Change 2982077 on 2016/05/18 by Uriel.Doyon Removed debug options! Change 2982108 on 2016/05/18 by Olaf.Piesche #jira UE-30772 moving AMD hacks to console variables Change 2982422 on 2016/05/18 by Gil.Gribb UE4 - Potential crash fix on foliage occlusion queries and reflection captures. Change 2982547 on 2016/05/18 by Martin.Mittring UE-26409 Crash when Light Propagation Volume Plugin is disabled on a Project Change 2982548 on 2016/05/18 by Martin.Mittring Refactored MRT and outer Pixel Shader output to a struct to allow it passed in/out of functions allowing for a more readable code (less #ifdefs, reducing the boolean hell) Needed for upcoming MeshDecals Change 2982601 on 2016/05/18 by Daniel.Wright Movable skylight now matches stationary for subsurface shading models * Two sided was broken in 4.11, Subsurface had never been handled Change 2982603 on 2016/05/18 by Daniel.Wright DrawMaterialToRenderTarget / BeginDrawCanvasToRenderTarget now work correctly with material parameter collections and Time * FCanvas stores an optional scene to render to, UWorld caches the UCanvas needed for implementing these functions Change 2982618 on 2016/05/18 by Daniel.Wright Better categories for some Rendering project settings Change 2982619 on 2016/05/18 by Daniel.Wright Scene capture 2d improvements * Orthographic projection supported * Opacity is now captured in alpha, allows partial rendering in a scene capture and compositing into another scene later * Various GBuffer attributes are now available to be captured, including depth * Changed Blueprint capture function to CaptureScene, which happens immediately (was previously deferred), allowing multiple captures with different parameters Change 2982664 on 2016/05/18 by Daniel.Wright Fading out planar reflections based on roughness since they don't have support for variable roughness (fade starts at .2 roughness, ends at .3) Change 2982684 on 2016/05/18 by Martin.Mittring polish ImageValidator Change 2982685 on 2016/05/18 by Martin.Mittring show testimage on sm4 as well Change 2982736 on 2016/05/18 by Uriel.Doyon Improved overbudget retention logic. Updated ListStreamingTextures stats. Change 2982854 on 2016/05/18 by Martin.Mittring ImageValidator can now save/load IVxml file Change 2982863 on 2016/05/18 by Daniel.Wright Fixed shader compile error Change 2982864 on 2016/05/18 by Daniel.Wright Removed deprecation message Change 2982927 on 2016/05/18 by Martin.Mittring ImageValidator is now sorting by time Change 2983743 on 2016/05/19 by Chris.Bunner Saturated tri-planar UV function outputs to prevent negative blending #jira UE-30964 Change 2983747 on 2016/05/19 by Martin.Wilson Fix for morph curves not getting applied to meshes in cooked builds (smart names were not being corrected). Change 2984008 on 2016/05/19 by Brian.Karis New contact shadows feature. Hair uses ray cast for nonshadow lights Change 2984009 on 2016/05/19 by Brian.Karis changed to ShadowedBits Change 2984054 on 2016/05/19 by Brian.Karis Deleted old motion blur Change 2984420 on 2016/05/19 by Daniel.Wright Shorter display name for WorldPosition material node Change 2984423 on 2016/05/19 by Daniel.Wright Fixed WorldPosition and ScreenPosition for downsampled separate translucency by scaling SvPosition before those computations. The View uniform buffer still contains incorrect buffer sizes for this pass. Change 2984432 on 2016/05/19 by Rolando.Caloca DR - Disable PPCombineLUT for Vulkan to work around glslang issue (will need to be reenabled when adding SM4/5 path) Change 2985415 on 2016/05/20 by Daniel.Wright Added a Texture2D exporter for .hdr Texture2D exporters now implement SupportsObject properly, so you only see extensions that are valid based on the format Change 2985439 on 2016/05/20 by Daniel.Wright Scene color alpha clear value validation Change 2987173 on 2016/05/23 by Martin.Mittring ImageValidator Report with Thumbnail (cannot be copied and pasted into email), non Thumbnail version could be. Change 2987248 on 2016/05/23 by Martin.Mittring ImageValidator: added Summary, removed timer hack Change 2987369 on 2016/05/23 by Martin.Mittring ImageValidator polish Change 2987390 on 2016/05/23 by Brian.Karis Improvement to temporal aa sharpness and speed. Change 2988038 on 2016/05/24 by Gil.Gribb Merging //UE4/Dev-Main@2987977 to Dev-Rendering (//UE4/Dev-Rendering) Change 2988304 on 2016/05/24 by Martin.Mittring added const to prevent coding errors Change 2988332 on 2016/05/24 by Brian.Karis Fixed motion blur crash on SM4 Change 2988446 on 2016/05/24 by Martin.Mittring nicer UI Change 2988990 on 2016/05/24 by Martin.Mittring fixed UE-31227 Building lighting produces bad results #jira:UE-31227 Change 2989729 on 2016/05/25 by Uriel.Doyon Fixed lightmaps and shadowmaps having low resolutions after building the lighting. #jira UE-31254 Change 2989752 on 2016/05/25 by Olaf.Piesche CVar to disable/freeze GPU particle simulation Change 2989811 on 2016/05/25 by Daniel.Wright Making use of MATERIALBLENDING_ANY_TRANSLUCENT Change 2989812 on 2016/05/25 by Daniel.Wright Hide DFGI show flags from UI Change 2989901 on 2016/05/25 by Daniel.Wright Height fog now works properly in planar reflections * The ray used for computing fog is first clipped by the reflection plane Change 2989904 on 2016/05/25 by Daniel.Wright Always use PF_FloatRGBA for LightAccumulation to guarantee alpha channel and negative range Change 2989991 on 2016/05/25 by Daniel.Wright Improved usability for DBuffer Decals * 'Show Decals' works correctly, previously would fetch from uninitialized textures * DBuffer being enabled forces a full prepass, previously decals would render incorrectly unless correct settings of r.EarlyZPass were used * Improved the PrePass draw event to indicate whether it's full or partial * Materials using DBuffer blend modes will fail to compile when the DBuffer project setting is disabled, instead of just being invisible * r.EarlyZPass can now be changed at runtime, which is useful for profiling Change 2990008 on 2016/05/25 by Daniel.Wright Fixed capsule shadows on skeletal meshes with scaling Change 2990274 on 2016/05/25 by Daniel.Wright Fixed DFAO (from cl 2961310) Change 2990304 on 2016/05/25 by Martin.Mittring OR-22233 GPU Sprites invisible unless solo'd #jira:OR-22233 Change 2990309 on 2016/05/25 by Martin.Mittring Added SubDSurface actor (using CPU code of OpenSubDiv), component, asset as starting point for more work in that direction, (Early work in progress) Change 2990363 on 2016/05/25 by Daniel.Wright Spreading precomputed visibility to neighbors now uses a 2d grid to find neighbors, speeds up the process for 800k cells from 40 mins to 20s Change 2990392 on 2016/05/25 by Daniel.Wright Added r.AOSpecularOcclusionMode, which determines how specular should be occluded by DFAO 0: Apply non-directional AO to specular. 1: (default) Intersect the reflection cone with the unoccluded cone produced by DFAO. This gives more accurate occlusion than 0, but can bring out DFAO sampling artifacts. 2: (experimental) Cone trace through distance fields along the reflection vector. Costs about the same as DFAO again because more cone tracing is done, but produces more accurate occlusion. Change 2990454 on 2016/05/25 by Martin.Mittring polish readme Change 2990610 on 2016/05/25 by Martin.Mittring fixed building with VS2015, the right OpenSubDiv .lib files are missing, temporarily disabled the relevant code #code_review:Shane.Caudle Change 2990754 on 2016/05/25 by Zabir.Hoque Fix compiler warning: C4456: declaration of 'NewStaticMesh' hides previous local declaration. #CodeReview: Martin.Mittring Change 2990801 on 2016/05/25 by Zabir.Hoque Only allocate reflection capture cubemaps if we are actually doing a reflection capture. The old approach always allocated based on CVar and worked with a warning on D3D since if SRC was larger than the DST, the extra SRC area was dropped. New approach only allocates when necessary and is correctly sized everytime. Also hardened access to CVar and what users are allowed to set. #CodeReview Marcus.Wassmer, Rolando.Caloca, Daniel.Wright, Martin.Mittring Change 2991169 on 2016/05/26 by Martin.Mittring fixed compiler warning WARNING: Non-editor build cannot depend on non-redistributable modules. Details: #lockdown: gil.gribb Change 2991238 on 2016/05/26 by Martin.Mittring fixed build fatal error C1083: Cannot open include file: 'RawMesh.h': No such file or directory (when RawMesh is not part of PrivateDependencyModuleNames in Engine.Build.cs) #lockdown:Gil.Gribb Change 2991726 on 2016/05/26 by Daniel.Wright Subsurface materials are now handled with simple forward shading #jira OR-22237 #lockdown gil.gribb Change 2991727 on 2016/05/26 by Daniel.Wright Emissive decals are now supported with simple forward shading #jira OR-22282 #lockdown Gil.Gribb Change 2994849 on 2016/05/31 by Daniel.Wright Disabled fix for WorldPosition and ScreenPosition in downsampled separate translucency, since it breaks GetScreenAlignedUV (used in DepthFade), since the uniform buffer still contains full res buffer sizes #lockdown Gil.Gribb Change 2997243 on 2016/06/01 by Gil.Gribb Merging //UE4/Dev-Main@2996565 to Dev-Rendering (//UE4/Dev-Rendering) #lockdown nick.penwarden [CL 2998067 by Gil Gribb in Main branch]
2016-06-02 13:13:43 -04:00
FRenderingCompositePassContext::FRenderingCompositePassContext(FRHICommandListImmediate& InRHICmdList, const FViewInfo& InView)
: View(InView)
, ViewState((FSceneViewState*)InView.State)
, Pass(0)
, RHICmdList(InRHICmdList)
, ViewPortRect(0, 0, 0 ,0)
, FeatureLevel(View.GetFeatureLevel())
, ShaderMap(InView.ShaderMap)
, bWasProcessed(false)
, bHasHmdMesh(false)
{
check(!IsViewportValid());
}
FRenderingCompositePassContext::~FRenderingCompositePassContext()
{
Graph.Free();
}
void FRenderingCompositePassContext::Process(FRenderingCompositePass* Root, const TCHAR *GraphDebugName)
{
// call this method only once after the graph is finished
check(!bWasProcessed);
bWasProcessed = true;
// query if we have a custom HMD post process mesh to use
static const auto* const HiddenAreaMaskCVar = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("vr.HiddenAreaMask"));
bHasHmdMesh = (HiddenAreaMaskCVar != nullptr &&
HiddenAreaMaskCVar->GetValueOnRenderThread() == 1 &&
GEngine &&
GEngine->HMDDevice.IsValid() &&
GEngine->HMDDevice->HasVisibleAreaMesh());
if(Root)
{
if(ShouldDebugCompositionGraph())
{
UE_LOG(LogConsoleResponse,Log, TEXT(""));
UE_LOG(LogConsoleResponse,Log, TEXT("FRenderingCompositePassContext:Debug '%s' ---------"), GraphDebugName);
UE_LOG(LogConsoleResponse,Log, TEXT(""));
GGMLFileWriter.OpenGMLFile(GraphDebugName);
GGMLFileWriter.WriteLine("Creator \"UnrealEngine4\"");
GGMLFileWriter.WriteLine("Version \"2.10\"");
GGMLFileWriter.WriteLine("graph");
GGMLFileWriter.WriteLine("[");
GGMLFileWriter.WriteLine("\tcomment\t\"This file can be viewed with yEd from yWorks. Run Layout/Hierarchical after loading.\"");
GGMLFileWriter.WriteLine("\thierarchic\t1");
GGMLFileWriter.WriteLine("\tdirected\t1");
}
bool bNewOrder = CVarCompositionGraphOrder.GetValueOnRenderThread() != 0;
Graph.RecursivelyGatherDependencies(Root);
if(bNewOrder)
{
// process in the order the nodes have been created (for more control), unless the dependencies require it differently
for (FRenderingCompositePass* Node : Graph.Nodes)
{
// only if this is true the node is actually needed - no need to compute it when it's not needed
if(Node->WasComputeOutputDescCalled())
{
Graph.RecursivelyProcess(Node, *this);
}
}
}
else
{
// process in the order of the dependencies, starting from the root (without processing unreferenced nodes)
Graph.RecursivelyProcess(Root, *this);
}
if(ShouldDebugCompositionGraph())
{
UE_LOG(LogConsoleResponse,Log, TEXT(""));
GGMLFileWriter.WriteLine("]");
GGMLFileWriter.CloseGMLFile();
}
}
}
// --------------------------------------------------------------------------
FRenderingCompositionGraph::FRenderingCompositionGraph()
{
}
FRenderingCompositionGraph::~FRenderingCompositionGraph()
{
Free();
}
void FRenderingCompositionGraph::Free()
{
for(uint32 i = 0; i < (uint32)Nodes.Num(); ++i)
{
FRenderingCompositePass *Element = Nodes[i];
if (FMemStack::Get().ContainsPointer(Element))
{
Element->~FRenderingCompositePass();
}
else
{
// Call release on non-stack allocated elements
Element->Release();
}
}
Nodes.Empty();
}
void FRenderingCompositionGraph::RecursivelyGatherDependencies(FRenderingCompositePass *Pass)
{
checkSlow(Pass);
if(Pass->bComputeOutputDescWasCalled)
{
// already processed
return;
}
Pass->bComputeOutputDescWasCalled = true;
// iterate through all inputs and additional dependencies of this pass
uint32 Index = 0;
while(const FRenderingCompositeOutputRef* OutputRefIt = Pass->GetDependency(Index++))
{
FRenderingCompositeOutput* InputOutput = OutputRefIt->GetOutput();
if(InputOutput)
{
// add a dependency to this output as we are referencing to it
InputOutput->AddDependency();
}
if(FRenderingCompositePass* OutputRefItPass = OutputRefIt->GetPass())
{
// recursively process all inputs of this Pass
RecursivelyGatherDependencies(OutputRefItPass);
}
}
// the pass is asked what the intermediate surface/texture format needs to be for all its outputs.
for(uint32 OutputId = 0; ; ++OutputId)
{
EPassOutputId PassOutputId = (EPassOutputId)(OutputId);
FRenderingCompositeOutput* Output = Pass->GetOutput(PassOutputId);
if(!Output)
{
break;
}
Output->RenderTargetDesc = Pass->ComputeOutputDesc(PassOutputId);
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3231693) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3219796 on 2016/12/02 by Rolando.Caloca DR - vk - Increase timeout to 60ms Change 3219884 on 2016/12/02 by Daniel.Wright Assert to help track down rare crash locking capsule indirect shadow vertex buffer Change 3219885 on 2016/12/02 by Daniel.Wright Fixed saving a package that doesn't exist on disk but exists in p4 at a newer revision when the user chooses 'Mark Writable' Change 3219886 on 2016/12/02 by Daniel.Wright Don't create projected shadows when r.ShadowQuality is 0 * Fixes crash in the forward path trying to render shadows * In the deferred path, the shadowmap was still being rendered and only the projection skipped, now all cost will be skipped Change 3219887 on 2016/12/02 by Daniel.Wright Changed ClearRenderTarget2D default alpha to 1, which is necessary for correct compositing Change 3219893 on 2016/12/02 by Daniel.Wright AMD AGS library with approved TPS Disabled DFAO on AMD pre-GCN PC video cards to workaround a driver bug which won't be fixed (Radeon 6xxx and below) Change 3219913 on 2016/12/02 by Daniel.Wright Level unload of a lighting scenario propagates the lighting scenario change - fixes crash when precomputed lighting volume data gets unloaded Change 3220029 on 2016/12/02 by Daniel.Wright Async shader compiling now recreates scene proxies which are affected by the material which was compiled. This fixes crashes which were occuring as proxies cache various material properties, but applying compiled materials would not update these cached properties (bRequiresAdjacencyInformation). * A new ensure has been added in FMeshElementCollector::AddMesh and FBatchingSPDI::DrawMesh to catch attempts to render with a material not reported in GetUsedMaterials * Fixed UParticleSystemComponent::GetUsedMaterials and UMaterialBillboardComponent::GetUsedMaterials * FMaterialUpdateContext should be changed to use the same pattern, but that hasn't been done yet Change 3220108 on 2016/12/02 by Daniel.Wright Fixed shadowmap channel assignment for stationary lights which are not in a lighting scenario level, when a lighting scenario level is present Change 3220504 on 2016/12/03 by Mark.Satterthwaite Metal Desktop Tessellation support from Unicorn. - Apple: Metal tessellation support added to MetalShaderFormat, MetalRHI and incl. changes to engine runtime/shaders for Desktop renderer and enabled in ElementalDemo by default (OS X 10.11 will run SM4). - Epic: Support for different Metal shader standards on Mac, iOS & tvOS which required moving some RHI functions around as this is a project setting and not a compile-time constant. - Epic: Fragment shader UAV support, which is also tied to newer Metal shader standard like Tessellation. - Epic: Significant refactor of MetalRHI's internals to clearly separate state-caching from render-pass management and command-encoding. - Epic: Internal MetalRHI validation code is now cleanly separated out into custom implementations of the Metal @protocol's and is on by default. - Epic: Various fixes to Layered Rendering for Metal. - Omits Mobile Tessellation support which needs further revision. Change 3220881 on 2016/12/04 by Mark.Satterthwaite Compiles fixes for iOS & static analysis fixes from Windows. Change 3221180 on 2016/12/05 by Guillaume.Abadie Avoid compiling PreviousFrameSwitch's both Current Frame and Previous Frame inputs every time. Change 3221217 on 2016/12/05 by Chris.Bunner More NVAPI warning fixups. Change 3221219 on 2016/12/05 by Chris.Bunner When comparing overriden properties used to force instance recompilation we need to check against the base material, not assume the immediate parent. #jira UE-37792 Change 3221220 on 2016/12/05 by Chris.Bunner Exported GetAllStaticSwitchParamNames and GetAllStaticComponentMaskParamNames. #jira UE-35132 Change 3221221 on 2016/12/05 by Chris.Bunner PR #2785: Fix comment typo in RendererInterface.h (Contributed by dustin-biser) #jira UE-35760 Change 3221223 on 2016/12/05 by Chris.Bunner Default to include dev-code when compiling material preview stats. #jira UE-20321 Change 3221534 on 2016/12/05 by Rolando.Caloca DR - Added FDynamicRHI::GetName() Change 3221833 on 2016/12/05 by Chris.Bunner Set correct output extent on PostProcessUpscale (allows users to extend chain correctly). #jira UE-36989 Change 3221852 on 2016/12/05 by Chris.Bunner 32-bit/ch EXR screenshot and frame dump output. Fixed row increment bug in 128-bit/px surface format readback. #jira UE-37962 Change 3222059 on 2016/12/05 by Rolando.Caloca DR - vk - Fix memory type not found Change 3222104 on 2016/12/05 by Rolando.Caloca DR - Lambdaize - Added quicker method to check if system textures are initialized Change 3222290 on 2016/12/05 by Mark.Satterthwaite Trivial fixes to reporting Metal shader pipeline errors - need to check if Hull & Domain exist. Change 3222864 on 2016/12/06 by Rolando.Caloca DR - Fix mem leak when exiting Change 3222873 on 2016/12/06 by Rolando.Caloca DR - vk - Minor info to help track down leaks Change 3222875 on 2016/12/06 by Rolando.Caloca DR - Fix mem leak with VisualizeTexture #jira UE-39360 Change 3223226 on 2016/12/06 by Chris.Bunner Static analysis warning workaround. Change 3223235 on 2016/12/06 by Ben.Woodhouse Integrate from NREAL: Set a custom projection matrix on a SceneCapture2D Change 3223343 on 2016/12/06 by Chris.Bunner Moved HLOD persistent data to viewstate to fix per-view compatability. #jira UE-37539 Change 3223349 on 2016/12/06 by Chris.Bunner Fixed HLOD with FreezeRendering command. #jira UE-29839 Change 3223371 on 2016/12/06 by Michael.Trepka Removed obsolete check() in FMetalSurface constructor Change 3223450 on 2016/12/06 by Chris.Bunner Added explicit ScRGB output device selection rather than Nvidia-only hardcoded checks. Allows easier support for Mac and other devices moving forward. Change 3223638 on 2016/12/06 by Michael.Trepka Restored part of the check() in FMetalSurface constructor removed in CL 3223371 Change 3223642 on 2016/12/06 by Mark.Satterthwaite Experimental Metal EDR/HDR output support for Mac (iOS/tvOS need custom formats & shaders so they are not supported yet). - Only available on macOS Sierra (10.12) for Macs with HDR displays (e.g. Retina iMacs). - Enable with -metaledr command-line argument as it is off-by-default. - Sets up the CAMetalLayer & the back-buffer for RGBA_FP16 output on Mac using DCI-P3 as the color gamut and ACES 1000 nit ScRGB output encoding. Change 3223830 on 2016/12/06 by Rolando.Caloca DR - vk - Better error when finding an invalid Vulkan driver #jira UE-37495 Change 3223869 on 2016/12/06 by Rolando.Caloca DR - vk - Reuse fences Change 3223906 on 2016/12/06 by Guillaume.Abadie Fix alpha through TempAA artifact causing a small darker edge layouts. Change 3224199 on 2016/12/06 by Mark.Satterthwaite Fix a dumb copy-paste error from the HDR changes to Metal. Change 3224220 on 2016/12/06 by Mark.Satterthwaite Fix various errors with Metal UAV & Render-Pass Restart support so that we can use the Pixel Shader culling for DistanceField effects. - Unfortunately Metal requires that a texture be bound to start a render-pass, so reuse the dummy depth-stencil surface from the problematic editor preview tile rendering. Change 3224236 on 2016/12/06 by Mark.Satterthwaite IWYU CIS compile fix for iOS. Change 3224366 on 2016/12/06 by Mark.Satterthwaite Simplify some of the changes from CL# 3224220 so that we don't perform unnecessary clears. - If the RenderPass is broken to issue compute or blit operations then treat the cached RenderTargetsInfo as invalid, unless the RenderPass is restarted. - This guarantees that we don't erroneously ignore calls to SetRenderTargets if the calling code issues a dispatch between two RenderPasses that use the same RenderTargetsInfo. Change 3224416 on 2016/12/06 by Uriel.Doyon New default implementation for UPrimitiveComponent::GetStreamingTextureInfo using a conservative heuristic where the textures are stretched across the bounds. Optimized UPrimitiveComponent::GetStreamingTextureInfoWithNULLRemoval by not handling registered components with no proxy (essentially hidden game / collision primitives). Added blueprint support for texture streaming built data through FStaticMeshComponentInstanceData. Fix for material texture streaming data not being available on some cooked builds. Enabled split requests on all texture load requests (first loading everything visible and then loaded everything not visible). This is controlled by "r.Streaming.MinMipForSplitRequest" which defines the minimum mip for which to allow splitting. Forced residency are now loaded in two steps (visible, then forced), improving reactiveness. Updated "stat streaming" to include "UnkownRefMips" which represent texture with no known component referencing them, and also "LastRenderTimeMips" which related to timed primitives. Changed "Forced Mips" so that it only shows mips that are loaded become of forced residency. "Texture Streaming Build" now updates the map check after execution. Removed Orphaned texture logic as this has become irrelevant with the latest retention priority logic. Updated "r.streaming.usenewmetrics" so that it shows behavior before and after 4.12 improvements. Change 3224532 on 2016/12/07 by Uriel.Doyon Integrated CL 3223965 : Building texture streaming data for materials does not wait for pending shaders to finish compilation anymore. Added more options to allow the user to cancel this build also. Change 3224714 on 2016/12/07 by Ben.Woodhouse Cherry pick CL 3223972 from //fortnite/main: Disable Geometry shader onchip on XB1. This saves 4ms for a single shadow casting point light @ 512x512 (4.8ms to 1.8ms) Change 3224715 on 2016/12/07 by Ben.Woodhouse New version of d3dx12.h from Microsoft which incorporates my suggested static analysis fixes. This avoids us diverging from the official version Change 3224975 on 2016/12/07 by Rolando.Caloca DR - vk - Dump improvements Change 3225012 on 2016/12/07 by Rolando.Caloca DR - Show warning if trying to use num samples != (1,2,4,8,16) Change 3225126 on 2016/12/07 by Chris.Bunner Added 'force 128-bit rendering pipeline' to high-res screenshot tool. #jira UE-39345 Change 3225449 on 2016/12/07 by Chris.Bunner Updated engine rendering defaults to better match current best practices. #jira UE-38081 Change 3225485 on 2016/12/07 by Chris.Bunner Moved QuantizeSceneBufferSize to RenderCore and added call for PostProcess settings. Fixes screenpercentage out-of-bounds reads in some cases. #jira UE-19394 Change 3225486 on 2016/12/07 by Chris.Bunner Only disable TAA during HighResScreenshots if we don't have a reasonable frame-delay enabled. Change 3225505 on 2016/12/07 by Daniel.Wright Fixed exponential height fog disappearing with no skybox Change 3225655 on 2016/12/07 by Benjamin.Hyder Updating TM-Shadermodels to include Translucent lighting, Two sided, updated cloth animation, and adjusted lighting. Change 3225668 on 2016/12/07 by Chris.Bunner Dirty owning packages when user manually forces regeneration of all reflection captures. #jira UE-38759 Change 3226139 on 2016/12/07 by Rolando.Caloca DR - Fix recompute tangents disabling skin cache - Make some macros into lambdas #jira UE-39143 Change 3226212 on 2016/12/07 by Daniel.Wright Features which require a full prepass use DDM_AllOpaque instead of DDM_AllOccluders, which can be skipped if the component has bUseAsOccluder=false Change 3226213 on 2016/12/07 by Daniel.Wright Scene Capture 2D can specify a global clip plane, which is useful for portals * Requires the global clip plane project setting to be enabled Change 3226214 on 2016/12/07 by Daniel.Wright Improved deferred shadowing with MSAA by upsampling light attenuation intelligently in the base pass * If the current fragment's depth doesn't match what was used for deferred shadowing, the neighbor (cross pattern) with the nearest depth's shadowing is used * Edge artifacts can still occur where the upsample fails or the shadow factor was computed per-sample due to depth / stencil testing * Indirect Occlusion from capsule shadows also uses the nearest depth neighbor UV for no extra cost * Base pass on 970 GTX 1.69ms -> 1.85ms (.16ms) in RoboRecall Change 3226258 on 2016/12/07 by Rolando.Caloca DR - Typo fix Change 3226259 on 2016/12/07 by Rolando.Caloca DR - compile fix #jira UE-39143 Change 3226932 on 2016/12/08 by Chris.Bunner Re-saved Infiltrator maps to update reflection captures. #jira UE-38759 Change 3227063 on 2016/12/08 by Mark.Satterthwaite For Metal platforms ONLY temporarily disable USE_LIGHT_GRID_REFLECTION_CAPTURE_CULLING to avoid UE-37436 while the Nvidia driver team investigate why this doesn't work for them but does for the others. This won't affect non-Metal platforms and the intent is to revert this prior to 4.16 provided we can work through the problem with Nvidia. #jira UE-37436 Change 3227120 on 2016/12/08 by Gil.Gribb Merging //UE4/Dev-Main@3226895 to Dev-Rendering (//UE4/Dev-Rendering) Change 3227211 on 2016/12/08 by Arne.Schober DR - UE-38585 - Fixing crash where HierInstStaticMesh duplication fails. Also reverting the fix from UE-28189 which is redundant. Change 3227257 on 2016/12/08 by Marc.Olano Extension to PseudoVolumeTexture for more flexible layout Change by ryan.brucks Change 3227286 on 2016/12/08 by Rolando.Caloca DR - Fix crash when using custom expressions and using reserved keywords #jira UE-39311 Change 3227376 on 2016/12/08 by Mark.Satterthwaite Must not include a private header inside the MenuStack public header as that causes compile errors in plugins. Change 3227415 on 2016/12/08 by Mark.Satterthwaite Fix shader compilation due to my disabling of USE_LIGHT_GRID_REFLECTION_CAPTURE_CULLING on Metal - InstancedCompositeTileReflectionCaptureIndices needs to be defined even though Metal doesn't support instanced-stereo rendering. Change 3227516 on 2016/12/08 by Daniel.Wright Implemented UWidgetComponent::GetUsedMaterials Change 3227521 on 2016/12/08 by Guillaume.Abadie Fixes post process volume's indirect lighting color. #jira UE-38888 Change 3227567 on 2016/12/08 by Marc.Olano New upscale filters: Lanczos-2 (new default), Lanczos-3 and Gaussian Unsharp Mask Change 3227628 on 2016/12/08 by Daniel.Wright Removed redundant ResolveSceneDepthTexture from the merge Change 3227635 on 2016/12/08 by Daniel.Wright Forward renderer supports shadowing from movable lights and light functions * Only 4 shadow casting movable or stationary lights can overlap at any point in space, otherwise the movable lights will lose their shadows and an on-screen message will be displayed * Light functions only work on shadow casting lights since they need a shadowmap channel to be assigned Change 3227660 on 2016/12/08 by Rolando.Caloca DR - vk - Fix r.MobileMSAA on Vulkan - r.MobileMSAA is now read-only (to be fixed on 4.16) - Show time for PSO creation hitches #jira UE-39184 Change 3227704 on 2016/12/08 by Mark.Satterthwaite Fix Mac HDR causing incorrect output color encoding being used, HDR support is now entirely off unless you pass -metaledr which will enable it regardless of whether the current display supports HDR (as we haven't written the detection code yet). Fixed the LUT/UI compositing along the way - Mac Metal wasn't using volume LUT as it should have been, RHISupportsVertexShaderLayer now correctly returns false for non-Mac Metal platforms. Change 3227705 on 2016/12/08 by Daniel.Wright Replaced built-in samplers in the nearest depth translucency upsample because the built-in samplers are no longer bound on PC (cl 2852426) Change 3227787 on 2016/12/08 by Chris.Bunner Added extent clear to motion blur pass to catch misized buffers bringing in errors. Added early out to clear call when excluded region matches RT region. #jira UE-39437 Change 3228177 on 2016/12/08 by Marc.Olano Fix DCC sqrt(int) error Change 3228285 on 2016/12/08 by Chris.Bunner Back out changelist 3225449. #jira UE-39528 Change 3228680 on 2016/12/09 by Gil.Gribb Merging //UE4/Dev-Main@3228528 to Dev-Rendering (//UE4/Dev-Rendering) Change 3228940 on 2016/12/09 by Mark.Satterthwaite Editor fixes for 4.15: - PostProcessTonemap can't fail to bind a texture to the ColorLUT or the subsequent rendering will be garbage: the changes for optimising stereo rendering forgot to account for the Editor's use of Views without States for the asset preview thumbnails. Amended the CombineLUT post-processing to allocate a local output texture when there's no ViewState and read from this when this situation arises which makes everything function again. - Don't start render-passes without a valid render-target-array in MetalRHI. Change 3228950 on 2016/12/09 by Mark.Satterthwaite Make GPUSkinCache run on Mac Metal - it wasn't working because it was forcibly disabled on all platforms but for Windows D3D 11. - Fixed the Skeleton editor tree trying to access a widget before it has been constructed. - Enable GPUSkinCache for Metal SM5: doesn't render correctly, even on AMD, so needs Radar's filing and investigation. #jira UE-39256 Change 3229013 on 2016/12/09 by Mark.Satterthwaite Further tidy up in SSkeletonTreeView as suggested by Nick.A. Change 3229101 on 2016/12/09 by Chris.Bunner Log compile error fix and updated cvar comments. Change 3229236 on 2016/12/09 by Ben.Woodhouse XB1 D3D11 and D3D12: Use the DXGI frame statistics to get accurate GPU time unaffected by bubbles Change 3229430 on 2016/12/09 by Ben.Woodhouse PR #2680: Optimized histogram generation. (Contributed by PjotrSvetachov) Profiled on nvidia 980GTX (2x faster), and on XB1 (marginally faster) Change 3229580 on 2016/12/09 by Marcus.Wassmer DepthBoundsTest for AMD. Change 3229701 on 2016/12/09 by Michael.Trepka Changed "OS X" to "macOS" in few places where we display it and updated the code that asks users to update to latest version to check for 10.12.2 Change 3229706 on 2016/12/09 by Chris.Bunner Added GameUserSettings controls for HDR display output. Removed Metal commandline as this should replace the need for it. Change 3229774 on 2016/12/09 by Michael.Trepka Disabled OpenGL on Mac. -opengl is now ignored, we always use Metal. On old Macs that do not support Metal we show a message saying that the app requires Metal and exit. Change 3229819 on 2016/12/09 by Chris.Bunner Updated engine rendering defaults to better match current best practices. #jira UE-38081 Change 3229948 on 2016/12/09 by Rolando.Caloca DR - Fix d3d debug error #jira UE-39589 Change 3230341 on 2016/12/11 by Mark.Satterthwaite Don't fatally assert that the game-thread stalled waiting for the rendering thread in the Editor executable, even when running -game as the rendering thread can take a while to respond if shaders need to be compiled. #jira UE-39613 Change 3230860 on 2016/12/12 by Marcus.Wassmer Experimental Nvidia AFR support. Change 3230930 on 2016/12/12 by Mark.Satterthwaite Disable RHICmdList state-caching on Mac - Metal already does this internally and depends on receiving all state changes in order to function. Change 3231252 on 2016/12/12 by Marcus.Wassmer Fix NumGPU detection. (SLI only crash) Change 3231486 on 2016/12/12 by Mark.Satterthwaite Fix a stupid mistake in MetalStateCache::CommitResourceTable that would unnecessarily rebind samplers. Change 3231661 on 2016/12/12 by Mark.Satterthwaite Retain the RHI samplers in MetalRHI to guarantee lifetime. [CL 3231696 by Gil Gribb in Main branch]
2016-12-12 17:47:42 -05:00
// Allow format overrides for high-precision work
static const auto CVarPostProcessingColorFormat = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.PostProcessingColorFormat"));
if (CVarPostProcessingColorFormat->GetValueOnRenderThread() == 1)
{
if (Output->RenderTargetDesc.Format == PF_FloatRGBA ||
Output->RenderTargetDesc.Format == PF_FloatRGB ||
Output->RenderTargetDesc.Format == PF_FloatR11G11B10)
{
Output->RenderTargetDesc.Format = PF_A32B32G32R32F;
}
}
}
}
Copying //UE4/Dev-Sequencer to Dev-Main (//UE4/Dev-Main) #lockdown nick.penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 2719576 on 2015/10/07 by Chris.Wood Added check for stale BP classes in FKismetCompilerUtilities::IsTypeCompatibleWithProperty() to stop compiler errors during reinstancing. [UE-19795] - UMG Compiler error when adding variable to nested Widget Change 2721474 on 2015/10/08 by Andrew.Rodham Sequencer: Movie render operations now successfully capture UMG UI Change 2724958 on 2015/10/12 by Chris.Wood Added missing resource cleanup code to UMG widgets [UE-21874] - UWIdget classes with missing ReleaseSlateResources() overrides Added ReleaseSlateResources() to ListView, TileView and Slider widgets to reset shared pointers to slate widgets. Change 2733562 on 2015/10/19 by Andrew.Rodham Sequencer: Fixed spawnables not working in sub-sequences - The issue here was that sequence track instance updates had no knowledge of which sub-sequence they were being evaluated within. We now pass the active sequence instance into the relevant track instance functions. - Also addressed some issues to do with save/restore state not getting called correctly on master tracks of sequence instances - Tidied up spawn track editor Change 2735264 on 2015/10/20 by Chris.Wood Improved Engine analytics handling for Editor and games [UE-21892] - Improve how Engine analytics are handled for Editor and games Changes: Added Privacy section to Editor settings Exposed editor analytics flag in Privacy options Added Details Customization to make this type of bool property clearer with extra info and hyperlink Changed AreEditorAnalyticsEnable() to use new flag Prevented analytics init when disabled by user Sending event and shutting down analytics when user opts out Add in-game project setting for anonymous game usage data Renamed and moved bHardwareSurveyEnabled Added message about exposing in-game setting to end users Added anonymous GUID id for in-game analytics Moved end user settings to global config (defaultengine.ini) Placeholder loc text on new options for now, pending legal wording sign-off Change 2735866 on 2015/10/20 by Max.Preussner Async: Added ability to register an optional callback function that is executed when a Future completes Change 2739793 on 2015/10/23 by Andrew.Rodham Sequencer: Refined movie scene capturing to ensure frame accuracies are maintained - Aborting an in-progress capture now gracefully terminates the process (through a remote session command) to ensure it still creates a valid video - Level sequece movie capture will now pick up a corresponding level sequence in the world, and use that to capture with. A new actor will be spawned at runtime with the correct asset, should one not already exist. - Made -nomovie actually work - Refined how active movie captures are managed - Added option to 'stage' a sequence before starting the capture. This feature will set the sequence on its first frame for the preroll, to ensure that PPP effects are allowed time to stabilize Change 2744402 on 2015/10/28 by Max.Preussner Sequencer: Separated track display names from track identifier names; code cleanup Change 2745953 on 2015/10/29 by Max.Chen Sequencer: Attach to socket. Relative attachments. #jira UETOOL-463 Change 2747028 on 2015/10/29 by Max.Preussner Sequencer: Another overhaul of track display name handling; code and documentation cleanup pass. Change 2758888 on 2015/11/09 by Chris.Wood Integrating changes - 4.10 to Dev-Sequencer From 4.10 branch fixes: Added check for debugger present when reporting abnormal termination to analytics. [UE-22844] CL 2750764 Added FSystemWideCriticalSection for desktop platforms. Used by analytics to lock access to editor instances list in the OS. [UE-22844] CL 2753661 Updating wording in privacy settings text. [UE-21892] CL 2753709 Mac and Linux CIS fix [UE-22844] CL 2755381 Change 2761287 on 2015/11/10 by Max.Chen Sequencer: Add null check when updating the UMG preview if the sequencer doesn't exist/has been closed. #jira UE-5206 Change 2764945 on 2015/11/12 by Max.Preussner Core: Templatized TypeContainer implementation to allow for thread-safe objects; updated unit test Also fixes UE-13850 Change 2765036 on 2015/11/12 by Max.Preussner UdpMessaging: Fixed message serialization unit test (UE-22571) #jira: UE-22571 Change 2766149 on 2015/11/13 by Max.Preussner Media: Implemented event that gets triggered when playback reached the end of media Also fixes looping. Change 2768157 on 2015/11/16 by Max.Preussner Media: Added .m4a to supported WMF file extensions Change 2769200 on 2015/11/16 by Max.Chen Editor: Add broadcast messages when snapping objects. #jira UE-22680 Change 2773066 on 2015/11/19 by Chris.Wood Upload crashes from CRC to Data Router [UECORE-249] - Integrate Crash Report Client with the Data Router Upload to Receiver still active as we are running both in parallel for now.
2015-12-11 13:52:32 -05:00
template<typename TColor> struct TAsyncBufferWrite;
struct FAsyncBufferWriteQueue
{
template<typename T>
static TFuture<void> Dispatch(TAsyncBufferWrite<T>&& In)
{
NumInProgressWrites.Increment();
while (NumInProgressWrites.GetValue() >= MaxAsyncWrites)
{
// Yield until we can write another
FPlatformProcess::Sleep(0.f);
}
return Async<void>(EAsyncExecution::ThreadPool, MoveTemp(In));
}
static FThreadSafeCounter NumInProgressWrites;
static const int32 MaxAsyncWrites = 6;
};
FThreadSafeCounter FAsyncBufferWriteQueue::NumInProgressWrites;
/** Callable type used to save a color buffer on an async task without allocating/copying into a new one */
template<typename TColor>
struct TAsyncBufferWrite
{
TAsyncBufferWrite(FString InFilename, FIntPoint InDestSize, TArray<TColor> InBitmap) : Filename(MoveTemp(InFilename)), DestSize(InDestSize), Bitmap(MoveTemp(InBitmap)) {}
TAsyncBufferWrite(TAsyncBufferWrite&& In) : Filename(MoveTemp(In.Filename)), DestSize(In.DestSize), Bitmap(MoveTemp(In.Bitmap)) {}
TAsyncBufferWrite& operator=(TAsyncBufferWrite&& In) { Filename = MoveTemp(In.Filename); DestSize = In.DestSize; Bitmap = MoveTemp(In.Bitmap); return *this; }
/** Call operator that saves the color buffer data */
void operator()()
{
FString ResultPath;
GetHighResScreenshotConfig().SaveImage(Filename, Bitmap, DestSize, &ResultPath);
UE_LOG(LogConsoleResponse, Display, TEXT("Content was saved to \"%s\""), *ResultPath);
FAsyncBufferWriteQueue::NumInProgressWrites.Decrement();
}
/** Copy semantics are only defined to appease TFunction, whose virtual CloneByCopy function is always instantiated, even if the TFunction itself is never copied */
TAsyncBufferWrite(const TAsyncBufferWrite& In) : Filename(In.Filename), DestSize(In.DestSize), Bitmap(In.Bitmap) { ensureMsgf(false, TEXT("Type should not be copied")); }
TAsyncBufferWrite& operator=(const TAsyncBufferWrite& In) { Filename = In.Filename; DestSize = In.DestSize; Bitmap = In.Bitmap; ensureMsgf(false, TEXT("Type should not be copied")); return *this; }
private:
/** The filename to save to */
FString Filename;
/** The size of the bitmap */
FIntPoint DestSize;
/** The bitmap data itself */
TArray<TColor> Bitmap;
};
TFuture<void> FRenderingCompositionGraph::DumpOutputToFile(FRenderingCompositePassContext& Context, const FString& Filename, FRenderingCompositeOutput* Output) const
{
FSceneRenderTargetItem& RenderTargetItem = Output->PooledRenderTarget->GetRenderTargetItem();
FHighResScreenshotConfig& HighResScreenshotConfig = GetHighResScreenshotConfig();
FTextureRHIRef Texture = RenderTargetItem.TargetableTexture ? RenderTargetItem.TargetableTexture : RenderTargetItem.ShaderResourceTexture;
check(Texture);
check(Texture->GetTexture2D());
FIntRect SourceRect = Context.View.ViewRect;
int32 MSAAXSamples = Texture->GetNumSamples();
if (GIsHighResScreenshot && HighResScreenshotConfig.CaptureRegion.Area())
{
SourceRect = HighResScreenshotConfig.CaptureRegion;
}
SourceRect.Min.X *= MSAAXSamples;
SourceRect.Max.X *= MSAAXSamples;
FIntPoint DestSize(SourceRect.Width(), SourceRect.Height());
EPixelFormat PixelFormat = Texture->GetFormat();
Copying //UE4/Dev-Sequencer to Dev-Main (//UE4/Dev-Main) #lockdown nick.penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 2719576 on 2015/10/07 by Chris.Wood Added check for stale BP classes in FKismetCompilerUtilities::IsTypeCompatibleWithProperty() to stop compiler errors during reinstancing. [UE-19795] - UMG Compiler error when adding variable to nested Widget Change 2721474 on 2015/10/08 by Andrew.Rodham Sequencer: Movie render operations now successfully capture UMG UI Change 2724958 on 2015/10/12 by Chris.Wood Added missing resource cleanup code to UMG widgets [UE-21874] - UWIdget classes with missing ReleaseSlateResources() overrides Added ReleaseSlateResources() to ListView, TileView and Slider widgets to reset shared pointers to slate widgets. Change 2733562 on 2015/10/19 by Andrew.Rodham Sequencer: Fixed spawnables not working in sub-sequences - The issue here was that sequence track instance updates had no knowledge of which sub-sequence they were being evaluated within. We now pass the active sequence instance into the relevant track instance functions. - Also addressed some issues to do with save/restore state not getting called correctly on master tracks of sequence instances - Tidied up spawn track editor Change 2735264 on 2015/10/20 by Chris.Wood Improved Engine analytics handling for Editor and games [UE-21892] - Improve how Engine analytics are handled for Editor and games Changes: Added Privacy section to Editor settings Exposed editor analytics flag in Privacy options Added Details Customization to make this type of bool property clearer with extra info and hyperlink Changed AreEditorAnalyticsEnable() to use new flag Prevented analytics init when disabled by user Sending event and shutting down analytics when user opts out Add in-game project setting for anonymous game usage data Renamed and moved bHardwareSurveyEnabled Added message about exposing in-game setting to end users Added anonymous GUID id for in-game analytics Moved end user settings to global config (defaultengine.ini) Placeholder loc text on new options for now, pending legal wording sign-off Change 2735866 on 2015/10/20 by Max.Preussner Async: Added ability to register an optional callback function that is executed when a Future completes Change 2739793 on 2015/10/23 by Andrew.Rodham Sequencer: Refined movie scene capturing to ensure frame accuracies are maintained - Aborting an in-progress capture now gracefully terminates the process (through a remote session command) to ensure it still creates a valid video - Level sequece movie capture will now pick up a corresponding level sequence in the world, and use that to capture with. A new actor will be spawned at runtime with the correct asset, should one not already exist. - Made -nomovie actually work - Refined how active movie captures are managed - Added option to 'stage' a sequence before starting the capture. This feature will set the sequence on its first frame for the preroll, to ensure that PPP effects are allowed time to stabilize Change 2744402 on 2015/10/28 by Max.Preussner Sequencer: Separated track display names from track identifier names; code cleanup Change 2745953 on 2015/10/29 by Max.Chen Sequencer: Attach to socket. Relative attachments. #jira UETOOL-463 Change 2747028 on 2015/10/29 by Max.Preussner Sequencer: Another overhaul of track display name handling; code and documentation cleanup pass. Change 2758888 on 2015/11/09 by Chris.Wood Integrating changes - 4.10 to Dev-Sequencer From 4.10 branch fixes: Added check for debugger present when reporting abnormal termination to analytics. [UE-22844] CL 2750764 Added FSystemWideCriticalSection for desktop platforms. Used by analytics to lock access to editor instances list in the OS. [UE-22844] CL 2753661 Updating wording in privacy settings text. [UE-21892] CL 2753709 Mac and Linux CIS fix [UE-22844] CL 2755381 Change 2761287 on 2015/11/10 by Max.Chen Sequencer: Add null check when updating the UMG preview if the sequencer doesn't exist/has been closed. #jira UE-5206 Change 2764945 on 2015/11/12 by Max.Preussner Core: Templatized TypeContainer implementation to allow for thread-safe objects; updated unit test Also fixes UE-13850 Change 2765036 on 2015/11/12 by Max.Preussner UdpMessaging: Fixed message serialization unit test (UE-22571) #jira: UE-22571 Change 2766149 on 2015/11/13 by Max.Preussner Media: Implemented event that gets triggered when playback reached the end of media Also fixes looping. Change 2768157 on 2015/11/16 by Max.Preussner Media: Added .m4a to supported WMF file extensions Change 2769200 on 2015/11/16 by Max.Chen Editor: Add broadcast messages when snapping objects. #jira UE-22680 Change 2773066 on 2015/11/19 by Chris.Wood Upload crashes from CRC to Data Router [UECORE-249] - Integrate Crash Report Client with the Data Router Upload to Receiver still active as we are running both in parallel for now.
2015-12-11 13:52:32 -05:00
switch (PixelFormat)
{
case PF_FloatRGBA:
{
TArray<FFloat16Color> Bitmap;
Context.RHICmdList.ReadSurfaceFloatData(Texture, SourceRect, Bitmap, (ECubeFace)0, 0, 0);
Copying //UE4/Dev-Sequencer to Dev-Main (//UE4/Dev-Main) #lockdown nick.penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 2719576 on 2015/10/07 by Chris.Wood Added check for stale BP classes in FKismetCompilerUtilities::IsTypeCompatibleWithProperty() to stop compiler errors during reinstancing. [UE-19795] - UMG Compiler error when adding variable to nested Widget Change 2721474 on 2015/10/08 by Andrew.Rodham Sequencer: Movie render operations now successfully capture UMG UI Change 2724958 on 2015/10/12 by Chris.Wood Added missing resource cleanup code to UMG widgets [UE-21874] - UWIdget classes with missing ReleaseSlateResources() overrides Added ReleaseSlateResources() to ListView, TileView and Slider widgets to reset shared pointers to slate widgets. Change 2733562 on 2015/10/19 by Andrew.Rodham Sequencer: Fixed spawnables not working in sub-sequences - The issue here was that sequence track instance updates had no knowledge of which sub-sequence they were being evaluated within. We now pass the active sequence instance into the relevant track instance functions. - Also addressed some issues to do with save/restore state not getting called correctly on master tracks of sequence instances - Tidied up spawn track editor Change 2735264 on 2015/10/20 by Chris.Wood Improved Engine analytics handling for Editor and games [UE-21892] - Improve how Engine analytics are handled for Editor and games Changes: Added Privacy section to Editor settings Exposed editor analytics flag in Privacy options Added Details Customization to make this type of bool property clearer with extra info and hyperlink Changed AreEditorAnalyticsEnable() to use new flag Prevented analytics init when disabled by user Sending event and shutting down analytics when user opts out Add in-game project setting for anonymous game usage data Renamed and moved bHardwareSurveyEnabled Added message about exposing in-game setting to end users Added anonymous GUID id for in-game analytics Moved end user settings to global config (defaultengine.ini) Placeholder loc text on new options for now, pending legal wording sign-off Change 2735866 on 2015/10/20 by Max.Preussner Async: Added ability to register an optional callback function that is executed when a Future completes Change 2739793 on 2015/10/23 by Andrew.Rodham Sequencer: Refined movie scene capturing to ensure frame accuracies are maintained - Aborting an in-progress capture now gracefully terminates the process (through a remote session command) to ensure it still creates a valid video - Level sequece movie capture will now pick up a corresponding level sequence in the world, and use that to capture with. A new actor will be spawned at runtime with the correct asset, should one not already exist. - Made -nomovie actually work - Refined how active movie captures are managed - Added option to 'stage' a sequence before starting the capture. This feature will set the sequence on its first frame for the preroll, to ensure that PPP effects are allowed time to stabilize Change 2744402 on 2015/10/28 by Max.Preussner Sequencer: Separated track display names from track identifier names; code cleanup Change 2745953 on 2015/10/29 by Max.Chen Sequencer: Attach to socket. Relative attachments. #jira UETOOL-463 Change 2747028 on 2015/10/29 by Max.Preussner Sequencer: Another overhaul of track display name handling; code and documentation cleanup pass. Change 2758888 on 2015/11/09 by Chris.Wood Integrating changes - 4.10 to Dev-Sequencer From 4.10 branch fixes: Added check for debugger present when reporting abnormal termination to analytics. [UE-22844] CL 2750764 Added FSystemWideCriticalSection for desktop platforms. Used by analytics to lock access to editor instances list in the OS. [UE-22844] CL 2753661 Updating wording in privacy settings text. [UE-21892] CL 2753709 Mac and Linux CIS fix [UE-22844] CL 2755381 Change 2761287 on 2015/11/10 by Max.Chen Sequencer: Add null check when updating the UMG preview if the sequencer doesn't exist/has been closed. #jira UE-5206 Change 2764945 on 2015/11/12 by Max.Preussner Core: Templatized TypeContainer implementation to allow for thread-safe objects; updated unit test Also fixes UE-13850 Change 2765036 on 2015/11/12 by Max.Preussner UdpMessaging: Fixed message serialization unit test (UE-22571) #jira: UE-22571 Change 2766149 on 2015/11/13 by Max.Preussner Media: Implemented event that gets triggered when playback reached the end of media Also fixes looping. Change 2768157 on 2015/11/16 by Max.Preussner Media: Added .m4a to supported WMF file extensions Change 2769200 on 2015/11/16 by Max.Chen Editor: Add broadcast messages when snapping objects. #jira UE-22680 Change 2773066 on 2015/11/19 by Chris.Wood Upload crashes from CRC to Data Router [UECORE-249] - Integrate Crash Report Client with the Data Router Upload to Receiver still active as we are running both in parallel for now.
2015-12-11 13:52:32 -05:00
return FAsyncBufferWriteQueue::Dispatch(TAsyncBufferWrite<FFloat16Color>(Filename, DestSize, MoveTemp(Bitmap)));
}
Copying //UE4/Dev-Sequencer to Dev-Main (//UE4/Dev-Main) #lockdown nick.penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 2719576 on 2015/10/07 by Chris.Wood Added check for stale BP classes in FKismetCompilerUtilities::IsTypeCompatibleWithProperty() to stop compiler errors during reinstancing. [UE-19795] - UMG Compiler error when adding variable to nested Widget Change 2721474 on 2015/10/08 by Andrew.Rodham Sequencer: Movie render operations now successfully capture UMG UI Change 2724958 on 2015/10/12 by Chris.Wood Added missing resource cleanup code to UMG widgets [UE-21874] - UWIdget classes with missing ReleaseSlateResources() overrides Added ReleaseSlateResources() to ListView, TileView and Slider widgets to reset shared pointers to slate widgets. Change 2733562 on 2015/10/19 by Andrew.Rodham Sequencer: Fixed spawnables not working in sub-sequences - The issue here was that sequence track instance updates had no knowledge of which sub-sequence they were being evaluated within. We now pass the active sequence instance into the relevant track instance functions. - Also addressed some issues to do with save/restore state not getting called correctly on master tracks of sequence instances - Tidied up spawn track editor Change 2735264 on 2015/10/20 by Chris.Wood Improved Engine analytics handling for Editor and games [UE-21892] - Improve how Engine analytics are handled for Editor and games Changes: Added Privacy section to Editor settings Exposed editor analytics flag in Privacy options Added Details Customization to make this type of bool property clearer with extra info and hyperlink Changed AreEditorAnalyticsEnable() to use new flag Prevented analytics init when disabled by user Sending event and shutting down analytics when user opts out Add in-game project setting for anonymous game usage data Renamed and moved bHardwareSurveyEnabled Added message about exposing in-game setting to end users Added anonymous GUID id for in-game analytics Moved end user settings to global config (defaultengine.ini) Placeholder loc text on new options for now, pending legal wording sign-off Change 2735866 on 2015/10/20 by Max.Preussner Async: Added ability to register an optional callback function that is executed when a Future completes Change 2739793 on 2015/10/23 by Andrew.Rodham Sequencer: Refined movie scene capturing to ensure frame accuracies are maintained - Aborting an in-progress capture now gracefully terminates the process (through a remote session command) to ensure it still creates a valid video - Level sequece movie capture will now pick up a corresponding level sequence in the world, and use that to capture with. A new actor will be spawned at runtime with the correct asset, should one not already exist. - Made -nomovie actually work - Refined how active movie captures are managed - Added option to 'stage' a sequence before starting the capture. This feature will set the sequence on its first frame for the preroll, to ensure that PPP effects are allowed time to stabilize Change 2744402 on 2015/10/28 by Max.Preussner Sequencer: Separated track display names from track identifier names; code cleanup Change 2745953 on 2015/10/29 by Max.Chen Sequencer: Attach to socket. Relative attachments. #jira UETOOL-463 Change 2747028 on 2015/10/29 by Max.Preussner Sequencer: Another overhaul of track display name handling; code and documentation cleanup pass. Change 2758888 on 2015/11/09 by Chris.Wood Integrating changes - 4.10 to Dev-Sequencer From 4.10 branch fixes: Added check for debugger present when reporting abnormal termination to analytics. [UE-22844] CL 2750764 Added FSystemWideCriticalSection for desktop platforms. Used by analytics to lock access to editor instances list in the OS. [UE-22844] CL 2753661 Updating wording in privacy settings text. [UE-21892] CL 2753709 Mac and Linux CIS fix [UE-22844] CL 2755381 Change 2761287 on 2015/11/10 by Max.Chen Sequencer: Add null check when updating the UMG preview if the sequencer doesn't exist/has been closed. #jira UE-5206 Change 2764945 on 2015/11/12 by Max.Preussner Core: Templatized TypeContainer implementation to allow for thread-safe objects; updated unit test Also fixes UE-13850 Change 2765036 on 2015/11/12 by Max.Preussner UdpMessaging: Fixed message serialization unit test (UE-22571) #jira: UE-22571 Change 2766149 on 2015/11/13 by Max.Preussner Media: Implemented event that gets triggered when playback reached the end of media Also fixes looping. Change 2768157 on 2015/11/16 by Max.Preussner Media: Added .m4a to supported WMF file extensions Change 2769200 on 2015/11/16 by Max.Chen Editor: Add broadcast messages when snapping objects. #jira UE-22680 Change 2773066 on 2015/11/19 by Chris.Wood Upload crashes from CRC to Data Router [UECORE-249] - Integrate Crash Report Client with the Data Router Upload to Receiver still active as we are running both in parallel for now.
2015-12-11 13:52:32 -05:00
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3231693) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3219796 on 2016/12/02 by Rolando.Caloca DR - vk - Increase timeout to 60ms Change 3219884 on 2016/12/02 by Daniel.Wright Assert to help track down rare crash locking capsule indirect shadow vertex buffer Change 3219885 on 2016/12/02 by Daniel.Wright Fixed saving a package that doesn't exist on disk but exists in p4 at a newer revision when the user chooses 'Mark Writable' Change 3219886 on 2016/12/02 by Daniel.Wright Don't create projected shadows when r.ShadowQuality is 0 * Fixes crash in the forward path trying to render shadows * In the deferred path, the shadowmap was still being rendered and only the projection skipped, now all cost will be skipped Change 3219887 on 2016/12/02 by Daniel.Wright Changed ClearRenderTarget2D default alpha to 1, which is necessary for correct compositing Change 3219893 on 2016/12/02 by Daniel.Wright AMD AGS library with approved TPS Disabled DFAO on AMD pre-GCN PC video cards to workaround a driver bug which won't be fixed (Radeon 6xxx and below) Change 3219913 on 2016/12/02 by Daniel.Wright Level unload of a lighting scenario propagates the lighting scenario change - fixes crash when precomputed lighting volume data gets unloaded Change 3220029 on 2016/12/02 by Daniel.Wright Async shader compiling now recreates scene proxies which are affected by the material which was compiled. This fixes crashes which were occuring as proxies cache various material properties, but applying compiled materials would not update these cached properties (bRequiresAdjacencyInformation). * A new ensure has been added in FMeshElementCollector::AddMesh and FBatchingSPDI::DrawMesh to catch attempts to render with a material not reported in GetUsedMaterials * Fixed UParticleSystemComponent::GetUsedMaterials and UMaterialBillboardComponent::GetUsedMaterials * FMaterialUpdateContext should be changed to use the same pattern, but that hasn't been done yet Change 3220108 on 2016/12/02 by Daniel.Wright Fixed shadowmap channel assignment for stationary lights which are not in a lighting scenario level, when a lighting scenario level is present Change 3220504 on 2016/12/03 by Mark.Satterthwaite Metal Desktop Tessellation support from Unicorn. - Apple: Metal tessellation support added to MetalShaderFormat, MetalRHI and incl. changes to engine runtime/shaders for Desktop renderer and enabled in ElementalDemo by default (OS X 10.11 will run SM4). - Epic: Support for different Metal shader standards on Mac, iOS & tvOS which required moving some RHI functions around as this is a project setting and not a compile-time constant. - Epic: Fragment shader UAV support, which is also tied to newer Metal shader standard like Tessellation. - Epic: Significant refactor of MetalRHI's internals to clearly separate state-caching from render-pass management and command-encoding. - Epic: Internal MetalRHI validation code is now cleanly separated out into custom implementations of the Metal @protocol's and is on by default. - Epic: Various fixes to Layered Rendering for Metal. - Omits Mobile Tessellation support which needs further revision. Change 3220881 on 2016/12/04 by Mark.Satterthwaite Compiles fixes for iOS & static analysis fixes from Windows. Change 3221180 on 2016/12/05 by Guillaume.Abadie Avoid compiling PreviousFrameSwitch's both Current Frame and Previous Frame inputs every time. Change 3221217 on 2016/12/05 by Chris.Bunner More NVAPI warning fixups. Change 3221219 on 2016/12/05 by Chris.Bunner When comparing overriden properties used to force instance recompilation we need to check against the base material, not assume the immediate parent. #jira UE-37792 Change 3221220 on 2016/12/05 by Chris.Bunner Exported GetAllStaticSwitchParamNames and GetAllStaticComponentMaskParamNames. #jira UE-35132 Change 3221221 on 2016/12/05 by Chris.Bunner PR #2785: Fix comment typo in RendererInterface.h (Contributed by dustin-biser) #jira UE-35760 Change 3221223 on 2016/12/05 by Chris.Bunner Default to include dev-code when compiling material preview stats. #jira UE-20321 Change 3221534 on 2016/12/05 by Rolando.Caloca DR - Added FDynamicRHI::GetName() Change 3221833 on 2016/12/05 by Chris.Bunner Set correct output extent on PostProcessUpscale (allows users to extend chain correctly). #jira UE-36989 Change 3221852 on 2016/12/05 by Chris.Bunner 32-bit/ch EXR screenshot and frame dump output. Fixed row increment bug in 128-bit/px surface format readback. #jira UE-37962 Change 3222059 on 2016/12/05 by Rolando.Caloca DR - vk - Fix memory type not found Change 3222104 on 2016/12/05 by Rolando.Caloca DR - Lambdaize - Added quicker method to check if system textures are initialized Change 3222290 on 2016/12/05 by Mark.Satterthwaite Trivial fixes to reporting Metal shader pipeline errors - need to check if Hull & Domain exist. Change 3222864 on 2016/12/06 by Rolando.Caloca DR - Fix mem leak when exiting Change 3222873 on 2016/12/06 by Rolando.Caloca DR - vk - Minor info to help track down leaks Change 3222875 on 2016/12/06 by Rolando.Caloca DR - Fix mem leak with VisualizeTexture #jira UE-39360 Change 3223226 on 2016/12/06 by Chris.Bunner Static analysis warning workaround. Change 3223235 on 2016/12/06 by Ben.Woodhouse Integrate from NREAL: Set a custom projection matrix on a SceneCapture2D Change 3223343 on 2016/12/06 by Chris.Bunner Moved HLOD persistent data to viewstate to fix per-view compatability. #jira UE-37539 Change 3223349 on 2016/12/06 by Chris.Bunner Fixed HLOD with FreezeRendering command. #jira UE-29839 Change 3223371 on 2016/12/06 by Michael.Trepka Removed obsolete check() in FMetalSurface constructor Change 3223450 on 2016/12/06 by Chris.Bunner Added explicit ScRGB output device selection rather than Nvidia-only hardcoded checks. Allows easier support for Mac and other devices moving forward. Change 3223638 on 2016/12/06 by Michael.Trepka Restored part of the check() in FMetalSurface constructor removed in CL 3223371 Change 3223642 on 2016/12/06 by Mark.Satterthwaite Experimental Metal EDR/HDR output support for Mac (iOS/tvOS need custom formats & shaders so they are not supported yet). - Only available on macOS Sierra (10.12) for Macs with HDR displays (e.g. Retina iMacs). - Enable with -metaledr command-line argument as it is off-by-default. - Sets up the CAMetalLayer & the back-buffer for RGBA_FP16 output on Mac using DCI-P3 as the color gamut and ACES 1000 nit ScRGB output encoding. Change 3223830 on 2016/12/06 by Rolando.Caloca DR - vk - Better error when finding an invalid Vulkan driver #jira UE-37495 Change 3223869 on 2016/12/06 by Rolando.Caloca DR - vk - Reuse fences Change 3223906 on 2016/12/06 by Guillaume.Abadie Fix alpha through TempAA artifact causing a small darker edge layouts. Change 3224199 on 2016/12/06 by Mark.Satterthwaite Fix a dumb copy-paste error from the HDR changes to Metal. Change 3224220 on 2016/12/06 by Mark.Satterthwaite Fix various errors with Metal UAV & Render-Pass Restart support so that we can use the Pixel Shader culling for DistanceField effects. - Unfortunately Metal requires that a texture be bound to start a render-pass, so reuse the dummy depth-stencil surface from the problematic editor preview tile rendering. Change 3224236 on 2016/12/06 by Mark.Satterthwaite IWYU CIS compile fix for iOS. Change 3224366 on 2016/12/06 by Mark.Satterthwaite Simplify some of the changes from CL# 3224220 so that we don't perform unnecessary clears. - If the RenderPass is broken to issue compute or blit operations then treat the cached RenderTargetsInfo as invalid, unless the RenderPass is restarted. - This guarantees that we don't erroneously ignore calls to SetRenderTargets if the calling code issues a dispatch between two RenderPasses that use the same RenderTargetsInfo. Change 3224416 on 2016/12/06 by Uriel.Doyon New default implementation for UPrimitiveComponent::GetStreamingTextureInfo using a conservative heuristic where the textures are stretched across the bounds. Optimized UPrimitiveComponent::GetStreamingTextureInfoWithNULLRemoval by not handling registered components with no proxy (essentially hidden game / collision primitives). Added blueprint support for texture streaming built data through FStaticMeshComponentInstanceData. Fix for material texture streaming data not being available on some cooked builds. Enabled split requests on all texture load requests (first loading everything visible and then loaded everything not visible). This is controlled by "r.Streaming.MinMipForSplitRequest" which defines the minimum mip for which to allow splitting. Forced residency are now loaded in two steps (visible, then forced), improving reactiveness. Updated "stat streaming" to include "UnkownRefMips" which represent texture with no known component referencing them, and also "LastRenderTimeMips" which related to timed primitives. Changed "Forced Mips" so that it only shows mips that are loaded become of forced residency. "Texture Streaming Build" now updates the map check after execution. Removed Orphaned texture logic as this has become irrelevant with the latest retention priority logic. Updated "r.streaming.usenewmetrics" so that it shows behavior before and after 4.12 improvements. Change 3224532 on 2016/12/07 by Uriel.Doyon Integrated CL 3223965 : Building texture streaming data for materials does not wait for pending shaders to finish compilation anymore. Added more options to allow the user to cancel this build also. Change 3224714 on 2016/12/07 by Ben.Woodhouse Cherry pick CL 3223972 from //fortnite/main: Disable Geometry shader onchip on XB1. This saves 4ms for a single shadow casting point light @ 512x512 (4.8ms to 1.8ms) Change 3224715 on 2016/12/07 by Ben.Woodhouse New version of d3dx12.h from Microsoft which incorporates my suggested static analysis fixes. This avoids us diverging from the official version Change 3224975 on 2016/12/07 by Rolando.Caloca DR - vk - Dump improvements Change 3225012 on 2016/12/07 by Rolando.Caloca DR - Show warning if trying to use num samples != (1,2,4,8,16) Change 3225126 on 2016/12/07 by Chris.Bunner Added 'force 128-bit rendering pipeline' to high-res screenshot tool. #jira UE-39345 Change 3225449 on 2016/12/07 by Chris.Bunner Updated engine rendering defaults to better match current best practices. #jira UE-38081 Change 3225485 on 2016/12/07 by Chris.Bunner Moved QuantizeSceneBufferSize to RenderCore and added call for PostProcess settings. Fixes screenpercentage out-of-bounds reads in some cases. #jira UE-19394 Change 3225486 on 2016/12/07 by Chris.Bunner Only disable TAA during HighResScreenshots if we don't have a reasonable frame-delay enabled. Change 3225505 on 2016/12/07 by Daniel.Wright Fixed exponential height fog disappearing with no skybox Change 3225655 on 2016/12/07 by Benjamin.Hyder Updating TM-Shadermodels to include Translucent lighting, Two sided, updated cloth animation, and adjusted lighting. Change 3225668 on 2016/12/07 by Chris.Bunner Dirty owning packages when user manually forces regeneration of all reflection captures. #jira UE-38759 Change 3226139 on 2016/12/07 by Rolando.Caloca DR - Fix recompute tangents disabling skin cache - Make some macros into lambdas #jira UE-39143 Change 3226212 on 2016/12/07 by Daniel.Wright Features which require a full prepass use DDM_AllOpaque instead of DDM_AllOccluders, which can be skipped if the component has bUseAsOccluder=false Change 3226213 on 2016/12/07 by Daniel.Wright Scene Capture 2D can specify a global clip plane, which is useful for portals * Requires the global clip plane project setting to be enabled Change 3226214 on 2016/12/07 by Daniel.Wright Improved deferred shadowing with MSAA by upsampling light attenuation intelligently in the base pass * If the current fragment's depth doesn't match what was used for deferred shadowing, the neighbor (cross pattern) with the nearest depth's shadowing is used * Edge artifacts can still occur where the upsample fails or the shadow factor was computed per-sample due to depth / stencil testing * Indirect Occlusion from capsule shadows also uses the nearest depth neighbor UV for no extra cost * Base pass on 970 GTX 1.69ms -> 1.85ms (.16ms) in RoboRecall Change 3226258 on 2016/12/07 by Rolando.Caloca DR - Typo fix Change 3226259 on 2016/12/07 by Rolando.Caloca DR - compile fix #jira UE-39143 Change 3226932 on 2016/12/08 by Chris.Bunner Re-saved Infiltrator maps to update reflection captures. #jira UE-38759 Change 3227063 on 2016/12/08 by Mark.Satterthwaite For Metal platforms ONLY temporarily disable USE_LIGHT_GRID_REFLECTION_CAPTURE_CULLING to avoid UE-37436 while the Nvidia driver team investigate why this doesn't work for them but does for the others. This won't affect non-Metal platforms and the intent is to revert this prior to 4.16 provided we can work through the problem with Nvidia. #jira UE-37436 Change 3227120 on 2016/12/08 by Gil.Gribb Merging //UE4/Dev-Main@3226895 to Dev-Rendering (//UE4/Dev-Rendering) Change 3227211 on 2016/12/08 by Arne.Schober DR - UE-38585 - Fixing crash where HierInstStaticMesh duplication fails. Also reverting the fix from UE-28189 which is redundant. Change 3227257 on 2016/12/08 by Marc.Olano Extension to PseudoVolumeTexture for more flexible layout Change by ryan.brucks Change 3227286 on 2016/12/08 by Rolando.Caloca DR - Fix crash when using custom expressions and using reserved keywords #jira UE-39311 Change 3227376 on 2016/12/08 by Mark.Satterthwaite Must not include a private header inside the MenuStack public header as that causes compile errors in plugins. Change 3227415 on 2016/12/08 by Mark.Satterthwaite Fix shader compilation due to my disabling of USE_LIGHT_GRID_REFLECTION_CAPTURE_CULLING on Metal - InstancedCompositeTileReflectionCaptureIndices needs to be defined even though Metal doesn't support instanced-stereo rendering. Change 3227516 on 2016/12/08 by Daniel.Wright Implemented UWidgetComponent::GetUsedMaterials Change 3227521 on 2016/12/08 by Guillaume.Abadie Fixes post process volume's indirect lighting color. #jira UE-38888 Change 3227567 on 2016/12/08 by Marc.Olano New upscale filters: Lanczos-2 (new default), Lanczos-3 and Gaussian Unsharp Mask Change 3227628 on 2016/12/08 by Daniel.Wright Removed redundant ResolveSceneDepthTexture from the merge Change 3227635 on 2016/12/08 by Daniel.Wright Forward renderer supports shadowing from movable lights and light functions * Only 4 shadow casting movable or stationary lights can overlap at any point in space, otherwise the movable lights will lose their shadows and an on-screen message will be displayed * Light functions only work on shadow casting lights since they need a shadowmap channel to be assigned Change 3227660 on 2016/12/08 by Rolando.Caloca DR - vk - Fix r.MobileMSAA on Vulkan - r.MobileMSAA is now read-only (to be fixed on 4.16) - Show time for PSO creation hitches #jira UE-39184 Change 3227704 on 2016/12/08 by Mark.Satterthwaite Fix Mac HDR causing incorrect output color encoding being used, HDR support is now entirely off unless you pass -metaledr which will enable it regardless of whether the current display supports HDR (as we haven't written the detection code yet). Fixed the LUT/UI compositing along the way - Mac Metal wasn't using volume LUT as it should have been, RHISupportsVertexShaderLayer now correctly returns false for non-Mac Metal platforms. Change 3227705 on 2016/12/08 by Daniel.Wright Replaced built-in samplers in the nearest depth translucency upsample because the built-in samplers are no longer bound on PC (cl 2852426) Change 3227787 on 2016/12/08 by Chris.Bunner Added extent clear to motion blur pass to catch misized buffers bringing in errors. Added early out to clear call when excluded region matches RT region. #jira UE-39437 Change 3228177 on 2016/12/08 by Marc.Olano Fix DCC sqrt(int) error Change 3228285 on 2016/12/08 by Chris.Bunner Back out changelist 3225449. #jira UE-39528 Change 3228680 on 2016/12/09 by Gil.Gribb Merging //UE4/Dev-Main@3228528 to Dev-Rendering (//UE4/Dev-Rendering) Change 3228940 on 2016/12/09 by Mark.Satterthwaite Editor fixes for 4.15: - PostProcessTonemap can't fail to bind a texture to the ColorLUT or the subsequent rendering will be garbage: the changes for optimising stereo rendering forgot to account for the Editor's use of Views without States for the asset preview thumbnails. Amended the CombineLUT post-processing to allocate a local output texture when there's no ViewState and read from this when this situation arises which makes everything function again. - Don't start render-passes without a valid render-target-array in MetalRHI. Change 3228950 on 2016/12/09 by Mark.Satterthwaite Make GPUSkinCache run on Mac Metal - it wasn't working because it was forcibly disabled on all platforms but for Windows D3D 11. - Fixed the Skeleton editor tree trying to access a widget before it has been constructed. - Enable GPUSkinCache for Metal SM5: doesn't render correctly, even on AMD, so needs Radar's filing and investigation. #jira UE-39256 Change 3229013 on 2016/12/09 by Mark.Satterthwaite Further tidy up in SSkeletonTreeView as suggested by Nick.A. Change 3229101 on 2016/12/09 by Chris.Bunner Log compile error fix and updated cvar comments. Change 3229236 on 2016/12/09 by Ben.Woodhouse XB1 D3D11 and D3D12: Use the DXGI frame statistics to get accurate GPU time unaffected by bubbles Change 3229430 on 2016/12/09 by Ben.Woodhouse PR #2680: Optimized histogram generation. (Contributed by PjotrSvetachov) Profiled on nvidia 980GTX (2x faster), and on XB1 (marginally faster) Change 3229580 on 2016/12/09 by Marcus.Wassmer DepthBoundsTest for AMD. Change 3229701 on 2016/12/09 by Michael.Trepka Changed "OS X" to "macOS" in few places where we display it and updated the code that asks users to update to latest version to check for 10.12.2 Change 3229706 on 2016/12/09 by Chris.Bunner Added GameUserSettings controls for HDR display output. Removed Metal commandline as this should replace the need for it. Change 3229774 on 2016/12/09 by Michael.Trepka Disabled OpenGL on Mac. -opengl is now ignored, we always use Metal. On old Macs that do not support Metal we show a message saying that the app requires Metal and exit. Change 3229819 on 2016/12/09 by Chris.Bunner Updated engine rendering defaults to better match current best practices. #jira UE-38081 Change 3229948 on 2016/12/09 by Rolando.Caloca DR - Fix d3d debug error #jira UE-39589 Change 3230341 on 2016/12/11 by Mark.Satterthwaite Don't fatally assert that the game-thread stalled waiting for the rendering thread in the Editor executable, even when running -game as the rendering thread can take a while to respond if shaders need to be compiled. #jira UE-39613 Change 3230860 on 2016/12/12 by Marcus.Wassmer Experimental Nvidia AFR support. Change 3230930 on 2016/12/12 by Mark.Satterthwaite Disable RHICmdList state-caching on Mac - Metal already does this internally and depends on receiving all state changes in order to function. Change 3231252 on 2016/12/12 by Marcus.Wassmer Fix NumGPU detection. (SLI only crash) Change 3231486 on 2016/12/12 by Mark.Satterthwaite Fix a stupid mistake in MetalStateCache::CommitResourceTable that would unnecessarily rebind samplers. Change 3231661 on 2016/12/12 by Mark.Satterthwaite Retain the RHI samplers in MetalRHI to guarantee lifetime. [CL 3231696 by Gil Gribb in Main branch]
2016-12-12 17:47:42 -05:00
case PF_A32B32G32R32F:
{
FReadSurfaceDataFlags ReadDataFlags(RCM_MinMax);
ReadDataFlags.SetLinearToGamma(false);
TArray<FLinearColor> Bitmap;
Context.RHICmdList.ReadSurfaceData(Texture, SourceRect, Bitmap, ReadDataFlags);
return FAsyncBufferWriteQueue::Dispatch(TAsyncBufferWrite<FLinearColor>(Filename, DestSize, MoveTemp(Bitmap)));
}
case PF_R8G8B8A8:
case PF_B8G8R8A8:
{
FReadSurfaceDataFlags ReadDataFlags;
ReadDataFlags.SetLinearToGamma(false);
TArray<FColor> Bitmap;
Context.RHICmdList.ReadSurfaceData(Texture, SourceRect, Bitmap, ReadDataFlags);
FColor* Pixel = Bitmap.GetData();
for (int32 i = 0, Count = Bitmap.Num(); i < Count; i++, Pixel++)
{
Pixel->A = 255;
}
Copying //UE4/Dev-Sequencer to Dev-Main (//UE4/Dev-Main) #lockdown nick.penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 2719576 on 2015/10/07 by Chris.Wood Added check for stale BP classes in FKismetCompilerUtilities::IsTypeCompatibleWithProperty() to stop compiler errors during reinstancing. [UE-19795] - UMG Compiler error when adding variable to nested Widget Change 2721474 on 2015/10/08 by Andrew.Rodham Sequencer: Movie render operations now successfully capture UMG UI Change 2724958 on 2015/10/12 by Chris.Wood Added missing resource cleanup code to UMG widgets [UE-21874] - UWIdget classes with missing ReleaseSlateResources() overrides Added ReleaseSlateResources() to ListView, TileView and Slider widgets to reset shared pointers to slate widgets. Change 2733562 on 2015/10/19 by Andrew.Rodham Sequencer: Fixed spawnables not working in sub-sequences - The issue here was that sequence track instance updates had no knowledge of which sub-sequence they were being evaluated within. We now pass the active sequence instance into the relevant track instance functions. - Also addressed some issues to do with save/restore state not getting called correctly on master tracks of sequence instances - Tidied up spawn track editor Change 2735264 on 2015/10/20 by Chris.Wood Improved Engine analytics handling for Editor and games [UE-21892] - Improve how Engine analytics are handled for Editor and games Changes: Added Privacy section to Editor settings Exposed editor analytics flag in Privacy options Added Details Customization to make this type of bool property clearer with extra info and hyperlink Changed AreEditorAnalyticsEnable() to use new flag Prevented analytics init when disabled by user Sending event and shutting down analytics when user opts out Add in-game project setting for anonymous game usage data Renamed and moved bHardwareSurveyEnabled Added message about exposing in-game setting to end users Added anonymous GUID id for in-game analytics Moved end user settings to global config (defaultengine.ini) Placeholder loc text on new options for now, pending legal wording sign-off Change 2735866 on 2015/10/20 by Max.Preussner Async: Added ability to register an optional callback function that is executed when a Future completes Change 2739793 on 2015/10/23 by Andrew.Rodham Sequencer: Refined movie scene capturing to ensure frame accuracies are maintained - Aborting an in-progress capture now gracefully terminates the process (through a remote session command) to ensure it still creates a valid video - Level sequece movie capture will now pick up a corresponding level sequence in the world, and use that to capture with. A new actor will be spawned at runtime with the correct asset, should one not already exist. - Made -nomovie actually work - Refined how active movie captures are managed - Added option to 'stage' a sequence before starting the capture. This feature will set the sequence on its first frame for the preroll, to ensure that PPP effects are allowed time to stabilize Change 2744402 on 2015/10/28 by Max.Preussner Sequencer: Separated track display names from track identifier names; code cleanup Change 2745953 on 2015/10/29 by Max.Chen Sequencer: Attach to socket. Relative attachments. #jira UETOOL-463 Change 2747028 on 2015/10/29 by Max.Preussner Sequencer: Another overhaul of track display name handling; code and documentation cleanup pass. Change 2758888 on 2015/11/09 by Chris.Wood Integrating changes - 4.10 to Dev-Sequencer From 4.10 branch fixes: Added check for debugger present when reporting abnormal termination to analytics. [UE-22844] CL 2750764 Added FSystemWideCriticalSection for desktop platforms. Used by analytics to lock access to editor instances list in the OS. [UE-22844] CL 2753661 Updating wording in privacy settings text. [UE-21892] CL 2753709 Mac and Linux CIS fix [UE-22844] CL 2755381 Change 2761287 on 2015/11/10 by Max.Chen Sequencer: Add null check when updating the UMG preview if the sequencer doesn't exist/has been closed. #jira UE-5206 Change 2764945 on 2015/11/12 by Max.Preussner Core: Templatized TypeContainer implementation to allow for thread-safe objects; updated unit test Also fixes UE-13850 Change 2765036 on 2015/11/12 by Max.Preussner UdpMessaging: Fixed message serialization unit test (UE-22571) #jira: UE-22571 Change 2766149 on 2015/11/13 by Max.Preussner Media: Implemented event that gets triggered when playback reached the end of media Also fixes looping. Change 2768157 on 2015/11/16 by Max.Preussner Media: Added .m4a to supported WMF file extensions Change 2769200 on 2015/11/16 by Max.Chen Editor: Add broadcast messages when snapping objects. #jira UE-22680 Change 2773066 on 2015/11/19 by Chris.Wood Upload crashes from CRC to Data Router [UECORE-249] - Integrate Crash Report Client with the Data Router Upload to Receiver still active as we are running both in parallel for now.
2015-12-11 13:52:32 -05:00
return FAsyncBufferWriteQueue::Dispatch(TAsyncBufferWrite<FColor>(Filename, DestSize, MoveTemp(Bitmap)));
}
}
Copying //UE4/Dev-Sequencer to Dev-Main (//UE4/Dev-Main) #lockdown nick.penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 2719576 on 2015/10/07 by Chris.Wood Added check for stale BP classes in FKismetCompilerUtilities::IsTypeCompatibleWithProperty() to stop compiler errors during reinstancing. [UE-19795] - UMG Compiler error when adding variable to nested Widget Change 2721474 on 2015/10/08 by Andrew.Rodham Sequencer: Movie render operations now successfully capture UMG UI Change 2724958 on 2015/10/12 by Chris.Wood Added missing resource cleanup code to UMG widgets [UE-21874] - UWIdget classes with missing ReleaseSlateResources() overrides Added ReleaseSlateResources() to ListView, TileView and Slider widgets to reset shared pointers to slate widgets. Change 2733562 on 2015/10/19 by Andrew.Rodham Sequencer: Fixed spawnables not working in sub-sequences - The issue here was that sequence track instance updates had no knowledge of which sub-sequence they were being evaluated within. We now pass the active sequence instance into the relevant track instance functions. - Also addressed some issues to do with save/restore state not getting called correctly on master tracks of sequence instances - Tidied up spawn track editor Change 2735264 on 2015/10/20 by Chris.Wood Improved Engine analytics handling for Editor and games [UE-21892] - Improve how Engine analytics are handled for Editor and games Changes: Added Privacy section to Editor settings Exposed editor analytics flag in Privacy options Added Details Customization to make this type of bool property clearer with extra info and hyperlink Changed AreEditorAnalyticsEnable() to use new flag Prevented analytics init when disabled by user Sending event and shutting down analytics when user opts out Add in-game project setting for anonymous game usage data Renamed and moved bHardwareSurveyEnabled Added message about exposing in-game setting to end users Added anonymous GUID id for in-game analytics Moved end user settings to global config (defaultengine.ini) Placeholder loc text on new options for now, pending legal wording sign-off Change 2735866 on 2015/10/20 by Max.Preussner Async: Added ability to register an optional callback function that is executed when a Future completes Change 2739793 on 2015/10/23 by Andrew.Rodham Sequencer: Refined movie scene capturing to ensure frame accuracies are maintained - Aborting an in-progress capture now gracefully terminates the process (through a remote session command) to ensure it still creates a valid video - Level sequece movie capture will now pick up a corresponding level sequence in the world, and use that to capture with. A new actor will be spawned at runtime with the correct asset, should one not already exist. - Made -nomovie actually work - Refined how active movie captures are managed - Added option to 'stage' a sequence before starting the capture. This feature will set the sequence on its first frame for the preroll, to ensure that PPP effects are allowed time to stabilize Change 2744402 on 2015/10/28 by Max.Preussner Sequencer: Separated track display names from track identifier names; code cleanup Change 2745953 on 2015/10/29 by Max.Chen Sequencer: Attach to socket. Relative attachments. #jira UETOOL-463 Change 2747028 on 2015/10/29 by Max.Preussner Sequencer: Another overhaul of track display name handling; code and documentation cleanup pass. Change 2758888 on 2015/11/09 by Chris.Wood Integrating changes - 4.10 to Dev-Sequencer From 4.10 branch fixes: Added check for debugger present when reporting abnormal termination to analytics. [UE-22844] CL 2750764 Added FSystemWideCriticalSection for desktop platforms. Used by analytics to lock access to editor instances list in the OS. [UE-22844] CL 2753661 Updating wording in privacy settings text. [UE-21892] CL 2753709 Mac and Linux CIS fix [UE-22844] CL 2755381 Change 2761287 on 2015/11/10 by Max.Chen Sequencer: Add null check when updating the UMG preview if the sequencer doesn't exist/has been closed. #jira UE-5206 Change 2764945 on 2015/11/12 by Max.Preussner Core: Templatized TypeContainer implementation to allow for thread-safe objects; updated unit test Also fixes UE-13850 Change 2765036 on 2015/11/12 by Max.Preussner UdpMessaging: Fixed message serialization unit test (UE-22571) #jira: UE-22571 Change 2766149 on 2015/11/13 by Max.Preussner Media: Implemented event that gets triggered when playback reached the end of media Also fixes looping. Change 2768157 on 2015/11/16 by Max.Preussner Media: Added .m4a to supported WMF file extensions Change 2769200 on 2015/11/16 by Max.Chen Editor: Add broadcast messages when snapping objects. #jira UE-22680 Change 2773066 on 2015/11/19 by Chris.Wood Upload crashes from CRC to Data Router [UECORE-249] - Integrate Crash Report Client with the Data Router Upload to Receiver still active as we are running both in parallel for now.
2015-12-11 13:52:32 -05:00
return TFuture<void>();
}
void FRenderingCompositionGraph::RecursivelyProcess(const FRenderingCompositeOutputRef& InOutputRef, FRenderingCompositePassContext& Context) const
{
FRenderingCompositePass *Pass = InOutputRef.GetPass();
FRenderingCompositeOutput *Output = InOutputRef.GetOutput();
#if !UE_BUILD_SHIPPING
if(!Pass || !Output)
{
// to track down a crash bug
if(Context.Pass)
{
UE_LOG(LogRenderer,Fatal, TEXT("FRenderingCompositionGraph::RecursivelyProcess %s"), *Context.Pass->ConstructDebugName());
}
}
#endif
check(Pass);
check(Output);
if(Pass->bProcessWasCalled)
{
// already processed
return;
}
Pass->bProcessWasCalled = true;
// iterate through all inputs and additional dependencies of this pass
{
uint32 Index = 0;
while(const FRenderingCompositeOutputRef* OutputRefIt = Pass->GetDependency(Index++))
{
if(OutputRefIt->GetPass())
{
if(!OutputRefIt)
{
// Pass doesn't have more inputs
break;
}
FRenderingCompositeOutput* Input = OutputRefIt->GetOutput();
// to track down an issue, should never happen
check(OutputRefIt->GetPass());
if(GRenderTargetPool.IsEventRecordingEnabled())
{
GRenderTargetPool.AddPhaseEvent(*Pass->ConstructDebugName());
}
Context.Pass = Pass;
RecursivelyProcess(*OutputRefIt, Context);
}
}
}
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
if(ShouldDebugCompositionGraph())
{
GGMLFileWriter.WriteLine("\tnode");
GGMLFileWriter.WriteLine("\t[");
int32 PassId = ComputeUniquePassId(Pass);
FString PassDebugName = Pass->ConstructDebugName();
ANSICHAR Line[MAX_SPRINTF];
{
GGMLFileWriter.WriteLine("\t\tgraphics");
GGMLFileWriter.WriteLine("\t\t[");
FCStringAnsi::Sprintf(Line, "\t\t\tw\t%d", 200);
GGMLFileWriter.WriteLine(Line);
FCStringAnsi::Sprintf(Line, "\t\t\th\t%d", 80);
GGMLFileWriter.WriteLine(Line);
GGMLFileWriter.WriteLine("\t\t\tfill\t\"#FFCCCC\"");
GGMLFileWriter.WriteLine("\t\t]");
}
{
FCStringAnsi::Sprintf(Line, "\t\tid\t%d", PassId);
GGMLFileWriter.WriteLine(Line);
GGMLFileWriter.WriteLine("\t\tLabelGraphics");
GGMLFileWriter.WriteLine("\t\t[");
FCStringAnsi::Sprintf(Line, "\t\t\ttext\t\"#%d\r%s\"", PassId, (const char *)TCHAR_TO_ANSI(*PassDebugName));
GGMLFileWriter.WriteLine(Line);
GGMLFileWriter.WriteLine("\t\t\tanchor\t\"t\""); // put label internally on top
GGMLFileWriter.WriteLine("\t\t\tfontSize\t14");
GGMLFileWriter.WriteLine("\t\t\tfontStyle\t\"bold\"");
GGMLFileWriter.WriteLine("\t\t]");
}
UE_LOG(LogConsoleResponse,Log, TEXT("Node#%d '%s'"), PassId, *PassDebugName);
GGMLFileWriter.WriteLine("\t\tisGroup\t1");
GGMLFileWriter.WriteLine("\t]");
uint32 InputId = 0;
while(FRenderingCompositeOutputRef* OutputRefIt = Pass->GetInput((EPassInputId)(InputId++)))
{
if(OutputRefIt->Source)
{
// source is hooked up
FString InputName = OutputRefIt->Source->ConstructDebugName();
int32 TargetPassId = ComputeUniquePassId(OutputRefIt->Source);
UE_LOG(LogConsoleResponse,Log, TEXT(" ePId_Input%d: Node#%d @ ePId_Output%d '%s'"), InputId - 1, TargetPassId, (uint32)OutputRefIt->PassOutputId, *InputName);
// input connection to another node
{
GGMLFileWriter.WriteLine("\tedge");
GGMLFileWriter.WriteLine("\t[");
{
FCStringAnsi::Sprintf(Line, "\t\tsource\t%d", ComputeUniqueOutputId(OutputRefIt->Source, OutputRefIt->PassOutputId));
GGMLFileWriter.WriteLine(Line);
FCStringAnsi::Sprintf(Line, "\t\ttarget\t%d", PassId);
GGMLFileWriter.WriteLine(Line);
}
{
FString EdgeName = FString::Printf(TEXT("ePId_Input%d"), InputId - 1);
GGMLFileWriter.WriteLine("\t\tLabelGraphics");
GGMLFileWriter.WriteLine("\t\t[");
FCStringAnsi::Sprintf(Line, "\t\t\ttext\t\"%s\"", (const char *)TCHAR_TO_ANSI(*EdgeName));
GGMLFileWriter.WriteLine(Line);
GGMLFileWriter.WriteLine("\t\t\tmodel\t\"three_center\"");
GGMLFileWriter.WriteLine("\t\t\tposition\t\"tcentr\"");
GGMLFileWriter.WriteLine("\t\t]");
}
GGMLFileWriter.WriteLine("\t]");
}
}
else
{
// source is not hooked up
UE_LOG(LogConsoleResponse,Log, TEXT(" ePId_Input%d:"), InputId - 1);
}
}
uint32 DepId = 0;
while(FRenderingCompositeOutputRef* OutputRefIt = Pass->GetAdditionalDependency(DepId++))
{
check(OutputRefIt->Source);
FString InputName = OutputRefIt->Source->ConstructDebugName();
int32 TargetPassId = ComputeUniquePassId(OutputRefIt->Source);
UE_LOG(LogConsoleResponse,Log, TEXT(" Dependency: Node#%d @ ePId_Output%d '%s'"), TargetPassId, (uint32)OutputRefIt->PassOutputId, *InputName);
// dependency connection to another node
{
GGMLFileWriter.WriteLine("\tedge");
GGMLFileWriter.WriteLine("\t[");
{
FCStringAnsi::Sprintf(Line, "\t\tsource\t%d", ComputeUniqueOutputId(OutputRefIt->Source, OutputRefIt->PassOutputId));
GGMLFileWriter.WriteLine(Line);
FCStringAnsi::Sprintf(Line, "\t\ttarget\t%d", PassId);
GGMLFileWriter.WriteLine(Line);
}
// dashed line
{
GGMLFileWriter.WriteLine("\t\tgraphics");
GGMLFileWriter.WriteLine("\t\t[");
GGMLFileWriter.WriteLine("\t\t\tstyle\t\"dashed\"");
GGMLFileWriter.WriteLine("\t\t]");
}
{
FString EdgeName = TEXT("Dependency");
GGMLFileWriter.WriteLine("\t\tLabelGraphics");
GGMLFileWriter.WriteLine("\t\t[");
FCStringAnsi::Sprintf(Line, "\t\t\ttext\t\"%s\"", (const char *)TCHAR_TO_ANSI(*EdgeName));
GGMLFileWriter.WriteLine(Line);
GGMLFileWriter.WriteLine("\t\t\tmodel\t\"three_center\"");
GGMLFileWriter.WriteLine("\t\t\tposition\t\"tcentr\"");
GGMLFileWriter.WriteLine("\t\t]");
}
GGMLFileWriter.WriteLine("\t]");
}
}
uint32 OutputId = 0;
while(FRenderingCompositeOutput* PassOutput = Pass->GetOutput((EPassOutputId)(OutputId)))
{
UE_LOG(LogConsoleResponse,Log, TEXT(" ePId_Output%d %s %s Dep: %d"), OutputId, *PassOutput->RenderTargetDesc.GenerateInfoString(), PassOutput->RenderTargetDesc.DebugName, PassOutput->GetDependencyCount());
GGMLFileWriter.WriteLine("\tnode");
GGMLFileWriter.WriteLine("\t[");
{
GGMLFileWriter.WriteLine("\t\tgraphics");
GGMLFileWriter.WriteLine("\t\t[");
FCStringAnsi::Sprintf(Line, "\t\t\tw\t%d", 220);
GGMLFileWriter.WriteLine(Line);
FCStringAnsi::Sprintf(Line, "\t\t\th\t%d", 40);
GGMLFileWriter.WriteLine(Line);
GGMLFileWriter.WriteLine("\t\t]");
}
{
FCStringAnsi::Sprintf(Line, "\t\tid\t%d", ComputeUniqueOutputId(Pass, (EPassOutputId)(OutputId)));
GGMLFileWriter.WriteLine(Line);
GGMLFileWriter.WriteLine("\t\tLabelGraphics");
GGMLFileWriter.WriteLine("\t\t[");
FCStringAnsi::Sprintf(Line, "\t\t\ttext\t\"ePId_Output%d '%s'\r%s\"",
OutputId,
(const char *)TCHAR_TO_ANSI(PassOutput->RenderTargetDesc.DebugName),
(const char *)TCHAR_TO_ANSI(*PassOutput->RenderTargetDesc.GenerateInfoString()));
GGMLFileWriter.WriteLine(Line);
GGMLFileWriter.WriteLine("\t\t]");
}
{
FCStringAnsi::Sprintf(Line, "\t\tgid\t%d", PassId);
GGMLFileWriter.WriteLine(Line);
}
GGMLFileWriter.WriteLine("\t]");
++OutputId;
}
UE_LOG(LogConsoleResponse,Log, TEXT(""));
}
#endif
Context.Pass = Pass;
Context.SetViewportInvalid();
// then process the pass itself
Pass->Process(Context);
// for VisualizeTexture and output buffer dumping
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
{
uint32 OutputId = 0;
while(FRenderingCompositeOutput* PassOutput = Pass->GetOutput((EPassOutputId)OutputId))
{
// use intermediate texture unless it's the last one where we render to the final output
if(PassOutput->PooledRenderTarget)
{
GRenderTargetPool.VisualizeTexture.SetCheckPoint(Context.RHICmdList, PassOutput->PooledRenderTarget);
// If this buffer was given a dump filename, write it out
const FString& Filename = Pass->GetOutputDumpFilename((EPassOutputId)OutputId);
if (!Filename.IsEmpty())
{
DumpOutputToFile(Context, Filename, PassOutput);
}
// If we've been asked to write out the pixel data for this pass to an external array, do it now
TArray<FColor>* OutputColorArray = Pass->GetOutputColorArray((EPassOutputId)OutputId);
if (OutputColorArray)
{
Context.RHICmdList.ReadSurfaceData(
PassOutput->PooledRenderTarget->GetRenderTargetItem().TargetableTexture,
Context.View.ViewRect,
*OutputColorArray,
FReadSurfaceDataFlags()
);
}
}
OutputId++;
}
}
#endif
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3357411) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3244756 on 2017/01/03 by Marcus.Wassmer Copying //Tasks/UE4/Dev-Niagara@3244743 to Dev-Rendering (//UE4/Dev-Rendering) Change 3248667 on 2017/01/05 by Olaf.Piesche Resaving default asset because of engine verison issue; maybe unnecessary, but resaving niagara engine content to be sure #jira UE-40160 Change 3249324 on 2017/01/06 by Marcus.Wassmer Resave with an actual version to stop cook warning Change 3249611 on 2017/01/06 by Marcus.Wassmer Just remove warning-causing niagara data for now. Change 3308052 on 2017/02/16 by Rolando.Caloca DR - Check for Vulkan SDK, and only use it if it's newer or the same as the headers we distribute Change 3308109 on 2017/02/16 by Rolando.Caloca DR - Upgrade glslang to 1.0.39.1 Change 3308111 on 2017/02/16 by Rolando.Caloca DR - Update Vulkan distribution to 1.0.39.1 Change 3308153 on 2017/02/16 by Rolando.Caloca DR - Updated glslang libs Change 3308842 on 2017/02/17 by Rolando.Caloca DR - Fixed copy/paste Change 3310007 on 2017/02/17 by Chris.Bunner Back out CL 3221219 - causing MIC generation issues and superseded by CL 3273971. #jira UE-37792 Change 3310154 on 2017/02/17 by Chris.Bunner Assert when attempting to add a custom material attribute already in the base attributes list. Change 3310155 on 2017/02/17 by Chris.Bunner PR #3231: Validate material index before accessing (Contributed by projectgheist) #jira UE-41774, UE-41788 Change 3310162 on 2017/02/17 by Chris.Bunner PR #3252: Added MobileMaterialInterface to UsedMaterials (Contributed by projectgheist) #jira UE-41823, UE-41950 Change 3310176 on 2017/02/17 by Chris.Bunner Merging CL 3233886: AMD HDR support (requires r.AMDSupportsHDRDisplayOutput=1 in ini). Update to AGS 5.0.5. Partial code tidy up. Change 3310187 on 2017/02/17 by Chris.Bunner Preserve constant expressions rather than always casting after translating a material attribute. Losing the notion of constant means we can't correctly detect used properties and falsely enable e.g. PDO. Happened because of the incorrect component masks in BreakMaterialNodes which then had to be downcast to the correct type which is done as an inline fragment rather than swizzle expression. #jira UE-41594 Change 3310215 on 2017/02/17 by Chris.Bunner Prevent SpeedTree node compiling for skeletal meshes (not supported as uses more UV sets than available). More descriptive error for missing Cubemap UV input on TextureSample material node . #jira UE-33098 Change 3310838 on 2017/02/18 by Joe.Graf Moved some private functions to public for a licensee #CodeReview: matt.kuhlenschmidt #rb: n/a Change 3311876 on 2017/02/20 by Rolando.Caloca DR - Expose skin cache cvar r.SkinCache.AccumulationBufferSizeInKB #jira UE-42014 Change 3314139 on 2017/02/21 by Rolando.Caloca DR - Minor cleanup pass - Remove FVulkanPendingState - Renamed some classes for clarity - Hoist pending UAVs for flush out to pending compute state Change 3314642 on 2017/02/21 by Rolando.Caloca DR - Some more renaming Change 3315431 on 2017/02/21 by Ben.Salem Properly set default values for test time out and tick. We now will default to ticking once per second, and tracking the macro stats of GPU/Render/Game thread time. #tests Ran showdown demo several times Change 3316710 on 2017/02/22 by Rolando.Caloca DR - hlslcc - Fix refract intrinsic Change 3316718 on 2017/02/22 by Rolando.Caloca DR - hlslcc - Built libs to pick up change from 3316710 - refract fix Change 3316820 on 2017/02/22 by Benjamin.Hyder updating Tm-TrigNodes map Change 3317192 on 2017/02/22 by Benjamin.Hyder Updating QA-Decals map Change 3317528 on 2017/02/22 by Benjamin.Hyder Updating QA-Decals map Change 3317639 on 2017/02/22 by Benjamin.Hyder Updating Decal on Complex Mesh example in QA-Decals Change 3317764 on 2017/02/22 by Benjamin.Hyder Final updates to QA-Decals Change 3318319 on 2017/02/22 by Rolando.Caloca DR - minor reorg/rename Change 3318379 on 2017/02/22 by Rolando.Caloca DR - more cleanup Change 3321181 on 2017/02/24 by Rolando.Caloca DR - Fix GL bug Change 3321247 on 2017/02/24 by Rolando.Caloca DR - Fix misc bugs Change 3321898 on 2017/02/24 by Chris.Bunner Only issue clear TLV dispatch if required. #jira UERNDR-193 Change 3321904 on 2017/02/24 by Chris.Bunner Added comment for potential future optimization. Change 3322013 on 2017/02/24 by Uriel.Doyon Fixed separate translucency being affected by Gaussian DOF #jira UE-40489 Change 3322517 on 2017/02/24 by Uriel.Doyon Fixed issue with InvestigateTexture command removing budget limit. Fixed StreamingBounds show flag not working. It nows shows the streaming bound for the currently selected textures. #jira UE-40485 Change 3323470 on 2017/02/27 by Chad.Garyet Removing DDC job from dev-rendering Change 3323479 on 2017/02/27 by Chad.Garyet Removing RDU agent type Change 3323519 on 2017/02/27 by Chad.Garyet removing NCL/LHR/SEA agent types to clean up space Change 3323639 on 2017/02/27 by Benjamin.Hyder More updates to QA-Decals Change 3324207 on 2017/02/27 by Uriel.Doyon Fixed typo ScaleTexturesByGlobalMyBias -> ScaleTexturesByGlobalMipBias Removed bad merge in FStreamingTextureLevelContext::GetBuildDataIndexRef Change 3324396 on 2017/02/27 by Uriel.Doyon Fixed an issue with the Streaming Bounds show flag interferring with the static level data initialization #jira UE-40485 Change 3325227 on 2017/02/28 by Chris.Bunner Fix-up AMD AGS libs. Change 3325566 on 2017/02/28 by Uriel.Doyon Fixed possible out-of-bound access in GetUsedTexture() when passing ERHIFeatureLevel::Num Change 3326009 on 2017/02/28 by Uriel.Doyon Better fix for 3325566, as the previous fix would ignore the material instance overrides. Change 3327058 on 2017/03/01 by Benjamin.Hyder Preparing TM_Shadermodels map for automation Change 3328222 on 2017/03/01 by Chris.Bunner Prevent decals from drawing in separate translucency pass. Whilst user control and material relevance were already removed, if the flag was checked before being disabled (by swapping to decal domain) this was still being read in the render loop, now explicitly ignores decals. #jira UE-42449, UE-42446 Change 3329848 on 2017/03/02 by Uriel.Doyon Added some extra logs to help track UE-42168 Change 3329977 on 2017/03/02 by Rolando.Caloca DR - Fix bad clear value Change 3330008 on 2017/03/02 by Benjamin.Hyder More preparations for QA-Decals automation Change 3330754 on 2017/03/02 by Daniel.Wright Prominent comment explaining reflection env async compute usage and why it's not overlapped with anything Change 3331451 on 2017/03/03 by Marc.Olano Manually unroll simplex noise loop to avoid PSO bug on AMD/Metal Change 3331839 on 2017/03/03 by Rolando.Caloca DR - hlslcc - add missing file to project Change 3332247 on 2017/03/03 by Rolando.Caloca DR - Fix for integrated intel PR #3305 #jira UE-42393 Change 3332259 on 2017/03/03 by Rolando.Caloca DR - Fix bad index into pixel formats PR #3237 #jira UE-41855 Change 3332305 on 2017/03/03 by Rolando.Caloca DR - OpenGL SRV for index buffers PR #3271 #jira UE-32618 Change 3332313 on 2017/03/03 by Rolando.Caloca DR - Fix for integrated intel (properly) PR #3305 #jira UE-42393 Change 3332317 on 2017/03/03 by Rolando.Caloca DR - OpenGL SRV for index buffers (properly) PR #3271 #jira UE-32618 Change 3332368 on 2017/03/03 by Rolando.Caloca DR - Minor fixes so -sm4 and -sm5 can be used on windows with OpenGL/Vulkan Change 3333690 on 2017/03/06 by Daniel.Wright [Copy] Changing movable skylight properties no longer affects static draw lists Change 3333693 on 2017/03/06 by Daniel.Wright [Copy] Added 'r.AOListMeshDistanceFields' which dumps out mesh distance fields sorted by memory size, useful for directing content optimizations Change 3333705 on 2017/03/06 by Daniel.Wright [Copy] Mesh distance fields are now 8 bit fixed point by default, but can be changed back to 16 bit floating piont with a project setting. * 8 bit uses half memory but introduces error for thin surfaces or large meshes. Change 3333721 on 2017/03/06 by David.Hill DecalProxy: Copy float FadeScreenSize to FDeferredDecalProxy for use in the render thread. This avoids pointer chasing to the UDecalComponent (game thread component). Change 3333772 on 2017/03/06 by Daniel.Wright [Copy] Scene motion blur data is only updated for the main renderer frames. Fixes scene captures and planar reflections breaking object motion blur. Change 3333790 on 2017/03/06 by Daniel.Wright [Copy] Mesh distance field generation uses Embree, for a 2.5x speedup * Can switch back to old kDOP generation with 'r.DistanceFieldBuild.UseEmbree 0' for debugging Change 3333822 on 2017/03/06 by Daniel.Wright [Copy] Moved mesh distance field code into MeshDistanceFieldUtilities.cpp * Moved FMeshUtilities to its own header so the 8k line MeshUtilites.cpp file can be further split up Change 3333827 on 2017/03/06 by Daniel.Wright [Copy] Range compress 8bit distance fields - gets one extra bit of precision on average Change 3333828 on 2017/03/06 by Daniel.Wright [Copy] Raised High ShadowQuality to 2048 as 1024 for CSM is way too low Change 3333831 on 2017/03/06 by Daniel.Wright Non-editor compile fix Change 3333836 on 2017/03/06 by Daniel.Wright [Copy] Workaround for gobal distance field volume textures being bloated by 4x on PS4 due to the recommended tiling modes. They now use a 2d tiling mode which avoids the bloat, saving 96Mb. Change 3333843 on 2017/03/06 by Daniel.Wright [Copy] Added OcclusionExponent to skylight component * Useful for brightening up indoors without losing contact shadows as MinOcclusion does Change 3333845 on 2017/03/06 by Daniel.Wright [Copy] Capsule shadow BP functions Change 3333850 on 2017/03/06 by Daniel.Wright [Copy] Added OcclusionCombineMode to skylight component Change 3333854 on 2017/03/06 by Daniel.Wright [Copy] Gnm properly registers clears as GPU work so those events show up in profilegpu Change 3333857 on 2017/03/06 by Daniel.Wright [Copy] Clear light attenuation for local lights with a quad covering their screen extents * Clearing the entire light attenuation buffer costs .1ms on PS4. This optimization lowers the minimum cost of a shadow casting light from .15ms -> .03ms. * Shadowed lights in Fortnite with 25 lights 3.7ms -> 1.42ms on PS4 Change 3333860 on 2017/03/06 by Daniel.Wright [Copy] Flush deferred deletes when reallocating distance field atlas to reduce peak memory Change 3333861 on 2017/03/06 by Daniel.Wright [Copy] Disable all distance field features on Intel cards as HD 4000 hangs in the RHICreateTexture3D call to allocate the large atlas Change 3333869 on 2017/03/06 by Daniel.Wright [Copy] Volumetric Fog using a volume texture mapped to the camera frustum * Volumetric fog can be enabled on an Exponential Height Fog component with additional controls * Lights have a VolumetricScatteringIntensity * New cvars r.VolumetricFog, r.VolumetricFog.GridPixelSize, r.VolumetricFog.GridSizeZ, r.VolumetricFog.DepthDistributionScale * Lighting features supported: * Directional light with CSM and a light function * Point / spot lights without shadows / light functions / IES profiles * Skylight with occlusion from distance fields * Analytical height fog covers the view range past where the volumetric fog ends * Temporal reprojection is used on the volumetric fog scattering and extinction to achieve stability * Translucency integrates properly into volumetric fog * Height fog StartDistance is not supported by volumetric fog and should be set to 0. Change 3333894 on 2017/03/06 by Daniel.Wright [Copy] Initialize GDummyVolumetricFogGlobalDataUniformBuffer outside of parallel rendering Change 3333902 on 2017/03/06 by Daniel.Wright [Copy] Better handling of volumetric fog enabled with distance of 0 Change 3333903 on 2017/03/06 by Daniel.Wright [Copy] Fixed volumetric fog trying to render light functions for a point light Change 3333908 on 2017/03/06 by Daniel.Wright [Copy] Volumetric materials * Added new material domain Volume, which can output Scattering, Absorption and Emissive. All properties are in world space densities. * Particle systems using the Volume domain are voxelized based on their ParticlePosition and ParticleRadius * Volumetric fog integration is now energy conservative - scattering is integrated against transmission over the depth of each slice. * Added bOverrideLightColorsWithFogInscatteringColors to exponential height fog, which can be enabled to make Volumetric Fog match Height fog more closely Change 3334134 on 2017/03/06 by Daniel.Wright [Copy from Michael Trepka] Added Embree 2.14.0 and changed MeshUtilities to use it as this solves issues with Embree leaking TLS keys. UnrealLightmass is still using older Embree 2.7.0 until we can find time to properly test it with the new version. Also, invalidated distance field DDC to force it to rebuild with updated Embree. Change 3334420 on 2017/03/06 by Daniel.Wright Fixed RTDF shadows Change 3335467 on 2017/03/07 by Benjamin.Hyder Initial submission of QA-Decals map to EngineTest Change 3335556 on 2017/03/07 by Daniel.Wright Changed mesh distance field default format back to R16f Change 3338020 on 2017/03/08 by Daniel.Wright Disable volumetric fog in vertex shaders for feature levels which don't support it Change 3339394 on 2017/03/09 by Chris.Bunner Correctly handle material texture translation error edge case. #jira UE-42579, UE-42670 Change 3339992 on 2017/03/09 by Daniel.Wright Only compile volumetric fog shaders on supporting platforms Change 3341858 on 2017/03/10 by Arne.Schober Copying //UE4/Dev-Rendering-PSO to Dev-Rendering (//UE4/Dev-Rendering) #RB Rolando.Caloca, Marcus.Wassmer, Daniel.Wright, Nick.Penwarden, Mark.Satterthwaite Change 3342004 on 2017/03/10 by Arne.Schober Copying //UE4/Dev-Rendering-PSO to Dev-Rendering (//UE4/Dev-Rendering) Fix unity build #RB Marcus.Wassmer Change 3343307 on 2017/03/13 by Marcus.Wassmer Update showflags when we are guaranteed it will happen in all possible ways to spawn the scenecapture. (drag into editor, PIE, -game, etc) Change 3343732 on 2017/03/13 by Rolando.Caloca DR - Vulkan compute pipeline & refactor Change 3344846 on 2017/03/14 by Rolando.Caloca DR - Android compile fixes Change 3344883 on 2017/03/14 by Rolando.Caloca DR - Add missing stencil load/store to PSO initializer Change 3344985 on 2017/03/14 by Rolando.Caloca DR - Made load/store actions uint8 Change 3345141 on 2017/03/14 by Rolando.Caloca DR - vk - Rework render pass hash Change 3345304 on 2017/03/14 by Benjamin.Hyder Updating TM-Distancefields map to include TemplateFloor mesh Change 3345387 on 2017/03/14 by Rolando.Caloca DR - Add _RenderThread calls for Create*Shader so RHIs can choose not to stall when creating Change 3345388 on 2017/03/14 by Rolando.Caloca DR - Do not stall when creating shaders on Vulkan Change 3345722 on 2017/03/14 by Chris.Bunner PR #3357: MinimalAPI add to many material expressions (Contributed by DeanoC) #jira UE-42752 Change 3345723 on 2017/03/14 by Chris.Bunner Reduce log verbosity causing spamming during landscape editing. #jira UE-42714 Change 3345725 on 2017/03/14 by Chris.Bunner [Duplicate 3341860] Fixed material translation error with multiple connections from custom interpolator nodes. Change 3345726 on 2017/03/14 by Chris.Bunner Typo fixes. Change 3345732 on 2017/03/14 by Rolando.Caloca DR - Decouple vertex declaration off BSS Change 3345746 on 2017/03/14 by Chris.Bunner Added sign() intrinsic material graph node and delisted material function workaround. Change 3346042 on 2017/03/14 by Chris.Bunner Implement missing size query interface for FRenderTargetResources. #jira UE-41672 Change 3346387 on 2017/03/14 by Daniel.Wright [Copy] Added VolumetricScatteringIntensity to particle lights Change 3346389 on 2017/03/14 by Daniel.Wright [Copy] Clamp Volumetric material attributes to fp16 range to avoid INFs Disable volumetric fog when the fog show flag is disabled Change 3346392 on 2017/03/14 by Daniel.Wright [Copy] Fixed skylight being much too bright on volumetric fog Change 3346406 on 2017/03/14 by Daniel.Wright [Copy] CSM resolution is now controlled by r.Shadow.MaxCSMResolution. * Changed HighPC to use 1024 MaxShadowResolution (max for all non-CSM shadows), saves 60Mb in Fortnite Change 3346412 on 2017/03/14 by Daniel.Wright [Copy] TexCreate_ReduceMemoryWithTilingMode for translucency lighting 3d textures, saves 13Mb Change 3346414 on 2017/03/14 by Daniel.Wright [Copy] TexCreate_ReduceMemoryWithTilingMode for volumetric fog 3d textures, saves 13Mb Change 3346415 on 2017/03/14 by Daniel.Wright [Copy] Missing file from cl 3338451 Change 3346421 on 2017/03/14 by Daniel.Wright [Copy] Fixed NaNs in volumetric fog due to rendering when height fog is disabled * Volumetric fog converts NaNs to black now so they don't spread Change 3346422 on 2017/03/14 by Daniel.Wright [Copy] Fixed NaN in volumetric fog with low density values Change 3346423 on 2017/03/14 by Daniel.Wright [Copy] Changed default VolumetricFogScatteringDistribution to .2 Change 3346430 on 2017/03/14 by Daniel.Wright [Copy] New translucent material option to compute fog per pixel instead of the default per vertex Change 3346432 on 2017/03/14 by Daniel.Wright [Copy] Moved Volumetric Fog parameters to view uniform buffer for translucency pass Fixed lifetimes of temporary Volumetric Fog render targets Change 3346526 on 2017/03/14 by Daniel.Wright [Copy] Volumetric Fog supports point and spot light shadows * These lights are injected separately so that per-light resources can be bound (shadow depth map, static shadow depth map) * Forward lighting of local lights can be forced with 'r.VolumetricFog.InjectShadowedLightsSeparately 0' * Shadowed lights come at a cost: 2.9ms for volumetric fog on 970 -> 4.2ms with shadowing Change 3347053 on 2017/03/15 by Rolando.Caloca DR - android compile fix Change 3347384 on 2017/03/15 by Rolando.Caloca DR - Fix merge issue Change 3347643 on 2017/03/15 by Marcus.Wassmer Fix some bugs with the 'disable stationary skylight ffor the project' feature. Fixes lighting in Persona on Paragon. Change 3347979 on 2017/03/15 by Rolando.Caloca DR - Allow to automatically apply cached rendertargets to PSO initializer Change 3348024 on 2017/03/15 by Rolando.Caloca DR - Remove NullPS on Vulkan to avoid deadlock Change 3348303 on 2017/03/15 by Rolando.Caloca DR - Fix for debugging SCW with material SRT Change 3348357 on 2017/03/15 by Marcus.Wassmer Fix stencildither and a stencilref bug that was probably breaking decals sometimes. Change 3348549 on 2017/03/15 by Marcus.Wassmer Hopefully fix static analysis for potential nullptr access. Change 3348614 on 2017/03/15 by Marcus.Wassmer Duplicate some switch changes to fix crash on launch. Change 3349369 on 2017/03/16 by Gil.Gribb Fixed botched merge Change 3349947 on 2017/03/16 by Rolando.Caloca DR - Fix for mismatched primitive type Change 3349956 on 2017/03/16 by Benjamin.Hyder initial updates to TM-DistanceFields map Change 3350151 on 2017/03/16 by Rolando.Caloca DR - Fix UT compile issue Change 3350155 on 2017/03/16 by Rolando.Caloca DR - Catch mismatched primitive type on PSOs on D3D11 Change 3350192 on 2017/03/16 by Daniel.Wright Fix for point light shadow depths rendering with wrong cull mode due to PSO refactor Change 3350736 on 2017/03/16 by Daniel.Wright Fixed formatting from merge Change 3350881 on 2017/03/16 by Rolando.Caloca DR - Fix texture arrays as UAVs on Metal Change 3350927 on 2017/03/16 by Rolando.Caloca DR - Fix warning Change 3350935 on 2017/03/16 by Daniel.Wright Fix for materials with non-Surface domains being skipped in mesh passes Change 3351583 on 2017/03/17 by Marcus.Wassmer Fix clang platforms Change 3351917 on 2017/03/17 by Marcus.Wassmer Fix linux compile Change 3351973 on 2017/03/17 by Marcus.Wassmer Fix mismatched rendertargetformat Change 3352038 on 2017/03/17 by Daniel.Wright Enabled GetAndOrCreateGraphicsPipelineState ensures in Development for testing Change 3352110 on 2017/03/17 by Marcus.Wassmer Fix missing RT PSO apply Change 3352695 on 2017/03/17 by Arne.Schober DR - Remove PSO Rendertarget check in DX12 Resolve with Shader. #RB Rolando.Caloca Change 3352960 on 2017/03/17 by Arne.Schober DR - Fix some things that slipped trough the PSO merge #RB none Change 3353150 on 2017/03/18 by Rolando.Caloca DR - compile fix Change 3353205 on 2017/03/18 by Arne.Schober DR - Fix Incremental Compile and PS4 runtime error where CMASK is not allowed for ThickTile Mode #RB none Change 3353207 on 2017/03/18 by Arne.Schober DR - Fix Confusion #RB none Change 3355183 on 2017/03/20 by Nick.Bullard Fixed up Content orginzation for Decals automation tests in EngineTest Change 3355627 on 2017/03/20 by Arne.Schober DR - [UE-43094] - removed ensure in comporiton graph as control of the clear color cannot be gurantueed. Change 3356342 on 2017/03/21 by Marcus.Wassmer Fix clang errors Change 3356591 on 2017/03/21 by Arne.Schober DR - Fix ensure message #RB none Change 3356873 on 2017/03/21 by Arne.Schober DR - Fix comparission of undefined values in RendertargetApply Check Change 3357261 on 2017/03/21 by Marcus.Wassmer Fix LinuxEditor compile Change 3357294 on 2017/03/21 by Marcus.Wassmer Add missing SSE functions Change 3357351 on 2017/03/21 by Frank.Fella Fix win32 and linux compiler errors Change 3357370 on 2017/03/21 by Arne.Schober DR - disable ensure in test builds #RB Marcus.Wassmer [CL 3357449 by Marcus Wassmer in Main branch]
2017-03-21 17:46:52 -04:00
// iterate through all inputs of this pass and decrement the references for it's inputs
// this can release some intermediate RT so they can be reused
{
uint32 InputId = 0;
while(const FRenderingCompositeOutputRef* OutputRefIt = Pass->GetDependency(InputId++))
{
FRenderingCompositeOutput* Input = OutputRefIt->GetOutput();
if(Input)
{
Input->ResolveDependencies();
}
}
}
}
// for debugging purpose O(n)
int32 FRenderingCompositionGraph::ComputeUniquePassId(FRenderingCompositePass* Pass) const
{
for(uint32 i = 0; i < (uint32)Nodes.Num(); ++i)
{
FRenderingCompositePass *Element = Nodes[i];
if(Element == Pass)
{
return i;
}
}
return -1;
}
int32 FRenderingCompositionGraph::ComputeUniqueOutputId(FRenderingCompositePass* Pass, EPassOutputId OutputId) const
{
uint32 Ret = Nodes.Num();
for(uint32 i = 0; i < (uint32)Nodes.Num(); ++i)
{
FRenderingCompositePass *Element = Nodes[i];
if(Element == Pass)
{
return (int32)(Ret + (uint32)OutputId);
}
uint32 OutputCount = 0;
while(Pass->GetOutput((EPassOutputId)OutputCount))
{
++OutputCount;
}
Ret += OutputCount;
}
return -1;
}
FRenderingCompositeOutput *FRenderingCompositeOutputRef::GetOutput() const
{
if(Source == 0)
{
return 0;
}
return Source->GetOutput(PassOutputId);
}
FRenderingCompositePass* FRenderingCompositeOutputRef::GetPass() const
{
return Source;
}
// -----------------------------------------------------------------
void FPostProcessPassParameters::Bind(const FShaderParameterMap& ParameterMap)
{
BilinearTextureSampler0.Bind(ParameterMap,TEXT("BilinearTextureSampler0"));
BilinearTextureSampler1.Bind(ParameterMap,TEXT("BilinearTextureSampler1"));
ViewportSize.Bind(ParameterMap,TEXT("ViewportSize"));
ViewportRect.Bind(ParameterMap,TEXT("ViewportRect"));
ScreenPosToPixel.Bind(ParameterMap,TEXT("ScreenPosToPixel"));
for(uint32 i = 0; i < ePId_Input_MAX; ++i)
{
PostprocessInputParameter[i].Bind(ParameterMap, *FString::Printf(TEXT("PostprocessInput%d"), i));
PostprocessInputParameterSampler[i].Bind(ParameterMap, *FString::Printf(TEXT("PostprocessInput%dSampler"), i));
PostprocessInputSizeParameter[i].Bind(ParameterMap, *FString::Printf(TEXT("PostprocessInput%dSize"), i));
PostProcessInputMinMaxParameter[i].Bind(ParameterMap, *FString::Printf(TEXT("PostprocessInput%dMinMax"), i));
}
}
void FPostProcessPassParameters::SetPS(const FPixelShaderRHIParamRef& ShaderRHI, const FRenderingCompositePassContext& Context, FSamplerStateRHIParamRef Filter, EFallbackColor FallbackColor, FSamplerStateRHIParamRef* FilterOverrideArray)
{
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2774277 on 2015/11/19 by Gil.Gribb UE4 - Did minor optimizations to the PS4 RHI and drawlists. Change 2791226 on 2015/12/04 by Uriel.Doyon Added source code for Embree 2.7.0 Removed duplicate files from the /doc folder. Change 2800193 on 2015/12/11 by Marcus.Wassmer SSAO AsyncCompute support. #rb Martin.Mittring Change 2801631 on 2015/12/14 by Olaf.Piesche Making auto deactivate true by default, moving checks to HasCompleted, eliminating some unnecessary logic #rb martin.mittring Change 2803240 on 2015/12/15 by Gil.Gribb UE4 - Added command to collect stats on spammy stats. Change 2803476 on 2015/12/15 by Rolando.Caloca DR - Allow toggling compute skin dispatch at runtime - r.SkinCacheShaders Now enable the shaders and feature - r.SkinCaching enables toggling at runtime - r.SkinCache.BufferSize Sets the size in bytes of buffer for outputting - Now uses 3 UAV buffers instead of one (avoid RenderDoc crashes) #codereview Marcus.Wassmer, Martin.Mittring Change 2803940 on 2015/12/15 by Marcus.Wassmer Add r.PS4.AsyncComputeBudgetMode to switch between CUMasking and WaveLimit modes. So far it looks like WaveLimits behave better in UE4. Also rearrange AsyncSSAO to run immediately after HZB to overlap with occlusion queries. In my testing this takes SSAO cost from .5ms -> .2ms. However it had to be hacked to run without normals. Hopefully Martin can get some real AsyncSSAO in. #rb Martin.Mittring #codereview Martin.Mittring Change 2803999 on 2015/12/15 by Uriel.Doyon Refactored the shader complexity material override logic to allow other viewmodes shader overrides. TexelFactorAccuracy ViewMode : shows the accuracy of the static mesh texel factors, used for streaming. WantedMipsAccuracy ViewMode : shows the accuracy of the static mesh wanted mips accuracy, used for streaming. Added an option to stream textures based on the AABB distance instead of using the sphere approximation. Added an option to only keep a the wanted mips. Moved optimization related viewmodes into a submenu to avoid polluting the interface. #jira UE-24502 #jira UE-24503 #jira UERNDR-89 Change 2804150 on 2015/12/15 by Olaf.Piesche make separate translucency screen percentage a bit more robust; add numsamples to the render target creation functions in preparation for MSAA support for higher quality with low res separate translucency #rb martin.mittring Change 2804367 on 2015/12/15 by Daniel.Wright Capsule shadow primitives are tracked separately on registration - saves 2.6ms of RT time doing the view frustum culling in a medium sized map Change 2805293 on 2015/12/16 by Olaf.Piesche logging if potentially immortal emitters are spawned from gameplay; this should catch if we spawn burst only emitters with indefinite life spans (muzzle flashes, hit impacts, etc.) #rb martin.mittring Change 2805586 on 2015/12/16 by Zabir.Hoque Adding support for decals to fade and destroy themselves automatically. #CodeReview: Martin.Mittring, Daniel.Wright, Olaf.Piesche Change 2807663 on 2015/12/17 by Rolando.Caloca DR - Remove expensive logging #codereview Marcus.Wassmer Change 2807903 on 2015/12/17 by Zabir.Hoque Refactored DecalComponent's lifetime management such that it can be set and reset from Blueprints. #CodeReview Daniel.Wright, Martin.Mittring, Olaf.Piesche Change 2809261 on 2015/12/18 by Martin.Mittring Added VisualizeShadingModels to track down issues like that: FORT-16913 Textures on Hero Mesh is not shown #rb:David.Hill #code_review:Bob.Tellez Change 2810136 on 2015/12/21 by Rolando.Caloca DR - Added back draw event colors PR #1602 #jira UE-21526 #codereview Mark.Satterthwaite, Keith.Judge, Marcus.Wassmer, Josh.Adams Change 2810680 on 2015/12/21 by Martin.Mittring moved SSAO ComputeShader running without per pixel normal (for AsyncCompute) into DevRendering #test:editor Change 2811205 on 2015/12/22 by Brian.Karis Pulled clear coat out of the reflection compute shader. Added permutation for skylight. Clear coat base layer now done in base pass. It only picks up the closest capture. This will cause popping when the object moves. Still needs a cross fade. Change 2811275 on 2015/12/22 by David.Hill UE-24675 #rb martin.mittring Corrected buffer-size related problem with fringe. Change 2811397 on 2015/12/22 by Brian.Karis
2016-01-08 11:12:28 -05:00
Set(ShaderRHI, Context, Context.RHICmdList, Filter, FallbackColor, FilterOverrideArray);
}
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2774277 on 2015/11/19 by Gil.Gribb UE4 - Did minor optimizations to the PS4 RHI and drawlists. Change 2791226 on 2015/12/04 by Uriel.Doyon Added source code for Embree 2.7.0 Removed duplicate files from the /doc folder. Change 2800193 on 2015/12/11 by Marcus.Wassmer SSAO AsyncCompute support. #rb Martin.Mittring Change 2801631 on 2015/12/14 by Olaf.Piesche Making auto deactivate true by default, moving checks to HasCompleted, eliminating some unnecessary logic #rb martin.mittring Change 2803240 on 2015/12/15 by Gil.Gribb UE4 - Added command to collect stats on spammy stats. Change 2803476 on 2015/12/15 by Rolando.Caloca DR - Allow toggling compute skin dispatch at runtime - r.SkinCacheShaders Now enable the shaders and feature - r.SkinCaching enables toggling at runtime - r.SkinCache.BufferSize Sets the size in bytes of buffer for outputting - Now uses 3 UAV buffers instead of one (avoid RenderDoc crashes) #codereview Marcus.Wassmer, Martin.Mittring Change 2803940 on 2015/12/15 by Marcus.Wassmer Add r.PS4.AsyncComputeBudgetMode to switch between CUMasking and WaveLimit modes. So far it looks like WaveLimits behave better in UE4. Also rearrange AsyncSSAO to run immediately after HZB to overlap with occlusion queries. In my testing this takes SSAO cost from .5ms -> .2ms. However it had to be hacked to run without normals. Hopefully Martin can get some real AsyncSSAO in. #rb Martin.Mittring #codereview Martin.Mittring Change 2803999 on 2015/12/15 by Uriel.Doyon Refactored the shader complexity material override logic to allow other viewmodes shader overrides. TexelFactorAccuracy ViewMode : shows the accuracy of the static mesh texel factors, used for streaming. WantedMipsAccuracy ViewMode : shows the accuracy of the static mesh wanted mips accuracy, used for streaming. Added an option to stream textures based on the AABB distance instead of using the sphere approximation. Added an option to only keep a the wanted mips. Moved optimization related viewmodes into a submenu to avoid polluting the interface. #jira UE-24502 #jira UE-24503 #jira UERNDR-89 Change 2804150 on 2015/12/15 by Olaf.Piesche make separate translucency screen percentage a bit more robust; add numsamples to the render target creation functions in preparation for MSAA support for higher quality with low res separate translucency #rb martin.mittring Change 2804367 on 2015/12/15 by Daniel.Wright Capsule shadow primitives are tracked separately on registration - saves 2.6ms of RT time doing the view frustum culling in a medium sized map Change 2805293 on 2015/12/16 by Olaf.Piesche logging if potentially immortal emitters are spawned from gameplay; this should catch if we spawn burst only emitters with indefinite life spans (muzzle flashes, hit impacts, etc.) #rb martin.mittring Change 2805586 on 2015/12/16 by Zabir.Hoque Adding support for decals to fade and destroy themselves automatically. #CodeReview: Martin.Mittring, Daniel.Wright, Olaf.Piesche Change 2807663 on 2015/12/17 by Rolando.Caloca DR - Remove expensive logging #codereview Marcus.Wassmer Change 2807903 on 2015/12/17 by Zabir.Hoque Refactored DecalComponent's lifetime management such that it can be set and reset from Blueprints. #CodeReview Daniel.Wright, Martin.Mittring, Olaf.Piesche Change 2809261 on 2015/12/18 by Martin.Mittring Added VisualizeShadingModels to track down issues like that: FORT-16913 Textures on Hero Mesh is not shown #rb:David.Hill #code_review:Bob.Tellez Change 2810136 on 2015/12/21 by Rolando.Caloca DR - Added back draw event colors PR #1602 #jira UE-21526 #codereview Mark.Satterthwaite, Keith.Judge, Marcus.Wassmer, Josh.Adams Change 2810680 on 2015/12/21 by Martin.Mittring moved SSAO ComputeShader running without per pixel normal (for AsyncCompute) into DevRendering #test:editor Change 2811205 on 2015/12/22 by Brian.Karis Pulled clear coat out of the reflection compute shader. Added permutation for skylight. Clear coat base layer now done in base pass. It only picks up the closest capture. This will cause popping when the object moves. Still needs a cross fade. Change 2811275 on 2015/12/22 by David.Hill UE-24675 #rb martin.mittring Corrected buffer-size related problem with fringe. Change 2811397 on 2015/12/22 by Brian.Karis
2016-01-08 11:12:28 -05:00
template< typename TRHICmdList >
void FPostProcessPassParameters::SetCS(const FComputeShaderRHIParamRef& ShaderRHI, const FRenderingCompositePassContext& Context, TRHICmdList& RHICmdList, FSamplerStateRHIParamRef Filter, EFallbackColor FallbackColor, FSamplerStateRHIParamRef* FilterOverrideArray)
{
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2774277 on 2015/11/19 by Gil.Gribb UE4 - Did minor optimizations to the PS4 RHI and drawlists. Change 2791226 on 2015/12/04 by Uriel.Doyon Added source code for Embree 2.7.0 Removed duplicate files from the /doc folder. Change 2800193 on 2015/12/11 by Marcus.Wassmer SSAO AsyncCompute support. #rb Martin.Mittring Change 2801631 on 2015/12/14 by Olaf.Piesche Making auto deactivate true by default, moving checks to HasCompleted, eliminating some unnecessary logic #rb martin.mittring Change 2803240 on 2015/12/15 by Gil.Gribb UE4 - Added command to collect stats on spammy stats. Change 2803476 on 2015/12/15 by Rolando.Caloca DR - Allow toggling compute skin dispatch at runtime - r.SkinCacheShaders Now enable the shaders and feature - r.SkinCaching enables toggling at runtime - r.SkinCache.BufferSize Sets the size in bytes of buffer for outputting - Now uses 3 UAV buffers instead of one (avoid RenderDoc crashes) #codereview Marcus.Wassmer, Martin.Mittring Change 2803940 on 2015/12/15 by Marcus.Wassmer Add r.PS4.AsyncComputeBudgetMode to switch between CUMasking and WaveLimit modes. So far it looks like WaveLimits behave better in UE4. Also rearrange AsyncSSAO to run immediately after HZB to overlap with occlusion queries. In my testing this takes SSAO cost from .5ms -> .2ms. However it had to be hacked to run without normals. Hopefully Martin can get some real AsyncSSAO in. #rb Martin.Mittring #codereview Martin.Mittring Change 2803999 on 2015/12/15 by Uriel.Doyon Refactored the shader complexity material override logic to allow other viewmodes shader overrides. TexelFactorAccuracy ViewMode : shows the accuracy of the static mesh texel factors, used for streaming. WantedMipsAccuracy ViewMode : shows the accuracy of the static mesh wanted mips accuracy, used for streaming. Added an option to stream textures based on the AABB distance instead of using the sphere approximation. Added an option to only keep a the wanted mips. Moved optimization related viewmodes into a submenu to avoid polluting the interface. #jira UE-24502 #jira UE-24503 #jira UERNDR-89 Change 2804150 on 2015/12/15 by Olaf.Piesche make separate translucency screen percentage a bit more robust; add numsamples to the render target creation functions in preparation for MSAA support for higher quality with low res separate translucency #rb martin.mittring Change 2804367 on 2015/12/15 by Daniel.Wright Capsule shadow primitives are tracked separately on registration - saves 2.6ms of RT time doing the view frustum culling in a medium sized map Change 2805293 on 2015/12/16 by Olaf.Piesche logging if potentially immortal emitters are spawned from gameplay; this should catch if we spawn burst only emitters with indefinite life spans (muzzle flashes, hit impacts, etc.) #rb martin.mittring Change 2805586 on 2015/12/16 by Zabir.Hoque Adding support for decals to fade and destroy themselves automatically. #CodeReview: Martin.Mittring, Daniel.Wright, Olaf.Piesche Change 2807663 on 2015/12/17 by Rolando.Caloca DR - Remove expensive logging #codereview Marcus.Wassmer Change 2807903 on 2015/12/17 by Zabir.Hoque Refactored DecalComponent's lifetime management such that it can be set and reset from Blueprints. #CodeReview Daniel.Wright, Martin.Mittring, Olaf.Piesche Change 2809261 on 2015/12/18 by Martin.Mittring Added VisualizeShadingModels to track down issues like that: FORT-16913 Textures on Hero Mesh is not shown #rb:David.Hill #code_review:Bob.Tellez Change 2810136 on 2015/12/21 by Rolando.Caloca DR - Added back draw event colors PR #1602 #jira UE-21526 #codereview Mark.Satterthwaite, Keith.Judge, Marcus.Wassmer, Josh.Adams Change 2810680 on 2015/12/21 by Martin.Mittring moved SSAO ComputeShader running without per pixel normal (for AsyncCompute) into DevRendering #test:editor Change 2811205 on 2015/12/22 by Brian.Karis Pulled clear coat out of the reflection compute shader. Added permutation for skylight. Clear coat base layer now done in base pass. It only picks up the closest capture. This will cause popping when the object moves. Still needs a cross fade. Change 2811275 on 2015/12/22 by David.Hill UE-24675 #rb martin.mittring Corrected buffer-size related problem with fringe. Change 2811397 on 2015/12/22 by Brian.Karis
2016-01-08 11:12:28 -05:00
Set(ShaderRHI, Context, RHICmdList, Filter, FallbackColor, FilterOverrideArray);
}
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2774277 on 2015/11/19 by Gil.Gribb UE4 - Did minor optimizations to the PS4 RHI and drawlists. Change 2791226 on 2015/12/04 by Uriel.Doyon Added source code for Embree 2.7.0 Removed duplicate files from the /doc folder. Change 2800193 on 2015/12/11 by Marcus.Wassmer SSAO AsyncCompute support. #rb Martin.Mittring Change 2801631 on 2015/12/14 by Olaf.Piesche Making auto deactivate true by default, moving checks to HasCompleted, eliminating some unnecessary logic #rb martin.mittring Change 2803240 on 2015/12/15 by Gil.Gribb UE4 - Added command to collect stats on spammy stats. Change 2803476 on 2015/12/15 by Rolando.Caloca DR - Allow toggling compute skin dispatch at runtime - r.SkinCacheShaders Now enable the shaders and feature - r.SkinCaching enables toggling at runtime - r.SkinCache.BufferSize Sets the size in bytes of buffer for outputting - Now uses 3 UAV buffers instead of one (avoid RenderDoc crashes) #codereview Marcus.Wassmer, Martin.Mittring Change 2803940 on 2015/12/15 by Marcus.Wassmer Add r.PS4.AsyncComputeBudgetMode to switch between CUMasking and WaveLimit modes. So far it looks like WaveLimits behave better in UE4. Also rearrange AsyncSSAO to run immediately after HZB to overlap with occlusion queries. In my testing this takes SSAO cost from .5ms -> .2ms. However it had to be hacked to run without normals. Hopefully Martin can get some real AsyncSSAO in. #rb Martin.Mittring #codereview Martin.Mittring Change 2803999 on 2015/12/15 by Uriel.Doyon Refactored the shader complexity material override logic to allow other viewmodes shader overrides. TexelFactorAccuracy ViewMode : shows the accuracy of the static mesh texel factors, used for streaming. WantedMipsAccuracy ViewMode : shows the accuracy of the static mesh wanted mips accuracy, used for streaming. Added an option to stream textures based on the AABB distance instead of using the sphere approximation. Added an option to only keep a the wanted mips. Moved optimization related viewmodes into a submenu to avoid polluting the interface. #jira UE-24502 #jira UE-24503 #jira UERNDR-89 Change 2804150 on 2015/12/15 by Olaf.Piesche make separate translucency screen percentage a bit more robust; add numsamples to the render target creation functions in preparation for MSAA support for higher quality with low res separate translucency #rb martin.mittring Change 2804367 on 2015/12/15 by Daniel.Wright Capsule shadow primitives are tracked separately on registration - saves 2.6ms of RT time doing the view frustum culling in a medium sized map Change 2805293 on 2015/12/16 by Olaf.Piesche logging if potentially immortal emitters are spawned from gameplay; this should catch if we spawn burst only emitters with indefinite life spans (muzzle flashes, hit impacts, etc.) #rb martin.mittring Change 2805586 on 2015/12/16 by Zabir.Hoque Adding support for decals to fade and destroy themselves automatically. #CodeReview: Martin.Mittring, Daniel.Wright, Olaf.Piesche Change 2807663 on 2015/12/17 by Rolando.Caloca DR - Remove expensive logging #codereview Marcus.Wassmer Change 2807903 on 2015/12/17 by Zabir.Hoque Refactored DecalComponent's lifetime management such that it can be set and reset from Blueprints. #CodeReview Daniel.Wright, Martin.Mittring, Olaf.Piesche Change 2809261 on 2015/12/18 by Martin.Mittring Added VisualizeShadingModels to track down issues like that: FORT-16913 Textures on Hero Mesh is not shown #rb:David.Hill #code_review:Bob.Tellez Change 2810136 on 2015/12/21 by Rolando.Caloca DR - Added back draw event colors PR #1602 #jira UE-21526 #codereview Mark.Satterthwaite, Keith.Judge, Marcus.Wassmer, Josh.Adams Change 2810680 on 2015/12/21 by Martin.Mittring moved SSAO ComputeShader running without per pixel normal (for AsyncCompute) into DevRendering #test:editor Change 2811205 on 2015/12/22 by Brian.Karis Pulled clear coat out of the reflection compute shader. Added permutation for skylight. Clear coat base layer now done in base pass. It only picks up the closest capture. This will cause popping when the object moves. Still needs a cross fade. Change 2811275 on 2015/12/22 by David.Hill UE-24675 #rb martin.mittring Corrected buffer-size related problem with fringe. Change 2811397 on 2015/12/22 by Brian.Karis
2016-01-08 11:12:28 -05:00
template void FPostProcessPassParameters::SetCS< FRHICommandListImmediate >(
const FComputeShaderRHIParamRef& ShaderRHI,
const FRenderingCompositePassContext& Context,
FRHICommandListImmediate& RHICmdList,
FSamplerStateRHIParamRef Filter,
EFallbackColor FallbackColor,
FSamplerStateRHIParamRef* FilterOverrideArray
);
template void FPostProcessPassParameters::SetCS< FRHIAsyncComputeCommandListImmediate >(
const FComputeShaderRHIParamRef& ShaderRHI,
const FRenderingCompositePassContext& Context,
FRHIAsyncComputeCommandListImmediate& RHICmdList,
FSamplerStateRHIParamRef Filter,
EFallbackColor FallbackColor,
FSamplerStateRHIParamRef* FilterOverrideArray
);
void FPostProcessPassParameters::SetVS(const FVertexShaderRHIParamRef& ShaderRHI, const FRenderingCompositePassContext& Context, FSamplerStateRHIParamRef Filter, EFallbackColor FallbackColor, FSamplerStateRHIParamRef* FilterOverrideArray)
{
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2774277 on 2015/11/19 by Gil.Gribb UE4 - Did minor optimizations to the PS4 RHI and drawlists. Change 2791226 on 2015/12/04 by Uriel.Doyon Added source code for Embree 2.7.0 Removed duplicate files from the /doc folder. Change 2800193 on 2015/12/11 by Marcus.Wassmer SSAO AsyncCompute support. #rb Martin.Mittring Change 2801631 on 2015/12/14 by Olaf.Piesche Making auto deactivate true by default, moving checks to HasCompleted, eliminating some unnecessary logic #rb martin.mittring Change 2803240 on 2015/12/15 by Gil.Gribb UE4 - Added command to collect stats on spammy stats. Change 2803476 on 2015/12/15 by Rolando.Caloca DR - Allow toggling compute skin dispatch at runtime - r.SkinCacheShaders Now enable the shaders and feature - r.SkinCaching enables toggling at runtime - r.SkinCache.BufferSize Sets the size in bytes of buffer for outputting - Now uses 3 UAV buffers instead of one (avoid RenderDoc crashes) #codereview Marcus.Wassmer, Martin.Mittring Change 2803940 on 2015/12/15 by Marcus.Wassmer Add r.PS4.AsyncComputeBudgetMode to switch between CUMasking and WaveLimit modes. So far it looks like WaveLimits behave better in UE4. Also rearrange AsyncSSAO to run immediately after HZB to overlap with occlusion queries. In my testing this takes SSAO cost from .5ms -> .2ms. However it had to be hacked to run without normals. Hopefully Martin can get some real AsyncSSAO in. #rb Martin.Mittring #codereview Martin.Mittring Change 2803999 on 2015/12/15 by Uriel.Doyon Refactored the shader complexity material override logic to allow other viewmodes shader overrides. TexelFactorAccuracy ViewMode : shows the accuracy of the static mesh texel factors, used for streaming. WantedMipsAccuracy ViewMode : shows the accuracy of the static mesh wanted mips accuracy, used for streaming. Added an option to stream textures based on the AABB distance instead of using the sphere approximation. Added an option to only keep a the wanted mips. Moved optimization related viewmodes into a submenu to avoid polluting the interface. #jira UE-24502 #jira UE-24503 #jira UERNDR-89 Change 2804150 on 2015/12/15 by Olaf.Piesche make separate translucency screen percentage a bit more robust; add numsamples to the render target creation functions in preparation for MSAA support for higher quality with low res separate translucency #rb martin.mittring Change 2804367 on 2015/12/15 by Daniel.Wright Capsule shadow primitives are tracked separately on registration - saves 2.6ms of RT time doing the view frustum culling in a medium sized map Change 2805293 on 2015/12/16 by Olaf.Piesche logging if potentially immortal emitters are spawned from gameplay; this should catch if we spawn burst only emitters with indefinite life spans (muzzle flashes, hit impacts, etc.) #rb martin.mittring Change 2805586 on 2015/12/16 by Zabir.Hoque Adding support for decals to fade and destroy themselves automatically. #CodeReview: Martin.Mittring, Daniel.Wright, Olaf.Piesche Change 2807663 on 2015/12/17 by Rolando.Caloca DR - Remove expensive logging #codereview Marcus.Wassmer Change 2807903 on 2015/12/17 by Zabir.Hoque Refactored DecalComponent's lifetime management such that it can be set and reset from Blueprints. #CodeReview Daniel.Wright, Martin.Mittring, Olaf.Piesche Change 2809261 on 2015/12/18 by Martin.Mittring Added VisualizeShadingModels to track down issues like that: FORT-16913 Textures on Hero Mesh is not shown #rb:David.Hill #code_review:Bob.Tellez Change 2810136 on 2015/12/21 by Rolando.Caloca DR - Added back draw event colors PR #1602 #jira UE-21526 #codereview Mark.Satterthwaite, Keith.Judge, Marcus.Wassmer, Josh.Adams Change 2810680 on 2015/12/21 by Martin.Mittring moved SSAO ComputeShader running without per pixel normal (for AsyncCompute) into DevRendering #test:editor Change 2811205 on 2015/12/22 by Brian.Karis Pulled clear coat out of the reflection compute shader. Added permutation for skylight. Clear coat base layer now done in base pass. It only picks up the closest capture. This will cause popping when the object moves. Still needs a cross fade. Change 2811275 on 2015/12/22 by David.Hill UE-24675 #rb martin.mittring Corrected buffer-size related problem with fringe. Change 2811397 on 2015/12/22 by Brian.Karis
2016-01-08 11:12:28 -05:00
Set(ShaderRHI, Context, Context.RHICmdList, Filter, FallbackColor, FilterOverrideArray);
}
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2774277 on 2015/11/19 by Gil.Gribb UE4 - Did minor optimizations to the PS4 RHI and drawlists. Change 2791226 on 2015/12/04 by Uriel.Doyon Added source code for Embree 2.7.0 Removed duplicate files from the /doc folder. Change 2800193 on 2015/12/11 by Marcus.Wassmer SSAO AsyncCompute support. #rb Martin.Mittring Change 2801631 on 2015/12/14 by Olaf.Piesche Making auto deactivate true by default, moving checks to HasCompleted, eliminating some unnecessary logic #rb martin.mittring Change 2803240 on 2015/12/15 by Gil.Gribb UE4 - Added command to collect stats on spammy stats. Change 2803476 on 2015/12/15 by Rolando.Caloca DR - Allow toggling compute skin dispatch at runtime - r.SkinCacheShaders Now enable the shaders and feature - r.SkinCaching enables toggling at runtime - r.SkinCache.BufferSize Sets the size in bytes of buffer for outputting - Now uses 3 UAV buffers instead of one (avoid RenderDoc crashes) #codereview Marcus.Wassmer, Martin.Mittring Change 2803940 on 2015/12/15 by Marcus.Wassmer Add r.PS4.AsyncComputeBudgetMode to switch between CUMasking and WaveLimit modes. So far it looks like WaveLimits behave better in UE4. Also rearrange AsyncSSAO to run immediately after HZB to overlap with occlusion queries. In my testing this takes SSAO cost from .5ms -> .2ms. However it had to be hacked to run without normals. Hopefully Martin can get some real AsyncSSAO in. #rb Martin.Mittring #codereview Martin.Mittring Change 2803999 on 2015/12/15 by Uriel.Doyon Refactored the shader complexity material override logic to allow other viewmodes shader overrides. TexelFactorAccuracy ViewMode : shows the accuracy of the static mesh texel factors, used for streaming. WantedMipsAccuracy ViewMode : shows the accuracy of the static mesh wanted mips accuracy, used for streaming. Added an option to stream textures based on the AABB distance instead of using the sphere approximation. Added an option to only keep a the wanted mips. Moved optimization related viewmodes into a submenu to avoid polluting the interface. #jira UE-24502 #jira UE-24503 #jira UERNDR-89 Change 2804150 on 2015/12/15 by Olaf.Piesche make separate translucency screen percentage a bit more robust; add numsamples to the render target creation functions in preparation for MSAA support for higher quality with low res separate translucency #rb martin.mittring Change 2804367 on 2015/12/15 by Daniel.Wright Capsule shadow primitives are tracked separately on registration - saves 2.6ms of RT time doing the view frustum culling in a medium sized map Change 2805293 on 2015/12/16 by Olaf.Piesche logging if potentially immortal emitters are spawned from gameplay; this should catch if we spawn burst only emitters with indefinite life spans (muzzle flashes, hit impacts, etc.) #rb martin.mittring Change 2805586 on 2015/12/16 by Zabir.Hoque Adding support for decals to fade and destroy themselves automatically. #CodeReview: Martin.Mittring, Daniel.Wright, Olaf.Piesche Change 2807663 on 2015/12/17 by Rolando.Caloca DR - Remove expensive logging #codereview Marcus.Wassmer Change 2807903 on 2015/12/17 by Zabir.Hoque Refactored DecalComponent's lifetime management such that it can be set and reset from Blueprints. #CodeReview Daniel.Wright, Martin.Mittring, Olaf.Piesche Change 2809261 on 2015/12/18 by Martin.Mittring Added VisualizeShadingModels to track down issues like that: FORT-16913 Textures on Hero Mesh is not shown #rb:David.Hill #code_review:Bob.Tellez Change 2810136 on 2015/12/21 by Rolando.Caloca DR - Added back draw event colors PR #1602 #jira UE-21526 #codereview Mark.Satterthwaite, Keith.Judge, Marcus.Wassmer, Josh.Adams Change 2810680 on 2015/12/21 by Martin.Mittring moved SSAO ComputeShader running without per pixel normal (for AsyncCompute) into DevRendering #test:editor Change 2811205 on 2015/12/22 by Brian.Karis Pulled clear coat out of the reflection compute shader. Added permutation for skylight. Clear coat base layer now done in base pass. It only picks up the closest capture. This will cause popping when the object moves. Still needs a cross fade. Change 2811275 on 2015/12/22 by David.Hill UE-24675 #rb martin.mittring Corrected buffer-size related problem with fringe. Change 2811397 on 2015/12/22 by Brian.Karis
2016-01-08 11:12:28 -05:00
template< typename ShaderRHIParamRef, typename TRHICmdList >
void FPostProcessPassParameters::Set(
const ShaderRHIParamRef& ShaderRHI,
const FRenderingCompositePassContext& Context,
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2774277 on 2015/11/19 by Gil.Gribb UE4 - Did minor optimizations to the PS4 RHI and drawlists. Change 2791226 on 2015/12/04 by Uriel.Doyon Added source code for Embree 2.7.0 Removed duplicate files from the /doc folder. Change 2800193 on 2015/12/11 by Marcus.Wassmer SSAO AsyncCompute support. #rb Martin.Mittring Change 2801631 on 2015/12/14 by Olaf.Piesche Making auto deactivate true by default, moving checks to HasCompleted, eliminating some unnecessary logic #rb martin.mittring Change 2803240 on 2015/12/15 by Gil.Gribb UE4 - Added command to collect stats on spammy stats. Change 2803476 on 2015/12/15 by Rolando.Caloca DR - Allow toggling compute skin dispatch at runtime - r.SkinCacheShaders Now enable the shaders and feature - r.SkinCaching enables toggling at runtime - r.SkinCache.BufferSize Sets the size in bytes of buffer for outputting - Now uses 3 UAV buffers instead of one (avoid RenderDoc crashes) #codereview Marcus.Wassmer, Martin.Mittring Change 2803940 on 2015/12/15 by Marcus.Wassmer Add r.PS4.AsyncComputeBudgetMode to switch between CUMasking and WaveLimit modes. So far it looks like WaveLimits behave better in UE4. Also rearrange AsyncSSAO to run immediately after HZB to overlap with occlusion queries. In my testing this takes SSAO cost from .5ms -> .2ms. However it had to be hacked to run without normals. Hopefully Martin can get some real AsyncSSAO in. #rb Martin.Mittring #codereview Martin.Mittring Change 2803999 on 2015/12/15 by Uriel.Doyon Refactored the shader complexity material override logic to allow other viewmodes shader overrides. TexelFactorAccuracy ViewMode : shows the accuracy of the static mesh texel factors, used for streaming. WantedMipsAccuracy ViewMode : shows the accuracy of the static mesh wanted mips accuracy, used for streaming. Added an option to stream textures based on the AABB distance instead of using the sphere approximation. Added an option to only keep a the wanted mips. Moved optimization related viewmodes into a submenu to avoid polluting the interface. #jira UE-24502 #jira UE-24503 #jira UERNDR-89 Change 2804150 on 2015/12/15 by Olaf.Piesche make separate translucency screen percentage a bit more robust; add numsamples to the render target creation functions in preparation for MSAA support for higher quality with low res separate translucency #rb martin.mittring Change 2804367 on 2015/12/15 by Daniel.Wright Capsule shadow primitives are tracked separately on registration - saves 2.6ms of RT time doing the view frustum culling in a medium sized map Change 2805293 on 2015/12/16 by Olaf.Piesche logging if potentially immortal emitters are spawned from gameplay; this should catch if we spawn burst only emitters with indefinite life spans (muzzle flashes, hit impacts, etc.) #rb martin.mittring Change 2805586 on 2015/12/16 by Zabir.Hoque Adding support for decals to fade and destroy themselves automatically. #CodeReview: Martin.Mittring, Daniel.Wright, Olaf.Piesche Change 2807663 on 2015/12/17 by Rolando.Caloca DR - Remove expensive logging #codereview Marcus.Wassmer Change 2807903 on 2015/12/17 by Zabir.Hoque Refactored DecalComponent's lifetime management such that it can be set and reset from Blueprints. #CodeReview Daniel.Wright, Martin.Mittring, Olaf.Piesche Change 2809261 on 2015/12/18 by Martin.Mittring Added VisualizeShadingModels to track down issues like that: FORT-16913 Textures on Hero Mesh is not shown #rb:David.Hill #code_review:Bob.Tellez Change 2810136 on 2015/12/21 by Rolando.Caloca DR - Added back draw event colors PR #1602 #jira UE-21526 #codereview Mark.Satterthwaite, Keith.Judge, Marcus.Wassmer, Josh.Adams Change 2810680 on 2015/12/21 by Martin.Mittring moved SSAO ComputeShader running without per pixel normal (for AsyncCompute) into DevRendering #test:editor Change 2811205 on 2015/12/22 by Brian.Karis Pulled clear coat out of the reflection compute shader. Added permutation for skylight. Clear coat base layer now done in base pass. It only picks up the closest capture. This will cause popping when the object moves. Still needs a cross fade. Change 2811275 on 2015/12/22 by David.Hill UE-24675 #rb martin.mittring Corrected buffer-size related problem with fringe. Change 2811397 on 2015/12/22 by Brian.Karis
2016-01-08 11:12:28 -05:00
TRHICmdList& RHICmdList,
FSamplerStateRHIParamRef Filter,
EFallbackColor FallbackColor,
FSamplerStateRHIParamRef* FilterOverrideArray)
{
// assuming all outputs have the same size
FRenderingCompositeOutput* Output = Context.Pass->GetOutput(ePId_Output0);
// Output0 should always exist
check(Output);
// one should be on
check(FilterOverrideArray || Filter);
// but not both
check(!FilterOverrideArray || !Filter);
if(BilinearTextureSampler0.IsBound())
{
RHICmdList.SetShaderSampler(
ShaderRHI,
BilinearTextureSampler0.GetBaseIndex(),
TStaticSamplerState<SF_Bilinear>::GetRHI()
);
}
if(BilinearTextureSampler1.IsBound())
{
RHICmdList.SetShaderSampler(
ShaderRHI,
BilinearTextureSampler1.GetBaseIndex(),
TStaticSamplerState<SF_Bilinear>::GetRHI()
);
}
if(ViewportSize.IsBound() || ScreenPosToPixel.IsBound() || ViewportRect.IsBound())
{
FIntRect LocalViewport = Context.GetViewport();
FIntPoint ViewportOffset = LocalViewport.Min;
FIntPoint ViewportExtent = LocalViewport.Size();
{
FVector4 Value(ViewportExtent.X, ViewportExtent.Y, 1.0f / ViewportExtent.X, 1.0f / ViewportExtent.Y);
SetShaderValue(RHICmdList, ShaderRHI, ViewportSize, Value);
}
{
SetShaderValue(RHICmdList, ShaderRHI, ViewportRect, Context.GetViewport());
}
{
FVector4 ScreenPosToPixelValue(
ViewportExtent.X * 0.5f,
-ViewportExtent.Y * 0.5f,
ViewportExtent.X * 0.5f - 0.5f + ViewportOffset.X,
ViewportExtent.Y * 0.5f - 0.5f + ViewportOffset.Y);
SetShaderValue(RHICmdList, ShaderRHI, ScreenPosToPixel, ScreenPosToPixelValue);
}
}
//Calculate a base scene texture min max which will be pulled in by a pixel for each PP input.
FIntRect ContextViewportRect = Context.IsViewportValid() ? Context.GetViewport() : FIntRect(0,0,0,0);
const FIntPoint SceneRTSize = FSceneRenderTargets::Get(RHICmdList).GetBufferSizeXY();
FVector4 BaseSceneTexMinMax( ((float)ContextViewportRect.Min.X/SceneRTSize.X),
((float)ContextViewportRect.Min.Y/SceneRTSize.Y),
((float)ContextViewportRect.Max.X/SceneRTSize.X),
((float)ContextViewportRect.Max.Y/SceneRTSize.Y) );
IPooledRenderTarget* FallbackTexture = 0;
switch(FallbackColor)
{
case eFC_0000: FallbackTexture = GSystemTextures.BlackDummy; break;
case eFC_0001: FallbackTexture = GSystemTextures.BlackAlphaOneDummy; break;
case eFC_1111: FallbackTexture = GSystemTextures.WhiteDummy; break;
default:
ensure(!"Unhandled enum in EFallbackColor");
}
// ePId_Input0, ePId_Input1, ...
for(uint32 Id = 0; Id < (uint32)ePId_Input_MAX; ++Id)
{
FRenderingCompositeOutputRef* OutputRef = Context.Pass->GetInput((EPassInputId)Id);
if(!OutputRef)
{
// Pass doesn't have more inputs
break;
}
const auto FeatureLevel = Context.GetFeatureLevel();
FRenderingCompositeOutput* Input = OutputRef->GetOutput();
TRefCountPtr<IPooledRenderTarget> InputPooledElement;
if(Input)
{
InputPooledElement = Input->RequestInput();
}
FSamplerStateRHIParamRef LocalFilter = FilterOverrideArray ? FilterOverrideArray[Id] : Filter;
if(InputPooledElement)
{
check(!InputPooledElement->IsFree());
const FTextureRHIRef& SrcTexture = InputPooledElement->GetRenderTargetItem().ShaderResourceTexture;
SetTextureParameter(RHICmdList, ShaderRHI, PostprocessInputParameter[Id], PostprocessInputParameterSampler[Id], LocalFilter, SrcTexture);
if(PostprocessInputSizeParameter[Id].IsBound() || PostProcessInputMinMaxParameter[Id].IsBound())
{
float Width = InputPooledElement->GetDesc().Extent.X;
float Height = InputPooledElement->GetDesc().Extent.Y;
FVector2D OnePPInputPixelUVSize = FVector2D(1.0f / Width, 1.0f / Height);
FVector4 TextureSize(Width, Height, OnePPInputPixelUVSize.X, OnePPInputPixelUVSize.Y);
SetShaderValue(RHICmdList, ShaderRHI, PostprocessInputSizeParameter[Id], TextureSize);
//We could use the main scene min max here if it weren't that we need to pull the max in by a pixel on a per input basis.
FVector4 PPInputMinMax = BaseSceneTexMinMax;
PPInputMinMax.Z -= OnePPInputPixelUVSize.X;
PPInputMinMax.W -= OnePPInputPixelUVSize.Y;
SetShaderValue(RHICmdList, ShaderRHI, PostProcessInputMinMaxParameter[Id], PPInputMinMax);
}
}
else
{
// if the input is not there but the shader request it we give it at least some data to avoid d3ddebug errors and shader permutations
// to make features optional we use default black for additive passes without shader permutations
SetTextureParameter(RHICmdList, ShaderRHI, PostprocessInputParameter[Id], PostprocessInputParameterSampler[Id], LocalFilter, FallbackTexture->GetRenderTargetItem().TargetableTexture);
FVector4 Dummy(1, 1, 1, 1);
SetShaderValue(RHICmdList, ShaderRHI, PostprocessInputSizeParameter[Id], Dummy);
SetShaderValue(RHICmdList, ShaderRHI, PostProcessInputMinMaxParameter[Id], Dummy);
}
}
// todo warning if Input[] or InputSize[] is bound but not available, maybe set a specific input texture (blinking?)
}
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2774277 on 2015/11/19 by Gil.Gribb UE4 - Did minor optimizations to the PS4 RHI and drawlists. Change 2791226 on 2015/12/04 by Uriel.Doyon Added source code for Embree 2.7.0 Removed duplicate files from the /doc folder. Change 2800193 on 2015/12/11 by Marcus.Wassmer SSAO AsyncCompute support. #rb Martin.Mittring Change 2801631 on 2015/12/14 by Olaf.Piesche Making auto deactivate true by default, moving checks to HasCompleted, eliminating some unnecessary logic #rb martin.mittring Change 2803240 on 2015/12/15 by Gil.Gribb UE4 - Added command to collect stats on spammy stats. Change 2803476 on 2015/12/15 by Rolando.Caloca DR - Allow toggling compute skin dispatch at runtime - r.SkinCacheShaders Now enable the shaders and feature - r.SkinCaching enables toggling at runtime - r.SkinCache.BufferSize Sets the size in bytes of buffer for outputting - Now uses 3 UAV buffers instead of one (avoid RenderDoc crashes) #codereview Marcus.Wassmer, Martin.Mittring Change 2803940 on 2015/12/15 by Marcus.Wassmer Add r.PS4.AsyncComputeBudgetMode to switch between CUMasking and WaveLimit modes. So far it looks like WaveLimits behave better in UE4. Also rearrange AsyncSSAO to run immediately after HZB to overlap with occlusion queries. In my testing this takes SSAO cost from .5ms -> .2ms. However it had to be hacked to run without normals. Hopefully Martin can get some real AsyncSSAO in. #rb Martin.Mittring #codereview Martin.Mittring Change 2803999 on 2015/12/15 by Uriel.Doyon Refactored the shader complexity material override logic to allow other viewmodes shader overrides. TexelFactorAccuracy ViewMode : shows the accuracy of the static mesh texel factors, used for streaming. WantedMipsAccuracy ViewMode : shows the accuracy of the static mesh wanted mips accuracy, used for streaming. Added an option to stream textures based on the AABB distance instead of using the sphere approximation. Added an option to only keep a the wanted mips. Moved optimization related viewmodes into a submenu to avoid polluting the interface. #jira UE-24502 #jira UE-24503 #jira UERNDR-89 Change 2804150 on 2015/12/15 by Olaf.Piesche make separate translucency screen percentage a bit more robust; add numsamples to the render target creation functions in preparation for MSAA support for higher quality with low res separate translucency #rb martin.mittring Change 2804367 on 2015/12/15 by Daniel.Wright Capsule shadow primitives are tracked separately on registration - saves 2.6ms of RT time doing the view frustum culling in a medium sized map Change 2805293 on 2015/12/16 by Olaf.Piesche logging if potentially immortal emitters are spawned from gameplay; this should catch if we spawn burst only emitters with indefinite life spans (muzzle flashes, hit impacts, etc.) #rb martin.mittring Change 2805586 on 2015/12/16 by Zabir.Hoque Adding support for decals to fade and destroy themselves automatically. #CodeReview: Martin.Mittring, Daniel.Wright, Olaf.Piesche Change 2807663 on 2015/12/17 by Rolando.Caloca DR - Remove expensive logging #codereview Marcus.Wassmer Change 2807903 on 2015/12/17 by Zabir.Hoque Refactored DecalComponent's lifetime management such that it can be set and reset from Blueprints. #CodeReview Daniel.Wright, Martin.Mittring, Olaf.Piesche Change 2809261 on 2015/12/18 by Martin.Mittring Added VisualizeShadingModels to track down issues like that: FORT-16913 Textures on Hero Mesh is not shown #rb:David.Hill #code_review:Bob.Tellez Change 2810136 on 2015/12/21 by Rolando.Caloca DR - Added back draw event colors PR #1602 #jira UE-21526 #codereview Mark.Satterthwaite, Keith.Judge, Marcus.Wassmer, Josh.Adams Change 2810680 on 2015/12/21 by Martin.Mittring moved SSAO ComputeShader running without per pixel normal (for AsyncCompute) into DevRendering #test:editor Change 2811205 on 2015/12/22 by Brian.Karis Pulled clear coat out of the reflection compute shader. Added permutation for skylight. Clear coat base layer now done in base pass. It only picks up the closest capture. This will cause popping when the object moves. Still needs a cross fade. Change 2811275 on 2015/12/22 by David.Hill UE-24675 #rb martin.mittring Corrected buffer-size related problem with fringe. Change 2811397 on 2015/12/22 by Brian.Karis
2016-01-08 11:12:28 -05:00
#define IMPLEMENT_POST_PROCESS_PARAM_SET( ShaderRHIParamRef, TRHICmdList ) \
template void FPostProcessPassParameters::Set< ShaderRHIParamRef >( \
const ShaderRHIParamRef& ShaderRHI, \
const FRenderingCompositePassContext& Context, \
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2774277 on 2015/11/19 by Gil.Gribb UE4 - Did minor optimizations to the PS4 RHI and drawlists. Change 2791226 on 2015/12/04 by Uriel.Doyon Added source code for Embree 2.7.0 Removed duplicate files from the /doc folder. Change 2800193 on 2015/12/11 by Marcus.Wassmer SSAO AsyncCompute support. #rb Martin.Mittring Change 2801631 on 2015/12/14 by Olaf.Piesche Making auto deactivate true by default, moving checks to HasCompleted, eliminating some unnecessary logic #rb martin.mittring Change 2803240 on 2015/12/15 by Gil.Gribb UE4 - Added command to collect stats on spammy stats. Change 2803476 on 2015/12/15 by Rolando.Caloca DR - Allow toggling compute skin dispatch at runtime - r.SkinCacheShaders Now enable the shaders and feature - r.SkinCaching enables toggling at runtime - r.SkinCache.BufferSize Sets the size in bytes of buffer for outputting - Now uses 3 UAV buffers instead of one (avoid RenderDoc crashes) #codereview Marcus.Wassmer, Martin.Mittring Change 2803940 on 2015/12/15 by Marcus.Wassmer Add r.PS4.AsyncComputeBudgetMode to switch between CUMasking and WaveLimit modes. So far it looks like WaveLimits behave better in UE4. Also rearrange AsyncSSAO to run immediately after HZB to overlap with occlusion queries. In my testing this takes SSAO cost from .5ms -> .2ms. However it had to be hacked to run without normals. Hopefully Martin can get some real AsyncSSAO in. #rb Martin.Mittring #codereview Martin.Mittring Change 2803999 on 2015/12/15 by Uriel.Doyon Refactored the shader complexity material override logic to allow other viewmodes shader overrides. TexelFactorAccuracy ViewMode : shows the accuracy of the static mesh texel factors, used for streaming. WantedMipsAccuracy ViewMode : shows the accuracy of the static mesh wanted mips accuracy, used for streaming. Added an option to stream textures based on the AABB distance instead of using the sphere approximation. Added an option to only keep a the wanted mips. Moved optimization related viewmodes into a submenu to avoid polluting the interface. #jira UE-24502 #jira UE-24503 #jira UERNDR-89 Change 2804150 on 2015/12/15 by Olaf.Piesche make separate translucency screen percentage a bit more robust; add numsamples to the render target creation functions in preparation for MSAA support for higher quality with low res separate translucency #rb martin.mittring Change 2804367 on 2015/12/15 by Daniel.Wright Capsule shadow primitives are tracked separately on registration - saves 2.6ms of RT time doing the view frustum culling in a medium sized map Change 2805293 on 2015/12/16 by Olaf.Piesche logging if potentially immortal emitters are spawned from gameplay; this should catch if we spawn burst only emitters with indefinite life spans (muzzle flashes, hit impacts, etc.) #rb martin.mittring Change 2805586 on 2015/12/16 by Zabir.Hoque Adding support for decals to fade and destroy themselves automatically. #CodeReview: Martin.Mittring, Daniel.Wright, Olaf.Piesche Change 2807663 on 2015/12/17 by Rolando.Caloca DR - Remove expensive logging #codereview Marcus.Wassmer Change 2807903 on 2015/12/17 by Zabir.Hoque Refactored DecalComponent's lifetime management such that it can be set and reset from Blueprints. #CodeReview Daniel.Wright, Martin.Mittring, Olaf.Piesche Change 2809261 on 2015/12/18 by Martin.Mittring Added VisualizeShadingModels to track down issues like that: FORT-16913 Textures on Hero Mesh is not shown #rb:David.Hill #code_review:Bob.Tellez Change 2810136 on 2015/12/21 by Rolando.Caloca DR - Added back draw event colors PR #1602 #jira UE-21526 #codereview Mark.Satterthwaite, Keith.Judge, Marcus.Wassmer, Josh.Adams Change 2810680 on 2015/12/21 by Martin.Mittring moved SSAO ComputeShader running without per pixel normal (for AsyncCompute) into DevRendering #test:editor Change 2811205 on 2015/12/22 by Brian.Karis Pulled clear coat out of the reflection compute shader. Added permutation for skylight. Clear coat base layer now done in base pass. It only picks up the closest capture. This will cause popping when the object moves. Still needs a cross fade. Change 2811275 on 2015/12/22 by David.Hill UE-24675 #rb martin.mittring Corrected buffer-size related problem with fringe. Change 2811397 on 2015/12/22 by Brian.Karis
2016-01-08 11:12:28 -05:00
TRHICmdList& RHICmdList, \
FSamplerStateRHIParamRef Filter, \
EFallbackColor FallbackColor, \
FSamplerStateRHIParamRef* FilterOverrideArray \
);
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2774277 on 2015/11/19 by Gil.Gribb UE4 - Did minor optimizations to the PS4 RHI and drawlists. Change 2791226 on 2015/12/04 by Uriel.Doyon Added source code for Embree 2.7.0 Removed duplicate files from the /doc folder. Change 2800193 on 2015/12/11 by Marcus.Wassmer SSAO AsyncCompute support. #rb Martin.Mittring Change 2801631 on 2015/12/14 by Olaf.Piesche Making auto deactivate true by default, moving checks to HasCompleted, eliminating some unnecessary logic #rb martin.mittring Change 2803240 on 2015/12/15 by Gil.Gribb UE4 - Added command to collect stats on spammy stats. Change 2803476 on 2015/12/15 by Rolando.Caloca DR - Allow toggling compute skin dispatch at runtime - r.SkinCacheShaders Now enable the shaders and feature - r.SkinCaching enables toggling at runtime - r.SkinCache.BufferSize Sets the size in bytes of buffer for outputting - Now uses 3 UAV buffers instead of one (avoid RenderDoc crashes) #codereview Marcus.Wassmer, Martin.Mittring Change 2803940 on 2015/12/15 by Marcus.Wassmer Add r.PS4.AsyncComputeBudgetMode to switch between CUMasking and WaveLimit modes. So far it looks like WaveLimits behave better in UE4. Also rearrange AsyncSSAO to run immediately after HZB to overlap with occlusion queries. In my testing this takes SSAO cost from .5ms -> .2ms. However it had to be hacked to run without normals. Hopefully Martin can get some real AsyncSSAO in. #rb Martin.Mittring #codereview Martin.Mittring Change 2803999 on 2015/12/15 by Uriel.Doyon Refactored the shader complexity material override logic to allow other viewmodes shader overrides. TexelFactorAccuracy ViewMode : shows the accuracy of the static mesh texel factors, used for streaming. WantedMipsAccuracy ViewMode : shows the accuracy of the static mesh wanted mips accuracy, used for streaming. Added an option to stream textures based on the AABB distance instead of using the sphere approximation. Added an option to only keep a the wanted mips. Moved optimization related viewmodes into a submenu to avoid polluting the interface. #jira UE-24502 #jira UE-24503 #jira UERNDR-89 Change 2804150 on 2015/12/15 by Olaf.Piesche make separate translucency screen percentage a bit more robust; add numsamples to the render target creation functions in preparation for MSAA support for higher quality with low res separate translucency #rb martin.mittring Change 2804367 on 2015/12/15 by Daniel.Wright Capsule shadow primitives are tracked separately on registration - saves 2.6ms of RT time doing the view frustum culling in a medium sized map Change 2805293 on 2015/12/16 by Olaf.Piesche logging if potentially immortal emitters are spawned from gameplay; this should catch if we spawn burst only emitters with indefinite life spans (muzzle flashes, hit impacts, etc.) #rb martin.mittring Change 2805586 on 2015/12/16 by Zabir.Hoque Adding support for decals to fade and destroy themselves automatically. #CodeReview: Martin.Mittring, Daniel.Wright, Olaf.Piesche Change 2807663 on 2015/12/17 by Rolando.Caloca DR - Remove expensive logging #codereview Marcus.Wassmer Change 2807903 on 2015/12/17 by Zabir.Hoque Refactored DecalComponent's lifetime management such that it can be set and reset from Blueprints. #CodeReview Daniel.Wright, Martin.Mittring, Olaf.Piesche Change 2809261 on 2015/12/18 by Martin.Mittring Added VisualizeShadingModels to track down issues like that: FORT-16913 Textures on Hero Mesh is not shown #rb:David.Hill #code_review:Bob.Tellez Change 2810136 on 2015/12/21 by Rolando.Caloca DR - Added back draw event colors PR #1602 #jira UE-21526 #codereview Mark.Satterthwaite, Keith.Judge, Marcus.Wassmer, Josh.Adams Change 2810680 on 2015/12/21 by Martin.Mittring moved SSAO ComputeShader running without per pixel normal (for AsyncCompute) into DevRendering #test:editor Change 2811205 on 2015/12/22 by Brian.Karis Pulled clear coat out of the reflection compute shader. Added permutation for skylight. Clear coat base layer now done in base pass. It only picks up the closest capture. This will cause popping when the object moves. Still needs a cross fade. Change 2811275 on 2015/12/22 by David.Hill UE-24675 #rb martin.mittring Corrected buffer-size related problem with fringe. Change 2811397 on 2015/12/22 by Brian.Karis
2016-01-08 11:12:28 -05:00
IMPLEMENT_POST_PROCESS_PARAM_SET( FVertexShaderRHIParamRef, FRHICommandListImmediate );
IMPLEMENT_POST_PROCESS_PARAM_SET( FHullShaderRHIParamRef, FRHICommandListImmediate );
IMPLEMENT_POST_PROCESS_PARAM_SET( FDomainShaderRHIParamRef, FRHICommandListImmediate );
IMPLEMENT_POST_PROCESS_PARAM_SET( FGeometryShaderRHIParamRef, FRHICommandListImmediate );
IMPLEMENT_POST_PROCESS_PARAM_SET( FPixelShaderRHIParamRef, FRHICommandListImmediate );
IMPLEMENT_POST_PROCESS_PARAM_SET( FComputeShaderRHIParamRef, FRHICommandListImmediate );
IMPLEMENT_POST_PROCESS_PARAM_SET( FComputeShaderRHIParamRef, FRHIAsyncComputeCommandListImmediate );
FArchive& operator<<(FArchive& Ar, FPostProcessPassParameters& P)
{
Ar << P.BilinearTextureSampler0 << P.BilinearTextureSampler1 << P.ViewportSize << P.ScreenPosToPixel << P.ViewportRect;
for(uint32 i = 0; i < ePId_Input_MAX; ++i)
{
Ar << P.PostprocessInputParameter[i];
Ar << P.PostprocessInputParameterSampler[i];
Ar << P.PostprocessInputSizeParameter[i];
Ar << P.PostProcessInputMinMaxParameter[i];
}
return Ar;
}
// -----------------------------------------------------------------
const FSceneRenderTargetItem& FRenderingCompositeOutput::RequestSurface(const FRenderingCompositePassContext& Context)
{
if(PooledRenderTarget)
{
Context.RHICmdList.TransitionResource(EResourceTransitionAccess::EWritable, PooledRenderTarget->GetRenderTargetItem().TargetableTexture);
return PooledRenderTarget->GetRenderTargetItem();
}
if(!RenderTargetDesc.IsValid())
{
// useful to use the CompositingGraph dependency resolve but pass the data between nodes differently
static FSceneRenderTargetItem Null;
return Null;
}
if(!PooledRenderTarget)
{
GRenderTargetPool.FindFreeElement(Context.RHICmdList, RenderTargetDesc, PooledRenderTarget, RenderTargetDesc.DebugName);
}
check(!PooledRenderTarget->IsFree());
FSceneRenderTargetItem& RenderTargetItem = PooledRenderTarget->GetRenderTargetItem();
return RenderTargetItem;
}
const FPooledRenderTargetDesc* FRenderingCompositePass::GetInputDesc(EPassInputId InPassInputId) const
{
// to overcome const issues, this way it's kept local
FRenderingCompositePass* This = (FRenderingCompositePass*)this;
const FRenderingCompositeOutputRef* OutputRef = This->GetInput(InPassInputId);
if(!OutputRef)
{
return 0;
}
FRenderingCompositeOutput* Input = OutputRef->GetOutput();
if(!Input)
{
return 0;
}
return &Input->RenderTargetDesc;
}
uint32 FRenderingCompositePass::ComputeInputCount()
{
for(uint32 i = 0; ; ++i)
{
if(!GetInput((EPassInputId)i))
{
return i;
}
}
}
uint32 FRenderingCompositePass::ComputeOutputCount()
{
for(uint32 i = 0; ; ++i)
{
if(!GetOutput((EPassOutputId)i))
{
return i;
}
}
}
FString FRenderingCompositePass::ConstructDebugName()
{
FString Name;
uint32 OutputId = 0;
while(FRenderingCompositeOutput* Output = GetOutput((EPassOutputId)OutputId))
{
Name += Output->RenderTargetDesc.DebugName;
++OutputId;
}
if(Name.IsEmpty())
{
Name = TEXT("UnknownName");
}
return Name;
}