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

209 lines
9.3 KiB
C++
Raw Normal View History

// Copyright Epic Games, Inc. All Rights Reserved.
#if WITH_EDITOR
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3209340 on 2016/11/23 by Ben.Marsh Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h. Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms. * Every header now includes everything it needs to compile. * There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first. * There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h. * Every .cpp file includes its matching .h file first. * This helps validate that each header is including everything it needs to compile. * No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more. * You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there. * There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible. * No engine code explicitly includes a precompiled header any more. * We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies. * PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files. Tool used to generate this transform is at Engine\Source\Programs\IncludeTool. [CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
#include "PostProcess/PostProcessSelectionOutline.h"
#include "PostProcess/PostProcessCompositeEditorPrimitives.h"
#include "EditorPrimitivesRendering.h"
#include "SceneTextureParameters.h"
#include "CanvasTypes.h"
#include "RenderTargetTemp.h"
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3249742) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3232283 on 2016/12/13 by Ben.Woodhouse D3D12 - downgrade root signature size warning to a log following a discussion with Microsoft. There's not much we can actually do about it, and it's not relevant to all hardware #jira UE-36999 Change 3232641 on 2016/12/13 by Mark.Satterthwaite - Eliminate redundant state changes in MetalRHI in the state cache. - Add a new debug level for setting buffers to nil prior to calls to set*Bytes so that the tool doesn't display incorrect data. - Make testing for validation & statistics features use the same EMetalFeatures API as everything else for consistency. - Cache the fallback depth-stencil texture in the state cache and ignore it for determining whether a pass can restart - if we are using this texture its contents are worthless anyway. Change 3232661 on 2016/12/13 by Mark.Satterthwaite Re-enable Metal SM5 & DFAO/DistanceFieldShadowing on Intel for 10.12.2 or later. Change 3232759 on 2016/12/13 by Ben.Woodhouse Fix memory leak on XB1 when calling GPURealloc with count of 0, suggested on UDN https://udn.unrealengine.com/questions/326660/gpurealloc-leak.html Change 3232803 on 2016/12/13 by Ben.Marsh Add UT to the populate DDC job, and cook UT and Fortnite for Mac as well. Change 3232836 on 2016/12/13 by Ben.Marsh Split cooks to populate DDC into separate nodes for each platform. May help to reduce number of timeouts on remote VMs. Change 3232974 on 2016/12/13 by Rolando.Caloca DR - Refactor common code to UWorld::RecreateScene #jira UE-36719 PR #2824 Change 3232976 on 2016/12/13 by Ben.Marsh Add missing dependency on tools node for Mac cooks. Need to compile SCW first. Change 3233289 on 2016/12/13 by Olaf.Piesche Fixing potentially broken spot/point light fade with old content; initialize new properties properly Change 3233811 on 2016/12/13 by Mark.Satterthwaite Fix compiling QA-Material tessellation shaders that don't need to emit from Hull or sample in Domain the HSOut buffer which was confusing MetalBackend. Change 3233854 on 2016/12/13 by Mark.Satterthwaite More information about texture type validation errors in Metal. Change 3234650 on 2016/12/14 by Rolando.Caloca DR - vk - Fix bad aspect on depth cubemaps Change 3234651 on 2016/12/14 by Rolando.Caloca DR - vk - Fix for 32 bit crash on dump layer Change 3234813 on 2016/12/14 by Guillaume.Abadie Fixes texture mask static lighting when using GBuffer selective outputs. #jira UE-39527 Change 3235047 on 2016/12/14 by Uriel.Doyon Refactored HLOD texture streaming strategy to separate forced load from visibility. Added an incremental update in the last stage of the texture streaming update load to clear any pending work. Added an option "All" to the "BuildMateriaTexturelStreamingData" command to force rebuild everything. Change 3235317 on 2016/12/14 by Uriel.Doyon Removed timed primitives in the texture streaming since it was not used and there is now a fallback implementation in UPrimitiveComponent::GetStreamingTextureInfo. Change 3235431 on 2016/12/14 by Rolando.Caloca DR - Fix for Vulkan drawing black Change 3236788 on 2016/12/15 by Mark.Satterthwaite Fix 10.11.6 support (aka -nometalv2): the stencil view workaround necessitates a mid-render blit and the way things were setup resulted in the HasValidRenderTargets assert firing. Refactored the code to separate the concept or valid render-states in the cache from active render-states in the render-pass. Now it works as intended and will be needed for 4.15. Change 3236850 on 2016/12/15 by Mark.Satterthwaite Make changing the Metal Shader Version project setting prompt the user to restart for the changes to take effect. #jira UE-39801 Change 3237002 on 2016/12/15 by Benjamin.Hyder submitting updated TM-Shadermodels map Change 3237312 on 2016/12/15 by Rolando.Caloca DR - Change more macros to lambdas Change 3237394 on 2016/12/15 by Mark.Satterthwaite Add Metal-specific permutations of TBasePassHS - they affect the C++ definition on all platforms but are only cached or used on Metal - because the way we compile the combined VS+HS tessellation stage requires that the combined VS + HS HLSL code references the same resources, otherwise we get incorrect resouce bindings and subsequently fail to render properly. Long-term the Metal tessellation code will need to be refactored so that the vertex shader stage is emitted as a separate shader from the hull shader stage as this but will keep cropping back up and continue to complicate the engine. #jira UE-39799 Change 3237490 on 2016/12/15 by Daniel.Wright Fixed ULandscapeComponent::GetUsedMaterials Change 3237597 on 2016/12/15 by Ben.Woodhouse Disable timestamp queries on pre-Maxwell nvidia hardware. Local testing suggests that this is the major cause of instability in the UE4.14 release. It's possible that we could be more targeted by only excluding Fermi and older hardware, but identifying fermi hardware by device ID is difficult in practice, since the range overlaps with Kepler. Change 3237654 on 2016/12/15 by Daniel.Wright Non-editor compile fix Change 3238229 on 2016/12/16 by Rolando.Caloca DR - Remove ExcludeRect from inner RHI Clear methods; ensure will happen if trying to use it Change 3238236 on 2016/12/16 by Rolando.Caloca DR - Compile fixes Change 3238280 on 2016/12/16 by Marc.Olano Small optimization to Lanczos-3 upsample shader code. Change 3238321 on 2016/12/16 by Rolando.Caloca DR - Compile fix Change 3238331 on 2016/12/16 by Rolando.Caloca DR - compile fix Change 3238495 on 2016/12/16 by Marc.Olano Replace TEA random number generator with PCG. Was only used in #if-disabled reference rendering, but ldoes make better quality reference rendering when enabled. Change 3238496 on 2016/12/16 by Marc.Olano Tone mapping fix for OR-31752, cherry picked from Orion 3208273 Assumption that green is approximates luminance fails on red/blue HDR content, resulting in ugly black artifacts. Go back to luminance. Change 3238520 on 2016/12/16 by Rolando.Caloca DR - CIS Fix Change 3238571 on 2016/12/16 by Rolando.Caloca DR - CIS fix Change 3238605 on 2016/12/16 by Daniel.Wright Sharing IndirectLightingCacheTextureSampler samplers Change 3238626 on 2016/12/16 by Daniel.Wright Ray Traced Distance Field Shadow optimizations * Tighter light space tile culling * Skip ray marching pixels before the RTDF cascade near distance, or further than the cascade far distance * Depth bounds test on upsample * Created FLightTileIntersectionParameters for encapsulation of light tile culling functionality * RTDF shadow time went from 1.8ms -> .8ms and 3.1ms -> 1.2ms in FortGPUTestbed on 7870 with these changes Change 3238652 on 2016/12/16 by Rolando.Caloca DR - RHI clear methods no longer have an ExcludeRect, use DrawClearQuad functions instead Change 3238855 on 2016/12/16 by Rolando.Caloca DR - Added FRHITexture2D GetSizeXY Change 3238881 on 2016/12/16 by Rolando.Caloca DR - CIS fix Change 3239008 on 2016/12/16 by Arne.Schober DR - Fixing accidently returning a stackpointer in EnqueueRenderCommands Change 3239012 on 2016/12/16 by Arne.Schober DR - missing file Change 3239255 on 2016/12/17 by Rolando.Caloca DR - Remove shader clears from D3D11 Change 3239690 on 2016/12/19 by Rolando.Caloca DR - vk - Misc fixes from 1.0.37.00 SDK warnings Change 3239964 on 2016/12/19 by Rolando.Caloca DR - Fix click on editor not showing selected Change 3239995 on 2016/12/19 by Rolando.Caloca DR - Enable dist field on GL4 & Vulkan SM5 Change 3240162 on 2016/12/19 by Daniel.Wright Added EnableDepthBoundsTest / DisableDepthBoundsTest to RHIUtilites to share some common code Change 3240163 on 2016/12/19 by Daniel.Wright Distance field self shadowing controls for hiding world position offset self-shadow artifacts * Removed static mesh build settings DistanceFieldBias, which shrunk the distance field, breaking AO and shadows * Added DistanceFieldSelfShadowBias, which prevents occlusion close to the surface only, maintaining shadows on the ground and AO on the ground Change 3240271 on 2016/12/19 by Daniel.Wright Use 16 bit indices for distance field objects culled to tiles, when 16 bit will be enough. Saves 10mb of tile culling buffers. Change 3240282 on 2016/12/19 by Rolando.Caloca DR - Proper fix for hit proxies clear - Added missing stencil ref to DrawClearQuad Change 3240316 on 2016/12/19 by Rolando.Caloca DR - vk - Fixed some new 1.0.37.0 warnings Change 3240354 on 2016/12/19 by Rolando.Caloca DR - Dev shaders on sm4/5 Change 3240759 on 2016/12/20 by Rolando.Caloca DR - Fix bad crc on GL element declarations Change 3240895 on 2016/12/20 by Rolando.Caloca DR - vk - Swapchain fixes Change 3241057 on 2016/12/20 by Rolando.Caloca DR - vk - Fix resize on desktop Change 3241112 on 2016/12/20 by Rolando.Caloca DR - vk - Fix 1.0.37.0 warnings - Ignore some warnings we know we can't fix Change 3241310 on 2016/12/20 by Rolando.Caloca DR - vk - Fix crash Change 3241417 on 2016/12/20 by Daniel.Wright [Copy] Fixed race condition with FPrecomputedLightVolume::Data which was exposed when switching lighting scenarios Change 3241990 on 2016/12/21 by Daniel.Wright Converted DistanceFieldVolume data to BulkData * FDistanceFieldVolumeData Serialize time from .7s on PS4 to 0s Change 3242005 on 2016/12/21 by Daniel.Wright Removed unused !USE_DEPTH_RANGE_LISTS path to reduce complexity Change 3242295 on 2016/12/21 by Bob.Tellez Duplicating CL#3242294 from //Fortnite/Main #UE4 Re-applying the fix for rendering editor primitives when r.EarlyZPassOnlyMaterialMasking is enabled Change 3242487 on 2016/12/21 by Marcus.Wassmer Fix typo Change 3243091 on 2016/12/22 by Daniel.Wright Fixed too many groups dispatched for TConeTraceScreenGridGlobalOcclusionCS Change 3243161 on 2016/12/22 by Uriel.Doyon New async tasks for the streaming update. Optimizing the biggest frame cost. Change 3243179 on 2016/12/22 by Uriel.Doyon Fixed possible invalid access from the async FNormalizeLightmapTexelFactorTask Change 3243236 on 2016/12/22 by Daniel.Wright Fixed DFAO bilateral upsample * Depth buffer was being unbound due to lack of DepthRead_StencilNop Change 3243452 on 2016/12/23 by Ben.Woodhouse Bring back 1024 render query limit workaround on D3D12 which was lost during the merge from partners #jira UE-35247 Change 3243512 on 2016/12/23 by Uriel.Doyon Improved task system for texture streaming. Change 3243742 on 2016/12/26 by Rolando.Caloca DR - vk - Fix UAV clears - Removed old validation layer - Print found device layers Change 3243745 on 2016/12/27 by Rolando.Caloca DR - vk - Fix for texture cube arrays - Warning for ClearUAVs Change 3243762 on 2016/12/27 by Rolando.Caloca DR - vk - Always use pipeline cache Change 3244450 on 2016/12/31 by Rolando.Caloca DR - vk - Pre reqs for separate transfer queue Change 3244453 on 2016/12/31 by Rolando.Caloca DR - vk - Win32 compile fix Change 3244756 on 2017/01/03 by Marcus.Wassmer Copying //Tasks/UE4/Dev-Niagara@3244743 to Dev-Rendering (//UE4/Dev-Rendering) Change 3244757 on 2017/01/03 by Marcus.Wassmer Niagara is still experimental in non-task branches. Change 3245059 on 2017/01/03 by Benjamin.Hyder Submitting TM-TrigNodes map Change 3245500 on 2017/01/03 by Olaf.Piesche Compile fix #1 for post-merge problems Change 3245572 on 2017/01/03 by Olaf.Piesche (Speculative) fix #2 for post-merge build problem. Hopefully fixes public distribution level error for cross compiler tool. Change 3245683 on 2017/01/03 by Marcus.Wassmer Fix some niagara warnings Change 3245732 on 2017/01/03 by Marcus.Wassmer Fix Niagara compile on clang platforms. Fix a few warnings / static analysis things as well. Change 3246403 on 2017/01/04 by Rolando.Caloca DR - vk - Fix bogus warning Change 3246432 on 2017/01/04 by Marcus.Wassmer Copying //Tasks/UE4/Dev-Niagara@3246424 to Dev-Rendering (//UE4/Dev-Rendering) Change 3246538 on 2017/01/04 by Rolando.Caloca DR - vk - Show hitch time for compute psos Change 3246580 on 2017/01/04 by Rolando.Caloca DR - vk - compile fix Change 3246610 on 2017/01/04 by Rolando.Caloca DR - Compute PSO pre reqs Change 3246707 on 2017/01/04 by Marcus.Wassmer Add missing integer operations to UnrealMathDirectX.h Change 3246786 on 2017/01/04 by Marcus.Wassmer Avoid public dependency build errors. Should probably just remove the DDCUtils module instead Change 3246828 on 2017/01/04 by Olaf.Piesche UE-39249; need to check the view as well as the view family in CheckAndUpdateLastFrame; scene captures use a different family, but each eye for VR uses a different scene view. Change 3247026 on 2017/01/04 by Rolando.Caloca DR - Remove CrossCompilerTool as it's not required anymore Change 3247086 on 2017/01/04 by Marcus.Wassmer Remove includes for Core.h monolithic header Change 3247227 on 2017/01/04 by Marcus.Wassmer Fix typo and compile errors. Change 3247228 on 2017/01/04 by Marcus.Wassmer Use crossplatform intrinsics Change 3247229 on 2017/01/04 by Marcus.Wassmer Implement missing integer NEON operations. Change NEON vectorint to match name and sign from other platforms Change 3247245 on 2017/01/04 by Marcus.Wassmer Fixing various warnings/errors from clang platforms (Mac/Linux) Change 3247331 on 2017/01/04 by Marcus.Wassmer More Mac/clang fixes Change 3247958 on 2017/01/05 by Marcus.Wassmer VectorInt < - > Float ops should be conversions not reinterpret cast Change 3247959 on 2017/01/05 by Marcus.Wassmer Add missing ops to non-vector header Change 3247964 on 2017/01/05 by Rolando.Caloca DR - Temp fix for crash #jira UE-40211 Change 3248067 on 2017/01/05 by Rolando.Caloca DR - Static analysis fixes #jira UE-40167 Change 3248284 on 2017/01/05 by Rolando.Caloca DR - Linuix Compile fix #jira UE-40260 Change 3248288 on 2017/01/05 by Rolando.Caloca DR - Linux compile fix #jira UE-40264 Change 3248399 on 2017/01/05 by Brian.Karis Filtered importance sampling for envmap prefiltering. Fixed SSR on clearcoat with skylight only. Change 3248503 on 2017/01/05 by Rolando.Caloca DR - Linux fixes #jira UE-40264 Change 3248666 on 2017/01/05 by Brian.Karis Fix GL compile error Change 3248740 on 2017/01/05 by Marcus.Wassmer Fix linux and clang errors/warnings Change 3248851 on 2017/01/05 by Marcus.Wassmer Simplest fix for ES2 compile errors Change 3249217 on 2017/01/06 by Simon.Tovey Speculative fix for static analysis warning Change 3249296 on 2017/01/06 by Ben.Woodhouse XB1/Fast semantics: Add missing L1/L2 cache flush on transition to readable (or RW). The missing cache flush was causing indeterminism when reading from a texture shortly after writing to it as a render target. This fixes bloom and diffuse irradiance issues The bug has been there for a while, but CL 3227787 (drawclear early out) caused it to manifest #jira UE-39727 #jira UE-40238 Change 3249300 on 2017/01/06 by Ben.Woodhouse Remove workaround for diffuse irradiance (redundant clear). No longer necessary with CL 3249296 Change 3249387 on 2017/01/06 by Rolando.Caloca DR - Fix GL clear issues #jira UE-40254 Change 3249435 on 2017/01/06 by Ben.Woodhouse Duplicated from UT CL 3238664 Fix dbuffer decal rendering issues in fullscreen on PC. Also fixes crash in editor when viewing dbuffer materials. Pass clearcolor in RT params for system textures to workaround a bug with ClearColorTexture not working in fullscreen mode on DX11. Make sure dbuffer targets are bound if we're rendering mesh decals #jira UT-6891 #jira UE-39842 Change 3249721 on 2017/01/06 by Marcus.Wassmer Remove final references to non-existent Niagara data Change 3249742 on 2017/01/06 by Marcus.Wassmer Fix missing GPU particles on Mac. Pointers getting reused is causing the blendstate equality operator to fail. Simple workaround until we have time for a proper fix. [CL 3249983 by Marcus Wassmer in Main branch]
2017-01-06 17:51:46 -05:00
#include "ClearQuad.h"
#include "ScenePrivate.h"
#include "SceneRenderTargets.h"
namespace
{
class FSelectionOutlinePS : public FEditorPrimitiveShader
{
public:
DECLARE_GLOBAL_SHADER(FSelectionOutlinePS);
SHADER_USE_PARAMETER_STRUCT(FSelectionOutlinePS, FEditorPrimitiveShader);
BEGIN_SHADER_PARAMETER_STRUCT(FParameters, )
SHADER_PARAMETER_STRUCT_REF(FViewUniformShaderParameters, View)
SHADER_PARAMETER_STRUCT(FScreenPassTextureViewportParameters, Color)
SHADER_PARAMETER_STRUCT(FScreenPassTextureViewportParameters, Depth)
SHADER_PARAMETER_RDG_TEXTURE(Texture2D, ColorTexture)
SHADER_PARAMETER_SAMPLER(SamplerState, ColorSampler)
SHADER_PARAMETER_RDG_TEXTURE(Texture2D, DepthTexture)
SHADER_PARAMETER_SAMPLER(SamplerState, DepthSampler)
SHADER_PARAMETER_RDG_TEXTURE(Texture2D, EditorPrimitivesDepth)
SHADER_PARAMETER_RDG_TEXTURE_SRV(Texture2D, EditorPrimitivesStencil)
SHADER_PARAMETER(FScreenTransform, ColorToDepth)
SHADER_PARAMETER(FVector3f, OutlineColor)
SHADER_PARAMETER(float, SelectionHighlightIntensity)
SHADER_PARAMETER(FVector3f, SubduedOutlineColor)
SHADER_PARAMETER(float, BSPSelectionIntensity)
RENDER_TARGET_BINDING_SLOTS()
END_SHADER_PARAMETER_STRUCT()
};
IMPLEMENT_GLOBAL_SHADER(FSelectionOutlinePS, "/Engine/Private/PostProcessSelectionOutline.usf", "MainPS", SF_Pixel);
} //! namespace
BEGIN_SHADER_PARAMETER_STRUCT(FSelectionOutlinePassParameters, )
//SHADER_PARAMETER_STRUCT_REF(FViewUniformShaderParameters, View)
SHADER_PARAMETER_STRUCT_INCLUDE(FSceneTextureShaderParameters, SceneTextures)
SHADER_PARAMETER_STRUCT_INCLUDE(FNaniteSelectionOutlineParameters, NaniteSelectionOutlineParameters)
SHADER_PARAMETER_STRUCT_INCLUDE(FInstanceCullingDrawParams, InstanceCullingDrawParams)
RENDER_TARGET_BINDING_SLOTS()
END_SHADER_PARAMETER_STRUCT()
FScreenPassTexture AddSelectionOutlinePass(FRDGBuilder& GraphBuilder, const FViewInfo& View, const FSelectionOutlineInputs& Inputs, const Nanite::FRasterResults* NaniteRasterResults)
{
check(Inputs.SceneColor.IsValid());
check(Inputs.SceneDepth.IsValid());
const bool bNaniteEnabled = NaniteRasterResults != nullptr;
RDG_EVENT_SCOPE(GraphBuilder, "EditorSelectionOutlines");
RDG_GPU_STAT_SCOPE(GraphBuilder, EditorPrimitives);
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
const uint32 NumSamples = View.GetSceneTexturesConfig().NumSamples;
// Patch uniform buffers with updated state for rendering the outline mesh draw commands.
const FViewInfo* EditorView = CreateEditorPrimitiveView(View, Inputs.SceneColor.ViewRect, NumSamples);
FRDGTextureRef DepthStencilTexture = nullptr;
// Generate custom depth / stencil for outline shapes.
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04: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
{
FRDGTextureDesc DepthStencilDesc = Inputs.SceneColor.Texture->Desc;
DepthStencilDesc.Reset();
DepthStencilDesc.Format = PF_DepthStencil;
// This is a reversed Z depth surface, so 0.0f is the far plane.
DepthStencilDesc.ClearValue = FClearValueBinding((float)ERHIZBuffer::FarPlane, 0);
DepthStencilDesc.Flags = TexCreate_DepthStencilTargetable | TexCreate_ShaderResource;
DepthStencilDesc.NumSamples = NumSamples;
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
DepthStencilTexture = GraphBuilder.CreateTexture(DepthStencilDesc, TEXT("Editor.SelectionOutline"));
}
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
auto* PassParameters = GraphBuilder.AllocParameters<FSelectionOutlinePassParameters>();
FScene* Scene = View.Family->Scene->GetRenderScene();
const FScreenPassTextureViewport SceneColorViewport(Inputs.SceneColor);
if (bNaniteEnabled)
{
Nanite::GetEditorSelectionPassParameters(GraphBuilder, *Scene, View, SceneColorViewport.Rect, NaniteRasterResults, &PassParameters->NaniteSelectionOutlineParameters);
}
PassParameters->NaniteSelectionOutlineParameters.View = EditorView->ViewUniformBuffer;
PassParameters->SceneTextures = Inputs.SceneTextures;
PassParameters->RenderTargets.DepthStencil = FDepthStencilBinding(
DepthStencilTexture,
ERenderTargetLoadAction::EClear,
ERenderTargetLoadAction::EClear,
FExclusiveDepthStencil::DepthWrite_StencilWrite);
const_cast<FViewInfo&>(View).ParallelMeshDrawCommandPasses[EMeshPass::EditorSelection].BuildRenderingCommands(GraphBuilder, Scene->GPUScene, PassParameters->InstanceCullingDrawParams);
GraphBuilder.AddPass(
RDG_EVENT_NAME("OutlineDepth %dx%d", SceneColorViewport.Rect.Width(), SceneColorViewport.Rect.Height()),
PassParameters,
ERDGPassFlags::Raster,
[&View, SceneColorViewport, DepthStencilTexture, NaniteRasterResults, PassParameters, bNaniteEnabled](FRHICommandListImmediate& RHICmdList)
{
RHICmdList.SetViewport(SceneColorViewport.Rect.Min.X, SceneColorViewport.Rect.Min.Y, 0.0f, SceneColorViewport.Rect.Max.X, SceneColorViewport.Rect.Max.Y, 1.0f);
{
SCOPED_DRAW_EVENT(RHICmdList, EditorSelection);
// Run selection pass on static elements
View.ParallelMeshDrawCommandPasses[EMeshPass::EditorSelection].DispatchDraw(nullptr, RHICmdList, &PassParameters->InstanceCullingDrawParams);
}
// Render Nanite mesh outlines after regular mesh outline, but before borders
if (bNaniteEnabled)
{
Nanite::DrawEditorSelection(RHICmdList, View, SceneColorViewport.Rect, PassParameters->NaniteSelectionOutlineParameters);
}
// to get an outline around the objects if it's partly outside of the screen
{
SCOPED_DRAW_EVENT(RHICmdList, DrawOutlineBorder);
FIntRect InnerRect = SceneColorViewport.Rect;
// 1 as we have an outline that is that thick
InnerRect.InflateRect(-1);
// top
RHICmdList.SetScissorRect(true, SceneColorViewport.Rect.Min.X, SceneColorViewport.Rect.Min.Y, SceneColorViewport.Rect.Max.X, InnerRect.Min.Y);
DrawClearQuad(RHICmdList, false, FLinearColor(), true, (float)ERHIZBuffer::FarPlane, true, 0, SceneColorViewport.Extent, FIntRect());
// bottom
RHICmdList.SetScissorRect(true, SceneColorViewport.Rect.Min.X, InnerRect.Max.Y, SceneColorViewport.Rect.Max.X, SceneColorViewport.Rect.Max.Y);
DrawClearQuad(RHICmdList, false, FLinearColor(), true, (float)ERHIZBuffer::FarPlane, true, 0, SceneColorViewport.Extent, FIntRect());
// left
RHICmdList.SetScissorRect(true, SceneColorViewport.Rect.Min.X, SceneColorViewport.Rect.Min.Y, InnerRect.Min.X, SceneColorViewport.Rect.Max.Y);
DrawClearQuad(RHICmdList, false, FLinearColor(), true, (float)ERHIZBuffer::FarPlane, true, 0, SceneColorViewport.Extent, FIntRect());
// right
RHICmdList.SetScissorRect(true, InnerRect.Max.X, SceneColorViewport.Rect.Min.Y, SceneColorViewport.Rect.Max.X, SceneColorViewport.Rect.Max.Y);
DrawClearQuad(RHICmdList, false, FLinearColor(), true, (float)ERHIZBuffer::FarPlane, true, 0, SceneColorViewport.Extent, FIntRect());
RHICmdList.SetScissorRect(false, 0, 0, 0, 0);
}
});
// Render HairStrands outlines
if (HairStrands::HasViewHairStrandsData(View))
{
HairStrands::DrawEditorSelection(GraphBuilder, View, SceneColorViewport.Rect, DepthStencilTexture);
}
}
FScreenPassRenderTarget Output = Inputs.OverrideOutput;
if (!Output.IsValid())
{
Output = FScreenPassRenderTarget::CreateFromInput(GraphBuilder, Inputs.SceneColor, View.GetOverwriteLoadAction(), TEXT("SelectionOutlineColor"));
}
// Render selection outlines.
{
const FScreenPassTextureViewport OutputViewport(Output);
const FScreenPassTextureViewport ColorViewport(Inputs.SceneColor);
const FScreenPassTextureViewport DepthViewport(Inputs.SceneDepth);
FRHISamplerState* PointClampSampler = TStaticSamplerState<SF_Point, AM_Clamp, AM_Clamp, AM_Clamp>::GetRHI();
FSelectionOutlinePS::FParameters* PassParameters = GraphBuilder.AllocParameters<FSelectionOutlinePS::FParameters>();
PassParameters->RenderTargets[0] = Output.GetRenderTargetBinding();
PassParameters->View = View.ViewUniformBuffer;
PassParameters->Color = GetScreenPassTextureViewportParameters(ColorViewport);
PassParameters->Depth = GetScreenPassTextureViewportParameters(DepthViewport);
PassParameters->ColorToDepth = FScreenTransform::ChangeTextureUVCoordinateFromTo(ColorViewport, DepthViewport);
PassParameters->ColorTexture = Inputs.SceneColor.Texture;
PassParameters->ColorSampler = PointClampSampler;
PassParameters->DepthTexture = Inputs.SceneDepth.Texture;
PassParameters->DepthSampler = PointClampSampler;
PassParameters->EditorPrimitivesDepth = DepthStencilTexture;
PassParameters->EditorPrimitivesStencil = GraphBuilder.CreateSRV(FRDGTextureSRVDesc::CreateWithPixelFormat(DepthStencilTexture, PF_X24_G8));
PassParameters->OutlineColor = FVector3f(View.SelectionOutlineColor);
PassParameters->SelectionHighlightIntensity = GEngine->SelectionHighlightIntensity;
PassParameters->SubduedOutlineColor = FVector3f(View.SubduedSelectionOutlineColor);
PassParameters->BSPSelectionIntensity = GEngine->BSPSelectionHighlightIntensity;
FSelectionOutlinePS::FPermutationDomain PermutationVector;
PermutationVector.Set<FSelectionOutlinePS::FSampleCountDimension>(NumSamples);
TShaderMapRef<FSelectionOutlinePS> PixelShader(View.ShaderMap, PermutationVector);
AddDrawScreenPass(
GraphBuilder,
RDG_EVENT_NAME("OutlineColor %dx%d", OutputViewport.Rect.Width(), OutputViewport.Rect.Height()),
View,
OutputViewport,
ColorViewport,
PixelShader,
PassParameters);
}
return MoveTemp(Output);
}
#endif