Files
UnrealEngineUWP/Engine/Source/Runtime/Renderer/Private/DebugViewModeRendering.cpp

586 lines
25 KiB
C++
Raw Normal View History

// Copyright Epic Games, Inc. All Rights Reserved.
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
/*=============================================================================
DebugViewModeRendering.cpp: Contains definitions for rendering debug viewmodes.
=============================================================================*/
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 "DebugViewModeRendering.h"
#include "Materials/Material.h"
#include "PrimitiveSceneInfo.h"
#include "ScenePrivate.h"
#include "PostProcessing.h"
#include "PostProcess/PostProcessVisualizeComplexity.h"
#include "PostProcess/PostProcessStreamingAccuracyLegend.h"
#include "PostProcess/PostProcessSelectionOutline.h"
#include "PostProcess/PostProcessCompositeEditorPrimitives.h"
#include "PostProcess/PostProcessUpscale.h"
#include "PostProcess/TemporalAA.h"
#include "SceneRendering.h"
#include "DeferredShadingRenderer.h"
#include "MeshPassProcessor.inl"
IMPLEMENT_GLOBAL_SHADER_PARAMETER_STRUCT(FDebugViewModeUniformParameters, "DebugViewModeStruct");
IMPLEMENT_STATIC_UNIFORM_BUFFER_STRUCT(FDebugViewModePassUniformParameters, "DebugViewModePass", SceneTextures);
#if WITH_DEBUG_VIEW_MODES
int32 GCacheShaderComplexityShaders = 0;
static FAutoConsoleVariableRef CVarCacheShaderComplexityShaders(
TEXT("r.ShaderComplexity.CacheShaders"),
GCacheShaderComplexityShaders,
TEXT("If non zero, store the shader complexity shaders in the material shader map, to prevent compile on-the-fly lag. (default=0)"),
ECVF_ReadOnly
);
int32 GShaderComplexityBaselineForwardVS = 134;
static FAutoConsoleVariableRef CVarShaderComplexityBaselineForwardVS(
TEXT("r.ShaderComplexity.Baseline.Forward.VS"),
GShaderComplexityBaselineForwardVS,
TEXT("Minimum number of instructions for vertex shaders in forward shading (default=134)"),
ECVF_Default
);
int32 GShaderComplexityBaselineForwardPS = 635;
static FAutoConsoleVariableRef CVarShaderComplexityBaselineForwardPS(
TEXT("r.ShaderComplexity.Baseline.Forward.PS"),
GShaderComplexityBaselineForwardPS,
TEXT("Minimum number of instructions for pixel shaders in forward shading (default=635)"),
ECVF_Default
);
int32 GShaderComplexityBaselineForwardUnlitPS = 47;
static FAutoConsoleVariableRef CVarShaderComplexityBaselineForwardUnlitPS(
TEXT("r.ShaderComplexity.Baseline.Forward.UnlitPS"),
GShaderComplexityBaselineForwardUnlitPS,
TEXT("Minimum number of instructions for unlit material pixel shaders in forward shading (default=47)"),
ECVF_Default
);
int32 GShaderComplexityBaselineDeferredVS = 41;
static FAutoConsoleVariableRef CVarShaderComplexityBaselineDeferredVS(
TEXT("r.ShaderComplexity.Baseline.Deferred.VS"),
GShaderComplexityBaselineDeferredVS,
TEXT("Minimum number of instructions for vertex shaders in deferred shading (default=41)"),
ECVF_Default
);
int32 GShaderComplexityBaselineDeferredPS = 111;
static FAutoConsoleVariableRef CVarShaderComplexityBaselineDeferredPS(
TEXT("r.ShaderComplexity.Baseline.Deferred.PS"),
GShaderComplexityBaselineDeferredPS,
TEXT("Minimum number of instructions for pixel shaders in deferred shading (default=111)"),
ECVF_Default
);
int32 GShaderComplexityBaselineDeferredUnlitPS = 33;
static FAutoConsoleVariableRef CVarShaderComplexityBaselineDeferredUnlitPS(
TEXT("r.ShaderComplexity.Baseline.Deferred.UnlitPS"),
GShaderComplexityBaselineDeferredUnlitPS,
TEXT("Minimum number of instructions for unlit material pixel shaders in deferred shading (default=33)"),
ECVF_Default
);
IMPLEMENT_MATERIAL_SHADER_TYPE(, FDebugViewModePS, TEXT("/Engine/Private/DebugViewModePixelShader.usf"), TEXT("Main"), SF_Pixel);
int32 GetQuadOverdrawUAVIndex(EShaderPlatform Platform, ERHIFeatureLevel::Type FeatureLevel)
{
if (IsSimpleForwardShadingEnabled(Platform))
{
return 1;
}
else if (IsForwardShadingEnabled(Platform))
{
return FVelocityRendering::BasePassCanOutputVelocity(FeatureLevel) ? 2 : 1;
}
else // GBuffer
{
return FVelocityRendering::BasePassCanOutputVelocity(FeatureLevel) ? 7 : 6;
}
}
void SetupDebugViewModePassUniformBufferConstants(const FViewInfo& ViewInfo, FDebugViewModeUniformParameters& Parameters)
{
// Accuracy colors
{
const int32 NumEngineColors = FMath::Min<int32>(GEngine->StreamingAccuracyColors.Num(), NumStreamingAccuracyColors);
int32 ColorIndex = 0;
for (; ColorIndex < NumEngineColors; ++ColorIndex)
{
Parameters.AccuracyColors[ColorIndex] = GEngine->StreamingAccuracyColors[ColorIndex];
}
for (; ColorIndex < NumStreamingAccuracyColors; ++ColorIndex)
{
Parameters.AccuracyColors[ColorIndex] = FLinearColor::Black;
}
}
// LOD / HLOD colors
{
const TArray<FLinearColor>* Colors = nullptr;
if (ViewInfo.Family->EngineShowFlags.LODColoration)
{
Colors = &(GEngine->LODColorationColors);
}
else if (ViewInfo.Family->EngineShowFlags.HLODColoration)
{
Colors = &GEngine->HLODColorationColors;
}
const int32 NumColors = Colors ? FMath::Min<int32>(NumLODColorationColors, Colors->Num()) : 0;
int32 ColorIndex = 0;
for (; ColorIndex < NumColors; ++ColorIndex)
{
Parameters.LODColors[ColorIndex] = (*Colors)[ColorIndex];
}
for (; ColorIndex < NumLODColorationColors; ++ColorIndex)
{
Parameters.LODColors[ColorIndex] = NumColors > 0 ? Colors->Last() : FLinearColor::Black;
}
}
}
TRDGUniformBufferRef<FDebugViewModePassUniformParameters> CreateDebugViewModePassUniformBuffer(FRDGBuilder& GraphBuilder, const FViewInfo& View, FRDGTextureRef QuadOverdrawTexture)
{
if (!QuadOverdrawTexture)
{
QuadOverdrawTexture = GraphBuilder.CreateTexture(FRDGTextureDesc::Create2D(FIntPoint(1, 1), PF_R32_UINT, FClearValueBinding::None, TexCreate_UAV), TEXT("DummyOverdrawUAV"));
}
auto* UniformBufferParameters = GraphBuilder.AllocParameters<FDebugViewModePassUniformParameters>();
UE5_MAIN: Multi-view-family scene renderer refactor, part 2. Move FSceneTextures singleton out of RDG blackboard and FSceneTexturesConfig global variable singleton, into FViewFamilyInfo. This is necessary to allow multiple view families to render in a single render graph and a single scene renderer call. * Existing calls to CreateSceneTextureShaderParameters and similar functions use "GetSceneTexturesChecked", which allows for the possibility that they are reached in a code path where scene textures haven't been initialized, and nullptr is returned instead of asserting. The shader parameter setup functions then fill in dummy defaults for that case. The goal was to precisely match the original behavior, which queried the RDG blackboard, and gracefully handled null if scene textures weren't there. This definitely appears to occur in FNiagaraGpuComputeDispatch::ProcessPendingTicksFlush, which can be called with a dummy scene with no scene textures. In the future, I may change this so dummy defaults are filled in for FSceneTextures at construction time, so the structure is never in an uninitialized state, but I would like to set up a test case for the Niagara code path before doing that, and the checks aren't harmful in the meantime. * I marked as deprecated global functions which query values from FSceneTexturesConfig, but they'll still work with the caveat that if you use multi-view-family rendering, the results will be indeterminate (whatever view family rendered last). There was only one case outside the scene renderer that accessed the globals (depth clear value), which I removed, noting that there is nowhere in the code where we modify the depth clear value from its global default. I would like to permanently deprecate or remove these at some point. Display Cluster is the only code that's currently using the multi-view-family code path, and as a new (still incomplete) feature, third party code can't be using it, and won't be affected. #jira NONE #rb chris.kulla zach.bethel mihnea.balta #preflight 6261aca76119a1a496bd2644 [CL 19873983 by jason hoerner in ue5-main branch]
2022-04-22 17:33:02 -04:00
SetupSceneTextureUniformParameters(GraphBuilder, View.GetSceneTexturesChecked(), View.FeatureLevel, ESceneTextureSetupMode::None, UniformBufferParameters->SceneTextures);
SetupDebugViewModePassUniformBufferConstants(View, UniformBufferParameters->DebugViewMode);
UniformBufferParameters->QuadOverdraw = GraphBuilder.CreateUAV(QuadOverdrawTexture);
return GraphBuilder.CreateUniformBuffer(UniformBufferParameters);
}
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
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3511476) #lockdown Nick.Penwarden ===================================== MAJOR FEATURES + CHANGES ===================================== Change 3372740 by Chris.Bunner [Experimental] Partial compute post process pipeline (r.PostProcess.PreferCompute). StencilSceneTexture added to deferred list. A few known issues to be fixed in a follow-up CL. Change 3374187 by Chris.Bunner Volume texture support for CombineLUTs/Tonemap compute pass. Refactored common param code to shared sub-class in CombineLUTs and Tonemap PS/CS. Skip compute post process out-of-bounds writes. Unsigned type conversion fixes. Trimmed compute post process shader inputs. Change 3441680 by Uriel.Doyon Added units to point light intensity, to allow the user to specify the value in candelas or lumens. New point light actors now configure the intensity in candelas by default. Replaced viewport exposure settings by an EV100 slider. Hidding the tone mapper in the show flag now still applies the exposure. Added a new AutoExposure method called EV100 which allows to specify : - MinEV100, MaxEV100 - Calibration Constnat - Exposure Compensation #jira UE-42783 Change 3454636 by Uriel.Doyon Fixed point light having an extra scale of 16 in mobile #jira UE-45272 Change 3454844 by Uriel.Doyon Fixed extra X16 on some point lights #jira UE-45250 Change 3454934 by Chris.Bunner Backing out changelists 3441680, 3454636 and 3454844 for the sake of integration stability. Change 3461206 by Guillaume.Abadie Adds possibility to scene captures and player controller to render no primitives at all. Change 3461207 by Guillaume.Abadie Exposes showflag details to USceneCaptureComponent. This gives the possibility to configure scene capture's showflags in blueprint encapsulated compositing pipeline. #jira UE-6810 Change 3461233 by Chris.Bunner Added Log10 material expression. Added tooltip for Log2 and Log10. Change 3461434 by Michael.Trepka Copy of CL 3456118 In Metal RHI report texture streaming as immediately successful as on D3D to avoid a race-condition leading to deadlock between the Main, Game, Render & RHI threads. #jira UE-44961 Change 3461770 by Benjamin.Hyder Submitting TM-RayTracedDistanceField map Change 3461929 by Marc.Olano Add Sobol blueprint and material node test maps to RenderTest project Change 3462249 by Uriel.Doyon Translucency after DoF is now disabled when showflag postprocess is disabled. Change 3462371 by Brian.Karis VT addressing is now 64bit to support huge sparse virtualized volumes 16bit page tables working. Change 3462936 by Marc.Olano Extend Sobol testing map with comparision between Random Sobol and Next Sobol functions Change 3464394 by Uriel.Doyon Improved synchronization for texture streaming commands. This fixes an issue when accessing FStreamingTexture for pending textures. Change 3464743 by Guillaume.Abadie Adds .usf file extension on all shader's source file names and adds checks to verify them at engine load time. Change 3464818 by Guillaume.Abadie Fixes compilation error in FindShaderRelativePath Change 3465184 by Daniel.Wright r.Shadow.PreShadowResolutionFactor 1.0 on Epic shadow settings Change 3465283 by Marc.Olano Update Sobol Gray code tables to match random order tables Change 3465976 by Arne.Schober DR - [UE-44393] - The Canvas is using the Globalshaders for clearing but compilation is done asynconously at load time. Unfortunately there could be Code that uses a canvas to draw and cause this issue in between. There might be some plugins that do this. For now we need to wait and block for the shaqders to be compiled until we can allo the use of the canvas. #RB none Change 3467513 by Guillaume.Abadie Fixes an issue where primitives would no longer draw in gameplay. #jira UE-45550 Change 3471116 by Richard.Wallis Mac OpenGL Is No Longer Supported - Remove All Code & Shader Platforms. Merge of CL 3327784 dev-editor stream from Michael Trepka with some extra changes. - Also removed Metal shader platforms from PlatformSupportsDebugViewShaders() otherwise we get a compiler error. HLSL register binds not implemented in metal backend. #jira UE-39108 Change 3471117 by Richard.Wallis Drop down menus clip on 27" Screen iMacs. Disable viewport HDR rendering on macOS 10.12.x when in editor. #jira UE-43026 Change 3471130 by Richard.Wallis Mac GPU hang causes editor output log to be written to the wrong file. Try to emulate windows behaviour when opening a file for reading or writing. Tested against behaviour of windows log file with multiple instances running. - Only defined in for Mac and non shipping. #jira UE-44934 Change 3471224 by Guillaume.Abadie Lets the ProjectFileGenerator to look at Shaders/ directories in plugin and game projects. Change 3471646 by Daniel.Wright Fixed ensure opening UT system settings Change 3471862 by Arne.Schober DR - revert accidently checked in changes. #RB Chris.Bunner Change 3472249 by Guillaume.Abadie Implements virtual shader source directory mapping. - /Engine/... maps to Engine/Shaders/... - /Plugin/FooBar/... maps to FooBar plugin's Shaders/ directory - /Project/... maps to project's Shaders/ directory Change 3472443 by Daniel.Wright Moved the Rendering category for lights to be just below the Light category, so the bVisible property is easily accessible Change 3474537 by Uriel.Doyon Fixed lighting needs rebuild happening after blueprint rescript and a non symetrical Quaterion != ToQuaternion(ToRotator(Quaternion) Change 3475192 by Guillaume.Abadie Implements LensDistortion engine plugin. This CL import a polished version of Raven's lens distortion and undistortion from OpenCV parameters: - It is implemented as the first engine plugin with its own shaders and render thread commands; - Has feature tests in EngineTest with gold images directly extracted from OpenCV itself (GenerateLensDistortionUndistortReferences.py) Change 3475209 by Guillaume.Abadie Back out changelist 3475192 Change 3475252 by Guillaume.Abadie Reland: Implements LensDistortion engine plugin. This CL import a polished version of Raven's lens distortion and undistortion from OpenCV parameters: - It is implemented as the first engine plugin with its own shaders and render thread commands; - Has feature tests in EngineTest with gold images directly extracted from OpenCV itself (GenerateLensDistortionUndistortReferences.py) Change 3475389 by Guillaume.Abadie Adds LensDistortion plugin's feature tests. Change 3475538 by Guillaume.Abadie Adds the /Engine/* prefix on all of the renderer's USF file references. Change 3475568 by Guillaume.Abadie Adds a check for virtual shader source file path format in FShaderType::FShaderType() Change 3475871 by Guillaume.Abadie Fixes a bug in shader compile worker, were an error in a relative #include USF file would trigger an check failure in CheckVirtualShaderFilePath Change 3475997 by Yujiang.Wang Workaround for a compiler optimization bug introduced in VS2015 Update 3. * The bug causes TSHVector<2>::CalcDiffuseTransfer to go to infinity at certain spot, making movable objects with ILCQ_Volume indirect lighting cache interpolation get very dark. * Debug builds don't exhibit this bug. * Semantics are exactly the same as the original code. Change 3476203 by David.Hill Compute SSAO: problem wiht AmbientOcclusionLevels and with various viewporttest sizes. Only seen when Levels >=2 #jira UE-45741 Change 3476536 by Benjamin.Hyder adding player start to Ray Traced Distance Field Shadows Map Change 3478298 by Benjamin.Hyder disabling mesh distance fields in Tm-Raytraced_DistanceField_Shadows map Change 3478948 by Rolando.Caloca DR - Nicer check Change 3478949 by Rolando.Caloca DR - Default GPU morphs to enabled Change 3478950 by Rolando.Caloca DR - By default -vulkan will launch SM5 Change 3478984 by Rolando.Caloca DR - Pass down -vulkan Change 3479655 by Richard.Wallis Video track does not switch in AVF Media Player. Need to disable unused video tracks to allow AVPlayerItemVideoOutput to decode the required track. - Minimal change to allow video track changes/selection. - Audio samples are extracted using AVAssetReaderTrackOutput but video uses AVPlayerItemVideoOutput. Video could also use AVAssetReaderTrackOutput to access the video data unless there is an iOS reason not to... - Flush the audio sink sample buffers so we get instant audio track changes #jira UE-39750, UE-39749 Change 3479834 by Rolando.Caloca DR - Fix issue with bad vertex colors (per licensee) Change 3480376 by Guillaume.Abadie Disables ComputeLightGrid() if no volumetric fog and no lighting. #jira UE-45377 Change 3480596 by Yujiang.Wang Fix for dynamic shadows and raytraced distance field shadows of directional lights not appearing in planar reflection * Bug caused by incorrect shadow culling volumes for cascaded shadow map and backface culling mode for WholeSceneShadowProjection * Fixed by taking View.bReverseCulling into account #jira UE-34452 Change 3480600 by Yujiang.Wang Fix for UE-42376 * The bug is caused by post-processing ambient cubemaps not being supported in forward shading currently. * This fix replaces all the occurences of them in CalcSceneView with a skylight using the cubemap * If a CalcSceneView is used solely for setting the PP ambient cubemap, it is removed. #jira UE-42376 Change 3480784 by Rolando.Caloca DR - hlslcc - Initial support for [RW]StructuredBuffer Change 3481690 by Uriel.Doyon Attempt to fix static analysis warning Change 3482012 by Simon.Tovey Fixed issue when building distribution lookup tables where the final sample fell short of the max input time. As sampling is done only over this range, under constant interpolation the final value was never actually sampled and so cut from the final optimized LUT. #tests constant interpolation now works. #jira UE-45614 Change 3482965 by Yujiang.Wang Some quality of life changes for UE-42757 * The UV overlay in static mesh editor now has a darker background * Selected edges are getting highlighted and bolder * When some edges are selected others turn grey #jira UE-42757 Change 3483014 by David.Hill Change labels on bloom boost from x,y,z to min, max, mult. #jira UE-43904 a PropertyRedirect in BaseEngine.ini allows this to work with older version. Change 3484573 by Yujiang.Wang Fix for shadow color not updated after light build when a texture is changed and reimported * Bug caused by counter-intuitive design of UMaterial::GetReferencedFunctionIds and UMaterial::GetReferencedParameterCollectionIds, both of which will reset the OutIds parameter * Renamed to AppendReferencedFunctionIdsTo and AppendReferencedParameterCollectionIdsTo, the resets are removed #jira UE-45647 Change 3484969 by Yujiang.Wang Fix for UE-39929 inconsistent type between C++ and shader code * MeshDistanceFieldCasterIndices is declared as Buffer<uint> in CapsuleShadowShaders.usf, while created as PF_R32_SINT in CapsuleShadowRendering.cpp * Changed PF_R32_SINT to PF_R32_UINT in CapsuleShadowRendering.cpp #jira UE-39929 Change 3485012 by Yujiang.Wang Fix for UE-39929 #2: Changed int32 to uint32 to match PF_R32_UINT #jira UE-39929 Change 3485146 by Guillaume.Abadie Destroyes scene capture's view states on the UnRegister, to avoid large memory usage cause by the ViewState's render targets when moving blueprints arround. #jira UE-43455 Change 3486602 by Joe.Conley Adding "texcoord" keyword to UMaterialExpressionTextureCoordinate so you can search for the name that is displayed on the node in the graph. Change 3487471 by Yujiang.Wang Github #3659: Improved performance of DumpUnbuiltLightInteractions * Replaced TArrays with TSets #jira UE-45783 Change 3487641 by Guillaume.Abadie Fixes some shader file name casing issues in LPV. Change 3488014 by Uriel.Doyon New AllowAsyncLoading flag for UTexture::CachePlatformData(). It allows to load the source texture data in the async task if the source bulk data was not yet loaded. Data loaded that way is not sharable between tasks and will be discarded. This is required because updating the source data is not thread safe. #jira UERNDR-190 #jira UE-33401 Change 3488249 by Uriel.Doyon Fixed long stall in UpdateResourceStreaming() caused by Actor.GetComponents() not resetting the number of actors anymore. Fixed inconsistent results in ALODActor::HasValidSubActors() caused by the same change. #jira UE-46004 Change 3490228 by Mark.Satterthwaite Fix the Nvidia driver bug with the old reversebits fallback function - you need to use the native reverse_bits intrinsic or use some uint(ushort()) casts to get the compiler to do the right thing, which means injecting the reverse_bits function in MetalBackend not the HLSL (as it has no such type). #jira UE-46067 Change 3490538 by Arne.Schober Back out changelist 3488249 #RB none Change 3490551 by Arne.Schober Back out changelist 3488249 #RB none Change 3491828 by Guillaume.Abadie Fixes another USf file reference casing issue in C++. Change 3491924 by Yujiang.Wang Fix for UE-43302 Crash when entering the DebugCreatePlayer console command with planar reflections in the level * Crash caused by check(Views.Num() <= 2); in SceneCaptureRendering.cpp * We still want to support at most 2 views for performance, but now instead of crash the planar reflections in additional views will simply turn black #jira UE-43302 Change 3492359 by Guillaume.Abadie Fixes non editor launches, failing in FGenericPlatformProcess::AddShaderSourceDirectoryMapping(). Change 3492367 by Marc.Olano Change Sobol texture size to 32x16, tweak distribution Change 3492599 by Marcus.Wassmer PR #3669: -Fix logmessages ParticleModules_Location.cpp (Contributed by UpwindSpring01) Change 3493473 by Uriel.Doyon Back out changelist 3490538 Change 3493590 by Uriel.Doyon Back out changelist 3490551 Fixed missing #pragma once Change 3493911 by Marcus.Wassmer Fix potential GPU crash/hang caused by out of bound subresource updates. Added checks at cross-platform level to catch any instance earlier. Change 3494139 by Uriel.Doyon Fixed shadow variable issue on UE4Editor Linux. Change 3494364 by Richard.Wallis Mac OpenGL Is No Longer Supported - Remove All Code & Shader Platforms - Part 2: Remove some more areas and fixes for previous attempt. Also removed OpenGL based GPU performance checks in EditorEngine.cpp - assuming that any GPU that can run Metal is currently OK for UE4. OpenGL left in the following areas: - OpenGLShaderCompiler - StandaloneRenderer The following files need to be reviewed in conjunction with CL 3471116 as there were some logic errors made: - OpenGLTexture.cpp #jira UE-39108 Change 3494413 by Guillaume.Abadie Updates r.InvalidateCachedShader and bump ShaderVersion.ush. Change 3494422 by Guillaume.Abadie Adds LensDistortion plugin's Private shader directory. Change 3494717 by Guillaume.Abadie Strengthens shader compiler with checks on generated file names and shader type file names. Change 3494763 by Guillaume.Abadie Removes a nolonger standing TODO in GlobalBeginCompileShader() that was automatically adding /Engine/ prefix to all relative virtual shader source file path. Change 3494985 by Rolando.Caloca DR - Integrate Vulkan Rewrite Change 3495031 by Rolando.Caloca DR - Delete file as it moved Change 3495032 by Rolando.Caloca DR - Show Vulkan SM5 instead of SM4 on windows packaging - Also added support for Vulkan SM5_UB Change 3495202 by Uriel.Doyon Fixed static analysis warning with pointer dereferencing. Change 3495342 by Rolando.Caloca DR - clang compile fix Change 3495354 by Rolando.Caloca DR - clang compile fixes Change 3495420 by Marc.Olano Use Sobol sampling for PCSS Change 3495799 by Rolando.Caloca DR - Delete old dev assets Change 3496202 by Mark.Satterthwaite Switch to using actual Vector*Matrix intrinsic for Metal to avoid a problem whereby the Metal compiler reorders operations in such a way that it loses precision and ends up being different between pre-pass and base-pass. #jira UE-46070 Change 3496253 by Uriel.Doyon Fixed static analysis warning for IncludeTool Change 3496631 by Guillaume.Abadie Makes AScreenshotFunctionalTest::ScreenshotOptions blueprint readable. Change 3496851 by Guillaume.Abadie Fixes back slash issues in Platform.usf. Change 3496852 by Guillaume.Abadie Fixes other back slashes includes in PS4 specific usf files. Change 3496941 by Guillaume.Abadie Adds a check() for no backslash in virtual shader file paths. Change 3497661 by Guillaume.Abadie Lets FLensDistortionCameraModel::GetUndistortOverscanFactor() early return 1.0 if the camera model is does an identity transform. Change 3497969 by Richard.Wallis Fix for start Up Movies Are not Playing for iOS Devices. Handle case when movie is loading aysnc in background - need to wait for state changes otherwise it skips intermediate movies. - Tested on iOS and Mac. #jira UE-39585 Change 3498035 by Guillaume.Abadie Polishes //Engine/Plugins/Compositing/LensDistortion/Shaders/Private/UVGeneration.usf from debuging artifacts. Change 3498101 by Rolando.Caloca DR - Compile fix Change 3498254 by Guillaume.Abadie Exposes comparing FLensDistortionCameraModel to blueprint with == and != operator nodes for cross frame uv displacement map caching. Change 3498264 by Guillaume.Abadie Integrate 3267269: Implements SceneCaptureComponent2D::bCameraCutThisFrame Change 3498371 by Yujiang.Wang Fix for UE-46149 Planar Reflections display screenspace info when viewports are >2 * Prevent planar reflections being rendered when ViewIndex >= GMaxPlanarReflectionViews * Now planar reflections in >2 viewports will fallback to other reflection methods (SSR, reflection captures) #jira UE-46149 Change 3498409 by Rolando.Caloca DR - Swap resolves Change 3498410 by Guillaume.Abadie Adds support for opacity output alpha for post process material when doing a draw material to render target. Change 3498705 by Rolando.Caloca DR - Add UID for debugging mem allocations Change 3498759 by Marcus.Wassmer No post processing in vertexcolor view mode #jira UE-44704 Change 3498891 by Rolando.Caloca DR - Minor Vulkan per frame allocator refactor in prep for changes Change 3499206 by Rolando.Caloca DR - Fix temp frame allocator OOM on Vulkan #jira UE-45913 Change 3499319 by Rolando.Caloca DR - Vulkan support for StorageBuffer Change 3499339 by Rolando.Caloca DR - Remove deprecated typedef Change 3499400 by Rolando.Caloca DR - Remove some RHICmdList deprecated functions Change 3499422 by Rolando.Caloca DR - Allow buffer transitions inside render passes Change 3500370 by Rolando.Caloca DR - Compile fix Change 3500474 by Rolando.Caloca DR - Fix static analysis Change 3500517 by Guillaume.Abadie Exposes r.PostProcessing.PropagateAlpha to the renderer settings. Change 3500537 by Guillaume.Abadie Fixes a bug where scene capture WorldToView matrix would get scale != 1 when scaling the scene capture actor in the world. #jira UE-39389 Change 3501069 by Mark.Satterthwaite Bring back temporary 4.16 fix for iOS 9 (CL #3425995) into Dev-Rendering for 4.17 as a real fix will need to wait for 4.18. temporary fix for skewed textures on IOS 9 #jira UE-44468 Change 3501164 by Michael.Lentine PR #3402: UE-43131: Format argument count not equal to actual arguments (Contributed by projectgheist) Change 3501222 by Benjamin.Hyder Checking in Tm_SobolNoise map Change 3501612 by zachary.wilson Adding testing content for RTDF shadows on planar reflections Change 3501708 by Guillaume.Abadie Break FPostProcessSettings into smallers structs. Change 3501830 by Olaf.Piesche #jira UE-39628; using fix proposed in UDN, will investigate further Change 3501954 by Marcus.Wassmer Duplicate 3480903 Light culling safety measures. Change 3502032 by Mark.Satterthwaite Fix generation of Metal precompiled headers for the bytecode compiler when using Xcode 9. Change 3502118 by Uriel.Doyon Fixed shader compilation issues. Change 3502191 by Guillaume.Abadie Implements Composure plugin to make compositing in UE4 easier. Change 3502192 by Guillaume.Abadie Implements Composure feature testing in EngineTests Change 3502196 by Guillaume.Abadie Creates a dependency of Composure plugin over LensDistortion plugin. Change 3502213 by Arciel.Rekman Fix for loading shaders on Linux (UE-46276). Change 3502243 by Brian.Karis Bent normal map support. Multibounce AO. Spherical Gaussian based specular occlusion. Change 3502506 by Guillaume.Abadie Fixes compilation failure in Composure with unity build. Change 3502507 by Guillaume.Abadie Fixes composure Set Pass with Render Target blueprint helper. Change 3502510 by Guillaume.Abadie Attempts to fix ComposureUtils.cpp compile errors. Change 3502515 by Guillaume.Abadie Some other composure failure fixes. Change 3502545 by Guillaume.Abadie Fixes some unity build related error in Composure. Change 3502548 by Guillaume.Abadie Fixes last missing includes in ComposurePostProcessPass.cpp Change 3502672 by Guillaume.Abadie Fixes linux warning in Composure. Change 3502790 by Ryan.Brucks float4 PseudoVolumeTexture: Fixed frame layout being a float instead of float2. Now works correctly with non-square frame layouts. Only called in custom nodes and calling with a float still functions properly so no old content will break. Change 3502836 by Guillaume.Abadie Propagates scene capture engine showflag changes from blueprint editor to the blueprint instances. #jira UE-6810 Change 3503096 by Guillaume.Abadie Resave a unversioned asset. Change 3503228 by Yujiang.Wang Fix for UE-45646 Dynamic Light placed inside of a Dynamic Static Mesh doesn't pass through the geometry * Bug caused by bReflectiveShadowmap not being passed into SetViewFlagsForShadowPass * Replaced the true with bReflectiveShadowmap #jira UE-45646 Change 3503284 by Rolando.Caloca DR - Fixed initial clear on rendertargets - Added support for r.Vulkan.EnableValidation 1, 2, 3 & 4 - Dump the vulkan log into VS output log - Added validation for layouts when using dump log Change 3503545 by Arciel.Rekman Fix black UI on Linux (UE-46333) - Rebuilt hlslcc with clang 3.7.0. Whatever issues we're running in with newer clangs still seem to persist. #jira UE-46333 Change 3503638 by Daniel.Wright [Copy] Changed DynamicBentNormalAO back to fp16, as PF_FloatR11G11B10 was not enough precision and introduced banding Change 3503787 by Marcus.Wassmer Fix difference between gpu/cpu morph target application Change 3503902 by Marcus.Wassmer Roll back TAA refactor until we have time to look into the bad interaction with DOF. Change 3503953 by Arne.Schober DR - UE-46319 - borked Reflections: The resource transition needs to be in this weired place for PS4 and switch until we teach the interface to know about subresources. #RB Marcus.Wassmer Change 3504131 by Rolando.Caloca DR - Maintain a cache of pipeline and descriptor set layouts - Fix marker dump Change 3504462 by Guillaume.Abadie Fixes an assertion failure that was failing because compute light grid was not done, but the shader used where not necessarily using compute light grid results. #jira UE-46277 Change 3504779 by Chris.Bunner Potential static analysis fix. #jira UE-46360 Change 3504950 by Marc.Olano Allow Sobol material nodes & textures only if feature level is at least ES3.1 #jira UE-46334 #jira UE-46317 Change 3505035 by Daniel.Wright Increased MaxSearchCount in GetShaderIncludes. The previous limit of 20 is now getting hit in BasePassPixelShader.usf, causing compiles to fail erroneously. Change 3505386 by Daniel.Wright GetShaderIncludes handles infinite recursion gracefully, needed by Metal causing BasePassTessellation.usf to include BasePassVertexShader.usf Change 3505491 by Rolando.Caloca DR - Fix crash on first frame of particles on modern APIs Change 3505557 by Chris.Bunner [Duplicate] Workaround for outdated shader map crash. #jira UE-46061 Change 3506071 by Rolando.Caloca DR - Vulkan fixes - Fix copy out of bounds reading textures to CPU - Defer event deletion - Split validation for errors and warnings - Skip validation error about attachment not used Change 3506698 by Guillaume.Abadie Fixes Composure alpha channel clobering and performance regression in bloom and tonemapper passes caused by scene capture API compatibility breakage brought by Fortnite merge. Change 3506797 by Rolando.Caloca DR - Fix static analysis #jira UE-46428 Change 3506861 by Rolando.Caloca DR - Fix crash due to layering violation #jira UE-46424 #jira UE-46431 Change 3508098 by Rolando.Caloca DR - Fix for Vulkan ES31 crash - Fix for AMD ensure Change 3508123 by Rolando.Caloca DR - Disable occlusion queries on Vulkan to avoid flickering - Fix for bad HZB & cube mips on Vulkan (now using RHIGenerateMips) - Fix for decal blending #jira UE-46376 Change 3509064 by Uriel.Doyon Changing the logic arround generating an error when HasHadBulkDataCleared() so that it only triggers if the DDC are not found. #jira UE-46427 Change 3509854 by Marc.Olano Fix 2D Sobol gray code numbers. Just changes some numbers in initialization tables, so no effect on existing tests or content. Change 3509920 by Marcus.Wassmer Fix LPV fastvram ensure Change 3509937 by Rolando.Caloca DR - Fix crash due to deleted viewport #jira UE-46281 Change 3509988 by Marcus.Wassmer Roll back part of Sobol fix to avoid full shader recompile for integration. Change 3510255 by Rolando.Caloca DR - Fix popup window ensure #jira UE-46511 Change 3510646 by Marcus.Wassmer fix ios compiles Change 3511442 by Rolando.Caloca DR - Change mesh simplification check to ensure/checkslow to unblock #jira UE-46538 DONE! XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX CHANGES WITH MULTIPLE PLATFORMS!!! YOU MUST COPY THESE INTO THE OTHER ONES AS MAKES SENSE!! XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Change 3467095 by Guillaume.Abadie Nukes all += TEXT(".usf") #jira UE-45530 Change 3475084 by Guillaume.Abadie Fixes compilation failure of the shader compiler on PS4 and XboxOne Change 3477464 by Guillaume.Abadie Fixes dumpshaderinfo that generate unecessary sub directory, breaking shell scripts. Change 3494395 by Guillaume.Abadie Moves all engine shader files into Public and Private directory, and introduce the .ush extensions for header file that do not contains entry points. DONE! [CL 3511602 by Marcus Wassmer in Main branch]
2017-06-27 11:38:28 -04:00
IMPLEMENT_MATERIAL_SHADER_TYPE(,FDebugViewModeVS,TEXT("/Engine/Private/DebugViewModeVertexShader.usf"),TEXT("Main"),SF_Vertex);
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
bool FDebugViewModeVS::ShouldCompilePermutation(const FMeshMaterialShaderPermutationParameters& Parameters)
{
return AllowDebugViewVSDSHS(Parameters.Platform) && EnumHasAllFlags(Parameters.Flags, EShaderPermutationFlags::HasEditorOnlyData);
}
BEGIN_SHADER_PARAMETER_STRUCT(FDebugViewModePassParameters, )
SHADER_PARAMETER_STRUCT_REF(FViewUniformShaderParameters, View)
SHADER_PARAMETER_RDG_UNIFORM_BUFFER(FDebugViewModePassUniformParameters, Pass)
SHADER_PARAMETER_STRUCT_INCLUDE(FInstanceCullingDrawParams, InstanceCullingDrawParams)
RENDER_TARGET_BINDING_SLOTS()
END_SHADER_PARAMETER_STRUCT()
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
void RenderDebugViewMode(FRDGBuilder& GraphBuilder, TArrayView<FViewInfo> Views, FRDGTextureRef QuadOverdrawTexture, const FRenderTargetBindingSlots& RenderTargets)
{
RDG_EVENT_SCOPE(GraphBuilder, "DebugViewMode");
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
for (int32 ViewIndex = 0; ViewIndex < Views.Num(); ++ViewIndex)
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
{
FViewInfo& View = Views[ViewIndex];
RDG_GPU_MASK_SCOPE(GraphBuilder, View.GPUMask);
RDG_EVENT_SCOPE_CONDITIONAL(GraphBuilder, Views.Num() > 1, "View%d", ViewIndex);
auto* PassParameters = GraphBuilder.AllocParameters<FDebugViewModePassParameters>();
PassParameters->View = View.ViewUniformBuffer;
PassParameters->Pass = CreateDebugViewModePassUniformBuffer(GraphBuilder, View, QuadOverdrawTexture);
PassParameters->RenderTargets = RenderTargets;
FScene* Scene = View.Family->Scene->GetRenderScene();
check(Scene != nullptr);
View.ParallelMeshDrawCommandPasses[EMeshPass::DebugViewMode].BuildRenderingCommands(GraphBuilder, Scene->GPUScene, PassParameters->InstanceCullingDrawParams);
GraphBuilder.AddPass(
{},
PassParameters,
ERDGPassFlags::Raster,
[&View, PassParameters](FRHICommandList& RHICmdList)
{
RHICmdList.SetViewport(View.ViewRect.Min.X, View.ViewRect.Min.Y, 0, View.ViewRect.Max.X, View.ViewRect.Max.Y, 1);
View.ParallelMeshDrawCommandPasses[EMeshPass::DebugViewMode].DispatchDraw(nullptr, RHICmdList, &PassParameters->InstanceCullingDrawParams);
});
}
}
bool FDebugViewModePS::ShouldCompilePermutation(const FMeshMaterialShaderPermutationParameters& Parameters)
{
return ShouldCompileDebugViewModeShader(Parameters);
}
void FDebugViewModePS::GetElementShaderBindings(
const FShaderMapPointerTable& PointerTable,
const FScene* Scene,
const FSceneView* ViewIfDynamicMeshCommand,
const FVertexFactory* VertexFactory,
const EVertexInputStreamType InputStreamType,
ERHIFeatureLevel::Type FeatureLevel,
const FPrimitiveSceneProxy* PrimitiveSceneProxy,
const FMeshBatch& MeshBatch,
const FMeshBatchElement& BatchElement,
const FDebugViewModeShaderElementData& ShaderElementData,
FMeshDrawSingleShaderBindings& ShaderBindings,
FVertexInputStreamArray& VertexStreams) const
{
FMeshMaterialShader::GetElementShaderBindings(PointerTable, Scene, ViewIfDynamicMeshCommand, VertexFactory, InputStreamType, FeatureLevel, PrimitiveSceneProxy, MeshBatch, BatchElement, ShaderElementData, ShaderBindings, VertexStreams);
int8 VisualizeElementIndex = 0;
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
VisualizeElementIndex = BatchElement.VisualizeElementIndex;
#endif
const FDebugViewModeInterface* Interface = FDebugViewModeInterface::GetInterface(ShaderElementData.DebugViewMode);
if (ensure(Interface))
{
Interface->GetDebugViewModeShaderBindings(
*this,
PrimitiveSceneProxy,
ShaderElementData.MaterialRenderProxy,
ShaderElementData.Material,
ShaderElementData.DebugViewMode,
ShaderElementData.ViewOrigin,
ShaderElementData.VisualizeLODIndex,
ShaderElementData.SkinCacheDebugColor,
VisualizeElementIndex,
ShaderElementData.NumVSInstructions,
ShaderElementData.NumPSInstructions,
ShaderElementData.ViewModeParam,
ShaderElementData.ViewModeParamName,
ShaderBindings
);
}
}
FDebugViewModeMeshProcessor::FDebugViewModeMeshProcessor(
const FScene* InScene,
ERHIFeatureLevel::Type InFeatureLevel,
const FSceneView* InViewIfDynamicMeshCommand,
bool bTranslucentBasePass,
FMeshPassDrawListContext* InDrawListContext
)
: FMeshPassProcessor(InScene, InFeatureLevel, InViewIfDynamicMeshCommand, InDrawListContext)
, DebugViewMode(DVSM_None)
, ViewModeParam(INDEX_NONE)
, DebugViewModeInterface(nullptr)
{
if (InViewIfDynamicMeshCommand)
{
DebugViewMode = InViewIfDynamicMeshCommand->Family->GetDebugViewShaderMode();
ViewModeParam = InViewIfDynamicMeshCommand->Family->GetViewModeParam();
ViewModeParamName = InViewIfDynamicMeshCommand->Family->GetViewModeParamName();
DebugViewModeInterface = FDebugViewModeInterface::GetInterface(DebugViewMode);
}
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
}
void FDebugViewModeMeshProcessor::AddMeshBatch(const FMeshBatch& RESTRICT MeshBatch, uint64 BatchElementMask, const FPrimitiveSceneProxy* RESTRICT PrimitiveSceneProxy, int32 StaticMeshId)
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
{
if (!DebugViewModeInterface)
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
{
return;
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
}
const FMaterialRenderProxy* MaterialRenderProxy = MeshBatch.MaterialRenderProxy;
const FMaterial* BatchMaterial = MaterialRenderProxy->GetMaterialNoFallback(FeatureLevel);
if (!BatchMaterial)
{
return;
}
const FMaterial* Material = BatchMaterial;
FVertexFactoryType* VertexFactoryType = MeshBatch.VertexFactory->GetType();
FMaterialShaderTypes ShaderTypes;
DebugViewModeInterface->AddShaderTypes(FeatureLevel, VertexFactoryType, ShaderTypes);
if (!Material->ShouldCacheShaders(GetFeatureLevelShaderPlatform(FeatureLevel), ShaderTypes, VertexFactoryType))
{
return;
}
FMaterialShaders Shaders;
if (!Material->TryGetShaders(ShaderTypes, VertexFactoryType, Shaders))
{
return;
}
TMeshProcessorShaders<FDebugViewModeVS, FDebugViewModePS> DebugViewModePassShaders;
Shaders.TryGetVertexShader(DebugViewModePassShaders.VertexShader);
Shaders.TryGetPixelShader(DebugViewModePassShaders.PixelShader);
const FMeshDrawingPolicyOverrideSettings OverrideSettings = ComputeMeshOverrideSettings(MeshBatch);
const ERasterizerFillMode MeshFillMode = ComputeMeshFillMode(MeshBatch, *BatchMaterial, OverrideSettings);
const ERasterizerCullMode MeshCullMode = ComputeMeshCullMode(MeshBatch, *BatchMaterial, OverrideSettings);
FMeshPassProcessorRenderState DrawRenderState;
FDebugViewModeInterface::FRenderState InterfaceRenderState;
DebugViewModeInterface->SetDrawRenderState(DebugViewMode, BatchMaterial->GetBlendMode(), InterfaceRenderState, Scene ? (Scene->GetShadingPath() == EShadingPath::Deferred && Scene->EarlyZPassMode != DDM_NonMaskedOnly) : false);
DrawRenderState.SetBlendState(InterfaceRenderState.BlendState);
DrawRenderState.SetDepthStencilState(InterfaceRenderState.DepthStencilState);
FDebugViewModeShaderElementData ShaderElementData(
*MaterialRenderProxy,
*Material,
DebugViewMode,
ViewIfDynamicMeshCommand ? ViewIfDynamicMeshCommand->ViewMatrices.GetViewOrigin() : FVector::ZeroVector,
(ViewIfDynamicMeshCommand && ViewIfDynamicMeshCommand->Family->EngineShowFlags.HLODColoration) ? MeshBatch.VisualizeHLODIndex : MeshBatch.VisualizeLODIndex,
(ViewIfDynamicMeshCommand && ViewIfDynamicMeshCommand->Family->EngineShowFlags.VisualizeGPUSkinCache) ? MeshBatch.Elements[0].SkinCacheDebugColor : FColor::White,
ViewModeParam,
ViewModeParamName);
// Shadermap can be null while shaders are compiling.
UpdateInstructionCount(ShaderElementData, BatchMaterial, VertexFactoryType);
ShaderElementData.InitializeMeshMaterialData(ViewIfDynamicMeshCommand, PrimitiveSceneProxy, MeshBatch, StaticMeshId, true);
const FMeshDrawCommandSortKey SortKey = CalculateMeshStaticSortKey(DebugViewModePassShaders.VertexShader, DebugViewModePassShaders.PixelShader);
BuildMeshDrawCommands(
MeshBatch,
BatchElementMask,
PrimitiveSceneProxy,
*MaterialRenderProxy,
*Material,
DrawRenderState,
DebugViewModePassShaders,
MeshFillMode,
MeshCullMode,
SortKey,
EMeshPassFeatures::Default,
ShaderElementData);
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
}
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3760894) #rb Rendering #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3658809 by Chris.Bunner Changing default HDR display gamut to P3 as in practice that's more common than Rec2020, this should be a user-facing option where possible though as we can't automatically retrieve that data. Change 3658842 by Chris.Bunner Backing out previous HDR default gamut change as it conflicts with mandatory platform defaults. Change 3695269 by Arne.Schober DR - Make clang happy wreorder Change 3695418 by Guillaume.Abadie Fixes compilation failure in FoliageType_InstancedStaticMesh.cpp. Change 3695430 by Guillaume.Abadie Fixes missing BeginFrame dynamic resolution event in EngineTest. Change 3695469 by Guillaume.Abadie Fixes crash when passing down an invalid parameter on the sample material expression's DDX, DDY parameters. Change 3696091 by Guillaume.Abadie Fixes Linux compilation failure in DynamicResolution.cpp Change 3696593 by Chris.Bunner Fixed typo in vetex factory enum. Change 3696596 by Chris.Bunner Added material attributes type checking to If material expression. Updated If material expression to validate compilation of inputs. Change 3696597 by Chris.Bunner Allow visible parameter retrieval to correctly traverse through internally called functions. Previous check was intended to prevent function previews from leaving their graph through unhooked inputs, but unintentionally blocked all function inputs. Change 3696599 by Chris.Bunner Fixed material instance parameter visiblity when using nested static switches across functions. #jira UE-50878 Change 3696734 by Chris.Bunner Return type fix. Change 3697123 by Guillaume.Abadie Fixes compilation failure in PostProcessWeightedSampleSum.cpp on Windows 32bits. Change 3697125 by Guillaume.Abadie Fixes compilation failure in MaterialExpressionIf.h Change 3697127 by Guillaume.Abadie Fixes compilation failure in DynamicResolution.cpp on shipping build. Change 3697135 by Guillaume.Abadie Fixes crash in dynamic resolution event frontend when resizing game play viewport in EngineTest. Change 3697199 by Guillaume.Abadie Fixes TAA upsample's shader compilation failure on Mac. Change 3697220 by Guillaume.Abadie Makes static analysis happy again. Change 3697280 by Chris.Bunner Fixing up invalid casts in material layers validation. Change 3697366 by Rolando.Caloca DR - hlslcc - Fix warning #jira UE-43988 Change 3697451 by Rolando.Caloca DR - vk - Per pipeline descriptor pools Descriptor pool are now allocated per PSO instead of globally to reduce peak mem consumption and fragmentation Enabled on Windows only via VULKAN_USE_PER_PIPELINE_DESCRIPTOR_POOLS Change 3697477 by Rolando.Caloca DR - vk - Custom memory allocator Remove old/unused stats Change 3697486 by Rolando.Caloca DR - vk - Fix validation issue Change 3697488 by Richard.Wallis Fix for Mac editor session no longer accurately tracking Mouse location after moving between Desktops in Mission Control on 10.12.6. Problem stems from the extra call to update the slate cached window position in mouse move while dragging, which is itself is a hack but apparently this is needed as we don't get window position updates on Mac while dragging (although I couldn't see any -ve side effects without it) then the OS (in 10.12.6) doesn't always push out a final window did move notificaiton when changing desktops which leaves the window according to slate incorrectly positoned to it's frame. Solution is to either remove the mouse-move-while-drag window position hack or add a final window position update to the mouse-up event while dragging - this change is the latter. #jira UE-37553 Change 3697501 by Richard.Wallis Move audio processing over to audio bus tap. Currently on Mac Media audio playback uses OS media player mixer rather than Engine as existing implemtation, using AVAssetReader, now suffers from poor performance with new Media Framework. This audio tap version replaces that asset reader implementation but also suffers from bad quality audio hence is still disabled at the top of AvfMediaTracks.cpp. Original Code Review Description: Convert Mac to Play audio through the engine MediaFramework API rather than using AVMediaPlayer. This is the Mac implementation only - this should work ok on iOS but unable to test due to missing audio type implementation (throws error "Init Buffer on unsupported sound type name = Synth type = 5"), as such is only enabled for Mac. There maybe some extra tweaks required for iOS on app backgrounding etc if this feature is enabled. - Stuttering Audio Performace issue investiagation: Re-Tested this implementation against [now fixed] current Mac implementation which was working fine last year and that implementation now has the same audio output quality (performance) issues as this one. Basic investigation seems to point to somewhere in the engine audio handing. When poor audio is heard the FMediaAudioResampler::Generate() function is dequeing an IMediaAudioSample sample buffer and the audio sample queue usually has 50-100 of these IMediaAudioSample buffers waiting in the queue. I think the AvfMedia playback system is providing the sample buffers in good time but they are not getting consumed "fast" enough. This under consuming also occurs if I force the Core Audio - Audio Unit mixer to use 48000 samples/sec. #jira UEPLAT-1677 Change 3697517 by Richard.Wallis XCode 9.0 extra nullability specifiers required. Change 3697537 by Richard.Wallis Back out revision 23 from //UE4/Dev-Rendering/Engine/Plugins/Media/AvfMedia/Source/AvfMedia/Private/Player/AvfMediaTracks.cpp Change 3697670 by Rolando.Caloca DR - vk - Fix mapstaging surface Change 3697846 by Uriel.Doyon Allow denormalized values when converting float32 to float16. Change 3697892 by Uriel.Doyon Fix for unaligned structure elements Change 3699335 by Richard.Wallis Mac compile fix - turns out I did need these nullability specifiers here. Change 3699663 by Guillaume.Abadie Fixes time unit conversions from microseconds to milliseconds error in dynamic resolution heuristic when using GPU busy time queries. Change 3699959 by Rolando.Caloca DR - Fix barrier in the middle of render pass Change 3699969 by Rolando.Caloca DR - vk - Change dump layer location so it prints out validation ids Change 3700356 by Guillaume.Abadie Implements secondary screen percentage to be able to do TAA upsample followed spatial upscale so that the editor viewport still have same TAA upsample screen percentage range to test the content with no matter monitor's DPI. Change 3701105 by Guillaume.Abadie Ignore per view automatic mip bias on texture type other than 2d textures. #jira UE-51396 Change 3702297 by Richard.Wallis Mac compile fix for nullable specifier. Looks like Obj class using the C++ class also needs this otherwise it throws. Seems to be some kind of xcode/compiler caching bug with this stuff as it'll report the error once then on subsequent compiles say everything is ok. #jira UE-51386 Change 3702357 by Richard.Wallis Mac nullability compile fix - again. Looks like I fell foul of that xcode compile caching! #jira UE-51386 Change 3702424 by Guillaume.Abadie Fixes planar reflection from drowing themselves in their own FSceneRenderer in forward shading. #jira UE-51395 Change 3702464 by Guillaume.Abadie Fixes wrong viewport to buffer conversion of the distortion. #jira UE-51406 Change 3702819 by Guillaume.Abadie Fixes planar reflections with secondary screen percentage for HighDPI editor viewports. Change 3703732 by Guillaume.Abadie Removes unecessary check(); when there is more than 2 players with planar reflections. #jira UE-51436 Change 3704302 by Guillaume.Abadie Removes unecessary Interface suffix on new dynamic resolution related interfaces Change 3704390 by Chris.Bunner Fixed a coincidentally correct define. Change 3704730 by Rolando.Caloca DR - vk - Fix map for depth surfaces Change 3704739 by Rolando.Caloca DR - Debug label on D3D11 UAVs - Validate when running -d3debug Change 3705000 by Chris.Bunner Skip compiling opacity and opacity mask inputs on opaque surface materials. Previously the code was always added to the shader, sometimes we force opaque materials down a masked path which then calls the dormant code unintentionally. A safer fix for UE-48254. Partially reverted previous fix in CL 3608303 which removed a material instance optimization caching the overridden base properties. Change 3706065 by Guillaume.Abadie Does some renaming for primary screen percentage, and move the primary screen percentage method selection from dynamic resolution driver to FSceneView. Change 3706464 by Chris.Bunner Fixed material property translate overrides that were generating code in the wrong entry. Fixed conditions in If material expression GetInputType and IsMA check. #jira UE-51368 Change 3706641 by Chris.Bunner Missing "break" in switch statement (which unfortunately needs another bump to resolve). Change 3706642 by Guillaume.Abadie Fixes assertion failure when r.TemporalAA.EnableUpscale = 1 Change 3706650 by Gil.Gribb UE4 - UE4 - Changes from intel. Increase number of worker threads on Windows to if hyperthreads (hyperthreads √ 2) else cores √ 1 up to a max of 22 workers. Increase MAX_THREADS multiplier per bank from 22 to 26. Intel VTune ITT event annotations. Wrapped in same function as your existing CPU events and enabled with √vtune. Optimize NV cloth by consuming FVector instead of FVector4 out of the solver. Vertex buffers were using FVector all along. ~15% improvement. Optimize cloth copy to vertex buffer by adding prefetch (similar to how bones are already done). Move local to world cloth transform from CPU to GPU. When simulating lots of vertices game thread was becoming bottleneck doing matrix multiply. Add your TaskGraph task switch latency test code. Change 3706733 by Daniel.Wright Print Embree Build time Change 3706841 by Daniel.Wright EmbreeFilterFunc4 now handles masked out intersections properly Change 3707437 by Rolando.Caloca DR - vk - Android compile fix #jira UE-51474 Change 3707785 by Guillaume.Abadie Fixes viewport issue in bloom setup pass with TAA upsample. Change 3709623 by Rolando.Caloca DR - vk - Missing barrier for reading into cpu Change 3709633 by Rolando.Caloca DR - vk - Compile fix Change 3710454 by Mark.Satterthwaite Refactor the way we compile Buffer<> & RWBuffer<> types for Metal so that we can support the type-conversion semantics of HLSL/D3D. - Buffer<> types are converted to Linear Textures unless the internal type is 3-compnent or the STRONG_TYPE macro is added as a type-qualifier. Linear Textures require an MTLTexture "view" object be created around the MTLBuffer which is the backing-store and it is typically best if that buffer is marked as Private (GPU-only) memory, reading from this in the shader then uses the texture-fetch hardware to perform the format conversion on load. - RWBuffer<> & 3-compnent Buffer<> types are converted to use template functions to load/store - the implementation of which will read the format from the BufferSizes meta-table and determine which type-conversion to apply. Function-constants are used to specialise the shader where feasible to reduce branch costs (function-constants are a Metal feature that allow efficient runtime recompilation of bytecode shaders). - Buffer<> & RWBuffer<> types where the STRONG_TYPE macro is added as a type-qualifier (only does something on Metal, everywhere else it is #define'd away) are compiled as "raw" Metal buffers of the inner-type (e.g. float4 for Buffer<float4>) and the MetalRHI runtime will enforce that only SRVs/UAVs of the proper format are bound to it. This is necessary in a couple of cases (BoneMatrices, NumCulledLightsGrid, CulledLightDataGrid & ForwardLocalLightBuffer buffers) which are used in a larger number of shaders as Linear Textures have poorer performance than Buffer<>/RWBuffer<>. - Most of the complications to generating subtly different Metal code for different OS/device combinations have been factored out into ue4_stdlib.metal which acts as an extension to the Metal shader standard-library and helps simplify the MetalBackend code - particularly helpful for Buffer<>/RWBuffer<> but also texturecube_array and the SM6 wave-related intrinsics. - Reverted some of the awkward Metal-specific changes Richard.Wallis & Arne had to make to the high-level shaders as they aren't necessary anymore. - Made the existing Metal-specific changes to use uint32 for all light-grid injection buffers apply to all Metal platforms again (I had hoped that it would not be necessary anymore, but it is much faster this way). - STRONG_TYPE is actually hlslcc's "invariant" keyword applied as a type-qualifier to a Buffer<>/RWBuffer<> type - only valid when using Metal which exports this through ILanguageSpec and #define'd out for everyone else. - Old versions of iOS (anything earlier than iOS 10.3) won't be able to use this new code, so every buffer will be treated as "raw" and the MetalRHI will now properly report when something goes awry rather than it leading to mysterious rendering errors and crashes. Change 3710456 by Mark.Satterthwaite Fix the Eddie workset project generator so that Enterprise projects don't get mixed in with regular projects at the top-level because of the way Eddie combines workset groups. Change 3710457 by Mark.Satterthwaite DX11 texture formats for Mac Metal please! Change 3710480 by Mark.Satterthwaite Permit RHI thread and parallel execution in Mac -game mode again. Change 3710522 by Mark.Satterthwaite MSVC type-mismatch error fixes. Change 3710580 by Mark.Satterthwaite Alright then - if I can't use the C++11 extended string semantics I'll have to use "xxd -i" to generate a hex-dump include header from ue4_stdlib.metal instead. This can only be updated from a machine with access to the POSIX xxd command (Mac & Linux, possibly the new Linux sub-system for Win10). Change 3710616 by Mark.Satterthwaite Missing file. Change 3712972 by Guillaume.Abadie Fixes Circle DOF's negative alpha channel getting clamped to 0 in TAA pass. Change 3712979 by Guillaume.Abadie Fixes wrong RT reallocation when doing TAA upsample in editor viewports with secondary upscale. Change 3713406 by Mark.Satterthwaite Use GPU morph targets on Mac - the necessary buffer conversions will always be available there. For iOS it can only be supported if iOS 10 is the minimum OS & Metal standard so leave that on the CPU path for now. Change 3713494 by Richard.Wallis Fix for hitch when PIE unloading sublevel. PerformReachabilityAnalysisOnObjects is spawing multiple threads in Editor builds as there is an extra code path that results in Critical Section locking within a singleton type static object - this is a bottle neck for multiple threads. However they all just need to read the data not change it. Replaced FScopeLock with a Read/Write version allowing these threads to all take a read lock at the same time to reduce contention. Changed the FUObjectAnnotationDense implementation only - left the sparse implementation alone as its not currently affecting this - although we could proactivly change that too. Also tested again repro in linked bug UE-24711. #jira UE-40533 Change 3713612 by Mark.Satterthwaite Integrate LPV_STORE_INDEX_IN_HEAD_BUFFER related changes from //depot/Partners/Microsoft/UE4-MS/Engine-Fable @ 2954744 This should make Light Propagation Volumes potentially viable on non-Microsoft platforms. Change 3713623 by Mark.Satterthwaite Implement ByteAddressBuffer/RWByteAddressBuffer in hlslcc in a similar manner to StructuredBuffer/RWStructuredBuffer so that the backends don't need too much modification. Implement the necessary changes into MetalBackend to make this work for Metal. Load/Store{+2,3,4} & Atomics are supported. Counter operations are not supported and aren't likely to be. Change 3713636 by Mark.Satterthwaite Enable LPVs for Mac Metal. - Rework some multi-dimensional arrays & array-index dependent HLSL code that hlslcc simply can't cope with, the mesa-glsl compiler core is only capable of dealing with 1 dimensional arrays and array-indexing can't itself be directly dependent on the result of an array-index operation. - MetalRHI needs to ignore any SetRenderTargets call that binds nothing at all as you must bind at least one target (UAV, RT, Depth/Stencil) for it to be able to do anything sensible. - Turn on LPVs for Metal as it works now. Change 3714049 by Guillaume.Abadie Do not set screen percentage method to TAA upsample when anti aliasing method is not TAA even if there is automatic fallback in the renderer. Change 3714306 by Guillaume.Abadie Fixes assertion failure in dynamic resolution state proxy with GPU busy time queries. Change 3714714 by Mark.Satterthwaite Tweak Metal GPU identification so that it works with eGPU boxes and protoype hardware - these changes only apply to macOS 10.13 so the system as a whole remains. Change 3716104 by Mark.Satterthwaite Fix 10.12/Xcode 8 compile errors from the build-farm which is still split until Fortnite can update. Change 3716120 by Mark.Satterthwaite Silence static-analysis. Change 3716158 by Guillaume.Abadie Rewrites editor primitive compositing to support TAA upsample. This takes the oportunity to remove the manual depth testing in base pass pixel shader of editor primitives. Change 3716271 by Daniel.Wright Lightmass correctness fixes * After these changes, point, spot, directional and sky lights closely match reference renderer Mitsuba after light unit conversions * Photon density trimming intended for direct photons was affecting indirect photons as well. This caused high noise for point / spot lights with a large attenuation radius. Indirect photon density even for small lights is 5x with this change, which improves 2nd bounce quality. * Removed legacy fudge factor on point / spot light photon energy * Spotlights no longer emit based on indirect photon paths. Fixes excessive photon energy from spot lights as they were emitting outside of the cone. * Fixed photons computing one more bounce than requested. * Added an option to use the Radiosity solver for all multibounce, replacing photons. Useful as a reference but generally too much noise indoors. * Fixed visualization of photons without final gather Change 3716434 by Mark.Satterthwaite Backout the remaining change from 3632041 that is no longer necessary - this was the last of the 4.18 Metal workarounds. Change 3716491 by Chris.Bunner Fixing up an edge-case on a recent optimization. Change 3716611 by Guillaume.Abadie Allows secondary screen percentage >= 100%. Change 3716977 by Guillaume.Abadie Back out changelist 3716158 to unblock QA pass. #jira UE-51580 Change 3717111 by Arne.Schober Fixing nomalization of Morph Tangents https://udn.unrealengine.com/questions/392462/ Also implemanted batching of the dispatches which should help worst case perfomance where dispatches become too small. CalculateInverseAccumulatedWeights is not cheap and proably should be moved onto a task thread that runs as soon as the input weights are ready. Change 3717127 by Mark.Satterthwaite Fix a mismerge from the reversion of 3632041 - part of the modified code had been moved into another file and I didn't initially notice. Change 3717178 by Mark.Satterthwaite Remove useless copy-pasted expressions from glsl_type::GetByteAddressBufferInstance & force MetalBackend to relink. Apparently the previous Mac libs were mysteriously broken. #jira UE-51583 Change 3717476 by Marcus.Wassmer Fix PS4 compile. funciton local statics not allowed on PSSL Also enabled the new atomics method for LPVs for all platforms Change 3717502 by Arne.Schober DR - Compiletime option for compressed ruleset (0.02ms perf gain on PS4 and disabled by default as it limits array size to 2million entries) Change 3717601 by Arne.Schober DR - Move cycle counter into more meaningfull locations. Change 3718054 by Guillaume.Abadie Removes unecessary check() failure on secondary upscale that fires when testing raw output screen percentage method. Change 3718066 by Guillaume.Abadie Reland: Rewrites editor primitive compositing to support TAA upsample. This takes the oportunity to remove the manual depth testing in base pass pixel shader of editor primitives. Change 3718589 by Mark.Satterthwaite Console-variable to enable and disable Manual-Vertex-Fetch for Metal and fix the internal code to handle the subtle changes in behaviour for vertex-declarations so we don't explode under the Metal validation layer. MVF works on macOS, though testing did expose an error with Tessellation on Nvidia (true for MVF enabled & disabled). Change 3718633 by Guillaume.Abadie Fixes temporal instability issue of TAA upsample with secondary screen percentage. Change 3718658 by Arne.Schober DR - 25% MorphTarget Speed increase because there was a bit of cache thrashing between the waves going on. Change 3718818 by Mark.Satterthwaite Fix compilation on hlslcc - integral values are not automatically converted into comparisons with zero. Change 3719004 by Guillaume.Abadie Lets the game viewport client automatically set raw output screen percentage method when doing dynamic resolution with stereo rendering but without TAA upsample. Change 3719375 by Mark.Satterthwaite Extend mtlpp compiler testing app to support Metal tessellation compute shaders so we can send Nvidia a much simpler reproduction of their regression. Change 3720099 by Mark.Satterthwaite Make the left-hand arguments work in airdiff. Change 3720413 by Mark.Satterthwaite Support standalone compute shaders in the mtlpp compiler test app. Change 3721232 by Mark.Satterthwaite No more Metal Shader Model 4 - instead we have to have a Metal Shader Model 5 w/o Tessellation as Nvidia's shader compiler is broken on all tessellation shaders in 10.13.0 and above. There is no guarantee that they will fix this prior to 10.14 and I can't afford to disable tessellation entirely as if I do that then the AMD & Intel compilers will also regress. As there is no Shader Model 4 platform on Mac anymore I've amended the LevelEditorActions to disable the preview modes when no appropriate shader platform is available. Change 3721244 by Mark.Satterthwaite Fix incorrect enum handling for Metal features due to overflow. #jira UE-51643 Change 3721338 by Mark.Satterthwaite MIssing file from 3721232 Change 3721818 by Mark.Satterthwaite Fix the Intel vector-array-dereference workaround so that it doesn't cause the AMD compiler to explode instead. Change 3722139 by Arne.Schober DR - [UE-51602] -Fixed Typo that accidently bound the LightingInstancebuffer to the Transform one #jira UE-51602 Change 3722165 by Rolando.Caloca DR - Default -opengl to GL4 Change 3722682 by Guillaume.Abadie Fixes wrong clear color in SSR important for VR that has a HMD mesh. Change 3722766 by Rolando.Caloca DR - Fix static analysis Change 3722943 by Mark.Satterthwaite Disable the METAL_SM5_NOTESS shader platform again - I can workaround the Nvidia pipeline state compiler crash by changing the buffer address space from "constant" to "device" as we're managing to confuse the poor thing. This won't materially affect AMD or Intel as they don't care much about this, but to limit performance issues on Nvidia we only need to do this for Tessellation Compute shaders. Change 3723100 by Mark.Satterthwaite Apparently users like enabling Metal shader standards that won't work on their current OS, so don't display those that aren't going to work & display an error message before quitting rather than crashing when trying to load a project that tries to use an incompatible shader version. Change 3723121 by Mark.Satterthwaite Fix build error. Change 3723245 by Daniel.Wright Ensure for when a reflection capture upload fails due to incorrect lighting scenario level handling Reflection captures with no data use an array index of 0, instead of -1. Might avoid reading uninitialized memory on PS4. Change 3723387 by Arne.Schober DR - Metal already applies the instance and vertexoffset in the shader Change 3723393 by Mark.Satterthwaite More fixes to the mtlpp compiler test application. Change 3725258 by Guillaume.Abadie Improves fast TAA upsample shader permutation by 15% on console. Change 3725555 by Chris.Bunner [Dupliate] CL 3725548 - Fixed invalid screenpercentage value in VehicleGame sample (was setting -1 but should default to 100). This has always been broken but was recently exposed by CL 3686200. Change 3726845 by Guillaume.Abadie Exposes SvPosition to material through screen position material expression, so that material no longer have SvPosition * InvViewSize * ViewSize precision loss. #jira UE-51428 Change 3728014 by Guillaume.Abadie Uses ScreenPosition material expression's PixelPosition pin in existing engine functions to improve precision. #jira UE-51428 Change 3728053 by Richard.Wallis Duplicate CL 3727958: Crash fix when using shared material libraries. Initial shader code library offset is not zero'd so all entry offsets were garbage. Change 3728339 by Guillaume.Abadie Adds project setting for TAA upample, and officialises TAA upsampling CVar. Change 3728549 by Guillaume.Abadie CsvProfiler is pretty cool, but even better with console autocompletion for lazy developers. Change 3728752 by nick.bullard Built and re-saved QA-MeshPaint #jira UE-50978 Change 3728775 by Guillaume.Abadie Implements r.DynamicRes.ChangePercentageThreshold to stabilize primary screen percentage. Change 3729224 by Uriel.Doyon Hidden levels now keep their last build data when using lighting scenarios. Hidden levels don't affect the scene anymore volumetric lighting when not using lighting scenarios. #jira UE-40454 #jira UE-38131 Change 3729243 by Marcus.Wassmer Update Ansel to 1.4 #github 4159 #jira UE-51545 Change 3729325 by zachary.wilson Adding indirect lighting to TM-LightingChannels #jira UE-47069 Change 3729485 by zachary.wilson Fixing ambient occlusion bias on QA-LightsStationary. Removed global PPV with bad settings, also fixed the shadow on the roof. #jira UE-50972 Change 3729629 by Uriel.Doyon Fixed crash when using debug view modes. Fixed d3ddebug error when clearing quad overdraw buffer. #jira UE-51836 Change 3730053 by Guillaume.Abadie Allows edititing of AScreenshotFunctionalTestBase::ScreenshotCamera. Change 3730308 by Guillaume.Abadie Disables TAA upsample on buffer visualization, and disallow screen percentage preview in editor viewport with any buffer visualization. Change 3730355 by Guillaume.Abadie Sacrifices consistency for good cvar name for TAA upsample. Change 3731403 by Daniel.Wright Reduced slider for ContactShadowLength to .1, algorithm produces poor results with larger values. Change 3731404 by Daniel.Wright Checkpoint for ScreenShadowMaskTexture, allowing 'vis ScreenShadowMaskTexture' Change 3731407 by Daniel.Wright Must opt-in for FDistanceFieldSceneData::VerifyIntegrity Change 3731517 by Guillaume.Abadie Freezes dynamic resolution heuristic when doing pause. Change 3732168 by Guillaume.Abadie Renames TAA upsampling cvar. Change 3732295 by Guillaume.Abadie Lets the scene texture's size and texel size return the correct sizes after TAA upsample. Change 3732313 by Guillaume.Abadie Implements SceneTexture material expressions' automated tests. Change 3734928 by Guillaume.Abadie Adds panic mode when the last N frames are over budget to the dynamic resolution heuristic. Change 3735966 by Ryan.Vance Fixing mac steamvr compile issue. Missed a few lines in the refactor because mac. Change 3736104 by Guillaume.Abadie Removes FSceneViewInitOptions::bDisableGameScreenPercentage brought by 4.18, that new screen percentage API do in a better way. Change 3736346 by Daniel.Wright Volumetric fog is always interpolated in the pixel shader, since per-vertex interpolation gives consistently poor results. Fixes Volumetric Fog on opaque in Forward, and on transparent in Deferred. Forward shading: per-pixel height fog is always done in the base pass, to work with MSAA correctly Change 3736348 by Daniel.Wright Forward shadowing of directional light for translucency * Static shadowing and CSM supported with minimal filtering (1 PCF) * Deferred renderer: affects translucency using 'Surface ForwardShading' lighting mode. Forward renderer: affects all translucency. Change 3736650 by Rolando.Caloca DR - vk - # of desc pools Change 3737985 by Guillaume.Abadie Fixes pixel inspector with primary and secondary screen percentage. Change 3738638 by Michael.Lentine Compile fix due to unclear operator precendence. Change 3739417 by Daniel.Wright Fixed a few issues with irradiance cache visualization Change 3739447 by Daniel.Wright Skip forward static shadowing in projects with static lighting disabled Change 3739595 by Daniel.Wright ConditionalPostLoad DistanceFieldReplacementMesh. Should fix a crash on load when static mesh derived data is being rebuilt, and the DistanceFieldReplacementMesh is in use. Change 3739598 by Daniel.Wright Disable capsules shadows on lowest shadow quality Change 3739611 by Daniel.Wright Added r.CapsuleDirectShadows and r.CapsuleIndirectShadows for more specific scalability control over capsule shadow features New Lighting Feature show flags for RTDF shadows and Capsule Shadows Change 3740516 by Guillaume.Abadie Fixes VR editor rendering only on eye with TAA upsample. #jira UE-52016 Change 3740580 by Guillaume.Abadie Fixes chromatic aberration with TAA upsample and multiple view rendering. #jira UE-51993 Change 3740588 by Guillaume.Abadie Gives to FXAA a more explicit draw event name for easier UDN support. Change 3740845 by Michael.Lentine Fix shipping build. Change 3740903 by Guillaume.Abadie Disables dynamic resolution threading outliers detection by default and includes editor UI GPU cost within dynamic resolution's begin/end frame events for better reliability of timestamp query based dynamic res in editor. Change 3741355 by Daniel.Wright Normalize planar reflection plane - fixes crash when scaling a BP with a planar reflection component Change 3741357 by Daniel.Wright More info on volumetric lightmap import failure Change 3742535 by Ryan.Vance Fix for view rect changes. Change 3743282 by Guillaume.Abadie Fixes a bug in dynamic resolution heuristic's outlier detection that was preventing the over budget panic to react. Change 3743559 by Michael.Lentine Port Siren changes for recompute tangents. This adds recompute tangents for cloth as well as the ability for recompute tangents to work across seams where vertices are duplicated. Change 3743679 by Guillaume.Abadie Cherry-pick 3743621: Fixes subsurface profile fallback to lit shading model when Opacity == 0, introduced by 3447144. #jira UE-51569 Change 3743906 by Ryan.Brucks BlueprintMaterialAndTextureNodes Plugin: Fix for clamping sampled HDR render target values by setting ERangeCompressionMode in the FReadSurfaceDataFlags to RCM_MinMax Change 3744096 by Ryan.Brucks BlueprintMaterialAndTextureNodes Plugin: removed Mip option from Texture2D_SampleUV_EditorOnly for now since reads from source data cannot access mips and it can be misleading. Change 3744253 by Guillaume.Abadie Fixes merge collisions of debug canvas rendering with High DPI, fixes stat unit on high DPI monitors, and fixes secondary screen percentages. Change 3744953 by Chris.Bunner Crash workaround. Change 3745628 by Marcus.Wassmer Temporarily disable recalctangent normal-smoothing #jira UE-52166 Change 3745942 by Guillaume.Abadie Fixes a todo in FCommonViewportClient Change 3746005 by Guillaume.Abadie Fixes stat UnitGraph on high DPI monitor. Change 3746029 by Guillaume.Abadie Oups.... Fix compilation. :D Change 3748322 by Guillaume.Abadie Shows dynamic resolution's primary screen percentage on stat unit/unitgraph console commands. Change 3748346 by Chris.Bunner Potential static analysis fix. Change 3748349 by Chris.Bunner Mac feature support flag fix on versions < 10.30. Change 3749336 by Guillaume.Abadie Fixes some spelling mistakes in dynamic resolution cvars. Thanks Daniel! Change 3749374 by Guillaume.Abadie Adds a black background on the stat unitgraph so timing curves can be seen no matter the content. Change 3749437 by Guillaume.Abadie Final UI polish up for `stat unitgraph` Change 3749719 by Guillaume.Abadie Fixes a crash when changing r.DynamicRes.MaxScreenPercentage below current screen percentage. Change 3750243 by Chris.Bunner Increasing controller's automated test timeout to allow for slower machines to complete the longest tests. #jira UE-48494, UE-51907 Change 3750728 by Guillaume.Abadie Fixes merge collision in chromatic aberration. #jira UE-52282 Change 3750791 by Guillaume.Abadie Fixes chromatic baerration R and G channel swap. Change 3751246 by Guillaume.Abadie Bypasses screen percentage apply with mobile LDR rendering. #jira UE-52089 Change 3752624 by Guillaume.Abadie Simplies dyn res state's event interface to a single virtual method. Change 3753766 by Chris.Bunner Rebuilt volumetric baked lighting test map and updated screenshots. #jira UE-52322 Change 3755108 by Guillaume.Abadie Fixes a bug where default dynamic resolution state was created at startup of server build. #jira UE-52345 Change 3755267 by Mark.Satterthwaite Fix condition controlling which features are enabled when iOS >= 10.3 - it wasn't working for iOS 11+ which was causing all kinds of problems. #jira UE-52301 Change 3755811 by Chris.Bunner Disable some new logging that was causing a stack overflow during EnginePreInit. #jira UE-52345 Change 3756983 by Mark.Satterthwaite Prevent different versions of metal_stdlib/ue4_stdlib from causing shader compilation failures due to a time-stamp mismatch between the local file & the PCH. This can happen when working with Xcode Beta releases that change the modification date, but not the content or compiler version, amongst other possibilities. #jira UE-52073 Change 3757156 by Guillaume.Abadie Fixes editor compositing with wireframe rendering. #jira UE-52017 Change 3757435 by Mark.Satterthwaite Workaround a bug in the MobileSceneCaptureRendering where it was copying the ViewInfo's ViewRect prior to it being configured by the mobile renderer. #jira UE-52327 Change 3757523 by Uriel.Doyon Fixed d3ddebug warning with unused inputs Change 3758318 by Guillaume.Abadie Cleaner fix for mobile scene captures. #jira UE-52327 Change 3759541 by Mark.Satterthwaite Don't enable Manual Vertex Fetch on iOS Metal for the moment as it isn't well tested there and will probably need further changes. Change 3695086 by Guillaume.Abadie Render thread dynamic resolution & TAA upsample. Merging //Tasks/UE4/Dev-DynamicRes/...@3694528 to //UE4/Dev-Rendering/... New features breakdown: - TAA upsample compute shader that accepts screen percentage from 50% to 200%, with a faster shader permutation for consoles; - Material no longer have to deal with BufferUV, and post process material after TAA upsample can sample any scene buffer seamlessly; - Material texture per view mip bias to produce sharper images with TAA upsample; - Render thread dynamic resolution heuristic is fully plugable by game code (for VR plugin specific heuristics); - Dynamic resolution in PIE and game builds; - Busy time queries in the RHI to be implemented on the different platforms so that the dynamic resolution heuristic can exactly associate GPU frame times with screen percentages in its history; - Game user settings to enable/disable dynamic resolution; - In editor viewport screen percentage config to previsualise and test content at different screen percentage. Fixes: - Various fixes for algorithms producing different outputs at different screen percentage. - Various fixes for algorithms sampling outside view rects. Refactors: - TAA shader - Moved some screen percentage specific members from FSceneView to FViewInfo for thread race bullet proofing. Aknowledgements: - VR plugins are broken - DFAO still have some artifacts Premiliminary review: Marcus.Wassmer Review for TAA refactor and TAA upsample shader: Brian.Karis Review for dynamic resolution: Brian.Karis [CL 3761165 by Chris Bunner in Main branch]
2017-11-16 11:36:35 -05:00
void FDebugViewModeMeshProcessor::UpdateInstructionCount(FDebugViewModeShaderElementData& OutShaderElementData, const FMaterial* InBatchMaterial, FVertexFactoryType* InVertexFactoryType)
{
check(InBatchMaterial && InVertexFactoryType);
if (Scene)
{
if (Scene->GetShadingPath() == EShadingPath::Deferred)
{
const EShaderPlatform ShaderPlatform = GetFeatureLevelShaderPlatform(InBatchMaterial->GetFeatureLevel());
FMaterialShaderTypes ShaderTypes;
if (IsSimpleForwardShadingEnabled(ShaderPlatform))
{
ShaderTypes.AddShaderType<TBasePassVS<TUniformLightMapPolicy<LMP_SIMPLE_NO_LIGHTMAP>>>();
ShaderTypes.AddShaderType<TBasePassPS<TUniformLightMapPolicy<LMP_SIMPLE_NO_LIGHTMAP>, false>>();
}
else
{
ShaderTypes.AddShaderType<TBasePassVS<TUniformLightMapPolicy<LMP_NO_LIGHTMAP>>>();
ShaderTypes.AddShaderType<TBasePassPS<TUniformLightMapPolicy<LMP_NO_LIGHTMAP>, false>>();
}
FMaterialShaders Shaders;
if (InBatchMaterial->TryGetShaders(ShaderTypes, InVertexFactoryType, Shaders))
{
OutShaderElementData.NumVSInstructions = Shaders.Shaders[SF_Vertex]->GetNumInstructions();
OutShaderElementData.NumPSInstructions = Shaders.Shaders[SF_Pixel]->GetNumInstructions();
if (IsForwardShadingEnabled(ShaderPlatform) &&
!IsSimpleForwardShadingEnabled(ShaderPlatform) &&
!IsTranslucentBlendMode(InBatchMaterial->GetBlendMode()))
{
const bool bLit = InBatchMaterial->GetShadingModels().IsLit();
// Those numbers are taken from a simple material where common inputs are bound to vector parameters (to prevent constant optimizations).
OutShaderElementData.NumVSInstructions -= GShaderComplexityBaselineForwardVS - GShaderComplexityBaselineDeferredVS;
OutShaderElementData.NumPSInstructions -= bLit ? (GShaderComplexityBaselineForwardPS - GShaderComplexityBaselineDeferredPS) : (GShaderComplexityBaselineForwardUnlitPS - GShaderComplexityBaselineDeferredUnlitPS);
}
OutShaderElementData.NumVSInstructions = FMath::Max<int32>(0, OutShaderElementData.NumVSInstructions);
OutShaderElementData.NumPSInstructions = FMath::Max<int32>(0, OutShaderElementData.NumPSInstructions);
}
}
else // EShadingPath::Mobile
{
TShaderRef<TMobileBasePassVSPolicyParamType<FUniformLightMapPolicy>> MobileVS;
TShaderRef<TMobileBasePassPSPolicyParamType<FUniformLightMapPolicy>> MobilePS;
if (MobileBasePass::GetShaders(LMP_NO_LIGHTMAP, 0, *InBatchMaterial, InVertexFactoryType, false, MobileVS, MobilePS))
{
OutShaderElementData.NumVSInstructions = MobileVS.IsValid() ? MobileVS->GetNumInstructions() : 0;
OutShaderElementData.NumPSInstructions = MobilePS.IsValid() ? MobilePS->GetNumInstructions() : 0;
}
}
}
}
void FDebugViewModeImplementation::AddShaderTypes(ERHIFeatureLevel::Type InFeatureLevel,
const FVertexFactoryType* InVertexFactoryType,
FMaterialShaderTypes& OutShaderTypes) const
{
OutShaderTypes.AddShaderType<FDebugViewModeVS>();
OutShaderTypes.AddShaderType<FDebugViewModePS>();
}
void FDebugViewModeImplementation::GetDebugViewModeShaderBindings(
const FDebugViewModePS& Shader,
const FPrimitiveSceneProxy* PrimitiveSceneProxy,
const FMaterialRenderProxy& MaterialRenderProxy,
const FMaterial& Material,
EDebugViewShaderMode DebugViewMode,
const FVector& ViewOrigin,
int32 VisualizeLODIndex,
const FColor& SkinCacheDebugColor,
int32 VisualizeElementIndex,
int32 NumVSInstructions,
int32 NumPSInstructions,
int32 ViewModeParam,
FName ViewModeParamName,
FMeshDrawSingleShaderBindings& ShaderBindings) const
{
FVector4f OneOverCPUTexCoordScales[TEXSTREAM_MAX_NUM_TEXTURES_PER_MATERIAL / 4];
FIntVector4 TexCoordIndices[TEXSTREAM_MAX_NUM_TEXTURES_PER_MATERIAL / 4];
FVector4 WorldUVDensities;
FVector4f NormalizedComplexityValue;
FIntPoint AnalysisParameter;
const float PrimitiveAlpha = (!PrimitiveSceneProxy || PrimitiveSceneProxy->IsSelected()) ? 1.f : .2f;
const int32 TexCoordAnalysisIndex = ViewModeParam >= 0 ? FMath::Clamp<int32>(ViewModeParam, 0, MAX_TEXCOORDS - 1) : -1;
float CPULogDistance = -1.0f;
int32 bShowQuadOverdraw = 0;
const int32 boolOutputQuadOverdraw = (DebugViewMode == DVSM_QuadComplexity) || (DebugViewMode == DVSM_ShaderComplexityContainedQuadOverhead) ? 1 : 0;
const int32 LODIndex = FMath::Clamp(VisualizeLODIndex, 0, NumLODColorationColors - 1);
FMemory::Memzero(OneOverCPUTexCoordScales); // 0 remap to irrelevant data.
FMemory::Memzero(TexCoordIndices);
FMemory::Memzero(WorldUVDensities);
// Gather Data
#if WITH_EDITORONLY_DATA
if (PrimitiveSceneProxy)
{
PrimitiveSceneProxy->GetMaterialTextureScales(VisualizeLODIndex, VisualizeElementIndex, nullptr, OneOverCPUTexCoordScales, TexCoordIndices);
PrimitiveSceneProxy->GetMeshUVDensities(VisualizeLODIndex, VisualizeElementIndex, WorldUVDensities);
float Distance = 0;
if (PrimitiveSceneProxy->GetPrimitiveDistance(VisualizeLODIndex, VisualizeElementIndex, ViewOrigin, Distance))
{
// Because the streamer use FMath::FloorToFloat, here we need to use -1 to have a useful result.
CPULogDistance = FMath::Max<float>(0.f, FMath::Log2(FMath::Max<float>(1.f, Distance)));
}
}
#endif
if (DebugViewMode == DVSM_OutputMaterialTextureScales || DebugViewMode == DVSM_MaterialTextureScaleAccuracy)
{
const bool bOutputScales = DebugViewMode == DVSM_OutputMaterialTextureScales;
const int32 AnalysisIndex = ViewModeParam >= 0 ? FMath::Clamp<int32>(ViewModeParam, 0, TEXSTREAM_MAX_NUM_TEXTURES_PER_MATERIAL - 1) : -1;
AnalysisParameter = FIntPoint(bOutputScales ? -1 : AnalysisIndex, bOutputScales ? 1 : 0);
}
else if (DebugViewMode == DVSM_RequiredTextureResolution || DebugViewMode == DVSM_VirtualTexturePendingMips)
{
int32 AnalysisIndex = INDEX_NONE;
int32 TextureResolution = 64;
FMaterialRenderContext MaterialContext(&MaterialRenderProxy, Material, nullptr);
const FUniformExpressionSet& UniformExpressions = Material.GetUniformExpressions();
EMaterialTextureParameterType TextureTypes[] = { EMaterialTextureParameterType::Standard2D, EMaterialTextureParameterType::Virtual };
if (ViewModeParam != INDEX_NONE && ViewModeParamName == NAME_None) // If displaying texture per texture indices
{
for (EMaterialTextureParameterType TextureType : TextureTypes)
{
for (int32 ParameterIndex = 0; ParameterIndex < UniformExpressions.GetNumTextures(TextureType); ++ParameterIndex)
{
const FMaterialTextureParameterInfo& Parameter = UniformExpressions.GetTextureParameter(TextureType, ParameterIndex);
if (Parameter.TextureIndex == ViewModeParam)
{
const UTexture* Texture = nullptr;
UniformExpressions.GetTextureValue(TextureType, ParameterIndex, MaterialContext, Material, Texture);
if (Texture && Texture->GetResource())
{
AnalysisIndex = ViewModeParam;
if (Texture->IsStreamable())
{
TextureResolution = 1 << FMath::Max((Texture->GetResource()->GetCurrentMipCount() - 1), 0);
}
else
{
TextureResolution = FMath::Max(Texture->GetResource()->GetSizeX(), Texture->GetResource()->GetSizeY());
}
}
}
}
}
}
else if (ViewModeParam != INDEX_NONE) // Otherwise show only texture matching the given name
{
for (EMaterialTextureParameterType TextureType : TextureTypes)
{
for (int32 ParameterIndex = 0; ParameterIndex < UniformExpressions.GetNumTextures(TextureType); ++ParameterIndex)
{
const UTexture* Texture = nullptr;
UniformExpressions.GetTextureValue(TextureType, ParameterIndex, MaterialContext, Material, Texture);
if (Texture && Texture->GetResource() && Texture->GetFName() == ViewModeParamName)
{
const FMaterialTextureParameterInfo& Parameter = UniformExpressions.GetTextureParameter(TextureType, ParameterIndex);
AnalysisIndex = Parameter.TextureIndex;
if (Texture->IsStreamable())
{
TextureResolution = 1 << FMath::Max((Texture->GetResource()->GetCurrentMipCount() - 1), 0);
}
else
{
TextureResolution = FMath::Max(Texture->GetResource()->GetSizeX(), Texture->GetResource()->GetSizeY());
}
}
}
}
}
AnalysisParameter = FIntPoint(AnalysisIndex, TextureResolution);
}
if (DebugViewMode == DVSM_QuadComplexity)
{
NormalizedComplexityValue = FVector4f(NormalizedQuadComplexityValue);
bShowQuadOverdraw = true;
}
else
{
// normalize the complexity so we can fit it in a low precision scene color which is necessary on some platforms
// late value is for overdraw which can be problematic with a low precision float format, at some point the precision isn't there any more and it doesn't accumulate
const float NormalizeMul = 1.0f / GetMaxShaderComplexityCount(Material.GetFeatureLevel());
NormalizedComplexityValue = FVector4f(NumPSInstructions * NormalizeMul, NumVSInstructions * NormalizeMul, 1 / 32.0f);
ShaderBindings.Add(Shader.ShowQuadOverdraw, DebugViewMode != DVSM_ShaderComplexity ? 1 : 0);
bShowQuadOverdraw = DebugViewMode != DVSM_ShaderComplexity ? 1 : 0;
}
// Bind Data
ShaderBindings.Add(Shader.OneOverCPUTexCoordScalesParameter, OneOverCPUTexCoordScales);
ShaderBindings.Add(Shader.TexCoordIndicesParameter, TexCoordIndices);
ShaderBindings.Add(Shader.CPUTexelFactorParameter, FVector4f(WorldUVDensities));
ShaderBindings.Add(Shader.NormalizedComplexity, NormalizedComplexityValue);
ShaderBindings.Add(Shader.AnalysisParamsParameter, AnalysisParameter);
ShaderBindings.Add(Shader.PrimitiveAlphaParameter, PrimitiveAlpha);
ShaderBindings.Add(Shader.TexCoordAnalysisIndexParameter, TexCoordAnalysisIndex);
ShaderBindings.Add(Shader.CPULogDistanceParameter, CPULogDistance);
ShaderBindings.Add(Shader.ShowQuadOverdraw, bShowQuadOverdraw);
ShaderBindings.Add(Shader.LODIndexParameter, LODIndex);
ShaderBindings.Add(Shader.SkinCacheDebugColorParameter, FVector3f(SkinCacheDebugColor.R / 255.f, SkinCacheDebugColor.G / 255.f, SkinCacheDebugColor.B / 255.f));
ShaderBindings.Add(Shader.OutputQuadOverdrawParameter, boolOutputQuadOverdraw);
ShaderBindings.Add(Shader.VisualizeModeParameter, DebugViewMode);
}
FMeshPassProcessor* CreateDebugViewModePassProcessor(const FScene* Scene, const FSceneView* InViewIfDynamicMeshCommand, FMeshPassDrawListContext* InDrawListContext)
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3760894) #rb Rendering #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3658809 by Chris.Bunner Changing default HDR display gamut to P3 as in practice that's more common than Rec2020, this should be a user-facing option where possible though as we can't automatically retrieve that data. Change 3658842 by Chris.Bunner Backing out previous HDR default gamut change as it conflicts with mandatory platform defaults. Change 3695269 by Arne.Schober DR - Make clang happy wreorder Change 3695418 by Guillaume.Abadie Fixes compilation failure in FoliageType_InstancedStaticMesh.cpp. Change 3695430 by Guillaume.Abadie Fixes missing BeginFrame dynamic resolution event in EngineTest. Change 3695469 by Guillaume.Abadie Fixes crash when passing down an invalid parameter on the sample material expression's DDX, DDY parameters. Change 3696091 by Guillaume.Abadie Fixes Linux compilation failure in DynamicResolution.cpp Change 3696593 by Chris.Bunner Fixed typo in vetex factory enum. Change 3696596 by Chris.Bunner Added material attributes type checking to If material expression. Updated If material expression to validate compilation of inputs. Change 3696597 by Chris.Bunner Allow visible parameter retrieval to correctly traverse through internally called functions. Previous check was intended to prevent function previews from leaving their graph through unhooked inputs, but unintentionally blocked all function inputs. Change 3696599 by Chris.Bunner Fixed material instance parameter visiblity when using nested static switches across functions. #jira UE-50878 Change 3696734 by Chris.Bunner Return type fix. Change 3697123 by Guillaume.Abadie Fixes compilation failure in PostProcessWeightedSampleSum.cpp on Windows 32bits. Change 3697125 by Guillaume.Abadie Fixes compilation failure in MaterialExpressionIf.h Change 3697127 by Guillaume.Abadie Fixes compilation failure in DynamicResolution.cpp on shipping build. Change 3697135 by Guillaume.Abadie Fixes crash in dynamic resolution event frontend when resizing game play viewport in EngineTest. Change 3697199 by Guillaume.Abadie Fixes TAA upsample's shader compilation failure on Mac. Change 3697220 by Guillaume.Abadie Makes static analysis happy again. Change 3697280 by Chris.Bunner Fixing up invalid casts in material layers validation. Change 3697366 by Rolando.Caloca DR - hlslcc - Fix warning #jira UE-43988 Change 3697451 by Rolando.Caloca DR - vk - Per pipeline descriptor pools Descriptor pool are now allocated per PSO instead of globally to reduce peak mem consumption and fragmentation Enabled on Windows only via VULKAN_USE_PER_PIPELINE_DESCRIPTOR_POOLS Change 3697477 by Rolando.Caloca DR - vk - Custom memory allocator Remove old/unused stats Change 3697486 by Rolando.Caloca DR - vk - Fix validation issue Change 3697488 by Richard.Wallis Fix for Mac editor session no longer accurately tracking Mouse location after moving between Desktops in Mission Control on 10.12.6. Problem stems from the extra call to update the slate cached window position in mouse move while dragging, which is itself is a hack but apparently this is needed as we don't get window position updates on Mac while dragging (although I couldn't see any -ve side effects without it) then the OS (in 10.12.6) doesn't always push out a final window did move notificaiton when changing desktops which leaves the window according to slate incorrectly positoned to it's frame. Solution is to either remove the mouse-move-while-drag window position hack or add a final window position update to the mouse-up event while dragging - this change is the latter. #jira UE-37553 Change 3697501 by Richard.Wallis Move audio processing over to audio bus tap. Currently on Mac Media audio playback uses OS media player mixer rather than Engine as existing implemtation, using AVAssetReader, now suffers from poor performance with new Media Framework. This audio tap version replaces that asset reader implementation but also suffers from bad quality audio hence is still disabled at the top of AvfMediaTracks.cpp. Original Code Review Description: Convert Mac to Play audio through the engine MediaFramework API rather than using AVMediaPlayer. This is the Mac implementation only - this should work ok on iOS but unable to test due to missing audio type implementation (throws error "Init Buffer on unsupported sound type name = Synth type = 5"), as such is only enabled for Mac. There maybe some extra tweaks required for iOS on app backgrounding etc if this feature is enabled. - Stuttering Audio Performace issue investiagation: Re-Tested this implementation against [now fixed] current Mac implementation which was working fine last year and that implementation now has the same audio output quality (performance) issues as this one. Basic investigation seems to point to somewhere in the engine audio handing. When poor audio is heard the FMediaAudioResampler::Generate() function is dequeing an IMediaAudioSample sample buffer and the audio sample queue usually has 50-100 of these IMediaAudioSample buffers waiting in the queue. I think the AvfMedia playback system is providing the sample buffers in good time but they are not getting consumed "fast" enough. This under consuming also occurs if I force the Core Audio - Audio Unit mixer to use 48000 samples/sec. #jira UEPLAT-1677 Change 3697517 by Richard.Wallis XCode 9.0 extra nullability specifiers required. Change 3697537 by Richard.Wallis Back out revision 23 from //UE4/Dev-Rendering/Engine/Plugins/Media/AvfMedia/Source/AvfMedia/Private/Player/AvfMediaTracks.cpp Change 3697670 by Rolando.Caloca DR - vk - Fix mapstaging surface Change 3697846 by Uriel.Doyon Allow denormalized values when converting float32 to float16. Change 3697892 by Uriel.Doyon Fix for unaligned structure elements Change 3699335 by Richard.Wallis Mac compile fix - turns out I did need these nullability specifiers here. Change 3699663 by Guillaume.Abadie Fixes time unit conversions from microseconds to milliseconds error in dynamic resolution heuristic when using GPU busy time queries. Change 3699959 by Rolando.Caloca DR - Fix barrier in the middle of render pass Change 3699969 by Rolando.Caloca DR - vk - Change dump layer location so it prints out validation ids Change 3700356 by Guillaume.Abadie Implements secondary screen percentage to be able to do TAA upsample followed spatial upscale so that the editor viewport still have same TAA upsample screen percentage range to test the content with no matter monitor's DPI. Change 3701105 by Guillaume.Abadie Ignore per view automatic mip bias on texture type other than 2d textures. #jira UE-51396 Change 3702297 by Richard.Wallis Mac compile fix for nullable specifier. Looks like Obj class using the C++ class also needs this otherwise it throws. Seems to be some kind of xcode/compiler caching bug with this stuff as it'll report the error once then on subsequent compiles say everything is ok. #jira UE-51386 Change 3702357 by Richard.Wallis Mac nullability compile fix - again. Looks like I fell foul of that xcode compile caching! #jira UE-51386 Change 3702424 by Guillaume.Abadie Fixes planar reflection from drowing themselves in their own FSceneRenderer in forward shading. #jira UE-51395 Change 3702464 by Guillaume.Abadie Fixes wrong viewport to buffer conversion of the distortion. #jira UE-51406 Change 3702819 by Guillaume.Abadie Fixes planar reflections with secondary screen percentage for HighDPI editor viewports. Change 3703732 by Guillaume.Abadie Removes unecessary check(); when there is more than 2 players with planar reflections. #jira UE-51436 Change 3704302 by Guillaume.Abadie Removes unecessary Interface suffix on new dynamic resolution related interfaces Change 3704390 by Chris.Bunner Fixed a coincidentally correct define. Change 3704730 by Rolando.Caloca DR - vk - Fix map for depth surfaces Change 3704739 by Rolando.Caloca DR - Debug label on D3D11 UAVs - Validate when running -d3debug Change 3705000 by Chris.Bunner Skip compiling opacity and opacity mask inputs on opaque surface materials. Previously the code was always added to the shader, sometimes we force opaque materials down a masked path which then calls the dormant code unintentionally. A safer fix for UE-48254. Partially reverted previous fix in CL 3608303 which removed a material instance optimization caching the overridden base properties. Change 3706065 by Guillaume.Abadie Does some renaming for primary screen percentage, and move the primary screen percentage method selection from dynamic resolution driver to FSceneView. Change 3706464 by Chris.Bunner Fixed material property translate overrides that were generating code in the wrong entry. Fixed conditions in If material expression GetInputType and IsMA check. #jira UE-51368 Change 3706641 by Chris.Bunner Missing "break" in switch statement (which unfortunately needs another bump to resolve). Change 3706642 by Guillaume.Abadie Fixes assertion failure when r.TemporalAA.EnableUpscale = 1 Change 3706650 by Gil.Gribb UE4 - UE4 - Changes from intel. Increase number of worker threads on Windows to if hyperthreads (hyperthreads √ 2) else cores √ 1 up to a max of 22 workers. Increase MAX_THREADS multiplier per bank from 22 to 26. Intel VTune ITT event annotations. Wrapped in same function as your existing CPU events and enabled with √vtune. Optimize NV cloth by consuming FVector instead of FVector4 out of the solver. Vertex buffers were using FVector all along. ~15% improvement. Optimize cloth copy to vertex buffer by adding prefetch (similar to how bones are already done). Move local to world cloth transform from CPU to GPU. When simulating lots of vertices game thread was becoming bottleneck doing matrix multiply. Add your TaskGraph task switch latency test code. Change 3706733 by Daniel.Wright Print Embree Build time Change 3706841 by Daniel.Wright EmbreeFilterFunc4 now handles masked out intersections properly Change 3707437 by Rolando.Caloca DR - vk - Android compile fix #jira UE-51474 Change 3707785 by Guillaume.Abadie Fixes viewport issue in bloom setup pass with TAA upsample. Change 3709623 by Rolando.Caloca DR - vk - Missing barrier for reading into cpu Change 3709633 by Rolando.Caloca DR - vk - Compile fix Change 3710454 by Mark.Satterthwaite Refactor the way we compile Buffer<> & RWBuffer<> types for Metal so that we can support the type-conversion semantics of HLSL/D3D. - Buffer<> types are converted to Linear Textures unless the internal type is 3-compnent or the STRONG_TYPE macro is added as a type-qualifier. Linear Textures require an MTLTexture "view" object be created around the MTLBuffer which is the backing-store and it is typically best if that buffer is marked as Private (GPU-only) memory, reading from this in the shader then uses the texture-fetch hardware to perform the format conversion on load. - RWBuffer<> & 3-compnent Buffer<> types are converted to use template functions to load/store - the implementation of which will read the format from the BufferSizes meta-table and determine which type-conversion to apply. Function-constants are used to specialise the shader where feasible to reduce branch costs (function-constants are a Metal feature that allow efficient runtime recompilation of bytecode shaders). - Buffer<> & RWBuffer<> types where the STRONG_TYPE macro is added as a type-qualifier (only does something on Metal, everywhere else it is #define'd away) are compiled as "raw" Metal buffers of the inner-type (e.g. float4 for Buffer<float4>) and the MetalRHI runtime will enforce that only SRVs/UAVs of the proper format are bound to it. This is necessary in a couple of cases (BoneMatrices, NumCulledLightsGrid, CulledLightDataGrid & ForwardLocalLightBuffer buffers) which are used in a larger number of shaders as Linear Textures have poorer performance than Buffer<>/RWBuffer<>. - Most of the complications to generating subtly different Metal code for different OS/device combinations have been factored out into ue4_stdlib.metal which acts as an extension to the Metal shader standard-library and helps simplify the MetalBackend code - particularly helpful for Buffer<>/RWBuffer<> but also texturecube_array and the SM6 wave-related intrinsics. - Reverted some of the awkward Metal-specific changes Richard.Wallis & Arne had to make to the high-level shaders as they aren't necessary anymore. - Made the existing Metal-specific changes to use uint32 for all light-grid injection buffers apply to all Metal platforms again (I had hoped that it would not be necessary anymore, but it is much faster this way). - STRONG_TYPE is actually hlslcc's "invariant" keyword applied as a type-qualifier to a Buffer<>/RWBuffer<> type - only valid when using Metal which exports this through ILanguageSpec and #define'd out for everyone else. - Old versions of iOS (anything earlier than iOS 10.3) won't be able to use this new code, so every buffer will be treated as "raw" and the MetalRHI will now properly report when something goes awry rather than it leading to mysterious rendering errors and crashes. Change 3710456 by Mark.Satterthwaite Fix the Eddie workset project generator so that Enterprise projects don't get mixed in with regular projects at the top-level because of the way Eddie combines workset groups. Change 3710457 by Mark.Satterthwaite DX11 texture formats for Mac Metal please! Change 3710480 by Mark.Satterthwaite Permit RHI thread and parallel execution in Mac -game mode again. Change 3710522 by Mark.Satterthwaite MSVC type-mismatch error fixes. Change 3710580 by Mark.Satterthwaite Alright then - if I can't use the C++11 extended string semantics I'll have to use "xxd -i" to generate a hex-dump include header from ue4_stdlib.metal instead. This can only be updated from a machine with access to the POSIX xxd command (Mac & Linux, possibly the new Linux sub-system for Win10). Change 3710616 by Mark.Satterthwaite Missing file. Change 3712972 by Guillaume.Abadie Fixes Circle DOF's negative alpha channel getting clamped to 0 in TAA pass. Change 3712979 by Guillaume.Abadie Fixes wrong RT reallocation when doing TAA upsample in editor viewports with secondary upscale. Change 3713406 by Mark.Satterthwaite Use GPU morph targets on Mac - the necessary buffer conversions will always be available there. For iOS it can only be supported if iOS 10 is the minimum OS & Metal standard so leave that on the CPU path for now. Change 3713494 by Richard.Wallis Fix for hitch when PIE unloading sublevel. PerformReachabilityAnalysisOnObjects is spawing multiple threads in Editor builds as there is an extra code path that results in Critical Section locking within a singleton type static object - this is a bottle neck for multiple threads. However they all just need to read the data not change it. Replaced FScopeLock with a Read/Write version allowing these threads to all take a read lock at the same time to reduce contention. Changed the FUObjectAnnotationDense implementation only - left the sparse implementation alone as its not currently affecting this - although we could proactivly change that too. Also tested again repro in linked bug UE-24711. #jira UE-40533 Change 3713612 by Mark.Satterthwaite Integrate LPV_STORE_INDEX_IN_HEAD_BUFFER related changes from //depot/Partners/Microsoft/UE4-MS/Engine-Fable @ 2954744 This should make Light Propagation Volumes potentially viable on non-Microsoft platforms. Change 3713623 by Mark.Satterthwaite Implement ByteAddressBuffer/RWByteAddressBuffer in hlslcc in a similar manner to StructuredBuffer/RWStructuredBuffer so that the backends don't need too much modification. Implement the necessary changes into MetalBackend to make this work for Metal. Load/Store{+2,3,4} & Atomics are supported. Counter operations are not supported and aren't likely to be. Change 3713636 by Mark.Satterthwaite Enable LPVs for Mac Metal. - Rework some multi-dimensional arrays & array-index dependent HLSL code that hlslcc simply can't cope with, the mesa-glsl compiler core is only capable of dealing with 1 dimensional arrays and array-indexing can't itself be directly dependent on the result of an array-index operation. - MetalRHI needs to ignore any SetRenderTargets call that binds nothing at all as you must bind at least one target (UAV, RT, Depth/Stencil) for it to be able to do anything sensible. - Turn on LPVs for Metal as it works now. Change 3714049 by Guillaume.Abadie Do not set screen percentage method to TAA upsample when anti aliasing method is not TAA even if there is automatic fallback in the renderer. Change 3714306 by Guillaume.Abadie Fixes assertion failure in dynamic resolution state proxy with GPU busy time queries. Change 3714714 by Mark.Satterthwaite Tweak Metal GPU identification so that it works with eGPU boxes and protoype hardware - these changes only apply to macOS 10.13 so the system as a whole remains. Change 3716104 by Mark.Satterthwaite Fix 10.12/Xcode 8 compile errors from the build-farm which is still split until Fortnite can update. Change 3716120 by Mark.Satterthwaite Silence static-analysis. Change 3716158 by Guillaume.Abadie Rewrites editor primitive compositing to support TAA upsample. This takes the oportunity to remove the manual depth testing in base pass pixel shader of editor primitives. Change 3716271 by Daniel.Wright Lightmass correctness fixes * After these changes, point, spot, directional and sky lights closely match reference renderer Mitsuba after light unit conversions * Photon density trimming intended for direct photons was affecting indirect photons as well. This caused high noise for point / spot lights with a large attenuation radius. Indirect photon density even for small lights is 5x with this change, which improves 2nd bounce quality. * Removed legacy fudge factor on point / spot light photon energy * Spotlights no longer emit based on indirect photon paths. Fixes excessive photon energy from spot lights as they were emitting outside of the cone. * Fixed photons computing one more bounce than requested. * Added an option to use the Radiosity solver for all multibounce, replacing photons. Useful as a reference but generally too much noise indoors. * Fixed visualization of photons without final gather Change 3716434 by Mark.Satterthwaite Backout the remaining change from 3632041 that is no longer necessary - this was the last of the 4.18 Metal workarounds. Change 3716491 by Chris.Bunner Fixing up an edge-case on a recent optimization. Change 3716611 by Guillaume.Abadie Allows secondary screen percentage >= 100%. Change 3716977 by Guillaume.Abadie Back out changelist 3716158 to unblock QA pass. #jira UE-51580 Change 3717111 by Arne.Schober Fixing nomalization of Morph Tangents https://udn.unrealengine.com/questions/392462/ Also implemanted batching of the dispatches which should help worst case perfomance where dispatches become too small. CalculateInverseAccumulatedWeights is not cheap and proably should be moved onto a task thread that runs as soon as the input weights are ready. Change 3717127 by Mark.Satterthwaite Fix a mismerge from the reversion of 3632041 - part of the modified code had been moved into another file and I didn't initially notice. Change 3717178 by Mark.Satterthwaite Remove useless copy-pasted expressions from glsl_type::GetByteAddressBufferInstance & force MetalBackend to relink. Apparently the previous Mac libs were mysteriously broken. #jira UE-51583 Change 3717476 by Marcus.Wassmer Fix PS4 compile. funciton local statics not allowed on PSSL Also enabled the new atomics method for LPVs for all platforms Change 3717502 by Arne.Schober DR - Compiletime option for compressed ruleset (0.02ms perf gain on PS4 and disabled by default as it limits array size to 2million entries) Change 3717601 by Arne.Schober DR - Move cycle counter into more meaningfull locations. Change 3718054 by Guillaume.Abadie Removes unecessary check() failure on secondary upscale that fires when testing raw output screen percentage method. Change 3718066 by Guillaume.Abadie Reland: Rewrites editor primitive compositing to support TAA upsample. This takes the oportunity to remove the manual depth testing in base pass pixel shader of editor primitives. Change 3718589 by Mark.Satterthwaite Console-variable to enable and disable Manual-Vertex-Fetch for Metal and fix the internal code to handle the subtle changes in behaviour for vertex-declarations so we don't explode under the Metal validation layer. MVF works on macOS, though testing did expose an error with Tessellation on Nvidia (true for MVF enabled & disabled). Change 3718633 by Guillaume.Abadie Fixes temporal instability issue of TAA upsample with secondary screen percentage. Change 3718658 by Arne.Schober DR - 25% MorphTarget Speed increase because there was a bit of cache thrashing between the waves going on. Change 3718818 by Mark.Satterthwaite Fix compilation on hlslcc - integral values are not automatically converted into comparisons with zero. Change 3719004 by Guillaume.Abadie Lets the game viewport client automatically set raw output screen percentage method when doing dynamic resolution with stereo rendering but without TAA upsample. Change 3719375 by Mark.Satterthwaite Extend mtlpp compiler testing app to support Metal tessellation compute shaders so we can send Nvidia a much simpler reproduction of their regression. Change 3720099 by Mark.Satterthwaite Make the left-hand arguments work in airdiff. Change 3720413 by Mark.Satterthwaite Support standalone compute shaders in the mtlpp compiler test app. Change 3721232 by Mark.Satterthwaite No more Metal Shader Model 4 - instead we have to have a Metal Shader Model 5 w/o Tessellation as Nvidia's shader compiler is broken on all tessellation shaders in 10.13.0 and above. There is no guarantee that they will fix this prior to 10.14 and I can't afford to disable tessellation entirely as if I do that then the AMD & Intel compilers will also regress. As there is no Shader Model 4 platform on Mac anymore I've amended the LevelEditorActions to disable the preview modes when no appropriate shader platform is available. Change 3721244 by Mark.Satterthwaite Fix incorrect enum handling for Metal features due to overflow. #jira UE-51643 Change 3721338 by Mark.Satterthwaite MIssing file from 3721232 Change 3721818 by Mark.Satterthwaite Fix the Intel vector-array-dereference workaround so that it doesn't cause the AMD compiler to explode instead. Change 3722139 by Arne.Schober DR - [UE-51602] -Fixed Typo that accidently bound the LightingInstancebuffer to the Transform one #jira UE-51602 Change 3722165 by Rolando.Caloca DR - Default -opengl to GL4 Change 3722682 by Guillaume.Abadie Fixes wrong clear color in SSR important for VR that has a HMD mesh. Change 3722766 by Rolando.Caloca DR - Fix static analysis Change 3722943 by Mark.Satterthwaite Disable the METAL_SM5_NOTESS shader platform again - I can workaround the Nvidia pipeline state compiler crash by changing the buffer address space from "constant" to "device" as we're managing to confuse the poor thing. This won't materially affect AMD or Intel as they don't care much about this, but to limit performance issues on Nvidia we only need to do this for Tessellation Compute shaders. Change 3723100 by Mark.Satterthwaite Apparently users like enabling Metal shader standards that won't work on their current OS, so don't display those that aren't going to work & display an error message before quitting rather than crashing when trying to load a project that tries to use an incompatible shader version. Change 3723121 by Mark.Satterthwaite Fix build error. Change 3723245 by Daniel.Wright Ensure for when a reflection capture upload fails due to incorrect lighting scenario level handling Reflection captures with no data use an array index of 0, instead of -1. Might avoid reading uninitialized memory on PS4. Change 3723387 by Arne.Schober DR - Metal already applies the instance and vertexoffset in the shader Change 3723393 by Mark.Satterthwaite More fixes to the mtlpp compiler test application. Change 3725258 by Guillaume.Abadie Improves fast TAA upsample shader permutation by 15% on console. Change 3725555 by Chris.Bunner [Dupliate] CL 3725548 - Fixed invalid screenpercentage value in VehicleGame sample (was setting -1 but should default to 100). This has always been broken but was recently exposed by CL 3686200. Change 3726845 by Guillaume.Abadie Exposes SvPosition to material through screen position material expression, so that material no longer have SvPosition * InvViewSize * ViewSize precision loss. #jira UE-51428 Change 3728014 by Guillaume.Abadie Uses ScreenPosition material expression's PixelPosition pin in existing engine functions to improve precision. #jira UE-51428 Change 3728053 by Richard.Wallis Duplicate CL 3727958: Crash fix when using shared material libraries. Initial shader code library offset is not zero'd so all entry offsets were garbage. Change 3728339 by Guillaume.Abadie Adds project setting for TAA upample, and officialises TAA upsampling CVar. Change 3728549 by Guillaume.Abadie CsvProfiler is pretty cool, but even better with console autocompletion for lazy developers. Change 3728752 by nick.bullard Built and re-saved QA-MeshPaint #jira UE-50978 Change 3728775 by Guillaume.Abadie Implements r.DynamicRes.ChangePercentageThreshold to stabilize primary screen percentage. Change 3729224 by Uriel.Doyon Hidden levels now keep their last build data when using lighting scenarios. Hidden levels don't affect the scene anymore volumetric lighting when not using lighting scenarios. #jira UE-40454 #jira UE-38131 Change 3729243 by Marcus.Wassmer Update Ansel to 1.4 #github 4159 #jira UE-51545 Change 3729325 by zachary.wilson Adding indirect lighting to TM-LightingChannels #jira UE-47069 Change 3729485 by zachary.wilson Fixing ambient occlusion bias on QA-LightsStationary. Removed global PPV with bad settings, also fixed the shadow on the roof. #jira UE-50972 Change 3729629 by Uriel.Doyon Fixed crash when using debug view modes. Fixed d3ddebug error when clearing quad overdraw buffer. #jira UE-51836 Change 3730053 by Guillaume.Abadie Allows edititing of AScreenshotFunctionalTestBase::ScreenshotCamera. Change 3730308 by Guillaume.Abadie Disables TAA upsample on buffer visualization, and disallow screen percentage preview in editor viewport with any buffer visualization. Change 3730355 by Guillaume.Abadie Sacrifices consistency for good cvar name for TAA upsample. Change 3731403 by Daniel.Wright Reduced slider for ContactShadowLength to .1, algorithm produces poor results with larger values. Change 3731404 by Daniel.Wright Checkpoint for ScreenShadowMaskTexture, allowing 'vis ScreenShadowMaskTexture' Change 3731407 by Daniel.Wright Must opt-in for FDistanceFieldSceneData::VerifyIntegrity Change 3731517 by Guillaume.Abadie Freezes dynamic resolution heuristic when doing pause. Change 3732168 by Guillaume.Abadie Renames TAA upsampling cvar. Change 3732295 by Guillaume.Abadie Lets the scene texture's size and texel size return the correct sizes after TAA upsample. Change 3732313 by Guillaume.Abadie Implements SceneTexture material expressions' automated tests. Change 3734928 by Guillaume.Abadie Adds panic mode when the last N frames are over budget to the dynamic resolution heuristic. Change 3735966 by Ryan.Vance Fixing mac steamvr compile issue. Missed a few lines in the refactor because mac. Change 3736104 by Guillaume.Abadie Removes FSceneViewInitOptions::bDisableGameScreenPercentage brought by 4.18, that new screen percentage API do in a better way. Change 3736346 by Daniel.Wright Volumetric fog is always interpolated in the pixel shader, since per-vertex interpolation gives consistently poor results. Fixes Volumetric Fog on opaque in Forward, and on transparent in Deferred. Forward shading: per-pixel height fog is always done in the base pass, to work with MSAA correctly Change 3736348 by Daniel.Wright Forward shadowing of directional light for translucency * Static shadowing and CSM supported with minimal filtering (1 PCF) * Deferred renderer: affects translucency using 'Surface ForwardShading' lighting mode. Forward renderer: affects all translucency. Change 3736650 by Rolando.Caloca DR - vk - # of desc pools Change 3737985 by Guillaume.Abadie Fixes pixel inspector with primary and secondary screen percentage. Change 3738638 by Michael.Lentine Compile fix due to unclear operator precendence. Change 3739417 by Daniel.Wright Fixed a few issues with irradiance cache visualization Change 3739447 by Daniel.Wright Skip forward static shadowing in projects with static lighting disabled Change 3739595 by Daniel.Wright ConditionalPostLoad DistanceFieldReplacementMesh. Should fix a crash on load when static mesh derived data is being rebuilt, and the DistanceFieldReplacementMesh is in use. Change 3739598 by Daniel.Wright Disable capsules shadows on lowest shadow quality Change 3739611 by Daniel.Wright Added r.CapsuleDirectShadows and r.CapsuleIndirectShadows for more specific scalability control over capsule shadow features New Lighting Feature show flags for RTDF shadows and Capsule Shadows Change 3740516 by Guillaume.Abadie Fixes VR editor rendering only on eye with TAA upsample. #jira UE-52016 Change 3740580 by Guillaume.Abadie Fixes chromatic aberration with TAA upsample and multiple view rendering. #jira UE-51993 Change 3740588 by Guillaume.Abadie Gives to FXAA a more explicit draw event name for easier UDN support. Change 3740845 by Michael.Lentine Fix shipping build. Change 3740903 by Guillaume.Abadie Disables dynamic resolution threading outliers detection by default and includes editor UI GPU cost within dynamic resolution's begin/end frame events for better reliability of timestamp query based dynamic res in editor. Change 3741355 by Daniel.Wright Normalize planar reflection plane - fixes crash when scaling a BP with a planar reflection component Change 3741357 by Daniel.Wright More info on volumetric lightmap import failure Change 3742535 by Ryan.Vance Fix for view rect changes. Change 3743282 by Guillaume.Abadie Fixes a bug in dynamic resolution heuristic's outlier detection that was preventing the over budget panic to react. Change 3743559 by Michael.Lentine Port Siren changes for recompute tangents. This adds recompute tangents for cloth as well as the ability for recompute tangents to work across seams where vertices are duplicated. Change 3743679 by Guillaume.Abadie Cherry-pick 3743621: Fixes subsurface profile fallback to lit shading model when Opacity == 0, introduced by 3447144. #jira UE-51569 Change 3743906 by Ryan.Brucks BlueprintMaterialAndTextureNodes Plugin: Fix for clamping sampled HDR render target values by setting ERangeCompressionMode in the FReadSurfaceDataFlags to RCM_MinMax Change 3744096 by Ryan.Brucks BlueprintMaterialAndTextureNodes Plugin: removed Mip option from Texture2D_SampleUV_EditorOnly for now since reads from source data cannot access mips and it can be misleading. Change 3744253 by Guillaume.Abadie Fixes merge collisions of debug canvas rendering with High DPI, fixes stat unit on high DPI monitors, and fixes secondary screen percentages. Change 3744953 by Chris.Bunner Crash workaround. Change 3745628 by Marcus.Wassmer Temporarily disable recalctangent normal-smoothing #jira UE-52166 Change 3745942 by Guillaume.Abadie Fixes a todo in FCommonViewportClient Change 3746005 by Guillaume.Abadie Fixes stat UnitGraph on high DPI monitor. Change 3746029 by Guillaume.Abadie Oups.... Fix compilation. :D Change 3748322 by Guillaume.Abadie Shows dynamic resolution's primary screen percentage on stat unit/unitgraph console commands. Change 3748346 by Chris.Bunner Potential static analysis fix. Change 3748349 by Chris.Bunner Mac feature support flag fix on versions < 10.30. Change 3749336 by Guillaume.Abadie Fixes some spelling mistakes in dynamic resolution cvars. Thanks Daniel! Change 3749374 by Guillaume.Abadie Adds a black background on the stat unitgraph so timing curves can be seen no matter the content. Change 3749437 by Guillaume.Abadie Final UI polish up for `stat unitgraph` Change 3749719 by Guillaume.Abadie Fixes a crash when changing r.DynamicRes.MaxScreenPercentage below current screen percentage. Change 3750243 by Chris.Bunner Increasing controller's automated test timeout to allow for slower machines to complete the longest tests. #jira UE-48494, UE-51907 Change 3750728 by Guillaume.Abadie Fixes merge collision in chromatic aberration. #jira UE-52282 Change 3750791 by Guillaume.Abadie Fixes chromatic baerration R and G channel swap. Change 3751246 by Guillaume.Abadie Bypasses screen percentage apply with mobile LDR rendering. #jira UE-52089 Change 3752624 by Guillaume.Abadie Simplies dyn res state's event interface to a single virtual method. Change 3753766 by Chris.Bunner Rebuilt volumetric baked lighting test map and updated screenshots. #jira UE-52322 Change 3755108 by Guillaume.Abadie Fixes a bug where default dynamic resolution state was created at startup of server build. #jira UE-52345 Change 3755267 by Mark.Satterthwaite Fix condition controlling which features are enabled when iOS >= 10.3 - it wasn't working for iOS 11+ which was causing all kinds of problems. #jira UE-52301 Change 3755811 by Chris.Bunner Disable some new logging that was causing a stack overflow during EnginePreInit. #jira UE-52345 Change 3756983 by Mark.Satterthwaite Prevent different versions of metal_stdlib/ue4_stdlib from causing shader compilation failures due to a time-stamp mismatch between the local file & the PCH. This can happen when working with Xcode Beta releases that change the modification date, but not the content or compiler version, amongst other possibilities. #jira UE-52073 Change 3757156 by Guillaume.Abadie Fixes editor compositing with wireframe rendering. #jira UE-52017 Change 3757435 by Mark.Satterthwaite Workaround a bug in the MobileSceneCaptureRendering where it was copying the ViewInfo's ViewRect prior to it being configured by the mobile renderer. #jira UE-52327 Change 3757523 by Uriel.Doyon Fixed d3ddebug warning with unused inputs Change 3758318 by Guillaume.Abadie Cleaner fix for mobile scene captures. #jira UE-52327 Change 3759541 by Mark.Satterthwaite Don't enable Manual Vertex Fetch on iOS Metal for the moment as it isn't well tested there and will probably need further changes. Change 3695086 by Guillaume.Abadie Render thread dynamic resolution & TAA upsample. Merging //Tasks/UE4/Dev-DynamicRes/...@3694528 to //UE4/Dev-Rendering/... New features breakdown: - TAA upsample compute shader that accepts screen percentage from 50% to 200%, with a faster shader permutation for consoles; - Material no longer have to deal with BufferUV, and post process material after TAA upsample can sample any scene buffer seamlessly; - Material texture per view mip bias to produce sharper images with TAA upsample; - Render thread dynamic resolution heuristic is fully plugable by game code (for VR plugin specific heuristics); - Dynamic resolution in PIE and game builds; - Busy time queries in the RHI to be implemented on the different platforms so that the dynamic resolution heuristic can exactly associate GPU frame times with screen percentages in its history; - Game user settings to enable/disable dynamic resolution; - In editor viewport screen percentage config to previsualise and test content at different screen percentage. Fixes: - Various fixes for algorithms producing different outputs at different screen percentage. - Various fixes for algorithms sampling outside view rects. Refactors: - TAA shader - Moved some screen percentage specific members from FSceneView to FViewInfo for thread race bullet proofing. Aknowledgements: - VR plugins are broken - DFAO still have some artifacts Premiliminary review: Marcus.Wassmer Review for TAA refactor and TAA upsample shader: Brian.Karis Review for dynamic resolution: Brian.Karis [CL 3761165 by Chris Bunner in Main branch]
2017-11-16 11:36:35 -05:00
{
const ERHIFeatureLevel::Type FeatureLevel = Scene ? Scene->GetFeatureLevel() : (InViewIfDynamicMeshCommand ? InViewIfDynamicMeshCommand->GetFeatureLevel() : GMaxRHIFeatureLevel);
return new(FMemStack::Get()) FDebugViewModeMeshProcessor(Scene, FeatureLevel, InViewIfDynamicMeshCommand, false, InDrawListContext);
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3760894) #rb Rendering #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3658809 by Chris.Bunner Changing default HDR display gamut to P3 as in practice that's more common than Rec2020, this should be a user-facing option where possible though as we can't automatically retrieve that data. Change 3658842 by Chris.Bunner Backing out previous HDR default gamut change as it conflicts with mandatory platform defaults. Change 3695269 by Arne.Schober DR - Make clang happy wreorder Change 3695418 by Guillaume.Abadie Fixes compilation failure in FoliageType_InstancedStaticMesh.cpp. Change 3695430 by Guillaume.Abadie Fixes missing BeginFrame dynamic resolution event in EngineTest. Change 3695469 by Guillaume.Abadie Fixes crash when passing down an invalid parameter on the sample material expression's DDX, DDY parameters. Change 3696091 by Guillaume.Abadie Fixes Linux compilation failure in DynamicResolution.cpp Change 3696593 by Chris.Bunner Fixed typo in vetex factory enum. Change 3696596 by Chris.Bunner Added material attributes type checking to If material expression. Updated If material expression to validate compilation of inputs. Change 3696597 by Chris.Bunner Allow visible parameter retrieval to correctly traverse through internally called functions. Previous check was intended to prevent function previews from leaving their graph through unhooked inputs, but unintentionally blocked all function inputs. Change 3696599 by Chris.Bunner Fixed material instance parameter visiblity when using nested static switches across functions. #jira UE-50878 Change 3696734 by Chris.Bunner Return type fix. Change 3697123 by Guillaume.Abadie Fixes compilation failure in PostProcessWeightedSampleSum.cpp on Windows 32bits. Change 3697125 by Guillaume.Abadie Fixes compilation failure in MaterialExpressionIf.h Change 3697127 by Guillaume.Abadie Fixes compilation failure in DynamicResolution.cpp on shipping build. Change 3697135 by Guillaume.Abadie Fixes crash in dynamic resolution event frontend when resizing game play viewport in EngineTest. Change 3697199 by Guillaume.Abadie Fixes TAA upsample's shader compilation failure on Mac. Change 3697220 by Guillaume.Abadie Makes static analysis happy again. Change 3697280 by Chris.Bunner Fixing up invalid casts in material layers validation. Change 3697366 by Rolando.Caloca DR - hlslcc - Fix warning #jira UE-43988 Change 3697451 by Rolando.Caloca DR - vk - Per pipeline descriptor pools Descriptor pool are now allocated per PSO instead of globally to reduce peak mem consumption and fragmentation Enabled on Windows only via VULKAN_USE_PER_PIPELINE_DESCRIPTOR_POOLS Change 3697477 by Rolando.Caloca DR - vk - Custom memory allocator Remove old/unused stats Change 3697486 by Rolando.Caloca DR - vk - Fix validation issue Change 3697488 by Richard.Wallis Fix for Mac editor session no longer accurately tracking Mouse location after moving between Desktops in Mission Control on 10.12.6. Problem stems from the extra call to update the slate cached window position in mouse move while dragging, which is itself is a hack but apparently this is needed as we don't get window position updates on Mac while dragging (although I couldn't see any -ve side effects without it) then the OS (in 10.12.6) doesn't always push out a final window did move notificaiton when changing desktops which leaves the window according to slate incorrectly positoned to it's frame. Solution is to either remove the mouse-move-while-drag window position hack or add a final window position update to the mouse-up event while dragging - this change is the latter. #jira UE-37553 Change 3697501 by Richard.Wallis Move audio processing over to audio bus tap. Currently on Mac Media audio playback uses OS media player mixer rather than Engine as existing implemtation, using AVAssetReader, now suffers from poor performance with new Media Framework. This audio tap version replaces that asset reader implementation but also suffers from bad quality audio hence is still disabled at the top of AvfMediaTracks.cpp. Original Code Review Description: Convert Mac to Play audio through the engine MediaFramework API rather than using AVMediaPlayer. This is the Mac implementation only - this should work ok on iOS but unable to test due to missing audio type implementation (throws error "Init Buffer on unsupported sound type name = Synth type = 5"), as such is only enabled for Mac. There maybe some extra tweaks required for iOS on app backgrounding etc if this feature is enabled. - Stuttering Audio Performace issue investiagation: Re-Tested this implementation against [now fixed] current Mac implementation which was working fine last year and that implementation now has the same audio output quality (performance) issues as this one. Basic investigation seems to point to somewhere in the engine audio handing. When poor audio is heard the FMediaAudioResampler::Generate() function is dequeing an IMediaAudioSample sample buffer and the audio sample queue usually has 50-100 of these IMediaAudioSample buffers waiting in the queue. I think the AvfMedia playback system is providing the sample buffers in good time but they are not getting consumed "fast" enough. This under consuming also occurs if I force the Core Audio - Audio Unit mixer to use 48000 samples/sec. #jira UEPLAT-1677 Change 3697517 by Richard.Wallis XCode 9.0 extra nullability specifiers required. Change 3697537 by Richard.Wallis Back out revision 23 from //UE4/Dev-Rendering/Engine/Plugins/Media/AvfMedia/Source/AvfMedia/Private/Player/AvfMediaTracks.cpp Change 3697670 by Rolando.Caloca DR - vk - Fix mapstaging surface Change 3697846 by Uriel.Doyon Allow denormalized values when converting float32 to float16. Change 3697892 by Uriel.Doyon Fix for unaligned structure elements Change 3699335 by Richard.Wallis Mac compile fix - turns out I did need these nullability specifiers here. Change 3699663 by Guillaume.Abadie Fixes time unit conversions from microseconds to milliseconds error in dynamic resolution heuristic when using GPU busy time queries. Change 3699959 by Rolando.Caloca DR - Fix barrier in the middle of render pass Change 3699969 by Rolando.Caloca DR - vk - Change dump layer location so it prints out validation ids Change 3700356 by Guillaume.Abadie Implements secondary screen percentage to be able to do TAA upsample followed spatial upscale so that the editor viewport still have same TAA upsample screen percentage range to test the content with no matter monitor's DPI. Change 3701105 by Guillaume.Abadie Ignore per view automatic mip bias on texture type other than 2d textures. #jira UE-51396 Change 3702297 by Richard.Wallis Mac compile fix for nullable specifier. Looks like Obj class using the C++ class also needs this otherwise it throws. Seems to be some kind of xcode/compiler caching bug with this stuff as it'll report the error once then on subsequent compiles say everything is ok. #jira UE-51386 Change 3702357 by Richard.Wallis Mac nullability compile fix - again. Looks like I fell foul of that xcode compile caching! #jira UE-51386 Change 3702424 by Guillaume.Abadie Fixes planar reflection from drowing themselves in their own FSceneRenderer in forward shading. #jira UE-51395 Change 3702464 by Guillaume.Abadie Fixes wrong viewport to buffer conversion of the distortion. #jira UE-51406 Change 3702819 by Guillaume.Abadie Fixes planar reflections with secondary screen percentage for HighDPI editor viewports. Change 3703732 by Guillaume.Abadie Removes unecessary check(); when there is more than 2 players with planar reflections. #jira UE-51436 Change 3704302 by Guillaume.Abadie Removes unecessary Interface suffix on new dynamic resolution related interfaces Change 3704390 by Chris.Bunner Fixed a coincidentally correct define. Change 3704730 by Rolando.Caloca DR - vk - Fix map for depth surfaces Change 3704739 by Rolando.Caloca DR - Debug label on D3D11 UAVs - Validate when running -d3debug Change 3705000 by Chris.Bunner Skip compiling opacity and opacity mask inputs on opaque surface materials. Previously the code was always added to the shader, sometimes we force opaque materials down a masked path which then calls the dormant code unintentionally. A safer fix for UE-48254. Partially reverted previous fix in CL 3608303 which removed a material instance optimization caching the overridden base properties. Change 3706065 by Guillaume.Abadie Does some renaming for primary screen percentage, and move the primary screen percentage method selection from dynamic resolution driver to FSceneView. Change 3706464 by Chris.Bunner Fixed material property translate overrides that were generating code in the wrong entry. Fixed conditions in If material expression GetInputType and IsMA check. #jira UE-51368 Change 3706641 by Chris.Bunner Missing "break" in switch statement (which unfortunately needs another bump to resolve). Change 3706642 by Guillaume.Abadie Fixes assertion failure when r.TemporalAA.EnableUpscale = 1 Change 3706650 by Gil.Gribb UE4 - UE4 - Changes from intel. Increase number of worker threads on Windows to if hyperthreads (hyperthreads √ 2) else cores √ 1 up to a max of 22 workers. Increase MAX_THREADS multiplier per bank from 22 to 26. Intel VTune ITT event annotations. Wrapped in same function as your existing CPU events and enabled with √vtune. Optimize NV cloth by consuming FVector instead of FVector4 out of the solver. Vertex buffers were using FVector all along. ~15% improvement. Optimize cloth copy to vertex buffer by adding prefetch (similar to how bones are already done). Move local to world cloth transform from CPU to GPU. When simulating lots of vertices game thread was becoming bottleneck doing matrix multiply. Add your TaskGraph task switch latency test code. Change 3706733 by Daniel.Wright Print Embree Build time Change 3706841 by Daniel.Wright EmbreeFilterFunc4 now handles masked out intersections properly Change 3707437 by Rolando.Caloca DR - vk - Android compile fix #jira UE-51474 Change 3707785 by Guillaume.Abadie Fixes viewport issue in bloom setup pass with TAA upsample. Change 3709623 by Rolando.Caloca DR - vk - Missing barrier for reading into cpu Change 3709633 by Rolando.Caloca DR - vk - Compile fix Change 3710454 by Mark.Satterthwaite Refactor the way we compile Buffer<> & RWBuffer<> types for Metal so that we can support the type-conversion semantics of HLSL/D3D. - Buffer<> types are converted to Linear Textures unless the internal type is 3-compnent or the STRONG_TYPE macro is added as a type-qualifier. Linear Textures require an MTLTexture "view" object be created around the MTLBuffer which is the backing-store and it is typically best if that buffer is marked as Private (GPU-only) memory, reading from this in the shader then uses the texture-fetch hardware to perform the format conversion on load. - RWBuffer<> & 3-compnent Buffer<> types are converted to use template functions to load/store - the implementation of which will read the format from the BufferSizes meta-table and determine which type-conversion to apply. Function-constants are used to specialise the shader where feasible to reduce branch costs (function-constants are a Metal feature that allow efficient runtime recompilation of bytecode shaders). - Buffer<> & RWBuffer<> types where the STRONG_TYPE macro is added as a type-qualifier (only does something on Metal, everywhere else it is #define'd away) are compiled as "raw" Metal buffers of the inner-type (e.g. float4 for Buffer<float4>) and the MetalRHI runtime will enforce that only SRVs/UAVs of the proper format are bound to it. This is necessary in a couple of cases (BoneMatrices, NumCulledLightsGrid, CulledLightDataGrid & ForwardLocalLightBuffer buffers) which are used in a larger number of shaders as Linear Textures have poorer performance than Buffer<>/RWBuffer<>. - Most of the complications to generating subtly different Metal code for different OS/device combinations have been factored out into ue4_stdlib.metal which acts as an extension to the Metal shader standard-library and helps simplify the MetalBackend code - particularly helpful for Buffer<>/RWBuffer<> but also texturecube_array and the SM6 wave-related intrinsics. - Reverted some of the awkward Metal-specific changes Richard.Wallis & Arne had to make to the high-level shaders as they aren't necessary anymore. - Made the existing Metal-specific changes to use uint32 for all light-grid injection buffers apply to all Metal platforms again (I had hoped that it would not be necessary anymore, but it is much faster this way). - STRONG_TYPE is actually hlslcc's "invariant" keyword applied as a type-qualifier to a Buffer<>/RWBuffer<> type - only valid when using Metal which exports this through ILanguageSpec and #define'd out for everyone else. - Old versions of iOS (anything earlier than iOS 10.3) won't be able to use this new code, so every buffer will be treated as "raw" and the MetalRHI will now properly report when something goes awry rather than it leading to mysterious rendering errors and crashes. Change 3710456 by Mark.Satterthwaite Fix the Eddie workset project generator so that Enterprise projects don't get mixed in with regular projects at the top-level because of the way Eddie combines workset groups. Change 3710457 by Mark.Satterthwaite DX11 texture formats for Mac Metal please! Change 3710480 by Mark.Satterthwaite Permit RHI thread and parallel execution in Mac -game mode again. Change 3710522 by Mark.Satterthwaite MSVC type-mismatch error fixes. Change 3710580 by Mark.Satterthwaite Alright then - if I can't use the C++11 extended string semantics I'll have to use "xxd -i" to generate a hex-dump include header from ue4_stdlib.metal instead. This can only be updated from a machine with access to the POSIX xxd command (Mac & Linux, possibly the new Linux sub-system for Win10). Change 3710616 by Mark.Satterthwaite Missing file. Change 3712972 by Guillaume.Abadie Fixes Circle DOF's negative alpha channel getting clamped to 0 in TAA pass. Change 3712979 by Guillaume.Abadie Fixes wrong RT reallocation when doing TAA upsample in editor viewports with secondary upscale. Change 3713406 by Mark.Satterthwaite Use GPU morph targets on Mac - the necessary buffer conversions will always be available there. For iOS it can only be supported if iOS 10 is the minimum OS & Metal standard so leave that on the CPU path for now. Change 3713494 by Richard.Wallis Fix for hitch when PIE unloading sublevel. PerformReachabilityAnalysisOnObjects is spawing multiple threads in Editor builds as there is an extra code path that results in Critical Section locking within a singleton type static object - this is a bottle neck for multiple threads. However they all just need to read the data not change it. Replaced FScopeLock with a Read/Write version allowing these threads to all take a read lock at the same time to reduce contention. Changed the FUObjectAnnotationDense implementation only - left the sparse implementation alone as its not currently affecting this - although we could proactivly change that too. Also tested again repro in linked bug UE-24711. #jira UE-40533 Change 3713612 by Mark.Satterthwaite Integrate LPV_STORE_INDEX_IN_HEAD_BUFFER related changes from //depot/Partners/Microsoft/UE4-MS/Engine-Fable @ 2954744 This should make Light Propagation Volumes potentially viable on non-Microsoft platforms. Change 3713623 by Mark.Satterthwaite Implement ByteAddressBuffer/RWByteAddressBuffer in hlslcc in a similar manner to StructuredBuffer/RWStructuredBuffer so that the backends don't need too much modification. Implement the necessary changes into MetalBackend to make this work for Metal. Load/Store{+2,3,4} & Atomics are supported. Counter operations are not supported and aren't likely to be. Change 3713636 by Mark.Satterthwaite Enable LPVs for Mac Metal. - Rework some multi-dimensional arrays & array-index dependent HLSL code that hlslcc simply can't cope with, the mesa-glsl compiler core is only capable of dealing with 1 dimensional arrays and array-indexing can't itself be directly dependent on the result of an array-index operation. - MetalRHI needs to ignore any SetRenderTargets call that binds nothing at all as you must bind at least one target (UAV, RT, Depth/Stencil) for it to be able to do anything sensible. - Turn on LPVs for Metal as it works now. Change 3714049 by Guillaume.Abadie Do not set screen percentage method to TAA upsample when anti aliasing method is not TAA even if there is automatic fallback in the renderer. Change 3714306 by Guillaume.Abadie Fixes assertion failure in dynamic resolution state proxy with GPU busy time queries. Change 3714714 by Mark.Satterthwaite Tweak Metal GPU identification so that it works with eGPU boxes and protoype hardware - these changes only apply to macOS 10.13 so the system as a whole remains. Change 3716104 by Mark.Satterthwaite Fix 10.12/Xcode 8 compile errors from the build-farm which is still split until Fortnite can update. Change 3716120 by Mark.Satterthwaite Silence static-analysis. Change 3716158 by Guillaume.Abadie Rewrites editor primitive compositing to support TAA upsample. This takes the oportunity to remove the manual depth testing in base pass pixel shader of editor primitives. Change 3716271 by Daniel.Wright Lightmass correctness fixes * After these changes, point, spot, directional and sky lights closely match reference renderer Mitsuba after light unit conversions * Photon density trimming intended for direct photons was affecting indirect photons as well. This caused high noise for point / spot lights with a large attenuation radius. Indirect photon density even for small lights is 5x with this change, which improves 2nd bounce quality. * Removed legacy fudge factor on point / spot light photon energy * Spotlights no longer emit based on indirect photon paths. Fixes excessive photon energy from spot lights as they were emitting outside of the cone. * Fixed photons computing one more bounce than requested. * Added an option to use the Radiosity solver for all multibounce, replacing photons. Useful as a reference but generally too much noise indoors. * Fixed visualization of photons without final gather Change 3716434 by Mark.Satterthwaite Backout the remaining change from 3632041 that is no longer necessary - this was the last of the 4.18 Metal workarounds. Change 3716491 by Chris.Bunner Fixing up an edge-case on a recent optimization. Change 3716611 by Guillaume.Abadie Allows secondary screen percentage >= 100%. Change 3716977 by Guillaume.Abadie Back out changelist 3716158 to unblock QA pass. #jira UE-51580 Change 3717111 by Arne.Schober Fixing nomalization of Morph Tangents https://udn.unrealengine.com/questions/392462/ Also implemanted batching of the dispatches which should help worst case perfomance where dispatches become too small. CalculateInverseAccumulatedWeights is not cheap and proably should be moved onto a task thread that runs as soon as the input weights are ready. Change 3717127 by Mark.Satterthwaite Fix a mismerge from the reversion of 3632041 - part of the modified code had been moved into another file and I didn't initially notice. Change 3717178 by Mark.Satterthwaite Remove useless copy-pasted expressions from glsl_type::GetByteAddressBufferInstance & force MetalBackend to relink. Apparently the previous Mac libs were mysteriously broken. #jira UE-51583 Change 3717476 by Marcus.Wassmer Fix PS4 compile. funciton local statics not allowed on PSSL Also enabled the new atomics method for LPVs for all platforms Change 3717502 by Arne.Schober DR - Compiletime option for compressed ruleset (0.02ms perf gain on PS4 and disabled by default as it limits array size to 2million entries) Change 3717601 by Arne.Schober DR - Move cycle counter into more meaningfull locations. Change 3718054 by Guillaume.Abadie Removes unecessary check() failure on secondary upscale that fires when testing raw output screen percentage method. Change 3718066 by Guillaume.Abadie Reland: Rewrites editor primitive compositing to support TAA upsample. This takes the oportunity to remove the manual depth testing in base pass pixel shader of editor primitives. Change 3718589 by Mark.Satterthwaite Console-variable to enable and disable Manual-Vertex-Fetch for Metal and fix the internal code to handle the subtle changes in behaviour for vertex-declarations so we don't explode under the Metal validation layer. MVF works on macOS, though testing did expose an error with Tessellation on Nvidia (true for MVF enabled & disabled). Change 3718633 by Guillaume.Abadie Fixes temporal instability issue of TAA upsample with secondary screen percentage. Change 3718658 by Arne.Schober DR - 25% MorphTarget Speed increase because there was a bit of cache thrashing between the waves going on. Change 3718818 by Mark.Satterthwaite Fix compilation on hlslcc - integral values are not automatically converted into comparisons with zero. Change 3719004 by Guillaume.Abadie Lets the game viewport client automatically set raw output screen percentage method when doing dynamic resolution with stereo rendering but without TAA upsample. Change 3719375 by Mark.Satterthwaite Extend mtlpp compiler testing app to support Metal tessellation compute shaders so we can send Nvidia a much simpler reproduction of their regression. Change 3720099 by Mark.Satterthwaite Make the left-hand arguments work in airdiff. Change 3720413 by Mark.Satterthwaite Support standalone compute shaders in the mtlpp compiler test app. Change 3721232 by Mark.Satterthwaite No more Metal Shader Model 4 - instead we have to have a Metal Shader Model 5 w/o Tessellation as Nvidia's shader compiler is broken on all tessellation shaders in 10.13.0 and above. There is no guarantee that they will fix this prior to 10.14 and I can't afford to disable tessellation entirely as if I do that then the AMD & Intel compilers will also regress. As there is no Shader Model 4 platform on Mac anymore I've amended the LevelEditorActions to disable the preview modes when no appropriate shader platform is available. Change 3721244 by Mark.Satterthwaite Fix incorrect enum handling for Metal features due to overflow. #jira UE-51643 Change 3721338 by Mark.Satterthwaite MIssing file from 3721232 Change 3721818 by Mark.Satterthwaite Fix the Intel vector-array-dereference workaround so that it doesn't cause the AMD compiler to explode instead. Change 3722139 by Arne.Schober DR - [UE-51602] -Fixed Typo that accidently bound the LightingInstancebuffer to the Transform one #jira UE-51602 Change 3722165 by Rolando.Caloca DR - Default -opengl to GL4 Change 3722682 by Guillaume.Abadie Fixes wrong clear color in SSR important for VR that has a HMD mesh. Change 3722766 by Rolando.Caloca DR - Fix static analysis Change 3722943 by Mark.Satterthwaite Disable the METAL_SM5_NOTESS shader platform again - I can workaround the Nvidia pipeline state compiler crash by changing the buffer address space from "constant" to "device" as we're managing to confuse the poor thing. This won't materially affect AMD or Intel as they don't care much about this, but to limit performance issues on Nvidia we only need to do this for Tessellation Compute shaders. Change 3723100 by Mark.Satterthwaite Apparently users like enabling Metal shader standards that won't work on their current OS, so don't display those that aren't going to work & display an error message before quitting rather than crashing when trying to load a project that tries to use an incompatible shader version. Change 3723121 by Mark.Satterthwaite Fix build error. Change 3723245 by Daniel.Wright Ensure for when a reflection capture upload fails due to incorrect lighting scenario level handling Reflection captures with no data use an array index of 0, instead of -1. Might avoid reading uninitialized memory on PS4. Change 3723387 by Arne.Schober DR - Metal already applies the instance and vertexoffset in the shader Change 3723393 by Mark.Satterthwaite More fixes to the mtlpp compiler test application. Change 3725258 by Guillaume.Abadie Improves fast TAA upsample shader permutation by 15% on console. Change 3725555 by Chris.Bunner [Dupliate] CL 3725548 - Fixed invalid screenpercentage value in VehicleGame sample (was setting -1 but should default to 100). This has always been broken but was recently exposed by CL 3686200. Change 3726845 by Guillaume.Abadie Exposes SvPosition to material through screen position material expression, so that material no longer have SvPosition * InvViewSize * ViewSize precision loss. #jira UE-51428 Change 3728014 by Guillaume.Abadie Uses ScreenPosition material expression's PixelPosition pin in existing engine functions to improve precision. #jira UE-51428 Change 3728053 by Richard.Wallis Duplicate CL 3727958: Crash fix when using shared material libraries. Initial shader code library offset is not zero'd so all entry offsets were garbage. Change 3728339 by Guillaume.Abadie Adds project setting for TAA upample, and officialises TAA upsampling CVar. Change 3728549 by Guillaume.Abadie CsvProfiler is pretty cool, but even better with console autocompletion for lazy developers. Change 3728752 by nick.bullard Built and re-saved QA-MeshPaint #jira UE-50978 Change 3728775 by Guillaume.Abadie Implements r.DynamicRes.ChangePercentageThreshold to stabilize primary screen percentage. Change 3729224 by Uriel.Doyon Hidden levels now keep their last build data when using lighting scenarios. Hidden levels don't affect the scene anymore volumetric lighting when not using lighting scenarios. #jira UE-40454 #jira UE-38131 Change 3729243 by Marcus.Wassmer Update Ansel to 1.4 #github 4159 #jira UE-51545 Change 3729325 by zachary.wilson Adding indirect lighting to TM-LightingChannels #jira UE-47069 Change 3729485 by zachary.wilson Fixing ambient occlusion bias on QA-LightsStationary. Removed global PPV with bad settings, also fixed the shadow on the roof. #jira UE-50972 Change 3729629 by Uriel.Doyon Fixed crash when using debug view modes. Fixed d3ddebug error when clearing quad overdraw buffer. #jira UE-51836 Change 3730053 by Guillaume.Abadie Allows edititing of AScreenshotFunctionalTestBase::ScreenshotCamera. Change 3730308 by Guillaume.Abadie Disables TAA upsample on buffer visualization, and disallow screen percentage preview in editor viewport with any buffer visualization. Change 3730355 by Guillaume.Abadie Sacrifices consistency for good cvar name for TAA upsample. Change 3731403 by Daniel.Wright Reduced slider for ContactShadowLength to .1, algorithm produces poor results with larger values. Change 3731404 by Daniel.Wright Checkpoint for ScreenShadowMaskTexture, allowing 'vis ScreenShadowMaskTexture' Change 3731407 by Daniel.Wright Must opt-in for FDistanceFieldSceneData::VerifyIntegrity Change 3731517 by Guillaume.Abadie Freezes dynamic resolution heuristic when doing pause. Change 3732168 by Guillaume.Abadie Renames TAA upsampling cvar. Change 3732295 by Guillaume.Abadie Lets the scene texture's size and texel size return the correct sizes after TAA upsample. Change 3732313 by Guillaume.Abadie Implements SceneTexture material expressions' automated tests. Change 3734928 by Guillaume.Abadie Adds panic mode when the last N frames are over budget to the dynamic resolution heuristic. Change 3735966 by Ryan.Vance Fixing mac steamvr compile issue. Missed a few lines in the refactor because mac. Change 3736104 by Guillaume.Abadie Removes FSceneViewInitOptions::bDisableGameScreenPercentage brought by 4.18, that new screen percentage API do in a better way. Change 3736346 by Daniel.Wright Volumetric fog is always interpolated in the pixel shader, since per-vertex interpolation gives consistently poor results. Fixes Volumetric Fog on opaque in Forward, and on transparent in Deferred. Forward shading: per-pixel height fog is always done in the base pass, to work with MSAA correctly Change 3736348 by Daniel.Wright Forward shadowing of directional light for translucency * Static shadowing and CSM supported with minimal filtering (1 PCF) * Deferred renderer: affects translucency using 'Surface ForwardShading' lighting mode. Forward renderer: affects all translucency. Change 3736650 by Rolando.Caloca DR - vk - # of desc pools Change 3737985 by Guillaume.Abadie Fixes pixel inspector with primary and secondary screen percentage. Change 3738638 by Michael.Lentine Compile fix due to unclear operator precendence. Change 3739417 by Daniel.Wright Fixed a few issues with irradiance cache visualization Change 3739447 by Daniel.Wright Skip forward static shadowing in projects with static lighting disabled Change 3739595 by Daniel.Wright ConditionalPostLoad DistanceFieldReplacementMesh. Should fix a crash on load when static mesh derived data is being rebuilt, and the DistanceFieldReplacementMesh is in use. Change 3739598 by Daniel.Wright Disable capsules shadows on lowest shadow quality Change 3739611 by Daniel.Wright Added r.CapsuleDirectShadows and r.CapsuleIndirectShadows for more specific scalability control over capsule shadow features New Lighting Feature show flags for RTDF shadows and Capsule Shadows Change 3740516 by Guillaume.Abadie Fixes VR editor rendering only on eye with TAA upsample. #jira UE-52016 Change 3740580 by Guillaume.Abadie Fixes chromatic aberration with TAA upsample and multiple view rendering. #jira UE-51993 Change 3740588 by Guillaume.Abadie Gives to FXAA a more explicit draw event name for easier UDN support. Change 3740845 by Michael.Lentine Fix shipping build. Change 3740903 by Guillaume.Abadie Disables dynamic resolution threading outliers detection by default and includes editor UI GPU cost within dynamic resolution's begin/end frame events for better reliability of timestamp query based dynamic res in editor. Change 3741355 by Daniel.Wright Normalize planar reflection plane - fixes crash when scaling a BP with a planar reflection component Change 3741357 by Daniel.Wright More info on volumetric lightmap import failure Change 3742535 by Ryan.Vance Fix for view rect changes. Change 3743282 by Guillaume.Abadie Fixes a bug in dynamic resolution heuristic's outlier detection that was preventing the over budget panic to react. Change 3743559 by Michael.Lentine Port Siren changes for recompute tangents. This adds recompute tangents for cloth as well as the ability for recompute tangents to work across seams where vertices are duplicated. Change 3743679 by Guillaume.Abadie Cherry-pick 3743621: Fixes subsurface profile fallback to lit shading model when Opacity == 0, introduced by 3447144. #jira UE-51569 Change 3743906 by Ryan.Brucks BlueprintMaterialAndTextureNodes Plugin: Fix for clamping sampled HDR render target values by setting ERangeCompressionMode in the FReadSurfaceDataFlags to RCM_MinMax Change 3744096 by Ryan.Brucks BlueprintMaterialAndTextureNodes Plugin: removed Mip option from Texture2D_SampleUV_EditorOnly for now since reads from source data cannot access mips and it can be misleading. Change 3744253 by Guillaume.Abadie Fixes merge collisions of debug canvas rendering with High DPI, fixes stat unit on high DPI monitors, and fixes secondary screen percentages. Change 3744953 by Chris.Bunner Crash workaround. Change 3745628 by Marcus.Wassmer Temporarily disable recalctangent normal-smoothing #jira UE-52166 Change 3745942 by Guillaume.Abadie Fixes a todo in FCommonViewportClient Change 3746005 by Guillaume.Abadie Fixes stat UnitGraph on high DPI monitor. Change 3746029 by Guillaume.Abadie Oups.... Fix compilation. :D Change 3748322 by Guillaume.Abadie Shows dynamic resolution's primary screen percentage on stat unit/unitgraph console commands. Change 3748346 by Chris.Bunner Potential static analysis fix. Change 3748349 by Chris.Bunner Mac feature support flag fix on versions < 10.30. Change 3749336 by Guillaume.Abadie Fixes some spelling mistakes in dynamic resolution cvars. Thanks Daniel! Change 3749374 by Guillaume.Abadie Adds a black background on the stat unitgraph so timing curves can be seen no matter the content. Change 3749437 by Guillaume.Abadie Final UI polish up for `stat unitgraph` Change 3749719 by Guillaume.Abadie Fixes a crash when changing r.DynamicRes.MaxScreenPercentage below current screen percentage. Change 3750243 by Chris.Bunner Increasing controller's automated test timeout to allow for slower machines to complete the longest tests. #jira UE-48494, UE-51907 Change 3750728 by Guillaume.Abadie Fixes merge collision in chromatic aberration. #jira UE-52282 Change 3750791 by Guillaume.Abadie Fixes chromatic baerration R and G channel swap. Change 3751246 by Guillaume.Abadie Bypasses screen percentage apply with mobile LDR rendering. #jira UE-52089 Change 3752624 by Guillaume.Abadie Simplies dyn res state's event interface to a single virtual method. Change 3753766 by Chris.Bunner Rebuilt volumetric baked lighting test map and updated screenshots. #jira UE-52322 Change 3755108 by Guillaume.Abadie Fixes a bug where default dynamic resolution state was created at startup of server build. #jira UE-52345 Change 3755267 by Mark.Satterthwaite Fix condition controlling which features are enabled when iOS >= 10.3 - it wasn't working for iOS 11+ which was causing all kinds of problems. #jira UE-52301 Change 3755811 by Chris.Bunner Disable some new logging that was causing a stack overflow during EnginePreInit. #jira UE-52345 Change 3756983 by Mark.Satterthwaite Prevent different versions of metal_stdlib/ue4_stdlib from causing shader compilation failures due to a time-stamp mismatch between the local file & the PCH. This can happen when working with Xcode Beta releases that change the modification date, but not the content or compiler version, amongst other possibilities. #jira UE-52073 Change 3757156 by Guillaume.Abadie Fixes editor compositing with wireframe rendering. #jira UE-52017 Change 3757435 by Mark.Satterthwaite Workaround a bug in the MobileSceneCaptureRendering where it was copying the ViewInfo's ViewRect prior to it being configured by the mobile renderer. #jira UE-52327 Change 3757523 by Uriel.Doyon Fixed d3ddebug warning with unused inputs Change 3758318 by Guillaume.Abadie Cleaner fix for mobile scene captures. #jira UE-52327 Change 3759541 by Mark.Satterthwaite Don't enable Manual Vertex Fetch on iOS Metal for the moment as it isn't well tested there and will probably need further changes. Change 3695086 by Guillaume.Abadie Render thread dynamic resolution & TAA upsample. Merging //Tasks/UE4/Dev-DynamicRes/...@3694528 to //UE4/Dev-Rendering/... New features breakdown: - TAA upsample compute shader that accepts screen percentage from 50% to 200%, with a faster shader permutation for consoles; - Material no longer have to deal with BufferUV, and post process material after TAA upsample can sample any scene buffer seamlessly; - Material texture per view mip bias to produce sharper images with TAA upsample; - Render thread dynamic resolution heuristic is fully plugable by game code (for VR plugin specific heuristics); - Dynamic resolution in PIE and game builds; - Busy time queries in the RHI to be implemented on the different platforms so that the dynamic resolution heuristic can exactly associate GPU frame times with screen percentages in its history; - Game user settings to enable/disable dynamic resolution; - In editor viewport screen percentage config to previsualise and test content at different screen percentage. Fixes: - Various fixes for algorithms producing different outputs at different screen percentage. - Various fixes for algorithms sampling outside view rects. Refactors: - TAA shader - Moved some screen percentage specific members from FSceneView to FViewInfo for thread race bullet proofing. Aknowledgements: - VR plugins are broken - DFAO still have some artifacts Premiliminary review: Marcus.Wassmer Review for TAA refactor and TAA upsample shader: Brian.Karis Review for dynamic resolution: Brian.Karis [CL 3761165 by Chris Bunner in Main branch]
2017-11-16 11:36:35 -05:00
}
FRegisterPassProcessorCreateFunction RegisterDebugViewModeMobilePass(&CreateDebugViewModePassProcessor, EShadingPath::Mobile, EMeshPass::DebugViewMode, EMeshPassFlags::MainView);
FRegisterPassProcessorCreateFunction RegisterDebugViewModePass(&CreateDebugViewModePassProcessor, EShadingPath::Deferred, EMeshPass::DebugViewMode, EMeshPassFlags::MainView);
void InitDebugViewModeInterface()
{
FDebugViewModeInterface::SetInterface(new FDebugViewModeImplementation());
}
#else // !WITH_DEBUG_VIEW_MODES
void RenderDebugViewMode(
FRDGBuilder& GraphBuilder,
TArrayView<FViewInfo> Views,
FRDGTextureRef QuadOverdrawTexture,
const FRenderTargetBindingSlots& RenderTargets)
{}
#endif // WITH_DEBUG_VIEW_MODES