2016-01-07 08:17:16 -05:00
|
|
|
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
/*=============================================================================
|
|
|
|
|
PostProcessDownsample.cpp: Post processing down sample implementation.
|
|
|
|
|
=============================================================================*/
|
|
|
|
|
|
|
|
|
|
#include "RendererPrivate.h"
|
|
|
|
|
#include "ScenePrivate.h"
|
|
|
|
|
#include "SceneFilterRendering.h"
|
|
|
|
|
#include "PostProcessDownsample.h"
|
|
|
|
|
#include "PostProcessing.h"
|
|
|
|
|
#include "PostProcessWeightedSampleSum.h"
|
2014-08-21 06:03:00 -04:00
|
|
|
#include "SceneUtils.h"
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
/** Encapsulates the post processing down sample pixel shader. */
|
|
|
|
|
template <uint32 Method>
|
|
|
|
|
class FPostProcessDownsamplePS : public FGlobalShader
|
|
|
|
|
{
|
|
|
|
|
DECLARE_SHADER_TYPE(FPostProcessDownsamplePS, Global);
|
|
|
|
|
|
|
|
|
|
static bool ShouldCache(EShaderPlatform Platform)
|
|
|
|
|
{
|
2014-08-25 14:41:54 -04:00
|
|
|
return Method != 2 || IsFeatureLevelSupported(Platform, ERHIFeatureLevel::SM4);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void ModifyCompilationEnvironment(EShaderPlatform Platform, FShaderCompilerEnvironment& OutEnvironment)
|
|
|
|
|
{
|
2014-06-05 16:38:54 -04:00
|
|
|
FGlobalShader::ModifyCompilationEnvironment(Platform,OutEnvironment);
|
2014-03-14 14:13:41 -04:00
|
|
|
OutEnvironment.SetDefine(TEXT("METHOD"), Method);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Default constructor. */
|
|
|
|
|
FPostProcessDownsamplePS() {}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
FPostProcessPassParameters PostprocessParameter;
|
|
|
|
|
FDeferredPixelShaderParameters DeferredParameters;
|
2015-09-14 20:08:14 -04:00
|
|
|
FShaderParameter DownsampleParams;
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
/** Initialization constructor. */
|
|
|
|
|
FPostProcessDownsamplePS(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
|
|
|
|
|
: FGlobalShader(Initializer)
|
|
|
|
|
{
|
|
|
|
|
PostprocessParameter.Bind(Initializer.ParameterMap);
|
|
|
|
|
DeferredParameters.Bind(Initializer.ParameterMap);
|
2015-09-14 20:08:14 -04:00
|
|
|
DownsampleParams.Bind(Initializer.ParameterMap, TEXT("DownsampleParams"));
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// FShader interface.
|
2015-04-01 07:20:55 -04:00
|
|
|
virtual bool Serialize(FArchive& Ar) override
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
bool bShaderHasOutdatedParameters = FGlobalShader::Serialize(Ar);
|
2015-09-14 20:08:14 -04:00
|
|
|
Ar << PostprocessParameter << DeferredParameters << DownsampleParams;
|
2014-03-14 14:13:41 -04:00
|
|
|
return bShaderHasOutdatedParameters;
|
|
|
|
|
}
|
|
|
|
|
|
2015-09-14 20:08:14 -04:00
|
|
|
void SetParameters(const FRenderingCompositePassContext& Context, const FPooledRenderTargetDesc* InputDesc)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
const FPixelShaderRHIParamRef ShaderRHI = GetPixelShader();
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
FGlobalShader::SetParameters(Context.RHICmdList, ShaderRHI, Context.View);
|
|
|
|
|
DeferredParameters.Set(Context.RHICmdList, ShaderRHI, Context.View);
|
2015-09-10 21:23:56 -04:00
|
|
|
|
|
|
|
|
// filter only if needed for better performance
|
|
|
|
|
FSamplerStateRHIParamRef Filter = (Method == 2) ?
|
|
|
|
|
TStaticSamplerState<SF_Point, AM_Clamp, AM_Clamp, AM_Clamp>::GetRHI():
|
|
|
|
|
TStaticSamplerState<SF_Bilinear, AM_Clamp, AM_Clamp, AM_Clamp>::GetRHI();
|
2015-09-14 20:08:14 -04:00
|
|
|
|
|
|
|
|
{
|
|
|
|
|
float PixelScale = (Method == 2) ? 0.5f : 1.0f;
|
|
|
|
|
|
|
|
|
|
FVector4 DownsampleParamsValue(PixelScale / InputDesc->Extent.X, PixelScale / InputDesc->Extent.Y, 0, 0);
|
|
|
|
|
SetShaderValue(Context.RHICmdList, ShaderRHI, DownsampleParams, DownsampleParamsValue);
|
|
|
|
|
}
|
2015-09-10 21:23:56 -04:00
|
|
|
|
|
|
|
|
PostprocessParameter.SetPS(ShaderRHI, Context, Filter);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static const TCHAR* GetSourceFilename()
|
|
|
|
|
{
|
|
|
|
|
return TEXT("PostProcessDownsample");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static const TCHAR* GetFunctionName()
|
|
|
|
|
{
|
|
|
|
|
return TEXT("MainPS");
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// #define avoids a lot of code duplication
|
|
|
|
|
#define VARIATION1(A) typedef FPostProcessDownsamplePS<A> FPostProcessDownsamplePS##A; \
|
|
|
|
|
IMPLEMENT_SHADER_TYPE2(FPostProcessDownsamplePS##A, SF_Pixel);
|
|
|
|
|
|
|
|
|
|
VARIATION1(0) VARIATION1(1) VARIATION1(2)
|
|
|
|
|
#undef VARIATION1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Encapsulates the post processing down sample vertex shader. */
|
|
|
|
|
class FPostProcessDownsampleVS : public FGlobalShader
|
|
|
|
|
{
|
|
|
|
|
DECLARE_SHADER_TYPE(FPostProcessDownsampleVS,Global);
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
static bool ShouldCache(EShaderPlatform Platform)
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Default constructor. */
|
|
|
|
|
FPostProcessDownsampleVS() {}
|
|
|
|
|
|
|
|
|
|
/** Initialization constructor. */
|
|
|
|
|
FPostProcessDownsampleVS(const ShaderMetaType::CompiledShaderInitializerType& Initializer):
|
|
|
|
|
FGlobalShader(Initializer)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Serializer */
|
2015-04-01 07:20:55 -04:00
|
|
|
virtual bool Serialize(FArchive& Ar) override
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
bool bShaderHasOutdatedParameters = FGlobalShader::Serialize(Ar);
|
|
|
|
|
|
|
|
|
|
return bShaderHasOutdatedParameters;
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void SetParameters(const FRenderingCompositePassContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
const FVertexShaderRHIParamRef ShaderRHI = GetVertexShader();
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
FGlobalShader::SetParameters(Context.RHICmdList, ShaderRHI, Context.View);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
const FPooledRenderTargetDesc* InputDesc = Context.Pass->GetInputDesc(ePId_Input0);
|
|
|
|
|
|
|
|
|
|
if(!InputDesc)
|
|
|
|
|
{
|
|
|
|
|
// input is not hooked up correctly
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(,FPostProcessDownsampleVS,TEXT("PostProcessDownsample"),TEXT("MainDownsampleVS"),SF_Vertex);
|
|
|
|
|
|
|
|
|
|
|
2014-09-10 12:31:36 -04:00
|
|
|
FRCPassPostProcessDownsample::FRCPassPostProcessDownsample(EPixelFormat InOverrideFormat, uint32 InQuality, const TCHAR *InDebugName)
|
2014-03-14 14:13:41 -04:00
|
|
|
: OverrideFormat(InOverrideFormat)
|
|
|
|
|
, Quality(InQuality)
|
|
|
|
|
, DebugName(InDebugName)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template <uint32 Method>
|
2015-09-14 20:08:14 -04:00
|
|
|
void FRCPassPostProcessDownsample::SetShader(const FRenderingCompositePassContext& Context, const FPooledRenderTargetDesc* InputDesc)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2014-08-28 06:22:54 -04:00
|
|
|
auto ShaderMap = Context.GetShaderMap();
|
|
|
|
|
TShaderMapRef<FPostProcessDownsampleVS> VertexShader(ShaderMap);
|
|
|
|
|
TShaderMapRef<FPostProcessDownsamplePS<Method> > PixelShader(ShaderMap);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
static FGlobalBoundShaderState BoundShaderState;
|
|
|
|
|
|
2014-08-19 10:41:34 -04:00
|
|
|
SetGlobalBoundShaderState(Context.RHICmdList, Context.GetFeatureLevel(), BoundShaderState, GFilterVertexDeclaration.VertexDeclarationRHI, *VertexShader, *PixelShader);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2015-09-14 20:08:14 -04:00
|
|
|
PixelShader->SetParameters(Context, InputDesc);
|
2014-06-12 07:13:34 -04:00
|
|
|
VertexShader->SetParameters(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void FRCPassPostProcessDownsample::Process(FRenderingCompositePassContext& Context)
|
|
|
|
|
{
|
|
|
|
|
const FPooledRenderTargetDesc* InputDesc = GetInputDesc(ePId_Input0);
|
|
|
|
|
|
|
|
|
|
if(!InputDesc)
|
|
|
|
|
{
|
|
|
|
|
// input is not hooked up correctly
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const FSceneView& View = Context.View;
|
|
|
|
|
const FSceneViewFamily& ViewFamily = *(View.Family);
|
|
|
|
|
|
|
|
|
|
FIntPoint SrcSize = InputDesc->Extent;
|
|
|
|
|
FIntPoint DestSize = PassOutputs[0].RenderTargetDesc.Extent;
|
|
|
|
|
|
|
|
|
|
// e.g. 4 means the input texture is 4x smaller than the buffer size
|
2016-04-11 23:01:18 -04:00
|
|
|
uint32 ScaleFactor = FMath::DivideAndRoundUp(FSceneRenderTargets::Get(Context.RHICmdList).GetBufferSizeXY().Y, SrcSize.Y);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2015-09-01 16:52:40 -04:00
|
|
|
FIntRect SrcRect = View.ViewRect / ScaleFactor;
|
|
|
|
|
FIntRect DestRect = FIntRect::DivideAndRoundUp(SrcRect, 2);
|
|
|
|
|
SrcRect = DestRect * 2;
|
|
|
|
|
|
|
|
|
|
SCOPED_DRAW_EVENTF(Context.RHICmdList, Downsample, TEXT("Downsample %dx%d"), DestRect.Width(), DestRect.Height());
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
const FSceneRenderTargetItem& DestRenderTarget = PassOutputs[0].RequestSurface(Context);
|
|
|
|
|
|
Copying //UE4/Orion-Staging to //UE4/Main (//Orion/Dev-General @ 2855324)
#lockdown Nick.Penwarden
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2855265 on 2016/02/03 by Max.Chen
Sequencer: Release track editors when destroying sequencer
#jira UE-26423
Change 2855247 on 2016/02/03 by Max.Chen
PlacementMode: Null factory check in constructor to fix cooking.
#codereview andrew.rodham
#rb andrew.rodham
#jira UE-26412
ChangeChange 2855116 on 2016/02/03 by Michael.Noland
[AUTOMERGE]
PS4: Added a log statement when the gap between SubmitDone calls exceeds 2 seconds and removed a duplicate call to set the LastSubmitDoneTime
PS4: Fixed a bogus log statement when PS4_GNM_SLOW_FRAME_DEBUGGING=1
Merging CL# 2854751 and 2852176 by way of 2855100
#tests Tested on PS4 with PS4_GNM_SLOW_FRAME_DEBUGGING=1
#rb dave.ratti
#lockdown andrew.grant
--------
Integrated using branch //Orion/Main_to_//Orion/Dev-General of change#2855109 by Michael.Noland on 2016/02/03 20:59:51.
Change 2855109 on 2016/02/03 by Michael.Noland
PS4: Added a log statement when the gap between SubmitDone calls exceeds 2 seconds and removed a duplicate call to set the LastSubmitDoneTime
PS4: Fixed a bogus log statement when PS4_GNM_SLOW_FRAME_DEBUGGING=1
Merging CL# 2854751 and 2852176 by way of 2855100
#tests Tested on PS4 with PS4_GNM_SLOW_FRAME_DEBUGGING=1
#rb dave.ratti
#lockdown andrew.grant
Change 2855100 on 2016/02/03 by Michael.Noland
PS4: Added a log statement when the gap between SubmitDone calls exceeds 2 seconds and removed a duplicate call to set the LastSubmitDoneTime
PS4: Fixed a bogus log statement when PS4_GNM_SLOW_FRAME_DEBUGGING=1
Merging CL# 2854751 and 2852176 using //Orion/Release-Next_to_//Orion/Release-Live
#tests Tested on PS4 with PS4_GNM_SLOW_FRAME_DEBUGGING=1
#rb dave.ratti
#lockdown andrew.grant
ChangeChangeChangeChangeChange 2854825 on 2016/02/03 by Zabir.Hoque
Harden MaterialParameterCollection from ending up with duplicate parameter names of GUIDs.
#Tests: Ran debug editor, create materail param collection with >500 elements. Still only ~18ms. Used param in shader.
#RB: Daniel.Wright
#CodeReview: Daniel.Wright, Gil.Gribb, Rolando.Caloca, Marcus.Wassmer
Change 2854788 on 2016/02/03 by Josh.Markiewicz
#UE4 - JsonObjectConverter changes
- added the ability for a UStruct to emit json as a string if type traits are setup with ExportTextItem / ImportTextItem
- allows the UStruct to convert to json as something other than FJsonValueObject
-- things like FColor, FDateTime but they are already handled differently
- checked for possible change in existing behavior, no classes currently use type traits for this that aren't handled special already
- FUniqueNetIdRepl can now convert to/from json as a string
#rb david.nikdel
#codereview ben.zeigler, sam.zamani, david.nikdel, paul.moore
#tests various online tests connecting to servers, etc
Change 2854751 on 2016/02/03 by Michael.Noland
PS4: Fixed a bogus log statement when PS4_GNM_SLOW_FRAME_DEBUGGING=1
#rb dave.ratti
#lockdown andrew.grant
#tests Tested on PS4 with PS4_GNM_SLOW_FRAME_DEBUGGING=1
ChangeChange 2854712 on 2016/02/03 by Josh.Markiewicz
#UE4 - added some json compatibility features to FUniqueNetIdRepl struct
- ImportTextItem
- To/FromJson
#rb david.nikdel
#codereview none
#tests various online features, additional unit tests added to class
Change 2854696 on 2016/02/03 by Dmitry.Rekman
Making Memprofiler usable (by MichaelN).
#rb Zak.Middleton (who I got the shelved CL # from)
#codereview Michael.Noland, Zak.Middleton, Bob.Tellez
#tests Used Memprofiler on a number of captures.
ChangeChange 2854536 on 2016/02/03 by John.Pollard
Add event groups as users to replay, so we can quickly find replays with certain events types in them
#rb RyanG
#tests Replays and events
Merging using OrionDevGeneral->ReleaseCandidate
Change 2854526 on 2016/02/03 by John.Pollard
Add support for getting replay id
#rb RyanG
#tests Replays
Merging using OrionDevGeneral->ReleaseCandidate
Change 2854522 on 2016/02/03 by John.Pollard
Support setting string values in perf counters through the perf counters helper class.
#rb none
#tests Client/Server match
[CL 2856676 by Andrew Grant in Main branch]
2016-02-04 23:40:42 -05:00
|
|
|
// check if we have to clear the whole surface.
|
|
|
|
|
// Otherwise perform the clear when the dest rectangle has been computed.
|
|
|
|
|
auto FeatureLevel = Context.View.GetFeatureLevel();
|
|
|
|
|
if (FeatureLevel == ERHIFeatureLevel::ES2 || FeatureLevel == ERHIFeatureLevel::ES3_1)
|
|
|
|
|
{
|
2016-03-16 21:16:51 -04:00
|
|
|
// Set the view family's render target/viewport.
|
|
|
|
|
SetRenderTarget(Context.RHICmdList, DestRenderTarget.TargetableTexture, FTextureRHIRef(), ESimpleRenderTargetMode::EClearColorAndDepth);
|
|
|
|
|
Context.SetViewportAndCallRHI(0, 0, 0.0f, DestSize.X, DestSize.Y, 1.0f );
|
Copying //UE4/Orion-Staging to //UE4/Main (//Orion/Dev-General @ 2855324)
#lockdown Nick.Penwarden
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2855265 on 2016/02/03 by Max.Chen
Sequencer: Release track editors when destroying sequencer
#jira UE-26423
Change 2855247 on 2016/02/03 by Max.Chen
PlacementMode: Null factory check in constructor to fix cooking.
#codereview andrew.rodham
#rb andrew.rodham
#jira UE-26412
ChangeChange 2855116 on 2016/02/03 by Michael.Noland
[AUTOMERGE]
PS4: Added a log statement when the gap between SubmitDone calls exceeds 2 seconds and removed a duplicate call to set the LastSubmitDoneTime
PS4: Fixed a bogus log statement when PS4_GNM_SLOW_FRAME_DEBUGGING=1
Merging CL# 2854751 and 2852176 by way of 2855100
#tests Tested on PS4 with PS4_GNM_SLOW_FRAME_DEBUGGING=1
#rb dave.ratti
#lockdown andrew.grant
--------
Integrated using branch //Orion/Main_to_//Orion/Dev-General of change#2855109 by Michael.Noland on 2016/02/03 20:59:51.
Change 2855109 on 2016/02/03 by Michael.Noland
PS4: Added a log statement when the gap between SubmitDone calls exceeds 2 seconds and removed a duplicate call to set the LastSubmitDoneTime
PS4: Fixed a bogus log statement when PS4_GNM_SLOW_FRAME_DEBUGGING=1
Merging CL# 2854751 and 2852176 by way of 2855100
#tests Tested on PS4 with PS4_GNM_SLOW_FRAME_DEBUGGING=1
#rb dave.ratti
#lockdown andrew.grant
Change 2855100 on 2016/02/03 by Michael.Noland
PS4: Added a log statement when the gap between SubmitDone calls exceeds 2 seconds and removed a duplicate call to set the LastSubmitDoneTime
PS4: Fixed a bogus log statement when PS4_GNM_SLOW_FRAME_DEBUGGING=1
Merging CL# 2854751 and 2852176 using //Orion/Release-Next_to_//Orion/Release-Live
#tests Tested on PS4 with PS4_GNM_SLOW_FRAME_DEBUGGING=1
#rb dave.ratti
#lockdown andrew.grant
ChangeChangeChangeChangeChange 2854825 on 2016/02/03 by Zabir.Hoque
Harden MaterialParameterCollection from ending up with duplicate parameter names of GUIDs.
#Tests: Ran debug editor, create materail param collection with >500 elements. Still only ~18ms. Used param in shader.
#RB: Daniel.Wright
#CodeReview: Daniel.Wright, Gil.Gribb, Rolando.Caloca, Marcus.Wassmer
Change 2854788 on 2016/02/03 by Josh.Markiewicz
#UE4 - JsonObjectConverter changes
- added the ability for a UStruct to emit json as a string if type traits are setup with ExportTextItem / ImportTextItem
- allows the UStruct to convert to json as something other than FJsonValueObject
-- things like FColor, FDateTime but they are already handled differently
- checked for possible change in existing behavior, no classes currently use type traits for this that aren't handled special already
- FUniqueNetIdRepl can now convert to/from json as a string
#rb david.nikdel
#codereview ben.zeigler, sam.zamani, david.nikdel, paul.moore
#tests various online tests connecting to servers, etc
Change 2854751 on 2016/02/03 by Michael.Noland
PS4: Fixed a bogus log statement when PS4_GNM_SLOW_FRAME_DEBUGGING=1
#rb dave.ratti
#lockdown andrew.grant
#tests Tested on PS4 with PS4_GNM_SLOW_FRAME_DEBUGGING=1
ChangeChange 2854712 on 2016/02/03 by Josh.Markiewicz
#UE4 - added some json compatibility features to FUniqueNetIdRepl struct
- ImportTextItem
- To/FromJson
#rb david.nikdel
#codereview none
#tests various online features, additional unit tests added to class
Change 2854696 on 2016/02/03 by Dmitry.Rekman
Making Memprofiler usable (by MichaelN).
#rb Zak.Middleton (who I got the shelved CL # from)
#codereview Michael.Noland, Zak.Middleton, Bob.Tellez
#tests Used Memprofiler on a number of captures.
ChangeChange 2854536 on 2016/02/03 by John.Pollard
Add event groups as users to replay, so we can quickly find replays with certain events types in them
#rb RyanG
#tests Replays and events
Merging using OrionDevGeneral->ReleaseCandidate
Change 2854526 on 2016/02/03 by John.Pollard
Add support for getting replay id
#rb RyanG
#tests Replays
Merging using OrionDevGeneral->ReleaseCandidate
Change 2854522 on 2016/02/03 by John.Pollard
Support setting string values in perf counters through the perf counters helper class.
#rb none
#tests Client/Server match
[CL 2856676 by Andrew Grant in Main branch]
2016-02-04 23:40:42 -05:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2016-03-16 21:16:51 -04:00
|
|
|
// Set the view family's render target/viewport.
|
|
|
|
|
SetRenderTarget(Context.RHICmdList, DestRenderTarget.TargetableTexture, FTextureRHIRef(), ESimpleRenderTargetMode::EExistingColorAndDepth);
|
|
|
|
|
Context.SetViewportAndCallRHI(0, 0, 0.0f, DestSize.X, DestSize.Y, 1.0f );
|
Copying //UE4/Orion-Staging to //UE4/Main (//Orion/Dev-General @ 2855324)
#lockdown Nick.Penwarden
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2855265 on 2016/02/03 by Max.Chen
Sequencer: Release track editors when destroying sequencer
#jira UE-26423
Change 2855247 on 2016/02/03 by Max.Chen
PlacementMode: Null factory check in constructor to fix cooking.
#codereview andrew.rodham
#rb andrew.rodham
#jira UE-26412
ChangeChange 2855116 on 2016/02/03 by Michael.Noland
[AUTOMERGE]
PS4: Added a log statement when the gap between SubmitDone calls exceeds 2 seconds and removed a duplicate call to set the LastSubmitDoneTime
PS4: Fixed a bogus log statement when PS4_GNM_SLOW_FRAME_DEBUGGING=1
Merging CL# 2854751 and 2852176 by way of 2855100
#tests Tested on PS4 with PS4_GNM_SLOW_FRAME_DEBUGGING=1
#rb dave.ratti
#lockdown andrew.grant
--------
Integrated using branch //Orion/Main_to_//Orion/Dev-General of change#2855109 by Michael.Noland on 2016/02/03 20:59:51.
Change 2855109 on 2016/02/03 by Michael.Noland
PS4: Added a log statement when the gap between SubmitDone calls exceeds 2 seconds and removed a duplicate call to set the LastSubmitDoneTime
PS4: Fixed a bogus log statement when PS4_GNM_SLOW_FRAME_DEBUGGING=1
Merging CL# 2854751 and 2852176 by way of 2855100
#tests Tested on PS4 with PS4_GNM_SLOW_FRAME_DEBUGGING=1
#rb dave.ratti
#lockdown andrew.grant
Change 2855100 on 2016/02/03 by Michael.Noland
PS4: Added a log statement when the gap between SubmitDone calls exceeds 2 seconds and removed a duplicate call to set the LastSubmitDoneTime
PS4: Fixed a bogus log statement when PS4_GNM_SLOW_FRAME_DEBUGGING=1
Merging CL# 2854751 and 2852176 using //Orion/Release-Next_to_//Orion/Release-Live
#tests Tested on PS4 with PS4_GNM_SLOW_FRAME_DEBUGGING=1
#rb dave.ratti
#lockdown andrew.grant
ChangeChangeChangeChangeChange 2854825 on 2016/02/03 by Zabir.Hoque
Harden MaterialParameterCollection from ending up with duplicate parameter names of GUIDs.
#Tests: Ran debug editor, create materail param collection with >500 elements. Still only ~18ms. Used param in shader.
#RB: Daniel.Wright
#CodeReview: Daniel.Wright, Gil.Gribb, Rolando.Caloca, Marcus.Wassmer
Change 2854788 on 2016/02/03 by Josh.Markiewicz
#UE4 - JsonObjectConverter changes
- added the ability for a UStruct to emit json as a string if type traits are setup with ExportTextItem / ImportTextItem
- allows the UStruct to convert to json as something other than FJsonValueObject
-- things like FColor, FDateTime but they are already handled differently
- checked for possible change in existing behavior, no classes currently use type traits for this that aren't handled special already
- FUniqueNetIdRepl can now convert to/from json as a string
#rb david.nikdel
#codereview ben.zeigler, sam.zamani, david.nikdel, paul.moore
#tests various online tests connecting to servers, etc
Change 2854751 on 2016/02/03 by Michael.Noland
PS4: Fixed a bogus log statement when PS4_GNM_SLOW_FRAME_DEBUGGING=1
#rb dave.ratti
#lockdown andrew.grant
#tests Tested on PS4 with PS4_GNM_SLOW_FRAME_DEBUGGING=1
ChangeChange 2854712 on 2016/02/03 by Josh.Markiewicz
#UE4 - added some json compatibility features to FUniqueNetIdRepl struct
- ImportTextItem
- To/FromJson
#rb david.nikdel
#codereview none
#tests various online features, additional unit tests added to class
Change 2854696 on 2016/02/03 by Dmitry.Rekman
Making Memprofiler usable (by MichaelN).
#rb Zak.Middleton (who I got the shelved CL # from)
#codereview Michael.Noland, Zak.Middleton, Bob.Tellez
#tests Used Memprofiler on a number of captures.
ChangeChange 2854536 on 2016/02/03 by John.Pollard
Add event groups as users to replay, so we can quickly find replays with certain events types in them
#rb RyanG
#tests Replays and events
Merging using OrionDevGeneral->ReleaseCandidate
Change 2854526 on 2016/02/03 by John.Pollard
Add support for getting replay id
#rb RyanG
#tests Replays
Merging using OrionDevGeneral->ReleaseCandidate
Change 2854522 on 2016/02/03 by John.Pollard
Support setting string values in perf counters through the perf counters helper class.
#rb none
#tests Client/Server match
[CL 2856676 by Andrew Grant in Main branch]
2016-02-04 23:40:42 -05:00
|
|
|
DrawClearQuad(Context.RHICmdList, Context.GetFeatureLevel(), true, FLinearColor(0, 0, 0, 0), false, 1.0f, false, 0, DestSize, DestRect);
|
|
|
|
|
}
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
// set the state
|
2014-06-12 07:13:34 -04:00
|
|
|
Context.RHICmdList.SetBlendState(TStaticBlendState<>::GetRHI());
|
|
|
|
|
Context.RHICmdList.SetRasterizerState(TStaticRasterizerState<>::GetRHI());
|
|
|
|
|
Context.RHICmdList.SetDepthStencilState(TStaticDepthStencilState<false, CF_Always>::GetRHI());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
// InflateSize increases the size of the source/dest rectangle to compensate for bilinear reads and UIBlur pass requirements.
|
|
|
|
|
int32 InflateSize;
|
|
|
|
|
// if second input is hooked up
|
|
|
|
|
if (IsDepthInputAvailable())
|
|
|
|
|
{
|
|
|
|
|
// also put depth in alpha
|
|
|
|
|
InflateSize = 2;
|
2015-09-14 20:08:14 -04:00
|
|
|
SetShader<2>(Context, InputDesc);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (Quality == 0)
|
|
|
|
|
{
|
2015-09-14 20:08:14 -04:00
|
|
|
SetShader<0>(Context, InputDesc);
|
2014-03-14 14:13:41 -04:00
|
|
|
InflateSize = 1;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2015-09-14 20:08:14 -04:00
|
|
|
SetShader<1>(Context, InputDesc);
|
2014-03-14 14:13:41 -04:00
|
|
|
InflateSize = 2;
|
|
|
|
|
}
|
2016-03-16 21:16:51 -04:00
|
|
|
}
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2014-08-28 06:22:54 -04:00
|
|
|
TShaderMapRef<FPostProcessDownsampleVS> VertexShader(Context.GetShaderMap());
|
2014-04-23 17:26:59 -04:00
|
|
|
|
2015-08-04 19:33:26 -04:00
|
|
|
DrawPostProcessPass(
|
2014-09-10 12:31:36 -04:00
|
|
|
Context.RHICmdList,
|
|
|
|
|
DestRect.Min.X, DestRect.Min.Y,
|
|
|
|
|
DestRect.Width(), DestRect.Height(),
|
|
|
|
|
SrcRect.Min.X, SrcRect.Min.Y,
|
|
|
|
|
SrcRect.Width(), SrcRect.Height(),
|
|
|
|
|
DestSize,
|
|
|
|
|
SrcSize,
|
|
|
|
|
*VertexShader,
|
2015-08-04 19:33:26 -04:00
|
|
|
View.StereoPass,
|
|
|
|
|
Context.HasHmdMesh(),
|
2014-09-10 12:31:36 -04:00
|
|
|
EDRF_UseTriangleOptimization);
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
Context.RHICmdList.CopyToResolveTarget(DestRenderTarget.TargetableTexture, DestRenderTarget.ShaderResourceTexture, false, FResolveParams());
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool FRCPassPostProcessDownsample::IsDepthInputAvailable() const
|
|
|
|
|
{
|
|
|
|
|
// remove const
|
|
|
|
|
FRCPassPostProcessDownsample *This = (FRCPassPostProcessDownsample*)this;
|
|
|
|
|
|
|
|
|
|
return This->GetInputDesc(ePId_Input1) != 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPooledRenderTargetDesc FRCPassPostProcessDownsample::ComputeOutputDesc(EPassOutputId InPassOutputId) const
|
|
|
|
|
{
|
2015-07-06 18:04:49 -04:00
|
|
|
FPooledRenderTargetDesc Ret = GetInput(ePId_Input0)->GetOutput()->RenderTargetDesc;
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
Ret.Reset();
|
|
|
|
|
|
|
|
|
|
Ret.Extent = FIntPoint::DivideAndRoundUp(Ret.Extent, 2);
|
|
|
|
|
|
|
|
|
|
Ret.Extent.X = FMath::Max(1, Ret.Extent.X);
|
|
|
|
|
Ret.Extent.Y = FMath::Max(1, Ret.Extent.Y);
|
|
|
|
|
|
|
|
|
|
if(OverrideFormat != PF_Unknown)
|
|
|
|
|
{
|
|
|
|
|
Ret.Format = OverrideFormat;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Ret.TargetableFlags &= ~TexCreate_UAV;
|
|
|
|
|
Ret.TargetableFlags |= TexCreate_RenderTargetable;
|
Copying //UE4/Fortnite-Staging to //UE4/Main
#lockdown nick.penwarden
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2806454 on 2015/12/16 by Bob.Tellez
#UE4 Getting crash reporting working again on linux servers. Since -Unattended is now being passed BEFORE the target folder, the cmd line parsing code was failing so now it parses tokens and switches in a more general way. Also, diagnostics.txt had the incorrect case, since the d is supposed to be capitolized and the crash report processor is case sensitive.
#rb Ben.Zeigler
#codereview Dmitry.Rekman
Change 2805502 on 2015/12/16 by Ben.Zeigler
#UE4 Move ValidateEnumProperties into ValidateGeneratedClass, it was happening too early in the generation process so was being called at an invalid time.
As a result of this ValidateEnumProperties will not be called correctly for compile on load blueprints, that issue is covered in UE-24569
#codereview mike.beach, bob.tellez
Change 2805288 on 2015/12/16 by David.Nikdel
#HTTP #HttpRetry
- Add new Failed_ConnectionError code to EHttpRequestStatus to distinguish between connection errors and protocol errors.
- Changed HTTP retry logic a little bit
* If a response was received, retry on service-specific explicit HTTP codes (defaults to empty)
* If a response was not received and we did not send a full request, automatically retry
* If a response was not received and a request may have been sent, retry if the verb is GET or HEAD (should be idempotent)
- Adjusted Curl/IOS/Mac/PS4/WinInet to try and distinguish Failed_ConnectionError where possible
* Other systems will default to Failed which is ok (ConnectionError is an opportunistic categorization)
* Opened a PS4 ticket to try to improve detection, but unfortunately there's no way (currently) to distinguish between send timeout, connection timeout, and receive timeout, the latter being the problematic case.
- Removed the concept of global/default HTTP retry status codes. No system has enough knowledge to set those globally.
* Individual requests still specify explicit "retryable" codes and McpServiceBase sets that on each request on a per-service basis
#RB: Sam.Zamani
#CodeReview: Sam.Zamani, Josh.Markiewicz, Alex.Fennell, Dmitry.Rekman, Sam.Spiro
#Fixes: FORT-17804
Change 2803864 on 2015/12/15 by Bob.Tellez
#UE4 Changed usage of !UE_SERVER to !IsRunningDedicatedServer in cases where we are preventing load attempts on UFonts. This is so running an editor build with -server works the same as running a cooked server.
#rb Dmitry.Rekman
#codereview Nick.Darnell
Change 2803677 on 2015/12/15 by Billy.Bramer
- Expose equality and inequality operators for gameplay attributes
#rb Todd.Eckert
Change 2802881 on 2015/12/14 by Bob.Tellez
#UE4 InheritableComponentHandler no longer keeps records for components that we are no longer inheriting.
#rb Phillip.Kavan, Maciej.Mroz
#codereview Phillip.Kavan, Maciej.Mroz
Change 2801636 on 2015/12/14 by Bob.Tellez
#UE4 Returning package insert order for non-imports back to being after those of matching priorities unconditionally since this is what you want even when you are not using the asset registry to preload packages.
#codereview Graeme.Thornton
Change 2800400 on 2015/12/11 by Jonathan.Lindquist
Submitting a new Pivot Painter Edition
- now renders to textures
- improved workflow
- greater capabilities
Change 2799579 on 2015/12/11 by John.Abercrombie
[AUTOMERGE]
Fixed EQS BP query wrappers getting GCed before wrapped query finishes #UE4
Fixes FORT-18649 - Patrols don't spawn consistently
- The patrol blueprint was waiting (endlessly) for an EQS query to finish but because the wrapper could be GC-ed while the EQS query was running the delegate would never fire
#rb me (this code was written by MieszkoZ)
(removed code review for integration of Mieszko.Zielinski, Phil.Cole, Dominic.Barile)
--------
Integrated using branch UE4-Fortnite-To-UE4-FortniteReleases/0.10 (reversed) of change#2799575 by John.Abercrombie on 2015/12/11 09:55:11.
Change 2799018 on 2015/12/10 by Bob.Tellez
#UE4 The asset registry tags stripped from cooked builds is now a blacklist by default that includes only the FiB tag. You can opt-in to using the whitelist by flipping the bUseAssetRegistryTagsWhitelistInsteadOfBlacklist flag.
#rb Fred.Kimberley
#codereview Peter.Knepley
Change 2798926 on 2015/12/10 by Bob.Tellez
#UE4 Removed some showflags from the list of "Fixed" showflags since they were actually in use at runtime in Fortnite in a scene capture.
#jira FORT-18514
#codereview Martin.Mittring
Change 2797758 on 2015/12/10 by Mark.Satterthwaite
Defer calls to AUGraphUpdate into FCoreAudioDevice::UpdateHardware - this call will synchronise the calling thread with the CoreAudio thread/run-loop so that the CoreAudio graph is safe to modify and this may incur a significant stall. This means it is far more efficient to amortise the cost of all changes to the graph with a single call. To ensure correctness the audio format conversion components are cached and disposed of after the call to AUGraphUpdate so that any existing operations on the CoreAudio thread are completed prior to disposal.
Change 2781204 on 2015/11/25 by Dmitry.Rekman
Linux: use jemalloc by default if available.
- Alleviates one of the reasons for player disconnect (FORT-18048), which was machines running OOM.
#rb Bob.Tellez
#codereview Bob.Tellez, Ben.Zeigler
Change 2779398 on 2015/11/24 by Mark.Satterthwaite
Switch the default graphics API on Mac back to OpenGL, but allow Metal to run with -metal (or -metalsm5 for experimental SM5 support).
2016-01-08 19:10:43 -05:00
|
|
|
Ret.AutoWritable = false;
|
2014-03-14 14:13:41 -04:00
|
|
|
Ret.DebugName = DebugName;
|
|
|
|
|
|
2016-03-16 21:16:51 -04:00
|
|
|
Ret.ClearValue = FClearValueBinding(FLinearColor(0,0,0,0));
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
return Ret;
|
|
|
|
|
}
|