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
|
|
|
|
|
|
|
|
/*=============================================================================
|
|
|
|
|
PostProcessMobile.cpp: Uber post for mobile implementation.
|
|
|
|
|
=============================================================================*/
|
|
|
|
|
|
|
|
|
|
#include "RendererPrivate.h"
|
|
|
|
|
#include "SceneRendering.h"
|
|
|
|
|
#include "ScenePrivate.h"
|
|
|
|
|
#include "SceneFilterRendering.h"
|
|
|
|
|
#include "PostProcessMobile.h"
|
|
|
|
|
#include "PostProcessing.h"
|
|
|
|
|
#include "PostProcessHistogram.h"
|
|
|
|
|
#include "PostProcessEyeAdaptation.h"
|
2014-08-21 06:03:00 -04:00
|
|
|
#include "SceneUtils.h"
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2015-07-15 06:39:44 -04:00
|
|
|
|
|
|
|
|
static EPixelFormat GetHDRPixelFormat()
|
|
|
|
|
{
|
|
|
|
|
// PF_B8G8R8A8 instead of floats for 32bpp hdr encoding.
|
|
|
|
|
return IsMobileHDR32bpp() ? PF_B8G8R8A8 : PF_FloatRGBA;
|
|
|
|
|
}
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
//
|
|
|
|
|
// BLOOM SETUP
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
class FPostProcessBloomSetupVS_ES2 : public FGlobalShader
|
|
|
|
|
{
|
|
|
|
|
DECLARE_SHADER_TYPE(FPostProcessBloomSetupVS_ES2, Global);
|
|
|
|
|
|
|
|
|
|
static bool ShouldCache(EShaderPlatform Platform)
|
|
|
|
|
{
|
|
|
|
|
return !IsConsolePlatform(Platform);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Default constructor. */
|
|
|
|
|
FPostProcessBloomSetupVS_ES2() {}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
FPostProcessPassParameters PostprocessParameter;
|
|
|
|
|
|
|
|
|
|
/** Initialization constructor. */
|
|
|
|
|
FPostProcessBloomSetupVS_ES2(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
|
|
|
|
|
: FGlobalShader(Initializer)
|
|
|
|
|
{
|
|
|
|
|
PostprocessParameter.Bind(Initializer.ParameterMap);
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void SetVS(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
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
PostprocessParameter.SetVS(ShaderRHI, Context, TStaticSamplerState<SF_Bilinear,AM_Clamp,AM_Clamp,AM_Clamp>::GetRHI());
|
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);
|
|
|
|
|
Ar << PostprocessParameter;
|
|
|
|
|
return bShaderHasOutdatedParameters;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2014-08-15 16:23:58 -04:00
|
|
|
template <uint32 UseSunDof> // 0=none, 1=dof, 2=sun, 3=sun&dof, 4=msaa
|
2014-03-14 14:13:41 -04:00
|
|
|
class FPostProcessBloomSetupPS_ES2 : public FGlobalShader
|
|
|
|
|
{
|
|
|
|
|
DECLARE_SHADER_TYPE(FPostProcessBloomSetupPS_ES2, Global);
|
|
|
|
|
|
|
|
|
|
static bool ShouldCache(EShaderPlatform Platform)
|
|
|
|
|
{
|
|
|
|
|
return !IsConsolePlatform(Platform);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void ModifyCompilationEnvironment(EShaderPlatform Platform, FShaderCompilerEnvironment& OutEnvironment)
|
|
|
|
|
{
|
|
|
|
|
FGlobalShader::ModifyCompilationEnvironment(Platform, OutEnvironment);
|
|
|
|
|
|
|
|
|
|
//Need to hack in exposure scale for < SM5
|
|
|
|
|
OutEnvironment.SetDefine(TEXT("NO_EYEADAPTATION_EXPOSURE_FIX"), 1);
|
|
|
|
|
|
Copying //UE4/Dev-Core to //UE4/Dev-Main (Source: //UE4/Dev-Core @ 2996057)
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2975196 on 2016/05/12 by Robert.Manuszewski
Garbage Collector will no longer be responsible for generating class token stream, instead the token stream will be generated on startup or when a class has finished loading.
- This way we can avoid very long GC times after new blueprints have been loaded.
- Temporarily enabled CLASS_TokenStreamAssembled check in development builds (for testing purposes)
Change 2993960 on 2016/05/30 by Robert.Manuszewski
Fixing leaked linkers created by blocking load requests during async loading.
Change 2959398 on 2016/04/28 by Steve.Robb
TMap references are strong and cannot be nulled by pending kill. This makes references in values strong too, even though we only really care about keys, which will corrupt the map when nulled.
#jira UE-20828
Change 2960723 on 2016/04/29 by Graeme.Thornton
Fix for texture asset import data being ignored when async loaded
Change 2960938 on 2016/04/29 by Robert.Manuszewski
Nulling out sql db handle after closing it.
Change 2967127 on 2016/05/05 by Steve.Robb
Move constructors explicitly disabled in generated code.
Change 2967143 on 2016/05/05 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant.
Change 2967164 on 2016/05/05 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer
Change 2968650 on 2016/05/06 by Steve.Robb
Fix for HotReload copying module manager.
Change 2968915 on 2016/05/06 by Robert.Manuszewski
Fixing spelling of SetImageIntegrityStatus function name.
Change 2970406 on 2016/05/09 by Steve.Robb
Static analysis fixes:
Function uses '...' bytes of stack: exceeds /analyze:stacksize '81940'. Consider moving some data to heap.
Change 2970419 on 2016/05/09 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant.
warning C6011: Dereferencing NULL pointer '...'.
warning C6385: Reading invalid data from '...': the readable size is '...' bytes, but '...' bytes may be read.
warning C6386: Buffer overrun while writing to '...': the writable size is '...' bytes, but '...' bytes might be written.
Change 2970431 on 2016/05/09 by Steve.Robb
Static analysis fixes:
warning C6299: Explicitly comparing a bit field to a Boolean type will yield unexpected results.
Change 2972032 on 2016/05/10 by Steven.Hutton
Workflow fixes to bugg / crashgroup filtering. Filters should now correctly persist across queries.
Change 2972085 on 2016/05/10 by Steve.Robb
Const-correctness fix for FLogCategoryBase::IsSuppressed.
Change 2972087 on 2016/05/10 by Steve.Robb
ELogVerbosity moved into its own header.
Change 2972090 on 2016/05/10 by Steve.Robb
Redundant ensure removed.
Change 2972103 on 2016/05/10 by Steve.Robb
Removal of redundant use of USING_CODE_ANALYSIS.
Change 2972139 on 2016/05/10 by Steve.Robb
Fix for ensure macros throwing C6326 warnings during static analysis.
Change 2972147 on 2016/05/10 by Steve.Robb
Fix for UE_LOG_ACTIVE macro throwing C6326 warnings during static analysis.
Change 2972162 on 2016/05/10 by Steve.Robb
SCOPE_CYCLE_COUNTER_GUARD removed.
Change 2972168 on 2016/05/10 by Steve.Robb
Compile error fix for logOrEnsureNanError in static analysis builds.
Change 2973084 on 2016/05/10 by Chris.Wood
Crash Report Server performance tweak
Change 2974030 on 2016/05/11 by Steve.Robb
Fix for IPropertyHandle::SetValue - used to take a non-const reference to a const UObject*, now it takes const references to both non-const and const UObject*.
Change 2974053 on 2016/05/11 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant.
Change 2974191 on 2016/05/11 by Steve.Robb
Fix for template instantiation error in VS2013.
Change 2975298 on 2016/05/12 by Steve.Robb
Static analysis fixes:
warning C6236: (<expression> || <non-zero constant>) is always a non-zero constant.
Change 2975318 on 2016/05/12 by Steve.Robb
Fix for hot reload info being reported as warnings.
#jira UE-30586
Change 2975447 on 2016/05/12 by Steve.Robb
Static analysis fixes:
warning C6235: (<non-zero constant> || <expression>) is always a non-zero constant.
warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator?
warning C6240: (<expression> && <non-zero constant>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator?
warning C6285: (<non-zero constant> || <non-zero constant>) is always a non-zero constant. Did you intend to use the bitwise-and operator?
warning C6286: (<non-zero constant> || <expression>) is always a non-zero constant. <expression> is never evaluated and might have side effects.
warning C6289: Incorrect operator: mutual exclusion over || is always a non-zero constant. Did you intend to use && instead?
warning C6316: Incorrect operator: tested expression is constant and non-zero. Use bitwise-and to determine whether bits are set.
Change 2975478 on 2016/05/12 by Steve.Robb
Static analysis fixes for lots of redundant <zero constant> and <non-zero constant> warnings.
Change 2975538 on 2016/05/12 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'StaticResource'
Change 2976640 on 2016/05/13 by Robert.Manuszewski
Fixing crashes caused by token stream generation changes. Making sure the token stream gets re-generated when a class gets re-linked.
#jira UE-30675
Change 2978320 on 2016/05/16 by Steve.Robb
Fix for static analysis warnings in XNA headers.
Change 2978329 on 2016/05/16 by Steve.Robb
Static analysis fixes:
warning C6334: sizeof operator applied to an expression with an operator might yield unexpected results: Parentheses can be used to disambiguate certain usages.
Change 2980222 on 2016/05/17 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'X'.
warning C28182: Dereferencing NULL pointer. 'X' contains the same NULL value as 'Y' did.
Change 2980458 on 2016/05/17 by Chris.Wood
Attempt to fix crash report submission problems from CRP to CR website
[UE-30257] - Crashreports are sometimes missing file attachments
Passing crash GUID so that website can easily check for duplicates in future
Increased request timeout for AddCrash to be longer than website database timeout
Logging retries for future visibility
CRP v.1.1.6
Change 2980639 on 2016/05/17 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'X'.
warning C28182: Dereferencing NULL pointer. 'X' contains the same NULL value as 'Y' did.
Change 2981750 on 2016/05/18 by Steve.Robb
check()s in ContainerAllocationPolicies.h changed to checkSlow()s, as they only exist to check that the container has been written correctly.
Change 2982106 on 2016/05/18 by John.Mahoney
Fixed a crash caused by loading two stat capture files simultaneously in the profiler.
If the user tries to load a capture file while another load is in progress, the previous load is now cancelled and cleaned up before proceeding with the new load.
Made the delegates in FNewStatsReader explicitly specify which profiler instance they are loading data for, instead of relying on the current value of LoadConnection->InstanceId.
This also fixes a crash that occurs when selecting a different capture file in the "Stats dump browser" pane of the profiler (after using Load Folder) while another file is still loading.
Cleaned up some weak pointer usage in the profiler window.
#jira UE-30741
Change 2983366 on 2016/05/19 by Steven.Hutton
Changes for passing crash type directly from CRP to CRW.
Change 2983394 on 2016/05/19 by Steven.Hutton
Minor changes to add crash with more error reporting
Change 2984685 on 2016/05/20 by Robert.Manuszewski
Merging //UE4/Dev-Main @ 2984626 to Dev-Core (//UE4/Dev-Core)
Change 2985143 on 2016/05/20 by Steve.Robb
Missing semi-colons.
Change 2986463 on 2016/05/23 by Steve.Robb
CopyTemp added to make it clear that you want to make a copy (rather than a move, or an accidental copy) at the call site of a function taking rvalue refs.
Change 2986475 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6313: Incorrect operator: zero-valued flag cannot be tested with bitwise-and.
Change 2986476 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6313: Incorrect operator: zero-valued flag cannot be tested with bitwise-and.
Change 2986480 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant
Change 2986515 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6340: Mismatch on sign: 'X' passed as _Param_(N) when some unsigned type is required in call to 'Func'
Change 2986680 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6386: Buffer overrun while writing to 'Ptr': the writable size is 'X' bytes, but 'Y' bytes might be written.
warning C6387: 'Ptr' could be '0': this does not adhere to the specification for the function 'Func'
warning C6031: Return value ignored: 'snprintf'.
warning C6340: Mismatch on sign: 'const unsigned int' passed as _Param_(4) when some signed type is required in call to 'snprintf'.
Change 2986865 on 2016/05/23 by Robert.Manuszewski
Removing redundand AddReferencedObjects functions
Change 2987968 on 2016/05/24 by Robert.Manuszewski
Removing redundant UPROPERTY macros from intrinsic classes.
Change 2987979 on 2016/05/24 by Steve.Robb
Optimization of some FString and FPaths operations to produce fewer temporaries.
Change 2988297 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6287: Redundant code: the left and right sub-expressions are identical.
Change 2988430 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6385: Reading invalid data from 'var': the readable size is 'X' bytes, but 'Y' bytes may be read.
Change 2988461 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6235: (<non-zero constant> || <expression>) is always a non-zero constant.
warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>.
warning C6240: (<expression> && <non-zero constant>) always evaluates to the result of <expression>.
Change 2988464 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6262: Function uses 'X' bytes of stack: exceeds /analyze:stacksize 'Y'. Consider moving some data to heap.
Change 2988494 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6237: (<zero> && <expression>) is always zero. <expression> is never evaluated and might have side effects.
Change 2989411 on 2016/05/25 by Robert.Manuszewski
Splitting GC cluster index and intenral object flags to allow more UObjects in editor builds.
Change 2989429 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6387: '_Param_(X)' could be '0': this does not adhere to the specification for the function 'Func'.
Change 2989982 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6001: Using uninitialized memory 'LODPlanesMin'.
Change 2990018 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6386: Buffer overrun while writing to 'X'
Change 2990077 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6240: (<expression> && <non-zero constant>) always evaluates to the result of <expression>.
warning C6011: Dereferencing NULL pointer 'Ptr'.
Change 2990114 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6336: Arithmetic operator has precedence over question operator, use parentheses to clarify intent.
Change 2990125 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>.
Change 2990162 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6294: Ill-defined for-loop: initial condition does not satisfy test. Loop body not executed.
Change 2990193 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C28182: Dereferencing NULL pointer. 'type' contains the same NULL value as 'type->base_type' did.
warning C6011: Dereferencing NULL pointer 'Semantic'.
Change 2991006 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C28113: Accessing a local variable dummy via an Interlocked function: This is an unusual usage which could be reconsidered.
Change 2991012 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6031: Return value ignored: 'InitializeCriticalSectionAndSpinCount'.
Change 2991013 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6287: Redundant code: the left and right sub-expressions are identical.
Change 2991016 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6236: (<expression> || <non-zero constant>) is always a non-zero constant.
Change 2991017 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant.
Change 2991019 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6292: Ill-defined for-loop: counts up from maximum.
Change 2991023 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6322: Empty _except block.
warning C28251: Inconsistent annotation for 'WinMain': this instance has no annotations.
Change 2991070 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C28182: Dereferencing NULL pointer. 'Ptr1' contains the same NULL value as 'Ptr2' did.
Change 2991416 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'Ptr'.
Change 2992738 on 2016/05/27 by Steve.Robb
Revert changes to FString::MatchesWildcard.
Change 2992916 on 2016/05/27 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'Ptr'.
Change 2992960 on 2016/05/27 by Chris.Wood
Optimized P4 access in Crash Report Process and MinidumpDiagostics.
Change 2992964 on 2016/05/27 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'Ptr'.
Change 2993956 on 2016/05/30 by Robert.Manuszewski
Fixing a crash after adding a new C++ class in the editor - made sure new classes have the token stream assembled after hot-reload.
#jira UE-31309
Change 2993977 on 2016/05/30 by Robert.Manuszewski
Don't wait for all packages to finish loading before PostLoading those which already have.
Change 2994206 on 2016/05/31 by Robert.Manuszewski
PR #2429: Three bug fixes required for script support to work properly (Contributed by pluranium)
#lockdown Nick.Penwarden
[CL 2996251 by Robert Manuszewski in Main branch]
2016-06-01 12:08:56 -04:00
|
|
|
CA_SUPPRESS(6313);
|
2014-08-15 16:23:58 -04:00
|
|
|
OutEnvironment.SetDefine(TEXT("ES2_USE_MSAA"), (UseSunDof & 4) ? (uint32)1 : (uint32)0);
|
Copying //UE4/Dev-Core to //UE4/Dev-Main (Source: //UE4/Dev-Core @ 2996057)
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2975196 on 2016/05/12 by Robert.Manuszewski
Garbage Collector will no longer be responsible for generating class token stream, instead the token stream will be generated on startup or when a class has finished loading.
- This way we can avoid very long GC times after new blueprints have been loaded.
- Temporarily enabled CLASS_TokenStreamAssembled check in development builds (for testing purposes)
Change 2993960 on 2016/05/30 by Robert.Manuszewski
Fixing leaked linkers created by blocking load requests during async loading.
Change 2959398 on 2016/04/28 by Steve.Robb
TMap references are strong and cannot be nulled by pending kill. This makes references in values strong too, even though we only really care about keys, which will corrupt the map when nulled.
#jira UE-20828
Change 2960723 on 2016/04/29 by Graeme.Thornton
Fix for texture asset import data being ignored when async loaded
Change 2960938 on 2016/04/29 by Robert.Manuszewski
Nulling out sql db handle after closing it.
Change 2967127 on 2016/05/05 by Steve.Robb
Move constructors explicitly disabled in generated code.
Change 2967143 on 2016/05/05 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant.
Change 2967164 on 2016/05/05 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer
Change 2968650 on 2016/05/06 by Steve.Robb
Fix for HotReload copying module manager.
Change 2968915 on 2016/05/06 by Robert.Manuszewski
Fixing spelling of SetImageIntegrityStatus function name.
Change 2970406 on 2016/05/09 by Steve.Robb
Static analysis fixes:
Function uses '...' bytes of stack: exceeds /analyze:stacksize '81940'. Consider moving some data to heap.
Change 2970419 on 2016/05/09 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant.
warning C6011: Dereferencing NULL pointer '...'.
warning C6385: Reading invalid data from '...': the readable size is '...' bytes, but '...' bytes may be read.
warning C6386: Buffer overrun while writing to '...': the writable size is '...' bytes, but '...' bytes might be written.
Change 2970431 on 2016/05/09 by Steve.Robb
Static analysis fixes:
warning C6299: Explicitly comparing a bit field to a Boolean type will yield unexpected results.
Change 2972032 on 2016/05/10 by Steven.Hutton
Workflow fixes to bugg / crashgroup filtering. Filters should now correctly persist across queries.
Change 2972085 on 2016/05/10 by Steve.Robb
Const-correctness fix for FLogCategoryBase::IsSuppressed.
Change 2972087 on 2016/05/10 by Steve.Robb
ELogVerbosity moved into its own header.
Change 2972090 on 2016/05/10 by Steve.Robb
Redundant ensure removed.
Change 2972103 on 2016/05/10 by Steve.Robb
Removal of redundant use of USING_CODE_ANALYSIS.
Change 2972139 on 2016/05/10 by Steve.Robb
Fix for ensure macros throwing C6326 warnings during static analysis.
Change 2972147 on 2016/05/10 by Steve.Robb
Fix for UE_LOG_ACTIVE macro throwing C6326 warnings during static analysis.
Change 2972162 on 2016/05/10 by Steve.Robb
SCOPE_CYCLE_COUNTER_GUARD removed.
Change 2972168 on 2016/05/10 by Steve.Robb
Compile error fix for logOrEnsureNanError in static analysis builds.
Change 2973084 on 2016/05/10 by Chris.Wood
Crash Report Server performance tweak
Change 2974030 on 2016/05/11 by Steve.Robb
Fix for IPropertyHandle::SetValue - used to take a non-const reference to a const UObject*, now it takes const references to both non-const and const UObject*.
Change 2974053 on 2016/05/11 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant.
Change 2974191 on 2016/05/11 by Steve.Robb
Fix for template instantiation error in VS2013.
Change 2975298 on 2016/05/12 by Steve.Robb
Static analysis fixes:
warning C6236: (<expression> || <non-zero constant>) is always a non-zero constant.
Change 2975318 on 2016/05/12 by Steve.Robb
Fix for hot reload info being reported as warnings.
#jira UE-30586
Change 2975447 on 2016/05/12 by Steve.Robb
Static analysis fixes:
warning C6235: (<non-zero constant> || <expression>) is always a non-zero constant.
warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator?
warning C6240: (<expression> && <non-zero constant>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator?
warning C6285: (<non-zero constant> || <non-zero constant>) is always a non-zero constant. Did you intend to use the bitwise-and operator?
warning C6286: (<non-zero constant> || <expression>) is always a non-zero constant. <expression> is never evaluated and might have side effects.
warning C6289: Incorrect operator: mutual exclusion over || is always a non-zero constant. Did you intend to use && instead?
warning C6316: Incorrect operator: tested expression is constant and non-zero. Use bitwise-and to determine whether bits are set.
Change 2975478 on 2016/05/12 by Steve.Robb
Static analysis fixes for lots of redundant <zero constant> and <non-zero constant> warnings.
Change 2975538 on 2016/05/12 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'StaticResource'
Change 2976640 on 2016/05/13 by Robert.Manuszewski
Fixing crashes caused by token stream generation changes. Making sure the token stream gets re-generated when a class gets re-linked.
#jira UE-30675
Change 2978320 on 2016/05/16 by Steve.Robb
Fix for static analysis warnings in XNA headers.
Change 2978329 on 2016/05/16 by Steve.Robb
Static analysis fixes:
warning C6334: sizeof operator applied to an expression with an operator might yield unexpected results: Parentheses can be used to disambiguate certain usages.
Change 2980222 on 2016/05/17 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'X'.
warning C28182: Dereferencing NULL pointer. 'X' contains the same NULL value as 'Y' did.
Change 2980458 on 2016/05/17 by Chris.Wood
Attempt to fix crash report submission problems from CRP to CR website
[UE-30257] - Crashreports are sometimes missing file attachments
Passing crash GUID so that website can easily check for duplicates in future
Increased request timeout for AddCrash to be longer than website database timeout
Logging retries for future visibility
CRP v.1.1.6
Change 2980639 on 2016/05/17 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'X'.
warning C28182: Dereferencing NULL pointer. 'X' contains the same NULL value as 'Y' did.
Change 2981750 on 2016/05/18 by Steve.Robb
check()s in ContainerAllocationPolicies.h changed to checkSlow()s, as they only exist to check that the container has been written correctly.
Change 2982106 on 2016/05/18 by John.Mahoney
Fixed a crash caused by loading two stat capture files simultaneously in the profiler.
If the user tries to load a capture file while another load is in progress, the previous load is now cancelled and cleaned up before proceeding with the new load.
Made the delegates in FNewStatsReader explicitly specify which profiler instance they are loading data for, instead of relying on the current value of LoadConnection->InstanceId.
This also fixes a crash that occurs when selecting a different capture file in the "Stats dump browser" pane of the profiler (after using Load Folder) while another file is still loading.
Cleaned up some weak pointer usage in the profiler window.
#jira UE-30741
Change 2983366 on 2016/05/19 by Steven.Hutton
Changes for passing crash type directly from CRP to CRW.
Change 2983394 on 2016/05/19 by Steven.Hutton
Minor changes to add crash with more error reporting
Change 2984685 on 2016/05/20 by Robert.Manuszewski
Merging //UE4/Dev-Main @ 2984626 to Dev-Core (//UE4/Dev-Core)
Change 2985143 on 2016/05/20 by Steve.Robb
Missing semi-colons.
Change 2986463 on 2016/05/23 by Steve.Robb
CopyTemp added to make it clear that you want to make a copy (rather than a move, or an accidental copy) at the call site of a function taking rvalue refs.
Change 2986475 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6313: Incorrect operator: zero-valued flag cannot be tested with bitwise-and.
Change 2986476 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6313: Incorrect operator: zero-valued flag cannot be tested with bitwise-and.
Change 2986480 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant
Change 2986515 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6340: Mismatch on sign: 'X' passed as _Param_(N) when some unsigned type is required in call to 'Func'
Change 2986680 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6386: Buffer overrun while writing to 'Ptr': the writable size is 'X' bytes, but 'Y' bytes might be written.
warning C6387: 'Ptr' could be '0': this does not adhere to the specification for the function 'Func'
warning C6031: Return value ignored: 'snprintf'.
warning C6340: Mismatch on sign: 'const unsigned int' passed as _Param_(4) when some signed type is required in call to 'snprintf'.
Change 2986865 on 2016/05/23 by Robert.Manuszewski
Removing redundand AddReferencedObjects functions
Change 2987968 on 2016/05/24 by Robert.Manuszewski
Removing redundant UPROPERTY macros from intrinsic classes.
Change 2987979 on 2016/05/24 by Steve.Robb
Optimization of some FString and FPaths operations to produce fewer temporaries.
Change 2988297 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6287: Redundant code: the left and right sub-expressions are identical.
Change 2988430 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6385: Reading invalid data from 'var': the readable size is 'X' bytes, but 'Y' bytes may be read.
Change 2988461 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6235: (<non-zero constant> || <expression>) is always a non-zero constant.
warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>.
warning C6240: (<expression> && <non-zero constant>) always evaluates to the result of <expression>.
Change 2988464 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6262: Function uses 'X' bytes of stack: exceeds /analyze:stacksize 'Y'. Consider moving some data to heap.
Change 2988494 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6237: (<zero> && <expression>) is always zero. <expression> is never evaluated and might have side effects.
Change 2989411 on 2016/05/25 by Robert.Manuszewski
Splitting GC cluster index and intenral object flags to allow more UObjects in editor builds.
Change 2989429 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6387: '_Param_(X)' could be '0': this does not adhere to the specification for the function 'Func'.
Change 2989982 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6001: Using uninitialized memory 'LODPlanesMin'.
Change 2990018 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6386: Buffer overrun while writing to 'X'
Change 2990077 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6240: (<expression> && <non-zero constant>) always evaluates to the result of <expression>.
warning C6011: Dereferencing NULL pointer 'Ptr'.
Change 2990114 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6336: Arithmetic operator has precedence over question operator, use parentheses to clarify intent.
Change 2990125 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>.
Change 2990162 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6294: Ill-defined for-loop: initial condition does not satisfy test. Loop body not executed.
Change 2990193 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C28182: Dereferencing NULL pointer. 'type' contains the same NULL value as 'type->base_type' did.
warning C6011: Dereferencing NULL pointer 'Semantic'.
Change 2991006 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C28113: Accessing a local variable dummy via an Interlocked function: This is an unusual usage which could be reconsidered.
Change 2991012 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6031: Return value ignored: 'InitializeCriticalSectionAndSpinCount'.
Change 2991013 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6287: Redundant code: the left and right sub-expressions are identical.
Change 2991016 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6236: (<expression> || <non-zero constant>) is always a non-zero constant.
Change 2991017 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant.
Change 2991019 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6292: Ill-defined for-loop: counts up from maximum.
Change 2991023 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6322: Empty _except block.
warning C28251: Inconsistent annotation for 'WinMain': this instance has no annotations.
Change 2991070 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C28182: Dereferencing NULL pointer. 'Ptr1' contains the same NULL value as 'Ptr2' did.
Change 2991416 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'Ptr'.
Change 2992738 on 2016/05/27 by Steve.Robb
Revert changes to FString::MatchesWildcard.
Change 2992916 on 2016/05/27 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'Ptr'.
Change 2992960 on 2016/05/27 by Chris.Wood
Optimized P4 access in Crash Report Process and MinidumpDiagostics.
Change 2992964 on 2016/05/27 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'Ptr'.
Change 2993956 on 2016/05/30 by Robert.Manuszewski
Fixing a crash after adding a new C++ class in the editor - made sure new classes have the token stream assembled after hot-reload.
#jira UE-31309
Change 2993977 on 2016/05/30 by Robert.Manuszewski
Don't wait for all packages to finish loading before PostLoading those which already have.
Change 2994206 on 2016/05/31 by Robert.Manuszewski
PR #2429: Three bug fixes required for script support to work properly (Contributed by pluranium)
#lockdown Nick.Penwarden
[CL 2996251 by Robert Manuszewski in Main branch]
2016-06-01 12:08:56 -04:00
|
|
|
CA_SUPPRESS(6313);
|
2014-03-14 14:13:41 -04:00
|
|
|
OutEnvironment.SetDefine(TEXT("ES2_USE_SUN"), (UseSunDof & 2) ? (uint32)1 : (uint32)0);
|
Copying //UE4/Dev-Core to //UE4/Dev-Main (Source: //UE4/Dev-Core @ 2996057)
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2975196 on 2016/05/12 by Robert.Manuszewski
Garbage Collector will no longer be responsible for generating class token stream, instead the token stream will be generated on startup or when a class has finished loading.
- This way we can avoid very long GC times after new blueprints have been loaded.
- Temporarily enabled CLASS_TokenStreamAssembled check in development builds (for testing purposes)
Change 2993960 on 2016/05/30 by Robert.Manuszewski
Fixing leaked linkers created by blocking load requests during async loading.
Change 2959398 on 2016/04/28 by Steve.Robb
TMap references are strong and cannot be nulled by pending kill. This makes references in values strong too, even though we only really care about keys, which will corrupt the map when nulled.
#jira UE-20828
Change 2960723 on 2016/04/29 by Graeme.Thornton
Fix for texture asset import data being ignored when async loaded
Change 2960938 on 2016/04/29 by Robert.Manuszewski
Nulling out sql db handle after closing it.
Change 2967127 on 2016/05/05 by Steve.Robb
Move constructors explicitly disabled in generated code.
Change 2967143 on 2016/05/05 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant.
Change 2967164 on 2016/05/05 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer
Change 2968650 on 2016/05/06 by Steve.Robb
Fix for HotReload copying module manager.
Change 2968915 on 2016/05/06 by Robert.Manuszewski
Fixing spelling of SetImageIntegrityStatus function name.
Change 2970406 on 2016/05/09 by Steve.Robb
Static analysis fixes:
Function uses '...' bytes of stack: exceeds /analyze:stacksize '81940'. Consider moving some data to heap.
Change 2970419 on 2016/05/09 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant.
warning C6011: Dereferencing NULL pointer '...'.
warning C6385: Reading invalid data from '...': the readable size is '...' bytes, but '...' bytes may be read.
warning C6386: Buffer overrun while writing to '...': the writable size is '...' bytes, but '...' bytes might be written.
Change 2970431 on 2016/05/09 by Steve.Robb
Static analysis fixes:
warning C6299: Explicitly comparing a bit field to a Boolean type will yield unexpected results.
Change 2972032 on 2016/05/10 by Steven.Hutton
Workflow fixes to bugg / crashgroup filtering. Filters should now correctly persist across queries.
Change 2972085 on 2016/05/10 by Steve.Robb
Const-correctness fix for FLogCategoryBase::IsSuppressed.
Change 2972087 on 2016/05/10 by Steve.Robb
ELogVerbosity moved into its own header.
Change 2972090 on 2016/05/10 by Steve.Robb
Redundant ensure removed.
Change 2972103 on 2016/05/10 by Steve.Robb
Removal of redundant use of USING_CODE_ANALYSIS.
Change 2972139 on 2016/05/10 by Steve.Robb
Fix for ensure macros throwing C6326 warnings during static analysis.
Change 2972147 on 2016/05/10 by Steve.Robb
Fix for UE_LOG_ACTIVE macro throwing C6326 warnings during static analysis.
Change 2972162 on 2016/05/10 by Steve.Robb
SCOPE_CYCLE_COUNTER_GUARD removed.
Change 2972168 on 2016/05/10 by Steve.Robb
Compile error fix for logOrEnsureNanError in static analysis builds.
Change 2973084 on 2016/05/10 by Chris.Wood
Crash Report Server performance tweak
Change 2974030 on 2016/05/11 by Steve.Robb
Fix for IPropertyHandle::SetValue - used to take a non-const reference to a const UObject*, now it takes const references to both non-const and const UObject*.
Change 2974053 on 2016/05/11 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant.
Change 2974191 on 2016/05/11 by Steve.Robb
Fix for template instantiation error in VS2013.
Change 2975298 on 2016/05/12 by Steve.Robb
Static analysis fixes:
warning C6236: (<expression> || <non-zero constant>) is always a non-zero constant.
Change 2975318 on 2016/05/12 by Steve.Robb
Fix for hot reload info being reported as warnings.
#jira UE-30586
Change 2975447 on 2016/05/12 by Steve.Robb
Static analysis fixes:
warning C6235: (<non-zero constant> || <expression>) is always a non-zero constant.
warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator?
warning C6240: (<expression> && <non-zero constant>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator?
warning C6285: (<non-zero constant> || <non-zero constant>) is always a non-zero constant. Did you intend to use the bitwise-and operator?
warning C6286: (<non-zero constant> || <expression>) is always a non-zero constant. <expression> is never evaluated and might have side effects.
warning C6289: Incorrect operator: mutual exclusion over || is always a non-zero constant. Did you intend to use && instead?
warning C6316: Incorrect operator: tested expression is constant and non-zero. Use bitwise-and to determine whether bits are set.
Change 2975478 on 2016/05/12 by Steve.Robb
Static analysis fixes for lots of redundant <zero constant> and <non-zero constant> warnings.
Change 2975538 on 2016/05/12 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'StaticResource'
Change 2976640 on 2016/05/13 by Robert.Manuszewski
Fixing crashes caused by token stream generation changes. Making sure the token stream gets re-generated when a class gets re-linked.
#jira UE-30675
Change 2978320 on 2016/05/16 by Steve.Robb
Fix for static analysis warnings in XNA headers.
Change 2978329 on 2016/05/16 by Steve.Robb
Static analysis fixes:
warning C6334: sizeof operator applied to an expression with an operator might yield unexpected results: Parentheses can be used to disambiguate certain usages.
Change 2980222 on 2016/05/17 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'X'.
warning C28182: Dereferencing NULL pointer. 'X' contains the same NULL value as 'Y' did.
Change 2980458 on 2016/05/17 by Chris.Wood
Attempt to fix crash report submission problems from CRP to CR website
[UE-30257] - Crashreports are sometimes missing file attachments
Passing crash GUID so that website can easily check for duplicates in future
Increased request timeout for AddCrash to be longer than website database timeout
Logging retries for future visibility
CRP v.1.1.6
Change 2980639 on 2016/05/17 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'X'.
warning C28182: Dereferencing NULL pointer. 'X' contains the same NULL value as 'Y' did.
Change 2981750 on 2016/05/18 by Steve.Robb
check()s in ContainerAllocationPolicies.h changed to checkSlow()s, as they only exist to check that the container has been written correctly.
Change 2982106 on 2016/05/18 by John.Mahoney
Fixed a crash caused by loading two stat capture files simultaneously in the profiler.
If the user tries to load a capture file while another load is in progress, the previous load is now cancelled and cleaned up before proceeding with the new load.
Made the delegates in FNewStatsReader explicitly specify which profiler instance they are loading data for, instead of relying on the current value of LoadConnection->InstanceId.
This also fixes a crash that occurs when selecting a different capture file in the "Stats dump browser" pane of the profiler (after using Load Folder) while another file is still loading.
Cleaned up some weak pointer usage in the profiler window.
#jira UE-30741
Change 2983366 on 2016/05/19 by Steven.Hutton
Changes for passing crash type directly from CRP to CRW.
Change 2983394 on 2016/05/19 by Steven.Hutton
Minor changes to add crash with more error reporting
Change 2984685 on 2016/05/20 by Robert.Manuszewski
Merging //UE4/Dev-Main @ 2984626 to Dev-Core (//UE4/Dev-Core)
Change 2985143 on 2016/05/20 by Steve.Robb
Missing semi-colons.
Change 2986463 on 2016/05/23 by Steve.Robb
CopyTemp added to make it clear that you want to make a copy (rather than a move, or an accidental copy) at the call site of a function taking rvalue refs.
Change 2986475 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6313: Incorrect operator: zero-valued flag cannot be tested with bitwise-and.
Change 2986476 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6313: Incorrect operator: zero-valued flag cannot be tested with bitwise-and.
Change 2986480 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant
Change 2986515 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6340: Mismatch on sign: 'X' passed as _Param_(N) when some unsigned type is required in call to 'Func'
Change 2986680 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6386: Buffer overrun while writing to 'Ptr': the writable size is 'X' bytes, but 'Y' bytes might be written.
warning C6387: 'Ptr' could be '0': this does not adhere to the specification for the function 'Func'
warning C6031: Return value ignored: 'snprintf'.
warning C6340: Mismatch on sign: 'const unsigned int' passed as _Param_(4) when some signed type is required in call to 'snprintf'.
Change 2986865 on 2016/05/23 by Robert.Manuszewski
Removing redundand AddReferencedObjects functions
Change 2987968 on 2016/05/24 by Robert.Manuszewski
Removing redundant UPROPERTY macros from intrinsic classes.
Change 2987979 on 2016/05/24 by Steve.Robb
Optimization of some FString and FPaths operations to produce fewer temporaries.
Change 2988297 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6287: Redundant code: the left and right sub-expressions are identical.
Change 2988430 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6385: Reading invalid data from 'var': the readable size is 'X' bytes, but 'Y' bytes may be read.
Change 2988461 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6235: (<non-zero constant> || <expression>) is always a non-zero constant.
warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>.
warning C6240: (<expression> && <non-zero constant>) always evaluates to the result of <expression>.
Change 2988464 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6262: Function uses 'X' bytes of stack: exceeds /analyze:stacksize 'Y'. Consider moving some data to heap.
Change 2988494 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6237: (<zero> && <expression>) is always zero. <expression> is never evaluated and might have side effects.
Change 2989411 on 2016/05/25 by Robert.Manuszewski
Splitting GC cluster index and intenral object flags to allow more UObjects in editor builds.
Change 2989429 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6387: '_Param_(X)' could be '0': this does not adhere to the specification for the function 'Func'.
Change 2989982 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6001: Using uninitialized memory 'LODPlanesMin'.
Change 2990018 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6386: Buffer overrun while writing to 'X'
Change 2990077 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6240: (<expression> && <non-zero constant>) always evaluates to the result of <expression>.
warning C6011: Dereferencing NULL pointer 'Ptr'.
Change 2990114 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6336: Arithmetic operator has precedence over question operator, use parentheses to clarify intent.
Change 2990125 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>.
Change 2990162 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6294: Ill-defined for-loop: initial condition does not satisfy test. Loop body not executed.
Change 2990193 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C28182: Dereferencing NULL pointer. 'type' contains the same NULL value as 'type->base_type' did.
warning C6011: Dereferencing NULL pointer 'Semantic'.
Change 2991006 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C28113: Accessing a local variable dummy via an Interlocked function: This is an unusual usage which could be reconsidered.
Change 2991012 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6031: Return value ignored: 'InitializeCriticalSectionAndSpinCount'.
Change 2991013 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6287: Redundant code: the left and right sub-expressions are identical.
Change 2991016 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6236: (<expression> || <non-zero constant>) is always a non-zero constant.
Change 2991017 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant.
Change 2991019 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6292: Ill-defined for-loop: counts up from maximum.
Change 2991023 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6322: Empty _except block.
warning C28251: Inconsistent annotation for 'WinMain': this instance has no annotations.
Change 2991070 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C28182: Dereferencing NULL pointer. 'Ptr1' contains the same NULL value as 'Ptr2' did.
Change 2991416 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'Ptr'.
Change 2992738 on 2016/05/27 by Steve.Robb
Revert changes to FString::MatchesWildcard.
Change 2992916 on 2016/05/27 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'Ptr'.
Change 2992960 on 2016/05/27 by Chris.Wood
Optimized P4 access in Crash Report Process and MinidumpDiagostics.
Change 2992964 on 2016/05/27 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'Ptr'.
Change 2993956 on 2016/05/30 by Robert.Manuszewski
Fixing a crash after adding a new C++ class in the editor - made sure new classes have the token stream assembled after hot-reload.
#jira UE-31309
Change 2993977 on 2016/05/30 by Robert.Manuszewski
Don't wait for all packages to finish loading before PostLoading those which already have.
Change 2994206 on 2016/05/31 by Robert.Manuszewski
PR #2429: Three bug fixes required for script support to work properly (Contributed by pluranium)
#lockdown Nick.Penwarden
[CL 2996251 by Robert Manuszewski in Main branch]
2016-06-01 12:08:56 -04:00
|
|
|
CA_SUPPRESS(6313);
|
2014-03-14 14:13:41 -04:00
|
|
|
OutEnvironment.SetDefine(TEXT("ES2_USE_DOF"), (UseSunDof & 1) ? (uint32)1 : (uint32)0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPostProcessBloomSetupPS_ES2() {}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
FPostProcessPassParameters PostprocessParameter;
|
|
|
|
|
FShaderParameter BloomThreshold;
|
|
|
|
|
|
|
|
|
|
/** Initialization constructor. */
|
|
|
|
|
FPostProcessBloomSetupPS_ES2(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
|
|
|
|
|
: FGlobalShader(Initializer)
|
|
|
|
|
{
|
|
|
|
|
PostprocessParameter.Bind(Initializer.ParameterMap);
|
|
|
|
|
BloomThreshold.Bind(Initializer.ParameterMap, TEXT("BloomThreshold"));
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void SetPS(const FRenderingCompositePassContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
const FPixelShaderRHIParamRef ShaderRHI = GetPixelShader();
|
|
|
|
|
|
|
|
|
|
const FPostProcessSettings& Settings = Context.View.FinalPostProcessSettings;
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
FGlobalShader::SetParameters(Context.RHICmdList, ShaderRHI, Context.View);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
PostprocessParameter.SetPS(ShaderRHI, Context, TStaticSamplerState<SF_Bilinear, AM_Clamp, AM_Clamp, AM_Clamp>::GetRHI());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
float ExposureScale = FRCPassPostProcessEyeAdaptation::ComputeExposureScaleValue(Context.View);
|
|
|
|
|
|
|
|
|
|
FVector4 BloomThresholdValue(Settings.BloomThreshold, 0, 0, ExposureScale);
|
2014-06-12 07:13:34 -04:00
|
|
|
SetShaderValue(Context.RHICmdList, ShaderRHI, BloomThreshold, BloomThresholdValue);
|
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);
|
|
|
|
|
Ar << PostprocessParameter << BloomThreshold;
|
|
|
|
|
return bShaderHasOutdatedParameters;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(,FPostProcessBloomSetupVS_ES2,TEXT("PostProcessMobile"),TEXT("BloomVS_ES2"),SF_Vertex);
|
|
|
|
|
|
|
|
|
|
typedef FPostProcessBloomSetupPS_ES2<0> FPostProcessBloomSetupPS_ES2_0;
|
|
|
|
|
typedef FPostProcessBloomSetupPS_ES2<1> FPostProcessBloomSetupPS_ES2_1;
|
|
|
|
|
typedef FPostProcessBloomSetupPS_ES2<2> FPostProcessBloomSetupPS_ES2_2;
|
|
|
|
|
typedef FPostProcessBloomSetupPS_ES2<3> FPostProcessBloomSetupPS_ES2_3;
|
2014-08-15 16:23:58 -04:00
|
|
|
typedef FPostProcessBloomSetupPS_ES2<4> FPostProcessBloomSetupPS_ES2_4;
|
2014-03-14 14:13:41 -04:00
|
|
|
IMPLEMENT_SHADER_TYPE(template<>,FPostProcessBloomSetupPS_ES2_0,TEXT("PostProcessMobile"),TEXT("BloomPS_ES2"),SF_Pixel);
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(template<>,FPostProcessBloomSetupPS_ES2_1,TEXT("PostProcessMobile"),TEXT("BloomPS_ES2"),SF_Pixel);
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(template<>,FPostProcessBloomSetupPS_ES2_2,TEXT("PostProcessMobile"),TEXT("BloomPS_ES2"),SF_Pixel);
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(template<>,FPostProcessBloomSetupPS_ES2_3,TEXT("PostProcessMobile"),TEXT("BloomPS_ES2"),SF_Pixel);
|
2014-08-15 16:23:58 -04:00
|
|
|
IMPLEMENT_SHADER_TYPE(template<>,FPostProcessBloomSetupPS_ES2_4,TEXT("PostProcessMobile"),TEXT("BloomPS_ES2"),SF_Pixel);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
template <uint32 UseSunDof>
|
2014-06-12 07:13:34 -04:00
|
|
|
static void BloomSetup_SetShader(const FRenderingCompositePassContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2014-08-28 06:22:54 -04:00
|
|
|
TShaderMapRef<FPostProcessBloomSetupVS_ES2> VertexShader(Context.GetShaderMap());
|
|
|
|
|
TShaderMapRef<FPostProcessBloomSetupPS_ES2<UseSunDof> > PixelShader(Context.GetShaderMap());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
static FGlobalBoundShaderState BoundShaderState;
|
2014-06-27 11:07:13 -04:00
|
|
|
|
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
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
VertexShader->SetVS(Context);
|
|
|
|
|
PixelShader->SetPS(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void FRCPassPostProcessBloomSetupES2::SetShader(const FRenderingCompositePassContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
const FSceneView& View = Context.View;
|
|
|
|
|
uint32 UseSun = Context.View.bLightShaftUse ? 1 : 0;
|
|
|
|
|
uint32 UseDof = (Context.View.FinalPostProcessSettings.DepthOfFieldScale > 0.0f) ? 1 : 0;
|
|
|
|
|
uint32 UseSunDof = (UseSun << 1) + UseDof;
|
|
|
|
|
|
2014-08-15 16:23:58 -04:00
|
|
|
static const auto CVarMobileMSAA = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.MobileMSAA"));
|
2016-03-16 21:16:51 -04:00
|
|
|
const EShaderPlatform ShaderPlatform = GShaderPlatformForFeatureLevel[Context.GetFeatureLevel()];
|
|
|
|
|
UseSunDof += (GSupportsShaderFramebufferFetch && (ShaderPlatform == SP_METAL || IsVulkanMobilePlatform(ShaderPlatform))) ? (CVarMobileMSAA ? (CVarMobileMSAA->GetValueOnRenderThread() > 1 ? 4 : 0) : 0) : 0;
|
2014-08-15 16:23:58 -04:00
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
switch(UseSunDof)
|
|
|
|
|
{
|
2014-06-12 07:13:34 -04:00
|
|
|
case 0: BloomSetup_SetShader<0>(Context); break;
|
|
|
|
|
case 1: BloomSetup_SetShader<1>(Context); break;
|
|
|
|
|
case 2: BloomSetup_SetShader<2>(Context); break;
|
|
|
|
|
case 3: BloomSetup_SetShader<3>(Context); break;
|
2014-08-15 16:23:58 -04:00
|
|
|
case 4: BloomSetup_SetShader<4>(Context); break;
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FRCPassPostProcessBloomSetupES2::Process(FRenderingCompositePassContext& Context)
|
|
|
|
|
{
|
2014-10-20 10:43:43 -04:00
|
|
|
SCOPED_DRAW_EVENT(Context.RHICmdList, PostProcessBloomSetup);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
const FPooledRenderTargetDesc* InputDesc = GetInputDesc(ePId_Input0);
|
2014-11-27 10:36:38 -05:00
|
|
|
FIntPoint PrePostSourceViewportSize = PrePostSourceViewportRect.Size();
|
2014-03-14 14:13:41 -04:00
|
|
|
uint32 DstX = FMath::Max(1, PrePostSourceViewportSize.X/4);
|
|
|
|
|
uint32 DstY = FMath::Max(1, PrePostSourceViewportSize.Y/4);
|
|
|
|
|
|
|
|
|
|
FIntRect DstRect;
|
|
|
|
|
DstRect.Min.X = 0;
|
|
|
|
|
DstRect.Min.Y = 0;
|
|
|
|
|
DstRect.Max.X = DstX;
|
|
|
|
|
DstRect.Max.Y = DstY;
|
|
|
|
|
|
|
|
|
|
FIntPoint DstSize = PrePostSourceViewportSize / 4;
|
|
|
|
|
|
|
|
|
|
FIntPoint SrcSize;
|
|
|
|
|
FIntRect SrcRect;
|
2014-09-17 09:30:48 -04:00
|
|
|
if(bUseViewRectSource)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
// Mobile with framebuffer fetch uses view rect as source.
|
|
|
|
|
const FSceneView& View = Context.View;
|
|
|
|
|
SrcSize = InputDesc->Extent;
|
|
|
|
|
// uint32 ScaleFactor = View.ViewRect.Width() / SrcSize.X;
|
|
|
|
|
// SrcRect = View.ViewRect / ScaleFactor;
|
|
|
|
|
// TODO: This won't work with scaled views.
|
2014-11-27 10:36:38 -05:00
|
|
|
SrcRect = PrePostSourceViewportRect;
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Otherwise using exact size texture.
|
|
|
|
|
SrcSize = DstSize;
|
|
|
|
|
SrcRect = DstRect;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const FSceneRenderTargetItem& DestRenderTarget = PassOutputs[0].RequestSurface(Context);
|
2014-06-12 07:13:34 -04:00
|
|
|
SetRenderTarget(Context.RHICmdList, DestRenderTarget.TargetableTexture, FTextureRHIRef());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
// is optimized away if possible (RT size=view size, )
|
2014-06-12 07:13:34 -04:00
|
|
|
Context.RHICmdList.Clear(true, FLinearColor::Black, false, 1.0f, false, 0, FIntRect());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
Context.SetViewportAndCallRHI(0, 0, 0.0f, DstX, DstY, 1.0f );
|
|
|
|
|
|
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
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
SetShader(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2014-08-28 06:22:54 -04:00
|
|
|
TShaderMapRef<FPostProcessBloomSetupVS_ES2> VertexShader(Context.GetShaderMap());
|
2014-04-23 17:26:59 -04:00
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
DrawRectangle(
|
2014-06-12 07:13:34 -04:00
|
|
|
Context.RHICmdList,
|
2014-03-14 14:13:41 -04:00
|
|
|
0, 0,
|
|
|
|
|
DstX, DstY,
|
|
|
|
|
SrcRect.Min.X, SrcRect.Min.Y,
|
|
|
|
|
SrcRect.Width(), SrcRect.Height(),
|
|
|
|
|
DstSize,
|
|
|
|
|
SrcSize,
|
2014-04-23 17:26:59 -04:00
|
|
|
*VertexShader,
|
2014-03-14 14:13:41 -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
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPooledRenderTargetDesc FRCPassPostProcessBloomSetupES2::ComputeOutputDesc(EPassOutputId InPassOutputId) const
|
|
|
|
|
{
|
|
|
|
|
FPooledRenderTargetDesc Ret;
|
|
|
|
|
Ret.Depth = 0;
|
|
|
|
|
Ret.ArraySize = 1;
|
|
|
|
|
Ret.bIsArray = false;
|
|
|
|
|
Ret.NumMips = 1;
|
|
|
|
|
Ret.TargetableFlags = TexCreate_RenderTargetable;
|
|
|
|
|
Ret.bForceSeparateTargetAndShaderResource = false;
|
2015-07-15 06:39:44 -04:00
|
|
|
Ret.Format = GetHDRPixelFormat();
|
2014-03-14 14:13:41 -04:00
|
|
|
Ret.NumSamples = 1;
|
2014-11-27 10:36:38 -05:00
|
|
|
Ret.Extent.X = FMath::Max(1, PrePostSourceViewportRect.Width() / 4);
|
|
|
|
|
Ret.Extent.Y = FMath::Max(1, PrePostSourceViewportRect.Height() / 4);
|
2014-03-14 14:13:41 -04:00
|
|
|
Ret.DebugName = TEXT("BloomSetup");
|
|
|
|
|
return Ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// BLOOM SETUP SMALL (BLOOM)
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
class FPostProcessBloomSetupSmallVS_ES2 : public FGlobalShader
|
|
|
|
|
{
|
|
|
|
|
DECLARE_SHADER_TYPE(FPostProcessBloomSetupSmallVS_ES2, Global);
|
|
|
|
|
|
|
|
|
|
static bool ShouldCache(EShaderPlatform Platform)
|
|
|
|
|
{
|
|
|
|
|
return !IsConsolePlatform(Platform);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Default constructor. */
|
|
|
|
|
FPostProcessBloomSetupSmallVS_ES2() {}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
FPostProcessPassParameters PostprocessParameter;
|
|
|
|
|
|
|
|
|
|
/** Initialization constructor. */
|
|
|
|
|
FPostProcessBloomSetupSmallVS_ES2(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
|
|
|
|
|
: FGlobalShader(Initializer)
|
|
|
|
|
{
|
|
|
|
|
PostprocessParameter.Bind(Initializer.ParameterMap);
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void SetVS(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
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
PostprocessParameter.SetVS(ShaderRHI, Context, TStaticSamplerState<SF_Bilinear,AM_Clamp,AM_Clamp,AM_Clamp>::GetRHI());
|
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);
|
|
|
|
|
Ar << PostprocessParameter;
|
|
|
|
|
return bShaderHasOutdatedParameters;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class FPostProcessBloomSetupSmallPS_ES2 : public FGlobalShader
|
|
|
|
|
{
|
|
|
|
|
DECLARE_SHADER_TYPE(FPostProcessBloomSetupSmallPS_ES2, Global);
|
|
|
|
|
|
|
|
|
|
static bool ShouldCache(EShaderPlatform Platform)
|
|
|
|
|
{
|
|
|
|
|
return !IsConsolePlatform(Platform);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void ModifyCompilationEnvironment(EShaderPlatform Platform, FShaderCompilerEnvironment& OutEnvironment)
|
|
|
|
|
{
|
|
|
|
|
FGlobalShader::ModifyCompilationEnvironment(Platform, OutEnvironment);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPostProcessBloomSetupSmallPS_ES2() {}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
FPostProcessPassParameters PostprocessParameter;
|
|
|
|
|
FShaderParameter BloomThreshold;
|
|
|
|
|
|
|
|
|
|
/** Initialization constructor. */
|
|
|
|
|
FPostProcessBloomSetupSmallPS_ES2(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
|
|
|
|
|
: FGlobalShader(Initializer)
|
|
|
|
|
{
|
|
|
|
|
PostprocessParameter.Bind(Initializer.ParameterMap);
|
|
|
|
|
BloomThreshold.Bind(Initializer.ParameterMap, TEXT("BloomThreshold"));
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void SetPS(const FRenderingCompositePassContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
const FPixelShaderRHIParamRef ShaderRHI = GetPixelShader();
|
|
|
|
|
|
|
|
|
|
const FPostProcessSettings& Settings = Context.View.FinalPostProcessSettings;
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
FGlobalShader::SetParameters(Context.RHICmdList, ShaderRHI, Context.View);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
PostprocessParameter.SetPS(ShaderRHI, Context, TStaticSamplerState<SF_Bilinear,AM_Clamp,AM_Clamp,AM_Clamp>::GetRHI());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
float ExposureScale = FRCPassPostProcessEyeAdaptation::ComputeExposureScaleValue(Context.View);
|
|
|
|
|
|
|
|
|
|
FVector4 BloomThresholdValue(Settings.BloomThreshold, 0, 0, ExposureScale);
|
2014-06-12 07:13:34 -04:00
|
|
|
SetShaderValue(Context.RHICmdList, ShaderRHI, BloomThreshold, BloomThresholdValue);
|
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);
|
|
|
|
|
Ar << PostprocessParameter << BloomThreshold;
|
|
|
|
|
return bShaderHasOutdatedParameters;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(,FPostProcessBloomSetupSmallVS_ES2,TEXT("PostProcessMobile"),TEXT("BloomSmallVS_ES2"),SF_Vertex);
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(,FPostProcessBloomSetupSmallPS_ES2,TEXT("PostProcessMobile"),TEXT("BloomSmallPS_ES2"),SF_Pixel);
|
|
|
|
|
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void FRCPassPostProcessBloomSetupSmallES2::SetShader(const FRenderingCompositePassContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2014-08-28 06:22:54 -04:00
|
|
|
TShaderMapRef<FPostProcessBloomSetupSmallVS_ES2> VertexShader(Context.GetShaderMap());
|
|
|
|
|
TShaderMapRef<FPostProcessBloomSetupSmallPS_ES2> PixelShader(Context.GetShaderMap());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
static FGlobalBoundShaderState BoundShaderState;
|
2014-06-27 11:07:13 -04:00
|
|
|
|
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
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
VertexShader->SetVS(Context);
|
|
|
|
|
PixelShader->SetPS(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FRCPassPostProcessBloomSetupSmallES2::Process(FRenderingCompositePassContext& Context)
|
|
|
|
|
{
|
2014-10-20 10:43:43 -04:00
|
|
|
SCOPED_DRAW_EVENT(Context.RHICmdList, PostProcessBloomSetupSmall);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
const FPooledRenderTargetDesc* InputDesc = GetInputDesc(ePId_Input0);
|
|
|
|
|
|
|
|
|
|
uint32 DstX = FMath::Max(1, PrePostSourceViewportSize.X/4);
|
|
|
|
|
uint32 DstY = FMath::Max(1, PrePostSourceViewportSize.Y/4);
|
|
|
|
|
|
|
|
|
|
FIntRect DstRect;
|
|
|
|
|
DstRect.Min.X = 0;
|
|
|
|
|
DstRect.Min.Y = 0;
|
|
|
|
|
DstRect.Max.X = DstX;
|
|
|
|
|
DstRect.Max.Y = DstY;
|
|
|
|
|
|
|
|
|
|
FIntPoint DstSize = PrePostSourceViewportSize / 4;
|
|
|
|
|
|
|
|
|
|
FIntPoint SrcSize;
|
|
|
|
|
FIntRect SrcRect;
|
2014-09-17 09:30:48 -04:00
|
|
|
if(bUseViewRectSource)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
// Mobile with framebuffer fetch uses view rect as source.
|
|
|
|
|
const FSceneView& View = Context.View;
|
|
|
|
|
SrcSize = InputDesc->Extent;
|
|
|
|
|
// uint32 ScaleFactor = View.ViewRect.Width() / SrcSize.X;
|
|
|
|
|
// SrcRect = View.ViewRect / ScaleFactor;
|
|
|
|
|
// TODO: This won't work with scaled views.
|
|
|
|
|
SrcRect = View.ViewRect;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Otherwise using exact size texture.
|
|
|
|
|
SrcSize = DstSize;
|
|
|
|
|
SrcRect = DstRect;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const FSceneRenderTargetItem& DestRenderTarget = PassOutputs[0].RequestSurface(Context);
|
2014-06-12 07:13:34 -04:00
|
|
|
SetRenderTarget(Context.RHICmdList, DestRenderTarget.TargetableTexture, FTextureRHIRef());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
// is optimized away if possible (RT size=view size, )
|
2014-06-12 07:13:34 -04:00
|
|
|
Context.RHICmdList.Clear(true, FLinearColor::Black, false, 1.0f, false, 0, FIntRect());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
Context.SetViewportAndCallRHI(0, 0, 0.0f, DstX, DstY, 1.0f );
|
|
|
|
|
|
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
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
SetShader(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2014-08-28 06:22:54 -04:00
|
|
|
TShaderMapRef<FPostProcessBloomSetupSmallVS_ES2> VertexShader(Context.GetShaderMap());
|
2014-03-14 14:13:41 -04:00
|
|
|
DrawRectangle(
|
2014-06-12 07:13:34 -04:00
|
|
|
Context.RHICmdList,
|
2014-03-14 14:13:41 -04:00
|
|
|
0, 0,
|
|
|
|
|
DstX, DstY,
|
|
|
|
|
SrcRect.Min.X, SrcRect.Min.Y,
|
|
|
|
|
SrcRect.Width(), SrcRect.Height(),
|
|
|
|
|
DstSize,
|
|
|
|
|
SrcSize,
|
2014-04-23 17:26:59 -04:00
|
|
|
*VertexShader,
|
2014-03-14 14:13:41 -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
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPooledRenderTargetDesc FRCPassPostProcessBloomSetupSmallES2::ComputeOutputDesc(EPassOutputId InPassOutputId) const
|
|
|
|
|
{
|
|
|
|
|
FPooledRenderTargetDesc Ret;
|
|
|
|
|
Ret.Depth = 0;
|
|
|
|
|
Ret.ArraySize = 1;
|
|
|
|
|
Ret.bIsArray = false;
|
|
|
|
|
Ret.NumMips = 1;
|
|
|
|
|
Ret.TargetableFlags = TexCreate_RenderTargetable;
|
|
|
|
|
Ret.bForceSeparateTargetAndShaderResource = false;
|
2015-07-15 06:39:44 -04:00
|
|
|
Ret.Format = GetHDRPixelFormat();
|
2014-03-14 14:13:41 -04:00
|
|
|
Ret.NumSamples = 1;
|
|
|
|
|
Ret.Extent.X = FMath::Max(1, PrePostSourceViewportSize.X/4);
|
|
|
|
|
Ret.Extent.Y = FMath::Max(1, PrePostSourceViewportSize.Y/4);
|
|
|
|
|
Ret.DebugName = TEXT("BloomSetupSmall");
|
|
|
|
|
return Ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// BLOOM DOWNSAMPLE
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
class FPostProcessBloomDownPS_ES2 : public FGlobalShader
|
|
|
|
|
{
|
|
|
|
|
DECLARE_SHADER_TYPE(FPostProcessBloomDownPS_ES2, Global);
|
|
|
|
|
|
|
|
|
|
static bool ShouldCache(EShaderPlatform Platform)
|
|
|
|
|
{
|
|
|
|
|
return !IsConsolePlatform(Platform);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void ModifyCompilationEnvironment(EShaderPlatform Platform, FShaderCompilerEnvironment& OutEnvironment)
|
|
|
|
|
{
|
|
|
|
|
FGlobalShader::ModifyCompilationEnvironment(Platform, OutEnvironment);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPostProcessBloomDownPS_ES2() {}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
FPostProcessPassParameters PostprocessParameter;
|
|
|
|
|
|
|
|
|
|
FPostProcessBloomDownPS_ES2(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
|
|
|
|
|
: FGlobalShader(Initializer)
|
|
|
|
|
{
|
|
|
|
|
PostprocessParameter.Bind(Initializer.ParameterMap);
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void SetPS(const FRenderingCompositePassContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
const FPixelShaderRHIParamRef ShaderRHI = GetPixelShader();
|
|
|
|
|
const FPostProcessSettings& Settings = Context.View.FinalPostProcessSettings;
|
2014-06-12 07:13:34 -04:00
|
|
|
FGlobalShader::SetParameters(Context.RHICmdList, ShaderRHI, Context.View);
|
|
|
|
|
PostprocessParameter.SetPS(ShaderRHI, Context, TStaticSamplerState<SF_Bilinear,AM_Clamp,AM_Clamp,AM_Clamp>::GetRHI());
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
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);
|
|
|
|
|
Ar << PostprocessParameter;
|
|
|
|
|
return bShaderHasOutdatedParameters;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(,FPostProcessBloomDownPS_ES2,TEXT("PostProcessMobile"),TEXT("BloomDownPS_ES2"),SF_Pixel);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class FPostProcessBloomDownVS_ES2 : public FGlobalShader
|
|
|
|
|
{
|
|
|
|
|
DECLARE_SHADER_TYPE(FPostProcessBloomDownVS_ES2,Global);
|
|
|
|
|
|
|
|
|
|
static bool ShouldCache(EShaderPlatform Platform)
|
|
|
|
|
{
|
|
|
|
|
return !IsConsolePlatform(Platform);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPostProcessBloomDownVS_ES2(){}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
FPostProcessPassParameters PostprocessParameter;
|
|
|
|
|
FShaderParameter BloomDownScale;
|
|
|
|
|
|
|
|
|
|
FPostProcessBloomDownVS_ES2(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
|
|
|
|
|
: FGlobalShader(Initializer)
|
|
|
|
|
{
|
|
|
|
|
PostprocessParameter.Bind(Initializer.ParameterMap);
|
|
|
|
|
BloomDownScale.Bind(Initializer.ParameterMap, TEXT("BloomDownScale"));
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void SetVS(const FRenderingCompositePassContext& Context, float InScale)
|
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);
|
|
|
|
|
PostprocessParameter.SetVS(ShaderRHI, Context, TStaticSamplerState<SF_Bilinear,AM_Clamp,AM_Clamp,AM_Clamp>::GetRHI());
|
|
|
|
|
SetShaderValue(Context.RHICmdList, ShaderRHI, BloomDownScale, InScale);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
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);
|
|
|
|
|
Ar << PostprocessParameter << BloomDownScale;
|
|
|
|
|
return bShaderHasOutdatedParameters;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(,FPostProcessBloomDownVS_ES2,TEXT("PostProcessMobile"),TEXT("BloomDownVS_ES2"),SF_Vertex);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void FRCPassPostProcessBloomDownES2::Process(FRenderingCompositePassContext& Context)
|
|
|
|
|
{
|
2014-10-20 10:43:43 -04:00
|
|
|
SCOPED_DRAW_EVENT(Context.RHICmdList, PostProcessBloomDown);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
uint32 DstX = FMath::Max(1, PrePostSourceViewportSize.X/2);
|
|
|
|
|
uint32 DstY = FMath::Max(1, PrePostSourceViewportSize.Y/2);
|
|
|
|
|
|
|
|
|
|
FIntRect DstRect;
|
|
|
|
|
DstRect.Min.X = 0;
|
|
|
|
|
DstRect.Min.Y = 0;
|
|
|
|
|
DstRect.Max.X = DstX;
|
|
|
|
|
DstRect.Max.Y = DstY;
|
|
|
|
|
|
|
|
|
|
const FSceneRenderTargetItem& DestRenderTarget = PassOutputs[0].RequestSurface(Context);
|
2014-06-12 07:13:34 -04:00
|
|
|
SetRenderTarget(Context.RHICmdList, DestRenderTarget.TargetableTexture, FTextureRHIRef());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
// is optimized away if possible (RT size=view size, )
|
2014-06-12 07:13:34 -04:00
|
|
|
Context.RHICmdList.Clear(true, FLinearColor::Black, false, 1.0f, false, 0, FIntRect());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
Context.SetViewportAndCallRHI(0, 0, 0.0f, DstX, DstY, 1.0f );
|
|
|
|
|
|
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
|
|
|
|
2014-08-28 06:22:54 -04:00
|
|
|
TShaderMapRef<FPostProcessBloomDownVS_ES2> VertexShader(Context.GetShaderMap());
|
|
|
|
|
TShaderMapRef<FPostProcessBloomDownPS_ES2> PixelShader(Context.GetShaderMap());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
static FGlobalBoundShaderState BoundShaderState;
|
2014-06-27 11:07:13 -04:00
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
|
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
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
VertexShader->SetVS(Context, Scale);
|
|
|
|
|
PixelShader->SetPS(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
FIntPoint SrcDstSize = PrePostSourceViewportSize/2;
|
|
|
|
|
|
|
|
|
|
DrawRectangle(
|
2014-06-12 07:13:34 -04:00
|
|
|
Context.RHICmdList,
|
2014-03-14 14:13:41 -04:00
|
|
|
0, 0,
|
|
|
|
|
DstX, DstY,
|
|
|
|
|
0, 0,
|
|
|
|
|
DstX, DstY,
|
|
|
|
|
SrcDstSize,
|
|
|
|
|
SrcDstSize,
|
2014-04-23 17:26:59 -04:00
|
|
|
*VertexShader,
|
2014-03-14 14:13:41 -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
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPooledRenderTargetDesc FRCPassPostProcessBloomDownES2::ComputeOutputDesc(EPassOutputId InPassOutputId) const
|
|
|
|
|
{
|
|
|
|
|
FPooledRenderTargetDesc Ret;
|
|
|
|
|
Ret.Depth = 0;
|
|
|
|
|
Ret.ArraySize = 1;
|
|
|
|
|
Ret.bIsArray = false;
|
|
|
|
|
Ret.NumMips = 1;
|
|
|
|
|
Ret.TargetableFlags = TexCreate_RenderTargetable;
|
|
|
|
|
Ret.bForceSeparateTargetAndShaderResource = false;
|
2015-07-15 06:39:44 -04:00
|
|
|
Ret.Format = GetHDRPixelFormat();
|
2014-03-14 14:13:41 -04:00
|
|
|
Ret.NumSamples = 1;
|
|
|
|
|
Ret.Extent.X = FMath::Max(1, PrePostSourceViewportSize.X/2);
|
|
|
|
|
Ret.Extent.Y = FMath::Max(1, PrePostSourceViewportSize.Y/2);
|
|
|
|
|
Ret.DebugName = TEXT("BloomDown");
|
|
|
|
|
return Ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// BLOOM UPSAMPLE
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
class FPostProcessBloomUpPS_ES2 : public FGlobalShader
|
|
|
|
|
{
|
|
|
|
|
DECLARE_SHADER_TYPE(FPostProcessBloomUpPS_ES2, Global);
|
|
|
|
|
|
|
|
|
|
static bool ShouldCache(EShaderPlatform Platform)
|
|
|
|
|
{
|
|
|
|
|
return !IsConsolePlatform(Platform);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void ModifyCompilationEnvironment(EShaderPlatform Platform, FShaderCompilerEnvironment& OutEnvironment)
|
|
|
|
|
{
|
|
|
|
|
FGlobalShader::ModifyCompilationEnvironment(Platform, OutEnvironment);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPostProcessBloomUpPS_ES2() {}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
FPostProcessPassParameters PostprocessParameter;
|
|
|
|
|
FShaderParameter TintA;
|
|
|
|
|
FShaderParameter TintB;
|
|
|
|
|
|
|
|
|
|
FPostProcessBloomUpPS_ES2(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
|
|
|
|
|
: FGlobalShader(Initializer)
|
|
|
|
|
{
|
|
|
|
|
PostprocessParameter.Bind(Initializer.ParameterMap);
|
|
|
|
|
TintA.Bind(Initializer.ParameterMap, TEXT("BloomTintA"));
|
|
|
|
|
TintB.Bind(Initializer.ParameterMap, TEXT("BloomTintB"));
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void SetPS(const FRenderingCompositePassContext& Context, FVector4& InTintA, FVector4& InTintB)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
const FPixelShaderRHIParamRef ShaderRHI = GetPixelShader();
|
|
|
|
|
const FPostProcessSettings& Settings = Context.View.FinalPostProcessSettings;
|
2014-06-12 07:13:34 -04:00
|
|
|
FGlobalShader::SetParameters(Context.RHICmdList, ShaderRHI, Context.View);
|
|
|
|
|
PostprocessParameter.SetPS(ShaderRHI, Context, TStaticSamplerState<SF_Bilinear,AM_Clamp,AM_Clamp,AM_Clamp>::GetRHI());
|
|
|
|
|
SetShaderValue(Context.RHICmdList, ShaderRHI, TintA, InTintA);
|
|
|
|
|
SetShaderValue(Context.RHICmdList, ShaderRHI, TintB, InTintB);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
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);
|
|
|
|
|
Ar << PostprocessParameter << TintA << TintB;
|
|
|
|
|
return bShaderHasOutdatedParameters;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(,FPostProcessBloomUpPS_ES2,TEXT("PostProcessMobile"),TEXT("BloomUpPS_ES2"),SF_Pixel);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class FPostProcessBloomUpVS_ES2 : public FGlobalShader
|
|
|
|
|
{
|
|
|
|
|
DECLARE_SHADER_TYPE(FPostProcessBloomUpVS_ES2,Global);
|
|
|
|
|
|
|
|
|
|
static bool ShouldCache(EShaderPlatform Platform)
|
|
|
|
|
{
|
|
|
|
|
return !IsConsolePlatform(Platform);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPostProcessBloomUpVS_ES2(){}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
FPostProcessPassParameters PostprocessParameter;
|
|
|
|
|
FShaderParameter BloomUpScales;
|
|
|
|
|
|
|
|
|
|
FPostProcessBloomUpVS_ES2(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
|
|
|
|
|
: FGlobalShader(Initializer)
|
|
|
|
|
{
|
|
|
|
|
PostprocessParameter.Bind(Initializer.ParameterMap);
|
|
|
|
|
BloomUpScales.Bind(Initializer.ParameterMap, TEXT("BloomUpScales"));
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void SetVS(const FRenderingCompositePassContext& Context, FVector2D InScale)
|
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);
|
|
|
|
|
PostprocessParameter.SetVS(ShaderRHI, Context, TStaticSamplerState<SF_Bilinear,AM_Clamp,AM_Clamp,AM_Clamp>::GetRHI());
|
|
|
|
|
SetShaderValue(Context.RHICmdList, ShaderRHI, BloomUpScales, InScale);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
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);
|
|
|
|
|
Ar << PostprocessParameter << BloomUpScales;
|
|
|
|
|
return bShaderHasOutdatedParameters;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(,FPostProcessBloomUpVS_ES2,TEXT("PostProcessMobile"),TEXT("BloomUpVS_ES2"),SF_Vertex);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void FRCPassPostProcessBloomUpES2::Process(FRenderingCompositePassContext& Context)
|
|
|
|
|
{
|
2014-10-20 10:43:43 -04:00
|
|
|
SCOPED_DRAW_EVENT(Context.RHICmdList, PostProcessBloomUp);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
uint32 DstX = FMath::Max(1, PrePostSourceViewportSize.X);
|
|
|
|
|
uint32 DstY = FMath::Max(1, PrePostSourceViewportSize.Y);
|
|
|
|
|
|
|
|
|
|
FIntRect DstRect;
|
|
|
|
|
DstRect.Min.X = 0;
|
|
|
|
|
DstRect.Min.Y = 0;
|
|
|
|
|
DstRect.Max.X = DstX;
|
|
|
|
|
DstRect.Max.Y = DstY;
|
|
|
|
|
|
|
|
|
|
const FSceneRenderTargetItem& DestRenderTarget = PassOutputs[0].RequestSurface(Context);
|
2014-06-12 07:13:34 -04:00
|
|
|
SetRenderTarget(Context.RHICmdList, DestRenderTarget.TargetableTexture, FTextureRHIRef());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
// is optimized away if possible (RT size=view size, )
|
2014-06-12 07:13:34 -04:00
|
|
|
Context.RHICmdList.Clear(true, FLinearColor::Black, false, 1.0f, false, 0, FIntRect());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
Context.SetViewportAndCallRHI(0, 0, 0.0f, DstX, DstY, 1.0f );
|
|
|
|
|
|
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
|
|
|
|
2014-08-28 06:22:54 -04:00
|
|
|
TShaderMapRef<FPostProcessBloomUpVS_ES2> VertexShader(Context.GetShaderMap());
|
|
|
|
|
TShaderMapRef<FPostProcessBloomUpPS_ES2> PixelShader(Context.GetShaderMap());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
static FGlobalBoundShaderState BoundShaderState;
|
2014-06-27 11:07:13 -04:00
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
|
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
|
|
|
|
|
|
|
|
// The 1/8 factor is because bloom is using 8 taps in the filter.
|
2014-06-12 07:13:34 -04:00
|
|
|
VertexShader->SetVS(Context, FVector2D(ScaleAB.X, ScaleAB.Y));
|
2014-03-14 14:13:41 -04:00
|
|
|
FVector4 TintAScaled = TintA * (1.0f/8.0f);
|
|
|
|
|
FVector4 TintBScaled = TintB * (1.0f/8.0f);
|
2014-06-12 07:13:34 -04:00
|
|
|
PixelShader->SetPS(Context, TintAScaled, TintBScaled);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
FIntPoint SrcDstSize = PrePostSourceViewportSize;
|
|
|
|
|
|
|
|
|
|
DrawRectangle(
|
2014-06-12 07:13:34 -04:00
|
|
|
Context.RHICmdList,
|
2014-03-14 14:13:41 -04:00
|
|
|
0, 0,
|
|
|
|
|
DstX, DstY,
|
|
|
|
|
0, 0,
|
|
|
|
|
DstX, DstY,
|
|
|
|
|
SrcDstSize,
|
|
|
|
|
SrcDstSize,
|
2014-04-23 17:26:59 -04:00
|
|
|
*VertexShader,
|
2014-03-14 14:13:41 -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
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPooledRenderTargetDesc FRCPassPostProcessBloomUpES2::ComputeOutputDesc(EPassOutputId InPassOutputId) const
|
|
|
|
|
{
|
|
|
|
|
FPooledRenderTargetDesc Ret;
|
|
|
|
|
Ret.Depth = 0;
|
|
|
|
|
Ret.ArraySize = 1;
|
|
|
|
|
Ret.bIsArray = false;
|
|
|
|
|
Ret.NumMips = 1;
|
|
|
|
|
Ret.TargetableFlags = TexCreate_RenderTargetable;
|
|
|
|
|
Ret.bForceSeparateTargetAndShaderResource = false;
|
2015-07-15 06:39:44 -04:00
|
|
|
Ret.Format = GetHDRPixelFormat();
|
2014-03-14 14:13:41 -04:00
|
|
|
Ret.NumSamples = 1;
|
|
|
|
|
Ret.Extent.X = FMath::Max(1, PrePostSourceViewportSize.X);
|
|
|
|
|
Ret.Extent.Y = FMath::Max(1, PrePostSourceViewportSize.Y);
|
|
|
|
|
Ret.DebugName = TEXT("BloomUp");
|
|
|
|
|
return Ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// SUN MASK
|
|
|
|
|
//
|
|
|
|
|
|
2016-03-16 21:16:51 -04:00
|
|
|
template <uint32 UseFetchSunDof, bool bUseDepthTexture> // 0=none, 1=dof, 2=sun, 3=sun&dof, {4,5,6,7}=ES2_USE_FETCH, 8=MSAA-pre-resolve
|
2014-03-14 14:13:41 -04:00
|
|
|
class FPostProcessSunMaskPS_ES2 : public FGlobalShader
|
|
|
|
|
{
|
|
|
|
|
DECLARE_SHADER_TYPE(FPostProcessSunMaskPS_ES2, Global);
|
|
|
|
|
|
|
|
|
|
static bool ShouldCache(EShaderPlatform Platform)
|
|
|
|
|
{
|
|
|
|
|
return !IsConsolePlatform(Platform);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void ModifyCompilationEnvironment(EShaderPlatform Platform, FShaderCompilerEnvironment& OutEnvironment)
|
|
|
|
|
{
|
|
|
|
|
FGlobalShader::ModifyCompilationEnvironment(Platform, OutEnvironment);
|
2016-03-16 21:16:51 -04:00
|
|
|
OutEnvironment.SetDefine(TEXT("ES2_USE_DEPTHTEXTURE"), bUseDepthTexture ? (uint32)1 : (uint32)0);
|
Copying //UE4/Dev-Core to //UE4/Dev-Main (Source: //UE4/Dev-Core @ 2996057)
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2975196 on 2016/05/12 by Robert.Manuszewski
Garbage Collector will no longer be responsible for generating class token stream, instead the token stream will be generated on startup or when a class has finished loading.
- This way we can avoid very long GC times after new blueprints have been loaded.
- Temporarily enabled CLASS_TokenStreamAssembled check in development builds (for testing purposes)
Change 2993960 on 2016/05/30 by Robert.Manuszewski
Fixing leaked linkers created by blocking load requests during async loading.
Change 2959398 on 2016/04/28 by Steve.Robb
TMap references are strong and cannot be nulled by pending kill. This makes references in values strong too, even though we only really care about keys, which will corrupt the map when nulled.
#jira UE-20828
Change 2960723 on 2016/04/29 by Graeme.Thornton
Fix for texture asset import data being ignored when async loaded
Change 2960938 on 2016/04/29 by Robert.Manuszewski
Nulling out sql db handle after closing it.
Change 2967127 on 2016/05/05 by Steve.Robb
Move constructors explicitly disabled in generated code.
Change 2967143 on 2016/05/05 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant.
Change 2967164 on 2016/05/05 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer
Change 2968650 on 2016/05/06 by Steve.Robb
Fix for HotReload copying module manager.
Change 2968915 on 2016/05/06 by Robert.Manuszewski
Fixing spelling of SetImageIntegrityStatus function name.
Change 2970406 on 2016/05/09 by Steve.Robb
Static analysis fixes:
Function uses '...' bytes of stack: exceeds /analyze:stacksize '81940'. Consider moving some data to heap.
Change 2970419 on 2016/05/09 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant.
warning C6011: Dereferencing NULL pointer '...'.
warning C6385: Reading invalid data from '...': the readable size is '...' bytes, but '...' bytes may be read.
warning C6386: Buffer overrun while writing to '...': the writable size is '...' bytes, but '...' bytes might be written.
Change 2970431 on 2016/05/09 by Steve.Robb
Static analysis fixes:
warning C6299: Explicitly comparing a bit field to a Boolean type will yield unexpected results.
Change 2972032 on 2016/05/10 by Steven.Hutton
Workflow fixes to bugg / crashgroup filtering. Filters should now correctly persist across queries.
Change 2972085 on 2016/05/10 by Steve.Robb
Const-correctness fix for FLogCategoryBase::IsSuppressed.
Change 2972087 on 2016/05/10 by Steve.Robb
ELogVerbosity moved into its own header.
Change 2972090 on 2016/05/10 by Steve.Robb
Redundant ensure removed.
Change 2972103 on 2016/05/10 by Steve.Robb
Removal of redundant use of USING_CODE_ANALYSIS.
Change 2972139 on 2016/05/10 by Steve.Robb
Fix for ensure macros throwing C6326 warnings during static analysis.
Change 2972147 on 2016/05/10 by Steve.Robb
Fix for UE_LOG_ACTIVE macro throwing C6326 warnings during static analysis.
Change 2972162 on 2016/05/10 by Steve.Robb
SCOPE_CYCLE_COUNTER_GUARD removed.
Change 2972168 on 2016/05/10 by Steve.Robb
Compile error fix for logOrEnsureNanError in static analysis builds.
Change 2973084 on 2016/05/10 by Chris.Wood
Crash Report Server performance tweak
Change 2974030 on 2016/05/11 by Steve.Robb
Fix for IPropertyHandle::SetValue - used to take a non-const reference to a const UObject*, now it takes const references to both non-const and const UObject*.
Change 2974053 on 2016/05/11 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant.
Change 2974191 on 2016/05/11 by Steve.Robb
Fix for template instantiation error in VS2013.
Change 2975298 on 2016/05/12 by Steve.Robb
Static analysis fixes:
warning C6236: (<expression> || <non-zero constant>) is always a non-zero constant.
Change 2975318 on 2016/05/12 by Steve.Robb
Fix for hot reload info being reported as warnings.
#jira UE-30586
Change 2975447 on 2016/05/12 by Steve.Robb
Static analysis fixes:
warning C6235: (<non-zero constant> || <expression>) is always a non-zero constant.
warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator?
warning C6240: (<expression> && <non-zero constant>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator?
warning C6285: (<non-zero constant> || <non-zero constant>) is always a non-zero constant. Did you intend to use the bitwise-and operator?
warning C6286: (<non-zero constant> || <expression>) is always a non-zero constant. <expression> is never evaluated and might have side effects.
warning C6289: Incorrect operator: mutual exclusion over || is always a non-zero constant. Did you intend to use && instead?
warning C6316: Incorrect operator: tested expression is constant and non-zero. Use bitwise-and to determine whether bits are set.
Change 2975478 on 2016/05/12 by Steve.Robb
Static analysis fixes for lots of redundant <zero constant> and <non-zero constant> warnings.
Change 2975538 on 2016/05/12 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'StaticResource'
Change 2976640 on 2016/05/13 by Robert.Manuszewski
Fixing crashes caused by token stream generation changes. Making sure the token stream gets re-generated when a class gets re-linked.
#jira UE-30675
Change 2978320 on 2016/05/16 by Steve.Robb
Fix for static analysis warnings in XNA headers.
Change 2978329 on 2016/05/16 by Steve.Robb
Static analysis fixes:
warning C6334: sizeof operator applied to an expression with an operator might yield unexpected results: Parentheses can be used to disambiguate certain usages.
Change 2980222 on 2016/05/17 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'X'.
warning C28182: Dereferencing NULL pointer. 'X' contains the same NULL value as 'Y' did.
Change 2980458 on 2016/05/17 by Chris.Wood
Attempt to fix crash report submission problems from CRP to CR website
[UE-30257] - Crashreports are sometimes missing file attachments
Passing crash GUID so that website can easily check for duplicates in future
Increased request timeout for AddCrash to be longer than website database timeout
Logging retries for future visibility
CRP v.1.1.6
Change 2980639 on 2016/05/17 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'X'.
warning C28182: Dereferencing NULL pointer. 'X' contains the same NULL value as 'Y' did.
Change 2981750 on 2016/05/18 by Steve.Robb
check()s in ContainerAllocationPolicies.h changed to checkSlow()s, as they only exist to check that the container has been written correctly.
Change 2982106 on 2016/05/18 by John.Mahoney
Fixed a crash caused by loading two stat capture files simultaneously in the profiler.
If the user tries to load a capture file while another load is in progress, the previous load is now cancelled and cleaned up before proceeding with the new load.
Made the delegates in FNewStatsReader explicitly specify which profiler instance they are loading data for, instead of relying on the current value of LoadConnection->InstanceId.
This also fixes a crash that occurs when selecting a different capture file in the "Stats dump browser" pane of the profiler (after using Load Folder) while another file is still loading.
Cleaned up some weak pointer usage in the profiler window.
#jira UE-30741
Change 2983366 on 2016/05/19 by Steven.Hutton
Changes for passing crash type directly from CRP to CRW.
Change 2983394 on 2016/05/19 by Steven.Hutton
Minor changes to add crash with more error reporting
Change 2984685 on 2016/05/20 by Robert.Manuszewski
Merging //UE4/Dev-Main @ 2984626 to Dev-Core (//UE4/Dev-Core)
Change 2985143 on 2016/05/20 by Steve.Robb
Missing semi-colons.
Change 2986463 on 2016/05/23 by Steve.Robb
CopyTemp added to make it clear that you want to make a copy (rather than a move, or an accidental copy) at the call site of a function taking rvalue refs.
Change 2986475 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6313: Incorrect operator: zero-valued flag cannot be tested with bitwise-and.
Change 2986476 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6313: Incorrect operator: zero-valued flag cannot be tested with bitwise-and.
Change 2986480 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant
Change 2986515 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6340: Mismatch on sign: 'X' passed as _Param_(N) when some unsigned type is required in call to 'Func'
Change 2986680 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6386: Buffer overrun while writing to 'Ptr': the writable size is 'X' bytes, but 'Y' bytes might be written.
warning C6387: 'Ptr' could be '0': this does not adhere to the specification for the function 'Func'
warning C6031: Return value ignored: 'snprintf'.
warning C6340: Mismatch on sign: 'const unsigned int' passed as _Param_(4) when some signed type is required in call to 'snprintf'.
Change 2986865 on 2016/05/23 by Robert.Manuszewski
Removing redundand AddReferencedObjects functions
Change 2987968 on 2016/05/24 by Robert.Manuszewski
Removing redundant UPROPERTY macros from intrinsic classes.
Change 2987979 on 2016/05/24 by Steve.Robb
Optimization of some FString and FPaths operations to produce fewer temporaries.
Change 2988297 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6287: Redundant code: the left and right sub-expressions are identical.
Change 2988430 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6385: Reading invalid data from 'var': the readable size is 'X' bytes, but 'Y' bytes may be read.
Change 2988461 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6235: (<non-zero constant> || <expression>) is always a non-zero constant.
warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>.
warning C6240: (<expression> && <non-zero constant>) always evaluates to the result of <expression>.
Change 2988464 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6262: Function uses 'X' bytes of stack: exceeds /analyze:stacksize 'Y'. Consider moving some data to heap.
Change 2988494 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6237: (<zero> && <expression>) is always zero. <expression> is never evaluated and might have side effects.
Change 2989411 on 2016/05/25 by Robert.Manuszewski
Splitting GC cluster index and intenral object flags to allow more UObjects in editor builds.
Change 2989429 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6387: '_Param_(X)' could be '0': this does not adhere to the specification for the function 'Func'.
Change 2989982 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6001: Using uninitialized memory 'LODPlanesMin'.
Change 2990018 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6386: Buffer overrun while writing to 'X'
Change 2990077 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6240: (<expression> && <non-zero constant>) always evaluates to the result of <expression>.
warning C6011: Dereferencing NULL pointer 'Ptr'.
Change 2990114 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6336: Arithmetic operator has precedence over question operator, use parentheses to clarify intent.
Change 2990125 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>.
Change 2990162 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6294: Ill-defined for-loop: initial condition does not satisfy test. Loop body not executed.
Change 2990193 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C28182: Dereferencing NULL pointer. 'type' contains the same NULL value as 'type->base_type' did.
warning C6011: Dereferencing NULL pointer 'Semantic'.
Change 2991006 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C28113: Accessing a local variable dummy via an Interlocked function: This is an unusual usage which could be reconsidered.
Change 2991012 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6031: Return value ignored: 'InitializeCriticalSectionAndSpinCount'.
Change 2991013 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6287: Redundant code: the left and right sub-expressions are identical.
Change 2991016 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6236: (<expression> || <non-zero constant>) is always a non-zero constant.
Change 2991017 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant.
Change 2991019 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6292: Ill-defined for-loop: counts up from maximum.
Change 2991023 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6322: Empty _except block.
warning C28251: Inconsistent annotation for 'WinMain': this instance has no annotations.
Change 2991070 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C28182: Dereferencing NULL pointer. 'Ptr1' contains the same NULL value as 'Ptr2' did.
Change 2991416 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'Ptr'.
Change 2992738 on 2016/05/27 by Steve.Robb
Revert changes to FString::MatchesWildcard.
Change 2992916 on 2016/05/27 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'Ptr'.
Change 2992960 on 2016/05/27 by Chris.Wood
Optimized P4 access in Crash Report Process and MinidumpDiagostics.
Change 2992964 on 2016/05/27 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'Ptr'.
Change 2993956 on 2016/05/30 by Robert.Manuszewski
Fixing a crash after adding a new C++ class in the editor - made sure new classes have the token stream assembled after hot-reload.
#jira UE-31309
Change 2993977 on 2016/05/30 by Robert.Manuszewski
Don't wait for all packages to finish loading before PostLoading those which already have.
Change 2994206 on 2016/05/31 by Robert.Manuszewski
PR #2429: Three bug fixes required for script support to work properly (Contributed by pluranium)
#lockdown Nick.Penwarden
[CL 2996251 by Robert Manuszewski in Main branch]
2016-06-01 12:08:56 -04:00
|
|
|
CA_SUPPRESS(6313);
|
2014-08-22 16:40:39 -04:00
|
|
|
OutEnvironment.SetDefine(TEXT("ES2_USE_MSAA"), (UseFetchSunDof & 8) ? (uint32)1 : (uint32)0);
|
Copying //UE4/Dev-Core to //UE4/Dev-Main (Source: //UE4/Dev-Core @ 2996057)
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2975196 on 2016/05/12 by Robert.Manuszewski
Garbage Collector will no longer be responsible for generating class token stream, instead the token stream will be generated on startup or when a class has finished loading.
- This way we can avoid very long GC times after new blueprints have been loaded.
- Temporarily enabled CLASS_TokenStreamAssembled check in development builds (for testing purposes)
Change 2993960 on 2016/05/30 by Robert.Manuszewski
Fixing leaked linkers created by blocking load requests during async loading.
Change 2959398 on 2016/04/28 by Steve.Robb
TMap references are strong and cannot be nulled by pending kill. This makes references in values strong too, even though we only really care about keys, which will corrupt the map when nulled.
#jira UE-20828
Change 2960723 on 2016/04/29 by Graeme.Thornton
Fix for texture asset import data being ignored when async loaded
Change 2960938 on 2016/04/29 by Robert.Manuszewski
Nulling out sql db handle after closing it.
Change 2967127 on 2016/05/05 by Steve.Robb
Move constructors explicitly disabled in generated code.
Change 2967143 on 2016/05/05 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant.
Change 2967164 on 2016/05/05 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer
Change 2968650 on 2016/05/06 by Steve.Robb
Fix for HotReload copying module manager.
Change 2968915 on 2016/05/06 by Robert.Manuszewski
Fixing spelling of SetImageIntegrityStatus function name.
Change 2970406 on 2016/05/09 by Steve.Robb
Static analysis fixes:
Function uses '...' bytes of stack: exceeds /analyze:stacksize '81940'. Consider moving some data to heap.
Change 2970419 on 2016/05/09 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant.
warning C6011: Dereferencing NULL pointer '...'.
warning C6385: Reading invalid data from '...': the readable size is '...' bytes, but '...' bytes may be read.
warning C6386: Buffer overrun while writing to '...': the writable size is '...' bytes, but '...' bytes might be written.
Change 2970431 on 2016/05/09 by Steve.Robb
Static analysis fixes:
warning C6299: Explicitly comparing a bit field to a Boolean type will yield unexpected results.
Change 2972032 on 2016/05/10 by Steven.Hutton
Workflow fixes to bugg / crashgroup filtering. Filters should now correctly persist across queries.
Change 2972085 on 2016/05/10 by Steve.Robb
Const-correctness fix for FLogCategoryBase::IsSuppressed.
Change 2972087 on 2016/05/10 by Steve.Robb
ELogVerbosity moved into its own header.
Change 2972090 on 2016/05/10 by Steve.Robb
Redundant ensure removed.
Change 2972103 on 2016/05/10 by Steve.Robb
Removal of redundant use of USING_CODE_ANALYSIS.
Change 2972139 on 2016/05/10 by Steve.Robb
Fix for ensure macros throwing C6326 warnings during static analysis.
Change 2972147 on 2016/05/10 by Steve.Robb
Fix for UE_LOG_ACTIVE macro throwing C6326 warnings during static analysis.
Change 2972162 on 2016/05/10 by Steve.Robb
SCOPE_CYCLE_COUNTER_GUARD removed.
Change 2972168 on 2016/05/10 by Steve.Robb
Compile error fix for logOrEnsureNanError in static analysis builds.
Change 2973084 on 2016/05/10 by Chris.Wood
Crash Report Server performance tweak
Change 2974030 on 2016/05/11 by Steve.Robb
Fix for IPropertyHandle::SetValue - used to take a non-const reference to a const UObject*, now it takes const references to both non-const and const UObject*.
Change 2974053 on 2016/05/11 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant.
Change 2974191 on 2016/05/11 by Steve.Robb
Fix for template instantiation error in VS2013.
Change 2975298 on 2016/05/12 by Steve.Robb
Static analysis fixes:
warning C6236: (<expression> || <non-zero constant>) is always a non-zero constant.
Change 2975318 on 2016/05/12 by Steve.Robb
Fix for hot reload info being reported as warnings.
#jira UE-30586
Change 2975447 on 2016/05/12 by Steve.Robb
Static analysis fixes:
warning C6235: (<non-zero constant> || <expression>) is always a non-zero constant.
warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator?
warning C6240: (<expression> && <non-zero constant>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator?
warning C6285: (<non-zero constant> || <non-zero constant>) is always a non-zero constant. Did you intend to use the bitwise-and operator?
warning C6286: (<non-zero constant> || <expression>) is always a non-zero constant. <expression> is never evaluated and might have side effects.
warning C6289: Incorrect operator: mutual exclusion over || is always a non-zero constant. Did you intend to use && instead?
warning C6316: Incorrect operator: tested expression is constant and non-zero. Use bitwise-and to determine whether bits are set.
Change 2975478 on 2016/05/12 by Steve.Robb
Static analysis fixes for lots of redundant <zero constant> and <non-zero constant> warnings.
Change 2975538 on 2016/05/12 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'StaticResource'
Change 2976640 on 2016/05/13 by Robert.Manuszewski
Fixing crashes caused by token stream generation changes. Making sure the token stream gets re-generated when a class gets re-linked.
#jira UE-30675
Change 2978320 on 2016/05/16 by Steve.Robb
Fix for static analysis warnings in XNA headers.
Change 2978329 on 2016/05/16 by Steve.Robb
Static analysis fixes:
warning C6334: sizeof operator applied to an expression with an operator might yield unexpected results: Parentheses can be used to disambiguate certain usages.
Change 2980222 on 2016/05/17 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'X'.
warning C28182: Dereferencing NULL pointer. 'X' contains the same NULL value as 'Y' did.
Change 2980458 on 2016/05/17 by Chris.Wood
Attempt to fix crash report submission problems from CRP to CR website
[UE-30257] - Crashreports are sometimes missing file attachments
Passing crash GUID so that website can easily check for duplicates in future
Increased request timeout for AddCrash to be longer than website database timeout
Logging retries for future visibility
CRP v.1.1.6
Change 2980639 on 2016/05/17 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'X'.
warning C28182: Dereferencing NULL pointer. 'X' contains the same NULL value as 'Y' did.
Change 2981750 on 2016/05/18 by Steve.Robb
check()s in ContainerAllocationPolicies.h changed to checkSlow()s, as they only exist to check that the container has been written correctly.
Change 2982106 on 2016/05/18 by John.Mahoney
Fixed a crash caused by loading two stat capture files simultaneously in the profiler.
If the user tries to load a capture file while another load is in progress, the previous load is now cancelled and cleaned up before proceeding with the new load.
Made the delegates in FNewStatsReader explicitly specify which profiler instance they are loading data for, instead of relying on the current value of LoadConnection->InstanceId.
This also fixes a crash that occurs when selecting a different capture file in the "Stats dump browser" pane of the profiler (after using Load Folder) while another file is still loading.
Cleaned up some weak pointer usage in the profiler window.
#jira UE-30741
Change 2983366 on 2016/05/19 by Steven.Hutton
Changes for passing crash type directly from CRP to CRW.
Change 2983394 on 2016/05/19 by Steven.Hutton
Minor changes to add crash with more error reporting
Change 2984685 on 2016/05/20 by Robert.Manuszewski
Merging //UE4/Dev-Main @ 2984626 to Dev-Core (//UE4/Dev-Core)
Change 2985143 on 2016/05/20 by Steve.Robb
Missing semi-colons.
Change 2986463 on 2016/05/23 by Steve.Robb
CopyTemp added to make it clear that you want to make a copy (rather than a move, or an accidental copy) at the call site of a function taking rvalue refs.
Change 2986475 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6313: Incorrect operator: zero-valued flag cannot be tested with bitwise-and.
Change 2986476 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6313: Incorrect operator: zero-valued flag cannot be tested with bitwise-and.
Change 2986480 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant
Change 2986515 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6340: Mismatch on sign: 'X' passed as _Param_(N) when some unsigned type is required in call to 'Func'
Change 2986680 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6386: Buffer overrun while writing to 'Ptr': the writable size is 'X' bytes, but 'Y' bytes might be written.
warning C6387: 'Ptr' could be '0': this does not adhere to the specification for the function 'Func'
warning C6031: Return value ignored: 'snprintf'.
warning C6340: Mismatch on sign: 'const unsigned int' passed as _Param_(4) when some signed type is required in call to 'snprintf'.
Change 2986865 on 2016/05/23 by Robert.Manuszewski
Removing redundand AddReferencedObjects functions
Change 2987968 on 2016/05/24 by Robert.Manuszewski
Removing redundant UPROPERTY macros from intrinsic classes.
Change 2987979 on 2016/05/24 by Steve.Robb
Optimization of some FString and FPaths operations to produce fewer temporaries.
Change 2988297 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6287: Redundant code: the left and right sub-expressions are identical.
Change 2988430 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6385: Reading invalid data from 'var': the readable size is 'X' bytes, but 'Y' bytes may be read.
Change 2988461 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6235: (<non-zero constant> || <expression>) is always a non-zero constant.
warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>.
warning C6240: (<expression> && <non-zero constant>) always evaluates to the result of <expression>.
Change 2988464 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6262: Function uses 'X' bytes of stack: exceeds /analyze:stacksize 'Y'. Consider moving some data to heap.
Change 2988494 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6237: (<zero> && <expression>) is always zero. <expression> is never evaluated and might have side effects.
Change 2989411 on 2016/05/25 by Robert.Manuszewski
Splitting GC cluster index and intenral object flags to allow more UObjects in editor builds.
Change 2989429 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6387: '_Param_(X)' could be '0': this does not adhere to the specification for the function 'Func'.
Change 2989982 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6001: Using uninitialized memory 'LODPlanesMin'.
Change 2990018 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6386: Buffer overrun while writing to 'X'
Change 2990077 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6240: (<expression> && <non-zero constant>) always evaluates to the result of <expression>.
warning C6011: Dereferencing NULL pointer 'Ptr'.
Change 2990114 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6336: Arithmetic operator has precedence over question operator, use parentheses to clarify intent.
Change 2990125 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>.
Change 2990162 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6294: Ill-defined for-loop: initial condition does not satisfy test. Loop body not executed.
Change 2990193 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C28182: Dereferencing NULL pointer. 'type' contains the same NULL value as 'type->base_type' did.
warning C6011: Dereferencing NULL pointer 'Semantic'.
Change 2991006 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C28113: Accessing a local variable dummy via an Interlocked function: This is an unusual usage which could be reconsidered.
Change 2991012 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6031: Return value ignored: 'InitializeCriticalSectionAndSpinCount'.
Change 2991013 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6287: Redundant code: the left and right sub-expressions are identical.
Change 2991016 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6236: (<expression> || <non-zero constant>) is always a non-zero constant.
Change 2991017 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant.
Change 2991019 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6292: Ill-defined for-loop: counts up from maximum.
Change 2991023 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6322: Empty _except block.
warning C28251: Inconsistent annotation for 'WinMain': this instance has no annotations.
Change 2991070 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C28182: Dereferencing NULL pointer. 'Ptr1' contains the same NULL value as 'Ptr2' did.
Change 2991416 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'Ptr'.
Change 2992738 on 2016/05/27 by Steve.Robb
Revert changes to FString::MatchesWildcard.
Change 2992916 on 2016/05/27 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'Ptr'.
Change 2992960 on 2016/05/27 by Chris.Wood
Optimized P4 access in Crash Report Process and MinidumpDiagostics.
Change 2992964 on 2016/05/27 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'Ptr'.
Change 2993956 on 2016/05/30 by Robert.Manuszewski
Fixing a crash after adding a new C++ class in the editor - made sure new classes have the token stream assembled after hot-reload.
#jira UE-31309
Change 2993977 on 2016/05/30 by Robert.Manuszewski
Don't wait for all packages to finish loading before PostLoading those which already have.
Change 2994206 on 2016/05/31 by Robert.Manuszewski
PR #2429: Three bug fixes required for script support to work properly (Contributed by pluranium)
#lockdown Nick.Penwarden
[CL 2996251 by Robert Manuszewski in Main branch]
2016-06-01 12:08:56 -04:00
|
|
|
CA_SUPPRESS(6313);
|
2014-03-14 14:13:41 -04:00
|
|
|
OutEnvironment.SetDefine(TEXT("ES2_USE_FETCH"), (UseFetchSunDof & 4) ? (uint32)1 : (uint32)0);
|
Copying //UE4/Dev-Core to //UE4/Dev-Main (Source: //UE4/Dev-Core @ 2996057)
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2975196 on 2016/05/12 by Robert.Manuszewski
Garbage Collector will no longer be responsible for generating class token stream, instead the token stream will be generated on startup or when a class has finished loading.
- This way we can avoid very long GC times after new blueprints have been loaded.
- Temporarily enabled CLASS_TokenStreamAssembled check in development builds (for testing purposes)
Change 2993960 on 2016/05/30 by Robert.Manuszewski
Fixing leaked linkers created by blocking load requests during async loading.
Change 2959398 on 2016/04/28 by Steve.Robb
TMap references are strong and cannot be nulled by pending kill. This makes references in values strong too, even though we only really care about keys, which will corrupt the map when nulled.
#jira UE-20828
Change 2960723 on 2016/04/29 by Graeme.Thornton
Fix for texture asset import data being ignored when async loaded
Change 2960938 on 2016/04/29 by Robert.Manuszewski
Nulling out sql db handle after closing it.
Change 2967127 on 2016/05/05 by Steve.Robb
Move constructors explicitly disabled in generated code.
Change 2967143 on 2016/05/05 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant.
Change 2967164 on 2016/05/05 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer
Change 2968650 on 2016/05/06 by Steve.Robb
Fix for HotReload copying module manager.
Change 2968915 on 2016/05/06 by Robert.Manuszewski
Fixing spelling of SetImageIntegrityStatus function name.
Change 2970406 on 2016/05/09 by Steve.Robb
Static analysis fixes:
Function uses '...' bytes of stack: exceeds /analyze:stacksize '81940'. Consider moving some data to heap.
Change 2970419 on 2016/05/09 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant.
warning C6011: Dereferencing NULL pointer '...'.
warning C6385: Reading invalid data from '...': the readable size is '...' bytes, but '...' bytes may be read.
warning C6386: Buffer overrun while writing to '...': the writable size is '...' bytes, but '...' bytes might be written.
Change 2970431 on 2016/05/09 by Steve.Robb
Static analysis fixes:
warning C6299: Explicitly comparing a bit field to a Boolean type will yield unexpected results.
Change 2972032 on 2016/05/10 by Steven.Hutton
Workflow fixes to bugg / crashgroup filtering. Filters should now correctly persist across queries.
Change 2972085 on 2016/05/10 by Steve.Robb
Const-correctness fix for FLogCategoryBase::IsSuppressed.
Change 2972087 on 2016/05/10 by Steve.Robb
ELogVerbosity moved into its own header.
Change 2972090 on 2016/05/10 by Steve.Robb
Redundant ensure removed.
Change 2972103 on 2016/05/10 by Steve.Robb
Removal of redundant use of USING_CODE_ANALYSIS.
Change 2972139 on 2016/05/10 by Steve.Robb
Fix for ensure macros throwing C6326 warnings during static analysis.
Change 2972147 on 2016/05/10 by Steve.Robb
Fix for UE_LOG_ACTIVE macro throwing C6326 warnings during static analysis.
Change 2972162 on 2016/05/10 by Steve.Robb
SCOPE_CYCLE_COUNTER_GUARD removed.
Change 2972168 on 2016/05/10 by Steve.Robb
Compile error fix for logOrEnsureNanError in static analysis builds.
Change 2973084 on 2016/05/10 by Chris.Wood
Crash Report Server performance tweak
Change 2974030 on 2016/05/11 by Steve.Robb
Fix for IPropertyHandle::SetValue - used to take a non-const reference to a const UObject*, now it takes const references to both non-const and const UObject*.
Change 2974053 on 2016/05/11 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant.
Change 2974191 on 2016/05/11 by Steve.Robb
Fix for template instantiation error in VS2013.
Change 2975298 on 2016/05/12 by Steve.Robb
Static analysis fixes:
warning C6236: (<expression> || <non-zero constant>) is always a non-zero constant.
Change 2975318 on 2016/05/12 by Steve.Robb
Fix for hot reload info being reported as warnings.
#jira UE-30586
Change 2975447 on 2016/05/12 by Steve.Robb
Static analysis fixes:
warning C6235: (<non-zero constant> || <expression>) is always a non-zero constant.
warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator?
warning C6240: (<expression> && <non-zero constant>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator?
warning C6285: (<non-zero constant> || <non-zero constant>) is always a non-zero constant. Did you intend to use the bitwise-and operator?
warning C6286: (<non-zero constant> || <expression>) is always a non-zero constant. <expression> is never evaluated and might have side effects.
warning C6289: Incorrect operator: mutual exclusion over || is always a non-zero constant. Did you intend to use && instead?
warning C6316: Incorrect operator: tested expression is constant and non-zero. Use bitwise-and to determine whether bits are set.
Change 2975478 on 2016/05/12 by Steve.Robb
Static analysis fixes for lots of redundant <zero constant> and <non-zero constant> warnings.
Change 2975538 on 2016/05/12 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'StaticResource'
Change 2976640 on 2016/05/13 by Robert.Manuszewski
Fixing crashes caused by token stream generation changes. Making sure the token stream gets re-generated when a class gets re-linked.
#jira UE-30675
Change 2978320 on 2016/05/16 by Steve.Robb
Fix for static analysis warnings in XNA headers.
Change 2978329 on 2016/05/16 by Steve.Robb
Static analysis fixes:
warning C6334: sizeof operator applied to an expression with an operator might yield unexpected results: Parentheses can be used to disambiguate certain usages.
Change 2980222 on 2016/05/17 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'X'.
warning C28182: Dereferencing NULL pointer. 'X' contains the same NULL value as 'Y' did.
Change 2980458 on 2016/05/17 by Chris.Wood
Attempt to fix crash report submission problems from CRP to CR website
[UE-30257] - Crashreports are sometimes missing file attachments
Passing crash GUID so that website can easily check for duplicates in future
Increased request timeout for AddCrash to be longer than website database timeout
Logging retries for future visibility
CRP v.1.1.6
Change 2980639 on 2016/05/17 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'X'.
warning C28182: Dereferencing NULL pointer. 'X' contains the same NULL value as 'Y' did.
Change 2981750 on 2016/05/18 by Steve.Robb
check()s in ContainerAllocationPolicies.h changed to checkSlow()s, as they only exist to check that the container has been written correctly.
Change 2982106 on 2016/05/18 by John.Mahoney
Fixed a crash caused by loading two stat capture files simultaneously in the profiler.
If the user tries to load a capture file while another load is in progress, the previous load is now cancelled and cleaned up before proceeding with the new load.
Made the delegates in FNewStatsReader explicitly specify which profiler instance they are loading data for, instead of relying on the current value of LoadConnection->InstanceId.
This also fixes a crash that occurs when selecting a different capture file in the "Stats dump browser" pane of the profiler (after using Load Folder) while another file is still loading.
Cleaned up some weak pointer usage in the profiler window.
#jira UE-30741
Change 2983366 on 2016/05/19 by Steven.Hutton
Changes for passing crash type directly from CRP to CRW.
Change 2983394 on 2016/05/19 by Steven.Hutton
Minor changes to add crash with more error reporting
Change 2984685 on 2016/05/20 by Robert.Manuszewski
Merging //UE4/Dev-Main @ 2984626 to Dev-Core (//UE4/Dev-Core)
Change 2985143 on 2016/05/20 by Steve.Robb
Missing semi-colons.
Change 2986463 on 2016/05/23 by Steve.Robb
CopyTemp added to make it clear that you want to make a copy (rather than a move, or an accidental copy) at the call site of a function taking rvalue refs.
Change 2986475 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6313: Incorrect operator: zero-valued flag cannot be tested with bitwise-and.
Change 2986476 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6313: Incorrect operator: zero-valued flag cannot be tested with bitwise-and.
Change 2986480 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant
Change 2986515 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6340: Mismatch on sign: 'X' passed as _Param_(N) when some unsigned type is required in call to 'Func'
Change 2986680 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6386: Buffer overrun while writing to 'Ptr': the writable size is 'X' bytes, but 'Y' bytes might be written.
warning C6387: 'Ptr' could be '0': this does not adhere to the specification for the function 'Func'
warning C6031: Return value ignored: 'snprintf'.
warning C6340: Mismatch on sign: 'const unsigned int' passed as _Param_(4) when some signed type is required in call to 'snprintf'.
Change 2986865 on 2016/05/23 by Robert.Manuszewski
Removing redundand AddReferencedObjects functions
Change 2987968 on 2016/05/24 by Robert.Manuszewski
Removing redundant UPROPERTY macros from intrinsic classes.
Change 2987979 on 2016/05/24 by Steve.Robb
Optimization of some FString and FPaths operations to produce fewer temporaries.
Change 2988297 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6287: Redundant code: the left and right sub-expressions are identical.
Change 2988430 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6385: Reading invalid data from 'var': the readable size is 'X' bytes, but 'Y' bytes may be read.
Change 2988461 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6235: (<non-zero constant> || <expression>) is always a non-zero constant.
warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>.
warning C6240: (<expression> && <non-zero constant>) always evaluates to the result of <expression>.
Change 2988464 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6262: Function uses 'X' bytes of stack: exceeds /analyze:stacksize 'Y'. Consider moving some data to heap.
Change 2988494 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6237: (<zero> && <expression>) is always zero. <expression> is never evaluated and might have side effects.
Change 2989411 on 2016/05/25 by Robert.Manuszewski
Splitting GC cluster index and intenral object flags to allow more UObjects in editor builds.
Change 2989429 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6387: '_Param_(X)' could be '0': this does not adhere to the specification for the function 'Func'.
Change 2989982 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6001: Using uninitialized memory 'LODPlanesMin'.
Change 2990018 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6386: Buffer overrun while writing to 'X'
Change 2990077 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6240: (<expression> && <non-zero constant>) always evaluates to the result of <expression>.
warning C6011: Dereferencing NULL pointer 'Ptr'.
Change 2990114 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6336: Arithmetic operator has precedence over question operator, use parentheses to clarify intent.
Change 2990125 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>.
Change 2990162 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6294: Ill-defined for-loop: initial condition does not satisfy test. Loop body not executed.
Change 2990193 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C28182: Dereferencing NULL pointer. 'type' contains the same NULL value as 'type->base_type' did.
warning C6011: Dereferencing NULL pointer 'Semantic'.
Change 2991006 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C28113: Accessing a local variable dummy via an Interlocked function: This is an unusual usage which could be reconsidered.
Change 2991012 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6031: Return value ignored: 'InitializeCriticalSectionAndSpinCount'.
Change 2991013 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6287: Redundant code: the left and right sub-expressions are identical.
Change 2991016 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6236: (<expression> || <non-zero constant>) is always a non-zero constant.
Change 2991017 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant.
Change 2991019 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6292: Ill-defined for-loop: counts up from maximum.
Change 2991023 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6322: Empty _except block.
warning C28251: Inconsistent annotation for 'WinMain': this instance has no annotations.
Change 2991070 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C28182: Dereferencing NULL pointer. 'Ptr1' contains the same NULL value as 'Ptr2' did.
Change 2991416 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'Ptr'.
Change 2992738 on 2016/05/27 by Steve.Robb
Revert changes to FString::MatchesWildcard.
Change 2992916 on 2016/05/27 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'Ptr'.
Change 2992960 on 2016/05/27 by Chris.Wood
Optimized P4 access in Crash Report Process and MinidumpDiagostics.
Change 2992964 on 2016/05/27 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'Ptr'.
Change 2993956 on 2016/05/30 by Robert.Manuszewski
Fixing a crash after adding a new C++ class in the editor - made sure new classes have the token stream assembled after hot-reload.
#jira UE-31309
Change 2993977 on 2016/05/30 by Robert.Manuszewski
Don't wait for all packages to finish loading before PostLoading those which already have.
Change 2994206 on 2016/05/31 by Robert.Manuszewski
PR #2429: Three bug fixes required for script support to work properly (Contributed by pluranium)
#lockdown Nick.Penwarden
[CL 2996251 by Robert Manuszewski in Main branch]
2016-06-01 12:08:56 -04:00
|
|
|
CA_SUPPRESS(6313);
|
2014-03-14 14:13:41 -04:00
|
|
|
OutEnvironment.SetDefine(TEXT("ES2_USE_SUN"), (UseFetchSunDof & 2) ? (uint32)1 : (uint32)0);
|
Copying //UE4/Dev-Core to //UE4/Dev-Main (Source: //UE4/Dev-Core @ 2996057)
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2975196 on 2016/05/12 by Robert.Manuszewski
Garbage Collector will no longer be responsible for generating class token stream, instead the token stream will be generated on startup or when a class has finished loading.
- This way we can avoid very long GC times after new blueprints have been loaded.
- Temporarily enabled CLASS_TokenStreamAssembled check in development builds (for testing purposes)
Change 2993960 on 2016/05/30 by Robert.Manuszewski
Fixing leaked linkers created by blocking load requests during async loading.
Change 2959398 on 2016/04/28 by Steve.Robb
TMap references are strong and cannot be nulled by pending kill. This makes references in values strong too, even though we only really care about keys, which will corrupt the map when nulled.
#jira UE-20828
Change 2960723 on 2016/04/29 by Graeme.Thornton
Fix for texture asset import data being ignored when async loaded
Change 2960938 on 2016/04/29 by Robert.Manuszewski
Nulling out sql db handle after closing it.
Change 2967127 on 2016/05/05 by Steve.Robb
Move constructors explicitly disabled in generated code.
Change 2967143 on 2016/05/05 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant.
Change 2967164 on 2016/05/05 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer
Change 2968650 on 2016/05/06 by Steve.Robb
Fix for HotReload copying module manager.
Change 2968915 on 2016/05/06 by Robert.Manuszewski
Fixing spelling of SetImageIntegrityStatus function name.
Change 2970406 on 2016/05/09 by Steve.Robb
Static analysis fixes:
Function uses '...' bytes of stack: exceeds /analyze:stacksize '81940'. Consider moving some data to heap.
Change 2970419 on 2016/05/09 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant.
warning C6011: Dereferencing NULL pointer '...'.
warning C6385: Reading invalid data from '...': the readable size is '...' bytes, but '...' bytes may be read.
warning C6386: Buffer overrun while writing to '...': the writable size is '...' bytes, but '...' bytes might be written.
Change 2970431 on 2016/05/09 by Steve.Robb
Static analysis fixes:
warning C6299: Explicitly comparing a bit field to a Boolean type will yield unexpected results.
Change 2972032 on 2016/05/10 by Steven.Hutton
Workflow fixes to bugg / crashgroup filtering. Filters should now correctly persist across queries.
Change 2972085 on 2016/05/10 by Steve.Robb
Const-correctness fix for FLogCategoryBase::IsSuppressed.
Change 2972087 on 2016/05/10 by Steve.Robb
ELogVerbosity moved into its own header.
Change 2972090 on 2016/05/10 by Steve.Robb
Redundant ensure removed.
Change 2972103 on 2016/05/10 by Steve.Robb
Removal of redundant use of USING_CODE_ANALYSIS.
Change 2972139 on 2016/05/10 by Steve.Robb
Fix for ensure macros throwing C6326 warnings during static analysis.
Change 2972147 on 2016/05/10 by Steve.Robb
Fix for UE_LOG_ACTIVE macro throwing C6326 warnings during static analysis.
Change 2972162 on 2016/05/10 by Steve.Robb
SCOPE_CYCLE_COUNTER_GUARD removed.
Change 2972168 on 2016/05/10 by Steve.Robb
Compile error fix for logOrEnsureNanError in static analysis builds.
Change 2973084 on 2016/05/10 by Chris.Wood
Crash Report Server performance tweak
Change 2974030 on 2016/05/11 by Steve.Robb
Fix for IPropertyHandle::SetValue - used to take a non-const reference to a const UObject*, now it takes const references to both non-const and const UObject*.
Change 2974053 on 2016/05/11 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant.
Change 2974191 on 2016/05/11 by Steve.Robb
Fix for template instantiation error in VS2013.
Change 2975298 on 2016/05/12 by Steve.Robb
Static analysis fixes:
warning C6236: (<expression> || <non-zero constant>) is always a non-zero constant.
Change 2975318 on 2016/05/12 by Steve.Robb
Fix for hot reload info being reported as warnings.
#jira UE-30586
Change 2975447 on 2016/05/12 by Steve.Robb
Static analysis fixes:
warning C6235: (<non-zero constant> || <expression>) is always a non-zero constant.
warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator?
warning C6240: (<expression> && <non-zero constant>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator?
warning C6285: (<non-zero constant> || <non-zero constant>) is always a non-zero constant. Did you intend to use the bitwise-and operator?
warning C6286: (<non-zero constant> || <expression>) is always a non-zero constant. <expression> is never evaluated and might have side effects.
warning C6289: Incorrect operator: mutual exclusion over || is always a non-zero constant. Did you intend to use && instead?
warning C6316: Incorrect operator: tested expression is constant and non-zero. Use bitwise-and to determine whether bits are set.
Change 2975478 on 2016/05/12 by Steve.Robb
Static analysis fixes for lots of redundant <zero constant> and <non-zero constant> warnings.
Change 2975538 on 2016/05/12 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'StaticResource'
Change 2976640 on 2016/05/13 by Robert.Manuszewski
Fixing crashes caused by token stream generation changes. Making sure the token stream gets re-generated when a class gets re-linked.
#jira UE-30675
Change 2978320 on 2016/05/16 by Steve.Robb
Fix for static analysis warnings in XNA headers.
Change 2978329 on 2016/05/16 by Steve.Robb
Static analysis fixes:
warning C6334: sizeof operator applied to an expression with an operator might yield unexpected results: Parentheses can be used to disambiguate certain usages.
Change 2980222 on 2016/05/17 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'X'.
warning C28182: Dereferencing NULL pointer. 'X' contains the same NULL value as 'Y' did.
Change 2980458 on 2016/05/17 by Chris.Wood
Attempt to fix crash report submission problems from CRP to CR website
[UE-30257] - Crashreports are sometimes missing file attachments
Passing crash GUID so that website can easily check for duplicates in future
Increased request timeout for AddCrash to be longer than website database timeout
Logging retries for future visibility
CRP v.1.1.6
Change 2980639 on 2016/05/17 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'X'.
warning C28182: Dereferencing NULL pointer. 'X' contains the same NULL value as 'Y' did.
Change 2981750 on 2016/05/18 by Steve.Robb
check()s in ContainerAllocationPolicies.h changed to checkSlow()s, as they only exist to check that the container has been written correctly.
Change 2982106 on 2016/05/18 by John.Mahoney
Fixed a crash caused by loading two stat capture files simultaneously in the profiler.
If the user tries to load a capture file while another load is in progress, the previous load is now cancelled and cleaned up before proceeding with the new load.
Made the delegates in FNewStatsReader explicitly specify which profiler instance they are loading data for, instead of relying on the current value of LoadConnection->InstanceId.
This also fixes a crash that occurs when selecting a different capture file in the "Stats dump browser" pane of the profiler (after using Load Folder) while another file is still loading.
Cleaned up some weak pointer usage in the profiler window.
#jira UE-30741
Change 2983366 on 2016/05/19 by Steven.Hutton
Changes for passing crash type directly from CRP to CRW.
Change 2983394 on 2016/05/19 by Steven.Hutton
Minor changes to add crash with more error reporting
Change 2984685 on 2016/05/20 by Robert.Manuszewski
Merging //UE4/Dev-Main @ 2984626 to Dev-Core (//UE4/Dev-Core)
Change 2985143 on 2016/05/20 by Steve.Robb
Missing semi-colons.
Change 2986463 on 2016/05/23 by Steve.Robb
CopyTemp added to make it clear that you want to make a copy (rather than a move, or an accidental copy) at the call site of a function taking rvalue refs.
Change 2986475 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6313: Incorrect operator: zero-valued flag cannot be tested with bitwise-and.
Change 2986476 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6313: Incorrect operator: zero-valued flag cannot be tested with bitwise-and.
Change 2986480 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant
Change 2986515 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6340: Mismatch on sign: 'X' passed as _Param_(N) when some unsigned type is required in call to 'Func'
Change 2986680 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6386: Buffer overrun while writing to 'Ptr': the writable size is 'X' bytes, but 'Y' bytes might be written.
warning C6387: 'Ptr' could be '0': this does not adhere to the specification for the function 'Func'
warning C6031: Return value ignored: 'snprintf'.
warning C6340: Mismatch on sign: 'const unsigned int' passed as _Param_(4) when some signed type is required in call to 'snprintf'.
Change 2986865 on 2016/05/23 by Robert.Manuszewski
Removing redundand AddReferencedObjects functions
Change 2987968 on 2016/05/24 by Robert.Manuszewski
Removing redundant UPROPERTY macros from intrinsic classes.
Change 2987979 on 2016/05/24 by Steve.Robb
Optimization of some FString and FPaths operations to produce fewer temporaries.
Change 2988297 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6287: Redundant code: the left and right sub-expressions are identical.
Change 2988430 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6385: Reading invalid data from 'var': the readable size is 'X' bytes, but 'Y' bytes may be read.
Change 2988461 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6235: (<non-zero constant> || <expression>) is always a non-zero constant.
warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>.
warning C6240: (<expression> && <non-zero constant>) always evaluates to the result of <expression>.
Change 2988464 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6262: Function uses 'X' bytes of stack: exceeds /analyze:stacksize 'Y'. Consider moving some data to heap.
Change 2988494 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6237: (<zero> && <expression>) is always zero. <expression> is never evaluated and might have side effects.
Change 2989411 on 2016/05/25 by Robert.Manuszewski
Splitting GC cluster index and intenral object flags to allow more UObjects in editor builds.
Change 2989429 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6387: '_Param_(X)' could be '0': this does not adhere to the specification for the function 'Func'.
Change 2989982 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6001: Using uninitialized memory 'LODPlanesMin'.
Change 2990018 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6386: Buffer overrun while writing to 'X'
Change 2990077 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6240: (<expression> && <non-zero constant>) always evaluates to the result of <expression>.
warning C6011: Dereferencing NULL pointer 'Ptr'.
Change 2990114 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6336: Arithmetic operator has precedence over question operator, use parentheses to clarify intent.
Change 2990125 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>.
Change 2990162 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6294: Ill-defined for-loop: initial condition does not satisfy test. Loop body not executed.
Change 2990193 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C28182: Dereferencing NULL pointer. 'type' contains the same NULL value as 'type->base_type' did.
warning C6011: Dereferencing NULL pointer 'Semantic'.
Change 2991006 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C28113: Accessing a local variable dummy via an Interlocked function: This is an unusual usage which could be reconsidered.
Change 2991012 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6031: Return value ignored: 'InitializeCriticalSectionAndSpinCount'.
Change 2991013 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6287: Redundant code: the left and right sub-expressions are identical.
Change 2991016 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6236: (<expression> || <non-zero constant>) is always a non-zero constant.
Change 2991017 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant.
Change 2991019 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6292: Ill-defined for-loop: counts up from maximum.
Change 2991023 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6322: Empty _except block.
warning C28251: Inconsistent annotation for 'WinMain': this instance has no annotations.
Change 2991070 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C28182: Dereferencing NULL pointer. 'Ptr1' contains the same NULL value as 'Ptr2' did.
Change 2991416 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'Ptr'.
Change 2992738 on 2016/05/27 by Steve.Robb
Revert changes to FString::MatchesWildcard.
Change 2992916 on 2016/05/27 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'Ptr'.
Change 2992960 on 2016/05/27 by Chris.Wood
Optimized P4 access in Crash Report Process and MinidumpDiagostics.
Change 2992964 on 2016/05/27 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'Ptr'.
Change 2993956 on 2016/05/30 by Robert.Manuszewski
Fixing a crash after adding a new C++ class in the editor - made sure new classes have the token stream assembled after hot-reload.
#jira UE-31309
Change 2993977 on 2016/05/30 by Robert.Manuszewski
Don't wait for all packages to finish loading before PostLoading those which already have.
Change 2994206 on 2016/05/31 by Robert.Manuszewski
PR #2429: Three bug fixes required for script support to work properly (Contributed by pluranium)
#lockdown Nick.Penwarden
[CL 2996251 by Robert Manuszewski in Main branch]
2016-06-01 12:08:56 -04:00
|
|
|
CA_SUPPRESS(6313);
|
2014-03-14 14:13:41 -04:00
|
|
|
OutEnvironment.SetDefine(TEXT("ES2_USE_DOF"), (UseFetchSunDof & 1) ? (uint32)1 : (uint32)0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPostProcessSunMaskPS_ES2() {}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
FPostProcessPassParameters PostprocessParameter;
|
|
|
|
|
FShaderParameter SunColorApertureDiv2Parameter;
|
|
|
|
|
|
2016-03-16 21:16:51 -04:00
|
|
|
FDeferredPixelShaderParameters DeferredParameters;
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
FPostProcessSunMaskPS_ES2(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
|
|
|
|
|
: FGlobalShader(Initializer)
|
|
|
|
|
{
|
|
|
|
|
PostprocessParameter.Bind(Initializer.ParameterMap);
|
|
|
|
|
SunColorApertureDiv2Parameter.Bind(Initializer.ParameterMap, TEXT("SunColorApertureDiv2"));
|
2016-03-16 21:16:51 -04:00
|
|
|
DeferredParameters.Bind(Initializer.ParameterMap);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void SetPS(const FRenderingCompositePassContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
const FPixelShaderRHIParamRef ShaderRHI = GetPixelShader();
|
|
|
|
|
const FPostProcessSettings& Settings = Context.View.FinalPostProcessSettings;
|
2014-06-12 07:13:34 -04:00
|
|
|
FGlobalShader::SetParameters(Context.RHICmdList, ShaderRHI, Context.View);
|
|
|
|
|
PostprocessParameter.SetPS(ShaderRHI, Context, TStaticSamplerState<SF_Bilinear,AM_Clamp,AM_Clamp,AM_Clamp>::GetRHI());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
FVector4 SunColorApertureDiv2;
|
|
|
|
|
SunColorApertureDiv2.X = Context.View.LightShaftColorMask.R;
|
|
|
|
|
SunColorApertureDiv2.Y = Context.View.LightShaftColorMask.G;
|
|
|
|
|
SunColorApertureDiv2.Z = Context.View.LightShaftColorMask.B;
|
|
|
|
|
SunColorApertureDiv2.W = Context.View.FinalPostProcessSettings.DepthOfFieldScale * 0.5f;
|
2014-06-12 07:13:34 -04:00
|
|
|
SetShaderValue(Context.RHICmdList, ShaderRHI, SunColorApertureDiv2Parameter, SunColorApertureDiv2);
|
2016-03-16 21:16:51 -04:00
|
|
|
|
|
|
|
|
DeferredParameters.Set(Context.RHICmdList, ShaderRHI, Context.View);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
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);
|
2016-03-16 21:16:51 -04:00
|
|
|
Ar << PostprocessParameter << SunColorApertureDiv2Parameter << DeferredParameters;
|
2014-03-14 14:13:41 -04:00
|
|
|
return bShaderHasOutdatedParameters;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2016-03-16 21:16:51 -04:00
|
|
|
// #define avoids a lot of code duplication
|
|
|
|
|
#define SUNMASK_PS_ES2(A) typedef FPostProcessSunMaskPS_ES2<A,true> FPostProcessSunMaskPS_ES2_DEPTH_##A; \
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(template<>,FPostProcessSunMaskPS_ES2_DEPTH_##A,TEXT("PostProcessMobile"),TEXT("SunMaskPS_ES2"), SF_Pixel); \
|
|
|
|
|
typedef FPostProcessSunMaskPS_ES2<A,false> FPostProcessSunMaskPS_ES2_##A; \
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(template<>,FPostProcessSunMaskPS_ES2_##A,TEXT("PostProcessMobile"),TEXT("SunMaskPS_ES2"), SF_Pixel);
|
|
|
|
|
|
|
|
|
|
SUNMASK_PS_ES2(0) SUNMASK_PS_ES2(1) SUNMASK_PS_ES2(2) SUNMASK_PS_ES2(3) SUNMASK_PS_ES2(4)
|
|
|
|
|
SUNMASK_PS_ES2(5) SUNMASK_PS_ES2(6) SUNMASK_PS_ES2(7) SUNMASK_PS_ES2(8)
|
|
|
|
|
|
|
|
|
|
#undef SUNMASK_PS_ES2
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class FPostProcessSunMaskVS_ES2 : public FGlobalShader
|
|
|
|
|
{
|
|
|
|
|
DECLARE_SHADER_TYPE(FPostProcessSunMaskVS_ES2,Global);
|
|
|
|
|
|
|
|
|
|
static bool ShouldCache(EShaderPlatform Platform)
|
|
|
|
|
{
|
|
|
|
|
return !IsConsolePlatform(Platform);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPostProcessSunMaskVS_ES2(){}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
FPostProcessPassParameters PostprocessParameter;
|
|
|
|
|
|
|
|
|
|
FPostProcessSunMaskVS_ES2(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
|
|
|
|
|
: FGlobalShader(Initializer)
|
|
|
|
|
{
|
|
|
|
|
PostprocessParameter.Bind(Initializer.ParameterMap);
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void SetVS(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);
|
|
|
|
|
PostprocessParameter.SetVS(ShaderRHI, Context, TStaticSamplerState<SF_Bilinear,AM_Clamp,AM_Clamp,AM_Clamp>::GetRHI());
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
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);
|
|
|
|
|
Ar << PostprocessParameter;
|
|
|
|
|
return bShaderHasOutdatedParameters;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(,FPostProcessSunMaskVS_ES2,TEXT("PostProcessMobile"),TEXT("SunMaskVS_ES2"),SF_Vertex);
|
|
|
|
|
|
2016-03-16 21:16:51 -04:00
|
|
|
template <uint32 UseFetchSunDof, bool bUseDepthTexture>
|
2014-06-12 07:13:34 -04:00
|
|
|
static void SunMask_SetShader(const FRenderingCompositePassContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2014-08-28 06:22:54 -04:00
|
|
|
TShaderMapRef<FPostProcessSunMaskVS_ES2> VertexShader(Context.GetShaderMap());
|
2016-03-16 21:16:51 -04:00
|
|
|
TShaderMapRef<FPostProcessSunMaskPS_ES2<UseFetchSunDof, bUseDepthTexture> > PixelShader(Context.GetShaderMap());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
static FGlobalBoundShaderState BoundShaderState;
|
2014-06-27 11:07:13 -04:00
|
|
|
|
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
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
VertexShader->SetVS(Context);
|
|
|
|
|
PixelShader->SetPS(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
2016-03-16 21:16:51 -04:00
|
|
|
template <bool bUseDepthTexture>
|
2014-06-12 07:13:34 -04:00
|
|
|
void FRCPassPostProcessSunMaskES2::SetShader(const FRenderingCompositePassContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
const FSceneView& View = Context.View;
|
|
|
|
|
uint32 UseSun = Context.View.bLightShaftUse ? 1 : 0;
|
|
|
|
|
uint32 UseDof = (Context.View.FinalPostProcessSettings.DepthOfFieldScale > 0.0f) ? 1 : 0;
|
|
|
|
|
uint32 UseFetch = GSupportsShaderFramebufferFetch ? 1 : 0;
|
|
|
|
|
uint32 UseFetchSunDof = (UseFetch << 2) + (UseSun << 1) + UseDof;
|
|
|
|
|
|
2014-08-22 16:40:39 -04:00
|
|
|
static const auto CVarMobileMSAA = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.MobileMSAA"));
|
2016-03-16 21:16:51 -04:00
|
|
|
const EShaderPlatform ShaderPlatform = Context.GetShaderPlatform();
|
|
|
|
|
|
|
|
|
|
if ((GSupportsShaderFramebufferFetch && (ShaderPlatform == SP_METAL || IsVulkanMobilePlatform(ShaderPlatform))) && (CVarMobileMSAA ? CVarMobileMSAA->GetValueOnAnyThread() > 1 : false))
|
2014-08-22 16:40:39 -04:00
|
|
|
{
|
|
|
|
|
UseFetchSunDof = 8;
|
|
|
|
|
}
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
switch(UseFetchSunDof)
|
|
|
|
|
{
|
2016-03-16 21:16:51 -04:00
|
|
|
case 0: SunMask_SetShader<0, bUseDepthTexture>(Context); break;
|
|
|
|
|
case 1: SunMask_SetShader<1, bUseDepthTexture>(Context); break;
|
|
|
|
|
case 2: SunMask_SetShader<2, bUseDepthTexture>(Context); break;
|
|
|
|
|
case 3: SunMask_SetShader<3, bUseDepthTexture>(Context); break;
|
|
|
|
|
case 4: SunMask_SetShader<4, bUseDepthTexture>(Context); break;
|
|
|
|
|
case 5: SunMask_SetShader<5, bUseDepthTexture>(Context); break;
|
|
|
|
|
case 6: SunMask_SetShader<6, bUseDepthTexture>(Context); break;
|
|
|
|
|
case 7: SunMask_SetShader<7, bUseDepthTexture>(Context); break;
|
|
|
|
|
case 8: SunMask_SetShader<8, bUseDepthTexture>(Context); break;
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FRCPassPostProcessSunMaskES2::Process(FRenderingCompositePassContext& Context)
|
|
|
|
|
{
|
2014-10-20 10:43:43 -04:00
|
|
|
SCOPED_DRAW_EVENT(Context.RHICmdList, PostProcessSunMask);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
const FPooledRenderTargetDesc* InputDesc = GetInputDesc(ePId_Input0);
|
|
|
|
|
|
|
|
|
|
uint32 DstX = FMath::Max(1, PrePostSourceViewportSize.X);
|
|
|
|
|
uint32 DstY = FMath::Max(1, PrePostSourceViewportSize.Y);
|
|
|
|
|
|
|
|
|
|
FIntRect DstRect;
|
|
|
|
|
DstRect.Min.X = 0;
|
|
|
|
|
DstRect.Min.Y = 0;
|
|
|
|
|
DstRect.Max.X = DstX;
|
|
|
|
|
DstRect.Max.Y = DstY;
|
|
|
|
|
|
|
|
|
|
FIntPoint DstSize = PrePostSourceViewportSize;
|
|
|
|
|
|
|
|
|
|
FIntPoint SrcSize;
|
|
|
|
|
FIntRect SrcRect;
|
|
|
|
|
const FSceneView& View = Context.View;
|
2014-04-23 17:26:59 -04:00
|
|
|
|
2014-08-28 06:22:54 -04:00
|
|
|
TShaderMapRef<FPostProcessSunMaskVS_ES2> VertexShader(Context.GetShaderMap());
|
2014-03-14 14:13:41 -04:00
|
|
|
if(bOnChip)
|
|
|
|
|
{
|
|
|
|
|
SrcSize = DstSize;
|
2016-03-16 21:16:51 -04:00
|
|
|
//SrcRect = DstRect;
|
|
|
|
|
SrcRect = View.ViewRect;
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
Context.SetViewportAndCallRHI(0, 0, 0.0f, DstX, DstY, 1.0f );
|
|
|
|
|
|
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
|
|
|
|
2016-03-16 21:16:51 -04:00
|
|
|
if (InputDesc != NULL && InputDesc->Format == PF_FloatR11G11B10)
|
|
|
|
|
{
|
|
|
|
|
SetShader<true>(Context);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
SetShader<false>(Context);
|
|
|
|
|
}
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
DrawRectangle(
|
2014-06-12 07:13:34 -04:00
|
|
|
Context.RHICmdList,
|
2014-03-14 14:13:41 -04:00
|
|
|
0, 0,
|
|
|
|
|
DstX, DstY,
|
|
|
|
|
SrcRect.Min.X, SrcRect.Min.Y,
|
|
|
|
|
SrcRect.Width(), SrcRect.Height(),
|
|
|
|
|
DstSize,
|
|
|
|
|
SrcSize,
|
2014-04-23 17:26:59 -04:00
|
|
|
*VertexShader,
|
2014-03-14 14:13:41 -04:00
|
|
|
EDRF_UseTriangleOptimization);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
SrcSize = InputDesc->Extent;
|
|
|
|
|
// uint32 ScaleFactor = View.ViewRect.Width() / SrcSize.X;
|
|
|
|
|
// SrcRect = View.ViewRect / ScaleFactor;
|
|
|
|
|
// TODO: This won't work with scaled views.
|
|
|
|
|
SrcRect = View.ViewRect;
|
|
|
|
|
|
|
|
|
|
const FSceneRenderTargetItem& DestRenderTarget = PassOutputs[0].RequestSurface(Context);
|
2016-03-16 21:16:51 -04:00
|
|
|
SetRenderTarget(Context.RHICmdList, DestRenderTarget.TargetableTexture, FTextureRHIRef(), ESimpleRenderTargetMode::EClearColorAndDepth);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
// is optimized away if possible (RT size=view size, )
|
2014-06-12 07:13:34 -04:00
|
|
|
Context.RHICmdList.Clear(true, FLinearColor::Black, false, 1.0f, false, 0, FIntRect());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
Context.SetViewportAndCallRHI(0, 0, 0.0f, DstX, DstY, 1.0f );
|
|
|
|
|
|
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
|
|
|
|
2016-03-16 21:16:51 -04:00
|
|
|
if (InputDesc != NULL && InputDesc->Format == PF_FloatR11G11B10)
|
|
|
|
|
{
|
|
|
|
|
SetShader<true>(Context);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
SetShader<false>(Context);
|
|
|
|
|
}
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
DrawRectangle(
|
2014-06-12 07:13:34 -04:00
|
|
|
Context.RHICmdList,
|
2016-03-16 21:16:51 -04:00
|
|
|
SrcRect.Min.X, SrcRect.Min.Y,
|
|
|
|
|
SrcRect.Width(), SrcRect.Height(),
|
2014-03-14 14:13:41 -04:00
|
|
|
SrcRect.Min.X, SrcRect.Min.Y,
|
|
|
|
|
SrcRect.Width(), SrcRect.Height(),
|
|
|
|
|
DstSize,
|
|
|
|
|
SrcSize,
|
2014-04-23 17:26:59 -04:00
|
|
|
*VertexShader,
|
2014-03-14 14:13:41 -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
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPooledRenderTargetDesc FRCPassPostProcessSunMaskES2::ComputeOutputDesc(EPassOutputId InPassOutputId) const
|
|
|
|
|
{
|
|
|
|
|
FPooledRenderTargetDesc Ret;
|
|
|
|
|
Ret.Depth = 0;
|
|
|
|
|
Ret.ArraySize = 1;
|
|
|
|
|
Ret.bIsArray = false;
|
|
|
|
|
Ret.NumMips = 1;
|
|
|
|
|
Ret.TargetableFlags = TexCreate_RenderTargetable;
|
|
|
|
|
Ret.bForceSeparateTargetAndShaderResource = false;
|
2015-07-15 06:39:44 -04:00
|
|
|
Ret.Format = GetHDRPixelFormat();
|
2014-03-14 14:13:41 -04:00
|
|
|
Ret.NumSamples = 1;
|
|
|
|
|
Ret.Extent.X = FMath::Max(1, PrePostSourceViewportSize.X);
|
|
|
|
|
Ret.Extent.Y = FMath::Max(1, PrePostSourceViewportSize.Y);
|
|
|
|
|
Ret.DebugName = TEXT("SunMask");
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// SUN ALPHA
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
template<uint32 UseDof>
|
|
|
|
|
class FPostProcessSunAlphaPS_ES2 : public FGlobalShader
|
|
|
|
|
{
|
|
|
|
|
DECLARE_SHADER_TYPE(FPostProcessSunAlphaPS_ES2, Global);
|
|
|
|
|
|
|
|
|
|
static bool ShouldCache(EShaderPlatform Platform)
|
|
|
|
|
{
|
|
|
|
|
return !IsConsolePlatform(Platform);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void ModifyCompilationEnvironment(EShaderPlatform Platform, FShaderCompilerEnvironment& OutEnvironment)
|
|
|
|
|
{
|
|
|
|
|
FGlobalShader::ModifyCompilationEnvironment(Platform, OutEnvironment);
|
|
|
|
|
OutEnvironment.SetDefine(TEXT("ES2_USE_DOF"), UseDof ? (uint32)1 : (uint32)0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPostProcessSunAlphaPS_ES2() {}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
FPostProcessPassParameters PostprocessParameter;
|
|
|
|
|
|
|
|
|
|
FPostProcessSunAlphaPS_ES2(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
|
|
|
|
|
: FGlobalShader(Initializer)
|
|
|
|
|
{
|
|
|
|
|
PostprocessParameter.Bind(Initializer.ParameterMap);
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void SetPS(const FRenderingCompositePassContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
const FPixelShaderRHIParamRef ShaderRHI = GetPixelShader();
|
|
|
|
|
const FPostProcessSettings& Settings = Context.View.FinalPostProcessSettings;
|
2014-06-12 07:13:34 -04:00
|
|
|
FGlobalShader::SetParameters(Context.RHICmdList, ShaderRHI, Context.View);
|
|
|
|
|
PostprocessParameter.SetPS(ShaderRHI, Context, TStaticSamplerState<SF_Bilinear,AM_Clamp,AM_Clamp,AM_Clamp>::GetRHI());
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
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);
|
|
|
|
|
Ar << PostprocessParameter;
|
|
|
|
|
return bShaderHasOutdatedParameters;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
typedef FPostProcessSunAlphaPS_ES2<0> FPostProcessSunAlphaPS_ES2_0;
|
|
|
|
|
typedef FPostProcessSunAlphaPS_ES2<1> FPostProcessSunAlphaPS_ES2_1;
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(template<>,FPostProcessSunAlphaPS_ES2_0,TEXT("PostProcessMobile"),TEXT("SunAlphaPS_ES2"),SF_Pixel);
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(template<>,FPostProcessSunAlphaPS_ES2_1,TEXT("PostProcessMobile"),TEXT("SunAlphaPS_ES2"),SF_Pixel);
|
|
|
|
|
|
|
|
|
|
class FPostProcessSunAlphaVS_ES2 : public FGlobalShader
|
|
|
|
|
{
|
|
|
|
|
DECLARE_SHADER_TYPE(FPostProcessSunAlphaVS_ES2,Global);
|
|
|
|
|
|
|
|
|
|
static bool ShouldCache(EShaderPlatform Platform)
|
|
|
|
|
{
|
|
|
|
|
return !IsConsolePlatform(Platform);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPostProcessSunAlphaVS_ES2(){}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
FPostProcessPassParameters PostprocessParameter;
|
|
|
|
|
FShaderParameter LightShaftCenter;
|
|
|
|
|
|
|
|
|
|
FPostProcessSunAlphaVS_ES2(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
|
|
|
|
|
: FGlobalShader(Initializer)
|
|
|
|
|
{
|
|
|
|
|
PostprocessParameter.Bind(Initializer.ParameterMap);
|
|
|
|
|
LightShaftCenter.Bind(Initializer.ParameterMap, TEXT("LightShaftCenter"));
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void SetVS(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);
|
|
|
|
|
PostprocessParameter.SetVS(ShaderRHI, Context, TStaticSamplerState<SF_Bilinear,AM_Clamp,AM_Clamp,AM_Clamp>::GetRHI());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
SetShaderValue(Context.RHICmdList, ShaderRHI, LightShaftCenter, Context.View.LightShaftCenter);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
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);
|
|
|
|
|
Ar << PostprocessParameter << LightShaftCenter;
|
|
|
|
|
return bShaderHasOutdatedParameters;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(,FPostProcessSunAlphaVS_ES2,TEXT("PostProcessMobile"),TEXT("SunAlphaVS_ES2"),SF_Vertex);
|
|
|
|
|
|
|
|
|
|
template <uint32 UseDof>
|
2014-06-12 07:13:34 -04:00
|
|
|
static void SunAlpha_SetShader(const FRenderingCompositePassContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2014-08-28 06:22:54 -04:00
|
|
|
TShaderMapRef<FPostProcessSunAlphaVS_ES2> VertexShader(Context.GetShaderMap());
|
|
|
|
|
TShaderMapRef<FPostProcessSunAlphaPS_ES2<UseDof> > PixelShader(Context.GetShaderMap());
|
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
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
VertexShader->SetVS(Context);
|
|
|
|
|
PixelShader->SetPS(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void FRCPassPostProcessSunAlphaES2::SetShader(const FRenderingCompositePassContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
if(Context.View.FinalPostProcessSettings.DepthOfFieldScale > 0.0f)
|
|
|
|
|
{
|
2014-06-12 07:13:34 -04:00
|
|
|
SunAlpha_SetShader<1>(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2014-06-12 07:13:34 -04:00
|
|
|
SunAlpha_SetShader<0>(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FRCPassPostProcessSunAlphaES2::Process(FRenderingCompositePassContext& Context)
|
|
|
|
|
{
|
2014-10-20 10:43:43 -04:00
|
|
|
SCOPED_DRAW_EVENT(Context.RHICmdList, PostProcessSunAlpha);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
uint32 DstX = FMath::Max(1, PrePostSourceViewportSize.X/4);
|
|
|
|
|
uint32 DstY = FMath::Max(1, PrePostSourceViewportSize.Y/4);
|
|
|
|
|
|
|
|
|
|
FIntRect DstRect;
|
|
|
|
|
DstRect.Min.X = 0;
|
|
|
|
|
DstRect.Min.Y = 0;
|
|
|
|
|
DstRect.Max.X = DstX;
|
|
|
|
|
DstRect.Max.Y = DstY;
|
|
|
|
|
|
|
|
|
|
const FSceneRenderTargetItem& DestRenderTarget = PassOutputs[0].RequestSurface(Context);
|
2014-06-12 07:13:34 -04:00
|
|
|
SetRenderTarget(Context.RHICmdList, DestRenderTarget.TargetableTexture, FTextureRHIRef());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
// is optimized away if possible (RT size=view size, )
|
2014-06-12 07:13:34 -04:00
|
|
|
Context.RHICmdList.Clear(true, FLinearColor::Black, false, 1.0f, false, 0, FIntRect());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
Context.SetViewportAndCallRHI(0, 0, 0.0f, DstX, DstY, 1.0f );
|
|
|
|
|
|
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
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
SetShader(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
FIntPoint SrcDstSize = PrePostSourceViewportSize / 4;
|
2014-08-28 06:22:54 -04:00
|
|
|
TShaderMapRef<FPostProcessSunAlphaVS_ES2> VertexShader(Context.GetShaderMap());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
DrawRectangle(
|
2014-06-12 07:13:34 -04:00
|
|
|
Context.RHICmdList,
|
2014-03-14 14:13:41 -04:00
|
|
|
0, 0,
|
|
|
|
|
DstX, DstY,
|
|
|
|
|
0, 0,
|
|
|
|
|
DstX, DstY,
|
|
|
|
|
SrcDstSize,
|
|
|
|
|
SrcDstSize,
|
2014-04-23 17:26:59 -04:00
|
|
|
*VertexShader,
|
2014-03-14 14:13:41 -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
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPooledRenderTargetDesc FRCPassPostProcessSunAlphaES2::ComputeOutputDesc(EPassOutputId InPassOutputId) const
|
|
|
|
|
{
|
|
|
|
|
FPooledRenderTargetDesc Ret;
|
|
|
|
|
Ret.Depth = 0;
|
|
|
|
|
Ret.ArraySize = 1;
|
|
|
|
|
Ret.bIsArray = false;
|
|
|
|
|
Ret.NumMips = 1;
|
|
|
|
|
Ret.TargetableFlags = TexCreate_RenderTargetable;
|
|
|
|
|
Ret.bForceSeparateTargetAndShaderResource = false;
|
|
|
|
|
// Only need one 8-bit channel as output (but mobile hardware often doesn't support that as a render target format).
|
|
|
|
|
// Highlight compression (tonemapping) was used to keep this in 8-bit.
|
|
|
|
|
Ret.Format = PF_B8G8R8A8;
|
|
|
|
|
Ret.NumSamples = 1;
|
|
|
|
|
Ret.Extent.X = FMath::Max(1, PrePostSourceViewportSize.X/4);
|
|
|
|
|
Ret.Extent.Y = FMath::Max(1, PrePostSourceViewportSize.Y/4);
|
|
|
|
|
Ret.DebugName = TEXT("SunAlpha");
|
|
|
|
|
return Ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// SUN BLUR
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
class FPostProcessSunBlurPS_ES2 : public FGlobalShader
|
|
|
|
|
{
|
|
|
|
|
DECLARE_SHADER_TYPE(FPostProcessSunBlurPS_ES2, Global);
|
|
|
|
|
|
|
|
|
|
static bool ShouldCache(EShaderPlatform Platform)
|
|
|
|
|
{
|
|
|
|
|
return !IsConsolePlatform(Platform);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void ModifyCompilationEnvironment(EShaderPlatform Platform, FShaderCompilerEnvironment& OutEnvironment)
|
|
|
|
|
{
|
|
|
|
|
FGlobalShader::ModifyCompilationEnvironment(Platform, OutEnvironment);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPostProcessSunBlurPS_ES2() {}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
FPostProcessPassParameters PostprocessParameter;
|
|
|
|
|
|
|
|
|
|
FPostProcessSunBlurPS_ES2(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
|
|
|
|
|
: FGlobalShader(Initializer)
|
|
|
|
|
{
|
|
|
|
|
PostprocessParameter.Bind(Initializer.ParameterMap);
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void SetPS(const FRenderingCompositePassContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
const FPixelShaderRHIParamRef ShaderRHI = GetPixelShader();
|
|
|
|
|
const FPostProcessSettings& Settings = Context.View.FinalPostProcessSettings;
|
2014-06-12 07:13:34 -04:00
|
|
|
FGlobalShader::SetParameters(Context.RHICmdList, ShaderRHI, Context.View);
|
|
|
|
|
PostprocessParameter.SetPS(ShaderRHI, Context, TStaticSamplerState<SF_Bilinear,AM_Clamp,AM_Clamp,AM_Clamp>::GetRHI());
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
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);
|
|
|
|
|
Ar << PostprocessParameter;
|
|
|
|
|
return bShaderHasOutdatedParameters;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(,FPostProcessSunBlurPS_ES2,TEXT("PostProcessMobile"),TEXT("SunBlurPS_ES2"),SF_Pixel);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class FPostProcessSunBlurVS_ES2 : public FGlobalShader
|
|
|
|
|
{
|
|
|
|
|
DECLARE_SHADER_TYPE(FPostProcessSunBlurVS_ES2,Global);
|
|
|
|
|
|
|
|
|
|
static bool ShouldCache(EShaderPlatform Platform)
|
|
|
|
|
{
|
|
|
|
|
return !IsConsolePlatform(Platform);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPostProcessSunBlurVS_ES2(){}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
FPostProcessPassParameters PostprocessParameter;
|
|
|
|
|
FShaderParameter LightShaftCenter;
|
|
|
|
|
|
|
|
|
|
FPostProcessSunBlurVS_ES2(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
|
|
|
|
|
: FGlobalShader(Initializer)
|
|
|
|
|
{
|
|
|
|
|
PostprocessParameter.Bind(Initializer.ParameterMap);
|
|
|
|
|
LightShaftCenter.Bind(Initializer.ParameterMap, TEXT("LightShaftCenter"));
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void SetVS(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);
|
|
|
|
|
PostprocessParameter.SetVS(ShaderRHI, Context, TStaticSamplerState<SF_Bilinear,AM_Clamp,AM_Clamp,AM_Clamp>::GetRHI());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
SetShaderValue(Context.RHICmdList, ShaderRHI, LightShaftCenter, Context.View.LightShaftCenter);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
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);
|
|
|
|
|
Ar << PostprocessParameter << LightShaftCenter;
|
|
|
|
|
return bShaderHasOutdatedParameters;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(,FPostProcessSunBlurVS_ES2,TEXT("PostProcessMobile"),TEXT("SunBlurVS_ES2"),SF_Vertex);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void FRCPassPostProcessSunBlurES2::Process(FRenderingCompositePassContext& Context)
|
|
|
|
|
{
|
2014-10-20 10:43:43 -04:00
|
|
|
SCOPED_DRAW_EVENT(Context.RHICmdList, PostProcessSunBlur);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
uint32 DstX = FMath::Max(1, PrePostSourceViewportSize.X/4);
|
|
|
|
|
uint32 DstY = FMath::Max(1, PrePostSourceViewportSize.Y/4);
|
|
|
|
|
|
|
|
|
|
FIntRect DstRect;
|
|
|
|
|
DstRect.Min.X = 0;
|
|
|
|
|
DstRect.Min.Y = 0;
|
|
|
|
|
DstRect.Max.X = DstX;
|
|
|
|
|
DstRect.Max.Y = DstY;
|
|
|
|
|
|
|
|
|
|
const FSceneRenderTargetItem& DestRenderTarget = PassOutputs[0].RequestSurface(Context);
|
2014-06-12 07:13:34 -04:00
|
|
|
SetRenderTarget(Context.RHICmdList, DestRenderTarget.TargetableTexture, FTextureRHIRef());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
// is optimized away if possible (RT size=view size, )
|
2014-06-12 07:13:34 -04:00
|
|
|
Context.RHICmdList.Clear(true, FLinearColor::Black, false, 1.0f, false, 0, FIntRect());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
Context.SetViewportAndCallRHI(0, 0, 0.0f, DstX, DstY, 1.0f );
|
|
|
|
|
|
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
|
|
|
|
2014-08-28 06:22:54 -04:00
|
|
|
TShaderMapRef<FPostProcessSunBlurVS_ES2> VertexShader(Context.GetShaderMap());
|
|
|
|
|
TShaderMapRef<FPostProcessSunBlurPS_ES2> PixelShader(Context.GetShaderMap());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
static FGlobalBoundShaderState BoundShaderState;
|
2014-06-27 11:07:13 -04:00
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
|
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
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
VertexShader->SetVS(Context);
|
|
|
|
|
PixelShader->SetPS(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
FIntPoint SrcDstSize = PrePostSourceViewportSize / 4;
|
|
|
|
|
|
|
|
|
|
DrawRectangle(
|
2014-06-12 07:13:34 -04:00
|
|
|
Context.RHICmdList,
|
2014-03-14 14:13:41 -04:00
|
|
|
0, 0,
|
|
|
|
|
DstX, DstY,
|
|
|
|
|
0, 0,
|
|
|
|
|
DstX, DstY,
|
|
|
|
|
SrcDstSize,
|
|
|
|
|
SrcDstSize,
|
2014-04-23 17:26:59 -04:00
|
|
|
*VertexShader,
|
2014-03-14 14:13:41 -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
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPooledRenderTargetDesc FRCPassPostProcessSunBlurES2::ComputeOutputDesc(EPassOutputId InPassOutputId) const
|
|
|
|
|
{
|
|
|
|
|
FPooledRenderTargetDesc Ret;
|
|
|
|
|
Ret.Depth = 0;
|
|
|
|
|
Ret.ArraySize = 1;
|
|
|
|
|
Ret.bIsArray = false;
|
|
|
|
|
Ret.NumMips = 1;
|
|
|
|
|
Ret.TargetableFlags = TexCreate_RenderTargetable;
|
|
|
|
|
Ret.bForceSeparateTargetAndShaderResource = false;
|
|
|
|
|
// Only need one 8-bit channel as output (but mobile hardware often doesn't support that as a render target format).
|
|
|
|
|
// Highlight compression (tonemapping) was used to keep this in 8-bit.
|
|
|
|
|
Ret.Format = PF_B8G8R8A8;
|
|
|
|
|
Ret.NumSamples = 1;
|
|
|
|
|
Ret.Extent.X = FMath::Max(1, PrePostSourceViewportSize.X/4);
|
|
|
|
|
Ret.Extent.Y = FMath::Max(1, PrePostSourceViewportSize.Y/4);
|
|
|
|
|
Ret.DebugName = TEXT("SunBlur");
|
|
|
|
|
return Ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// SUN MERGE
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
template <uint32 UseSunBloom>
|
|
|
|
|
class FPostProcessSunMergePS_ES2 : public FGlobalShader
|
|
|
|
|
{
|
|
|
|
|
DECLARE_SHADER_TYPE(FPostProcessSunMergePS_ES2, Global);
|
|
|
|
|
|
|
|
|
|
static bool ShouldCache(EShaderPlatform Platform)
|
|
|
|
|
{
|
|
|
|
|
return !IsConsolePlatform(Platform);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void ModifyCompilationEnvironment(EShaderPlatform Platform, FShaderCompilerEnvironment& OutEnvironment)
|
|
|
|
|
{
|
|
|
|
|
FGlobalShader::ModifyCompilationEnvironment(Platform, OutEnvironment);
|
Copying //UE4/Dev-Core to //UE4/Dev-Main (Source: //UE4/Dev-Core @ 2996057)
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2975196 on 2016/05/12 by Robert.Manuszewski
Garbage Collector will no longer be responsible for generating class token stream, instead the token stream will be generated on startup or when a class has finished loading.
- This way we can avoid very long GC times after new blueprints have been loaded.
- Temporarily enabled CLASS_TokenStreamAssembled check in development builds (for testing purposes)
Change 2993960 on 2016/05/30 by Robert.Manuszewski
Fixing leaked linkers created by blocking load requests during async loading.
Change 2959398 on 2016/04/28 by Steve.Robb
TMap references are strong and cannot be nulled by pending kill. This makes references in values strong too, even though we only really care about keys, which will corrupt the map when nulled.
#jira UE-20828
Change 2960723 on 2016/04/29 by Graeme.Thornton
Fix for texture asset import data being ignored when async loaded
Change 2960938 on 2016/04/29 by Robert.Manuszewski
Nulling out sql db handle after closing it.
Change 2967127 on 2016/05/05 by Steve.Robb
Move constructors explicitly disabled in generated code.
Change 2967143 on 2016/05/05 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant.
Change 2967164 on 2016/05/05 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer
Change 2968650 on 2016/05/06 by Steve.Robb
Fix for HotReload copying module manager.
Change 2968915 on 2016/05/06 by Robert.Manuszewski
Fixing spelling of SetImageIntegrityStatus function name.
Change 2970406 on 2016/05/09 by Steve.Robb
Static analysis fixes:
Function uses '...' bytes of stack: exceeds /analyze:stacksize '81940'. Consider moving some data to heap.
Change 2970419 on 2016/05/09 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant.
warning C6011: Dereferencing NULL pointer '...'.
warning C6385: Reading invalid data from '...': the readable size is '...' bytes, but '...' bytes may be read.
warning C6386: Buffer overrun while writing to '...': the writable size is '...' bytes, but '...' bytes might be written.
Change 2970431 on 2016/05/09 by Steve.Robb
Static analysis fixes:
warning C6299: Explicitly comparing a bit field to a Boolean type will yield unexpected results.
Change 2972032 on 2016/05/10 by Steven.Hutton
Workflow fixes to bugg / crashgroup filtering. Filters should now correctly persist across queries.
Change 2972085 on 2016/05/10 by Steve.Robb
Const-correctness fix for FLogCategoryBase::IsSuppressed.
Change 2972087 on 2016/05/10 by Steve.Robb
ELogVerbosity moved into its own header.
Change 2972090 on 2016/05/10 by Steve.Robb
Redundant ensure removed.
Change 2972103 on 2016/05/10 by Steve.Robb
Removal of redundant use of USING_CODE_ANALYSIS.
Change 2972139 on 2016/05/10 by Steve.Robb
Fix for ensure macros throwing C6326 warnings during static analysis.
Change 2972147 on 2016/05/10 by Steve.Robb
Fix for UE_LOG_ACTIVE macro throwing C6326 warnings during static analysis.
Change 2972162 on 2016/05/10 by Steve.Robb
SCOPE_CYCLE_COUNTER_GUARD removed.
Change 2972168 on 2016/05/10 by Steve.Robb
Compile error fix for logOrEnsureNanError in static analysis builds.
Change 2973084 on 2016/05/10 by Chris.Wood
Crash Report Server performance tweak
Change 2974030 on 2016/05/11 by Steve.Robb
Fix for IPropertyHandle::SetValue - used to take a non-const reference to a const UObject*, now it takes const references to both non-const and const UObject*.
Change 2974053 on 2016/05/11 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant.
Change 2974191 on 2016/05/11 by Steve.Robb
Fix for template instantiation error in VS2013.
Change 2975298 on 2016/05/12 by Steve.Robb
Static analysis fixes:
warning C6236: (<expression> || <non-zero constant>) is always a non-zero constant.
Change 2975318 on 2016/05/12 by Steve.Robb
Fix for hot reload info being reported as warnings.
#jira UE-30586
Change 2975447 on 2016/05/12 by Steve.Robb
Static analysis fixes:
warning C6235: (<non-zero constant> || <expression>) is always a non-zero constant.
warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator?
warning C6240: (<expression> && <non-zero constant>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator?
warning C6285: (<non-zero constant> || <non-zero constant>) is always a non-zero constant. Did you intend to use the bitwise-and operator?
warning C6286: (<non-zero constant> || <expression>) is always a non-zero constant. <expression> is never evaluated and might have side effects.
warning C6289: Incorrect operator: mutual exclusion over || is always a non-zero constant. Did you intend to use && instead?
warning C6316: Incorrect operator: tested expression is constant and non-zero. Use bitwise-and to determine whether bits are set.
Change 2975478 on 2016/05/12 by Steve.Robb
Static analysis fixes for lots of redundant <zero constant> and <non-zero constant> warnings.
Change 2975538 on 2016/05/12 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'StaticResource'
Change 2976640 on 2016/05/13 by Robert.Manuszewski
Fixing crashes caused by token stream generation changes. Making sure the token stream gets re-generated when a class gets re-linked.
#jira UE-30675
Change 2978320 on 2016/05/16 by Steve.Robb
Fix for static analysis warnings in XNA headers.
Change 2978329 on 2016/05/16 by Steve.Robb
Static analysis fixes:
warning C6334: sizeof operator applied to an expression with an operator might yield unexpected results: Parentheses can be used to disambiguate certain usages.
Change 2980222 on 2016/05/17 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'X'.
warning C28182: Dereferencing NULL pointer. 'X' contains the same NULL value as 'Y' did.
Change 2980458 on 2016/05/17 by Chris.Wood
Attempt to fix crash report submission problems from CRP to CR website
[UE-30257] - Crashreports are sometimes missing file attachments
Passing crash GUID so that website can easily check for duplicates in future
Increased request timeout for AddCrash to be longer than website database timeout
Logging retries for future visibility
CRP v.1.1.6
Change 2980639 on 2016/05/17 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'X'.
warning C28182: Dereferencing NULL pointer. 'X' contains the same NULL value as 'Y' did.
Change 2981750 on 2016/05/18 by Steve.Robb
check()s in ContainerAllocationPolicies.h changed to checkSlow()s, as they only exist to check that the container has been written correctly.
Change 2982106 on 2016/05/18 by John.Mahoney
Fixed a crash caused by loading two stat capture files simultaneously in the profiler.
If the user tries to load a capture file while another load is in progress, the previous load is now cancelled and cleaned up before proceeding with the new load.
Made the delegates in FNewStatsReader explicitly specify which profiler instance they are loading data for, instead of relying on the current value of LoadConnection->InstanceId.
This also fixes a crash that occurs when selecting a different capture file in the "Stats dump browser" pane of the profiler (after using Load Folder) while another file is still loading.
Cleaned up some weak pointer usage in the profiler window.
#jira UE-30741
Change 2983366 on 2016/05/19 by Steven.Hutton
Changes for passing crash type directly from CRP to CRW.
Change 2983394 on 2016/05/19 by Steven.Hutton
Minor changes to add crash with more error reporting
Change 2984685 on 2016/05/20 by Robert.Manuszewski
Merging //UE4/Dev-Main @ 2984626 to Dev-Core (//UE4/Dev-Core)
Change 2985143 on 2016/05/20 by Steve.Robb
Missing semi-colons.
Change 2986463 on 2016/05/23 by Steve.Robb
CopyTemp added to make it clear that you want to make a copy (rather than a move, or an accidental copy) at the call site of a function taking rvalue refs.
Change 2986475 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6313: Incorrect operator: zero-valued flag cannot be tested with bitwise-and.
Change 2986476 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6313: Incorrect operator: zero-valued flag cannot be tested with bitwise-and.
Change 2986480 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant
Change 2986515 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6340: Mismatch on sign: 'X' passed as _Param_(N) when some unsigned type is required in call to 'Func'
Change 2986680 on 2016/05/23 by Steve.Robb
Static analysis fixes:
warning C6386: Buffer overrun while writing to 'Ptr': the writable size is 'X' bytes, but 'Y' bytes might be written.
warning C6387: 'Ptr' could be '0': this does not adhere to the specification for the function 'Func'
warning C6031: Return value ignored: 'snprintf'.
warning C6340: Mismatch on sign: 'const unsigned int' passed as _Param_(4) when some signed type is required in call to 'snprintf'.
Change 2986865 on 2016/05/23 by Robert.Manuszewski
Removing redundand AddReferencedObjects functions
Change 2987968 on 2016/05/24 by Robert.Manuszewski
Removing redundant UPROPERTY macros from intrinsic classes.
Change 2987979 on 2016/05/24 by Steve.Robb
Optimization of some FString and FPaths operations to produce fewer temporaries.
Change 2988297 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6287: Redundant code: the left and right sub-expressions are identical.
Change 2988430 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6385: Reading invalid data from 'var': the readable size is 'X' bytes, but 'Y' bytes may be read.
Change 2988461 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6235: (<non-zero constant> || <expression>) is always a non-zero constant.
warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>.
warning C6240: (<expression> && <non-zero constant>) always evaluates to the result of <expression>.
Change 2988464 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6262: Function uses 'X' bytes of stack: exceeds /analyze:stacksize 'Y'. Consider moving some data to heap.
Change 2988494 on 2016/05/24 by Steve.Robb
Static analysis fixes:
warning C6237: (<zero> && <expression>) is always zero. <expression> is never evaluated and might have side effects.
Change 2989411 on 2016/05/25 by Robert.Manuszewski
Splitting GC cluster index and intenral object flags to allow more UObjects in editor builds.
Change 2989429 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6387: '_Param_(X)' could be '0': this does not adhere to the specification for the function 'Func'.
Change 2989982 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6001: Using uninitialized memory 'LODPlanesMin'.
Change 2990018 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6386: Buffer overrun while writing to 'X'
Change 2990077 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6240: (<expression> && <non-zero constant>) always evaluates to the result of <expression>.
warning C6011: Dereferencing NULL pointer 'Ptr'.
Change 2990114 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6336: Arithmetic operator has precedence over question operator, use parentheses to clarify intent.
Change 2990125 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>.
Change 2990162 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C6294: Ill-defined for-loop: initial condition does not satisfy test. Loop body not executed.
Change 2990193 on 2016/05/25 by Steve.Robb
Static analysis fixes:
warning C28182: Dereferencing NULL pointer. 'type' contains the same NULL value as 'type->base_type' did.
warning C6011: Dereferencing NULL pointer 'Semantic'.
Change 2991006 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C28113: Accessing a local variable dummy via an Interlocked function: This is an unusual usage which could be reconsidered.
Change 2991012 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6031: Return value ignored: 'InitializeCriticalSectionAndSpinCount'.
Change 2991013 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6287: Redundant code: the left and right sub-expressions are identical.
Change 2991016 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6236: (<expression> || <non-zero constant>) is always a non-zero constant.
Change 2991017 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6326: Potential comparison of a constant with another constant.
Change 2991019 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6292: Ill-defined for-loop: counts up from maximum.
Change 2991023 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6322: Empty _except block.
warning C28251: Inconsistent annotation for 'WinMain': this instance has no annotations.
Change 2991070 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C28182: Dereferencing NULL pointer. 'Ptr1' contains the same NULL value as 'Ptr2' did.
Change 2991416 on 2016/05/26 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'Ptr'.
Change 2992738 on 2016/05/27 by Steve.Robb
Revert changes to FString::MatchesWildcard.
Change 2992916 on 2016/05/27 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'Ptr'.
Change 2992960 on 2016/05/27 by Chris.Wood
Optimized P4 access in Crash Report Process and MinidumpDiagostics.
Change 2992964 on 2016/05/27 by Steve.Robb
Static analysis fixes:
warning C6011: Dereferencing NULL pointer 'Ptr'.
Change 2993956 on 2016/05/30 by Robert.Manuszewski
Fixing a crash after adding a new C++ class in the editor - made sure new classes have the token stream assembled after hot-reload.
#jira UE-31309
Change 2993977 on 2016/05/30 by Robert.Manuszewski
Don't wait for all packages to finish loading before PostLoading those which already have.
Change 2994206 on 2016/05/31 by Robert.Manuszewski
PR #2429: Three bug fixes required for script support to work properly (Contributed by pluranium)
#lockdown Nick.Penwarden
[CL 2996251 by Robert Manuszewski in Main branch]
2016-06-01 12:08:56 -04:00
|
|
|
CA_SUPPRESS(6313);
|
2014-03-14 14:13:41 -04:00
|
|
|
OutEnvironment.SetDefine(TEXT("ES2_USE_BLOOM"), (UseSunBloom & 1) ? (uint32)1 : (uint32)0);
|
|
|
|
|
OutEnvironment.SetDefine(TEXT("ES2_USE_SUN"), (UseSunBloom >> 1) ? (uint32)1 : (uint32)0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPostProcessSunMergePS_ES2() {}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
FPostProcessPassParameters PostprocessParameter;
|
|
|
|
|
FShaderParameter SunColorVignetteIntensity;
|
|
|
|
|
FShaderParameter VignetteColor;
|
|
|
|
|
FShaderParameter BloomColor;
|
|
|
|
|
|
|
|
|
|
FPostProcessSunMergePS_ES2(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
|
|
|
|
|
: FGlobalShader(Initializer)
|
|
|
|
|
{
|
|
|
|
|
PostprocessParameter.Bind(Initializer.ParameterMap);
|
|
|
|
|
SunColorVignetteIntensity.Bind(Initializer.ParameterMap, TEXT("SunColorVignetteIntensity"));
|
|
|
|
|
VignetteColor.Bind(Initializer.ParameterMap, TEXT("VignetteColor"));
|
|
|
|
|
BloomColor.Bind(Initializer.ParameterMap, TEXT("BloomColor"));
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void SetPS(const FRenderingCompositePassContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
const FPixelShaderRHIParamRef ShaderRHI = GetPixelShader();
|
|
|
|
|
const FPostProcessSettings& Settings = Context.View.FinalPostProcessSettings;
|
2014-06-12 07:13:34 -04:00
|
|
|
FGlobalShader::SetParameters(Context.RHICmdList, ShaderRHI, Context.View);
|
|
|
|
|
PostprocessParameter.SetPS(ShaderRHI, Context, TStaticSamplerState<SF_Bilinear,AM_Clamp,AM_Clamp,AM_Clamp>::GetRHI());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
FVector4 SunColorVignetteIntensityParam;
|
|
|
|
|
SunColorVignetteIntensityParam.X = Context.View.LightShaftColorApply.R;
|
|
|
|
|
SunColorVignetteIntensityParam.Y = Context.View.LightShaftColorApply.G;
|
|
|
|
|
SunColorVignetteIntensityParam.Z = Context.View.LightShaftColorApply.B;
|
|
|
|
|
SunColorVignetteIntensityParam.W = Settings.VignetteIntensity;
|
2014-06-12 07:13:34 -04:00
|
|
|
SetShaderValue(Context.RHICmdList, ShaderRHI, SunColorVignetteIntensity, SunColorVignetteIntensityParam);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
// Scaling Bloom1 by extra factor to match filter area difference between PC default and mobile.
|
2014-06-12 07:13:34 -04:00
|
|
|
SetShaderValue(Context.RHICmdList, ShaderRHI, BloomColor, Context.View.FinalPostProcessSettings.Bloom1Tint * Context.View.FinalPostProcessSettings.BloomIntensity * 0.5);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
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-04-28 15:27:19 -04:00
|
|
|
Ar << PostprocessParameter << SunColorVignetteIntensity << BloomColor;
|
2014-03-14 14:13:41 -04:00
|
|
|
return bShaderHasOutdatedParameters;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
typedef FPostProcessSunMergePS_ES2<0> FPostProcessSunMergePS_ES2_0;
|
|
|
|
|
typedef FPostProcessSunMergePS_ES2<1> FPostProcessSunMergePS_ES2_1;
|
|
|
|
|
typedef FPostProcessSunMergePS_ES2<2> FPostProcessSunMergePS_ES2_2;
|
|
|
|
|
typedef FPostProcessSunMergePS_ES2<3> FPostProcessSunMergePS_ES2_3;
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(template<>,FPostProcessSunMergePS_ES2_0,TEXT("PostProcessMobile"),TEXT("SunMergePS_ES2"),SF_Pixel);
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(template<>,FPostProcessSunMergePS_ES2_1,TEXT("PostProcessMobile"),TEXT("SunMergePS_ES2"),SF_Pixel);
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(template<>,FPostProcessSunMergePS_ES2_2,TEXT("PostProcessMobile"),TEXT("SunMergePS_ES2"),SF_Pixel);
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(template<>,FPostProcessSunMergePS_ES2_3,TEXT("PostProcessMobile"),TEXT("SunMergePS_ES2"),SF_Pixel);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class FPostProcessSunMergeVS_ES2 : public FGlobalShader
|
|
|
|
|
{
|
|
|
|
|
DECLARE_SHADER_TYPE(FPostProcessSunMergeVS_ES2,Global);
|
|
|
|
|
|
|
|
|
|
static bool ShouldCache(EShaderPlatform Platform)
|
|
|
|
|
{
|
|
|
|
|
return !IsConsolePlatform(Platform);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPostProcessSunMergeVS_ES2(){}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
FPostProcessPassParameters PostprocessParameter;
|
|
|
|
|
FShaderParameter LightShaftCenter;
|
|
|
|
|
|
|
|
|
|
FPostProcessSunMergeVS_ES2(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
|
|
|
|
|
: FGlobalShader(Initializer)
|
|
|
|
|
{
|
|
|
|
|
PostprocessParameter.Bind(Initializer.ParameterMap);
|
|
|
|
|
LightShaftCenter.Bind(Initializer.ParameterMap, TEXT("LightShaftCenter"));
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void SetVS(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);
|
|
|
|
|
PostprocessParameter.SetVS(ShaderRHI, Context, TStaticSamplerState<SF_Bilinear,AM_Clamp,AM_Clamp,AM_Clamp>::GetRHI());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
SetShaderValue(Context.RHICmdList, ShaderRHI, LightShaftCenter, Context.View.LightShaftCenter);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
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);
|
|
|
|
|
Ar << PostprocessParameter << LightShaftCenter;
|
|
|
|
|
return bShaderHasOutdatedParameters;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(,FPostProcessSunMergeVS_ES2,TEXT("PostProcessMobile"),TEXT("SunMergeVS_ES2"),SF_Vertex);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template <uint32 UseSunBloom>
|
2014-09-18 17:49:40 -04:00
|
|
|
FShader* SunMerge_SetShader(const FRenderingCompositePassContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2014-08-28 06:22:54 -04:00
|
|
|
TShaderMapRef<FPostProcessSunMergeVS_ES2> VertexShader(Context.GetShaderMap());
|
|
|
|
|
TShaderMapRef<FPostProcessSunMergePS_ES2<UseSunBloom> > PixelShader(Context.GetShaderMap());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
static FGlobalBoundShaderState BoundShaderState;
|
2014-06-27 11:07:13 -04:00
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
|
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
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
VertexShader->SetVS(Context);
|
|
|
|
|
PixelShader->SetPS(Context);
|
2014-09-18 17:49:40 -04:00
|
|
|
|
|
|
|
|
return *VertexShader;
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
2014-09-18 17:49:40 -04:00
|
|
|
FShader* FRCPassPostProcessSunMergeES2::SetShader(const FRenderingCompositePassContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
const FSceneView& View = Context.View;
|
|
|
|
|
uint32 UseBloom = (View.FinalPostProcessSettings.BloomIntensity > 0.0f) ? 1 : 0;
|
|
|
|
|
uint32 UseSun = Context.View.bLightShaftUse ? 1 : 0;
|
|
|
|
|
uint32 UseSunBloom = UseBloom + (UseSun<<1);
|
|
|
|
|
|
|
|
|
|
switch(UseSunBloom)
|
|
|
|
|
{
|
2014-09-18 17:49:40 -04:00
|
|
|
case 0: return SunMerge_SetShader<0>(Context);
|
|
|
|
|
case 1: return SunMerge_SetShader<1>(Context);
|
|
|
|
|
case 2: return SunMerge_SetShader<2>(Context);
|
|
|
|
|
case 3: return SunMerge_SetShader<3>(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
2014-09-18 17:49:40 -04:00
|
|
|
|
|
|
|
|
check(false);
|
|
|
|
|
return NULL;
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FRCPassPostProcessSunMergeES2::Process(FRenderingCompositePassContext& Context)
|
|
|
|
|
{
|
2014-10-20 10:43:43 -04:00
|
|
|
SCOPED_DRAW_EVENT(Context.RHICmdList, PostProcessSunMerge);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
uint32 DstX = FMath::Max(1, PrePostSourceViewportSize.X/4);
|
|
|
|
|
uint32 DstY = FMath::Max(1, PrePostSourceViewportSize.Y/4);
|
|
|
|
|
|
|
|
|
|
FIntRect DstRect;
|
|
|
|
|
DstRect.Min.X = 0;
|
|
|
|
|
DstRect.Min.Y = 0;
|
|
|
|
|
DstRect.Max.X = DstX;
|
|
|
|
|
DstRect.Max.Y = DstY;
|
|
|
|
|
|
|
|
|
|
const FSceneRenderTargetItem& DestRenderTarget = PassOutputs[0].RequestSurface(Context);
|
2014-06-12 07:13:34 -04:00
|
|
|
SetRenderTarget(Context.RHICmdList, DestRenderTarget.TargetableTexture, FTextureRHIRef());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
// is optimized away if possible (RT size=view size, )
|
2014-06-12 07:13:34 -04:00
|
|
|
Context.RHICmdList.Clear(true, FLinearColor::Black, false, 1.0f, false, 0, FIntRect());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
Context.SetViewportAndCallRHI(0, 0, 0.0f, DstX, DstY, 1.0f );
|
|
|
|
|
|
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
|
|
|
|
2014-09-18 17:49:40 -04:00
|
|
|
FShader* VertexShader = SetShader(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
FIntPoint SrcDstSize = PrePostSourceViewportSize / 4;
|
|
|
|
|
|
|
|
|
|
DrawRectangle(
|
2014-06-12 07:13:34 -04:00
|
|
|
Context.RHICmdList,
|
2014-03-14 14:13:41 -04:00
|
|
|
0, 0,
|
|
|
|
|
DstX, DstY,
|
|
|
|
|
0, 0,
|
|
|
|
|
DstX, DstY,
|
|
|
|
|
SrcDstSize,
|
|
|
|
|
SrcDstSize,
|
2014-09-18 17:49:40 -04:00
|
|
|
VertexShader,
|
2014-03-14 14:13:41 -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
|
|
|
|
|
|
|
|
// Double buffer sun+bloom+vignette composite.
|
|
|
|
|
if(Context.View.FinalPostProcessSettings.AntiAliasingMethod == AAM_TemporalAA)
|
|
|
|
|
{
|
|
|
|
|
FSceneViewState* ViewState = (FSceneViewState*)Context.View.State;
|
|
|
|
|
if(ViewState)
|
|
|
|
|
{
|
|
|
|
|
ViewState->MobileAaBloomSunVignette0 = PassOutputs[0].PooledRenderTarget;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPooledRenderTargetDesc FRCPassPostProcessSunMergeES2::ComputeOutputDesc(EPassOutputId InPassOutputId) const
|
|
|
|
|
{
|
|
|
|
|
// This might not have a valid input texture.
|
|
|
|
|
FPooledRenderTargetDesc Ret;
|
|
|
|
|
Ret.Depth = 0;
|
|
|
|
|
Ret.ArraySize = 1;
|
|
|
|
|
Ret.bIsArray = false;
|
|
|
|
|
Ret.NumMips = 1;
|
|
|
|
|
Ret.TargetableFlags = TexCreate_RenderTargetable;
|
|
|
|
|
Ret.bForceSeparateTargetAndShaderResource = false;
|
2015-07-15 06:39:44 -04:00
|
|
|
Ret.Format = GetHDRPixelFormat();
|
2014-03-14 14:13:41 -04:00
|
|
|
Ret.NumSamples = 1;
|
|
|
|
|
Ret.Extent.X = FMath::Max(1, PrePostSourceViewportSize.X/4);
|
|
|
|
|
Ret.Extent.Y = FMath::Max(1, PrePostSourceViewportSize.Y/4);
|
|
|
|
|
Ret.DebugName = TEXT("SunMerge");
|
|
|
|
|
return Ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// SUN MERGE SMALL (BLOOM)
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
class FPostProcessSunMergeSmallPS_ES2 : public FGlobalShader
|
|
|
|
|
{
|
|
|
|
|
DECLARE_SHADER_TYPE(FPostProcessSunMergeSmallPS_ES2, Global);
|
|
|
|
|
|
|
|
|
|
static bool ShouldCache(EShaderPlatform Platform)
|
|
|
|
|
{
|
|
|
|
|
return !IsConsolePlatform(Platform);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void ModifyCompilationEnvironment(EShaderPlatform Platform, FShaderCompilerEnvironment& OutEnvironment)
|
|
|
|
|
{
|
|
|
|
|
FGlobalShader::ModifyCompilationEnvironment(Platform, OutEnvironment);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPostProcessSunMergeSmallPS_ES2() {}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
FPostProcessPassParameters PostprocessParameter;
|
|
|
|
|
FShaderParameter SunColorVignetteIntensity;
|
|
|
|
|
FShaderParameter VignetteColor;
|
|
|
|
|
FShaderParameter BloomColor;
|
|
|
|
|
FShaderParameter BloomColor2;
|
|
|
|
|
|
|
|
|
|
FPostProcessSunMergeSmallPS_ES2(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
|
|
|
|
|
: FGlobalShader(Initializer)
|
|
|
|
|
{
|
|
|
|
|
PostprocessParameter.Bind(Initializer.ParameterMap);
|
|
|
|
|
SunColorVignetteIntensity.Bind(Initializer.ParameterMap, TEXT("SunColorVignetteIntensity"));
|
|
|
|
|
VignetteColor.Bind(Initializer.ParameterMap, TEXT("VignetteColor"));
|
|
|
|
|
BloomColor.Bind(Initializer.ParameterMap, TEXT("BloomColor"));
|
|
|
|
|
BloomColor2.Bind(Initializer.ParameterMap, TEXT("BloomColor2"));
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void SetPS(const FRenderingCompositePassContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
const FPixelShaderRHIParamRef ShaderRHI = GetPixelShader();
|
|
|
|
|
const FPostProcessSettings& Settings = Context.View.FinalPostProcessSettings;
|
2014-06-12 07:13:34 -04:00
|
|
|
FGlobalShader::SetParameters(Context.RHICmdList, ShaderRHI, Context.View);
|
|
|
|
|
PostprocessParameter.SetPS(ShaderRHI, Context, TStaticSamplerState<SF_Bilinear,AM_Clamp,AM_Clamp,AM_Clamp>::GetRHI());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
FVector4 SunColorVignetteIntensityParam;
|
|
|
|
|
SunColorVignetteIntensityParam.X = Context.View.LightShaftColorApply.R;
|
|
|
|
|
SunColorVignetteIntensityParam.Y = Context.View.LightShaftColorApply.G;
|
|
|
|
|
SunColorVignetteIntensityParam.Z = Context.View.LightShaftColorApply.B;
|
|
|
|
|
SunColorVignetteIntensityParam.W = Settings.VignetteIntensity;
|
2014-06-12 07:13:34 -04:00
|
|
|
SetShaderValue(Context.RHICmdList, ShaderRHI, SunColorVignetteIntensity, SunColorVignetteIntensityParam);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
// Scaling Bloom1 by extra factor to match filter area difference between PC default and mobile.
|
2014-06-12 07:13:34 -04:00
|
|
|
SetShaderValue(Context.RHICmdList, ShaderRHI, BloomColor, Context.View.FinalPostProcessSettings.Bloom1Tint * Context.View.FinalPostProcessSettings.BloomIntensity * 0.5);
|
|
|
|
|
SetShaderValue(Context.RHICmdList, ShaderRHI, BloomColor2, Context.View.FinalPostProcessSettings.Bloom2Tint * Context.View.FinalPostProcessSettings.BloomIntensity);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
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-04-28 15:27:19 -04:00
|
|
|
Ar << PostprocessParameter << SunColorVignetteIntensity << BloomColor << BloomColor2;
|
2014-03-14 14:13:41 -04:00
|
|
|
return bShaderHasOutdatedParameters;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(,FPostProcessSunMergeSmallPS_ES2,TEXT("PostProcessMobile"),TEXT("SunMergeSmallPS_ES2"),SF_Pixel);
|
|
|
|
|
|
|
|
|
|
class FPostProcessSunMergeSmallVS_ES2 : public FGlobalShader
|
|
|
|
|
{
|
|
|
|
|
DECLARE_SHADER_TYPE(FPostProcessSunMergeSmallVS_ES2,Global);
|
|
|
|
|
|
|
|
|
|
static bool ShouldCache(EShaderPlatform Platform)
|
|
|
|
|
{
|
|
|
|
|
return !IsConsolePlatform(Platform);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPostProcessSunMergeSmallVS_ES2(){}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
FPostProcessPassParameters PostprocessParameter;
|
|
|
|
|
|
|
|
|
|
FPostProcessSunMergeSmallVS_ES2(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
|
|
|
|
|
: FGlobalShader(Initializer)
|
|
|
|
|
{
|
|
|
|
|
PostprocessParameter.Bind(Initializer.ParameterMap);
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void SetVS(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);
|
|
|
|
|
PostprocessParameter.SetVS(ShaderRHI, Context, TStaticSamplerState<SF_Bilinear,AM_Clamp,AM_Clamp,AM_Clamp>::GetRHI());
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
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);
|
|
|
|
|
Ar << PostprocessParameter;
|
|
|
|
|
return bShaderHasOutdatedParameters;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(,FPostProcessSunMergeSmallVS_ES2,TEXT("PostProcessMobile"),TEXT("SunMergeSmallVS_ES2"),SF_Vertex);
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void FRCPassPostProcessSunMergeSmallES2::SetShader(const FRenderingCompositePassContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2014-08-28 06:22:54 -04:00
|
|
|
TShaderMapRef<FPostProcessSunMergeSmallVS_ES2> VertexShader(Context.GetShaderMap());
|
|
|
|
|
TShaderMapRef<FPostProcessSunMergeSmallPS_ES2> PixelShader(Context.GetShaderMap());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
static FGlobalBoundShaderState BoundShaderState;
|
2014-06-27 11:07:13 -04:00
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
|
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
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
VertexShader->SetVS(Context);
|
|
|
|
|
PixelShader->SetPS(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FRCPassPostProcessSunMergeSmallES2::Process(FRenderingCompositePassContext& Context)
|
|
|
|
|
{
|
2014-10-20 10:43:43 -04:00
|
|
|
SCOPED_DRAW_EVENT(Context.RHICmdList, PostProcessSunMergeSmall);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
uint32 DstX = FMath::Max(1, PrePostSourceViewportSize.X/4);
|
|
|
|
|
uint32 DstY = FMath::Max(1, PrePostSourceViewportSize.Y/4);
|
|
|
|
|
|
|
|
|
|
FIntRect DstRect;
|
|
|
|
|
DstRect.Min.X = 0;
|
|
|
|
|
DstRect.Min.Y = 0;
|
|
|
|
|
DstRect.Max.X = DstX;
|
|
|
|
|
DstRect.Max.Y = DstY;
|
|
|
|
|
|
|
|
|
|
const FSceneRenderTargetItem& DestRenderTarget = PassOutputs[0].RequestSurface(Context);
|
2014-06-12 07:13:34 -04:00
|
|
|
SetRenderTarget(Context.RHICmdList, DestRenderTarget.TargetableTexture, FTextureRHIRef());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
// is optimized away if possible (RT size=view size, )
|
2014-06-12 07:13:34 -04:00
|
|
|
Context.RHICmdList.Clear(true, FLinearColor::Black, false, 1.0f, false, 0, FIntRect());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
Context.SetViewportAndCallRHI(0, 0, 0.0f, DstX, DstY, 1.0f );
|
|
|
|
|
|
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
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
SetShader(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
FIntPoint SrcDstSize = PrePostSourceViewportSize / 4;
|
2014-08-28 06:22:54 -04:00
|
|
|
TShaderMapRef<FPostProcessSunMergeSmallVS_ES2> VertexShader(Context.GetShaderMap());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
DrawRectangle(
|
2014-06-12 07:13:34 -04:00
|
|
|
Context.RHICmdList,
|
2014-03-14 14:13:41 -04:00
|
|
|
0, 0,
|
|
|
|
|
DstX, DstY,
|
|
|
|
|
0, 0,
|
|
|
|
|
DstX, DstY,
|
|
|
|
|
SrcDstSize,
|
|
|
|
|
SrcDstSize,
|
2014-04-23 17:26:59 -04:00
|
|
|
*VertexShader,
|
2014-03-14 14:13:41 -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
|
|
|
|
|
|
|
|
// Double buffer sun+bloom+vignette composite.
|
2014-06-27 11:07:13 -04:00
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
if (Context.View.FinalPostProcessSettings.AntiAliasingMethod == AAM_TemporalAA)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
FSceneViewState* ViewState = (FSceneViewState*)Context.View.State;
|
|
|
|
|
if(ViewState)
|
|
|
|
|
{
|
|
|
|
|
ViewState->MobileAaBloomSunVignette0 = PassOutputs[0].PooledRenderTarget;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPooledRenderTargetDesc FRCPassPostProcessSunMergeSmallES2::ComputeOutputDesc(EPassOutputId InPassOutputId) const
|
|
|
|
|
{
|
|
|
|
|
// This might not have a valid input texture.
|
|
|
|
|
FPooledRenderTargetDesc Ret;
|
|
|
|
|
Ret.Depth = 0;
|
|
|
|
|
Ret.ArraySize = 1;
|
|
|
|
|
Ret.bIsArray = false;
|
|
|
|
|
Ret.NumMips = 1;
|
|
|
|
|
Ret.TargetableFlags = TexCreate_RenderTargetable;
|
|
|
|
|
Ret.bForceSeparateTargetAndShaderResource = false;
|
2015-07-15 06:39:44 -04:00
|
|
|
Ret.Format = GetHDRPixelFormat();
|
2014-03-14 14:13:41 -04:00
|
|
|
Ret.NumSamples = 1;
|
|
|
|
|
Ret.Extent.X = FMath::Max(1, PrePostSourceViewportSize.X/4);
|
|
|
|
|
Ret.Extent.Y = FMath::Max(1, PrePostSourceViewportSize.Y/4);
|
|
|
|
|
Ret.DebugName = TEXT("SunMergeSmall");
|
|
|
|
|
return Ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// DOF DOWNSAMPLE
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
class FPostProcessDofDownVS_ES2 : public FGlobalShader
|
|
|
|
|
{
|
|
|
|
|
DECLARE_SHADER_TYPE(FPostProcessDofDownVS_ES2, Global);
|
|
|
|
|
|
|
|
|
|
static bool ShouldCache(EShaderPlatform Platform)
|
|
|
|
|
{
|
|
|
|
|
return !IsConsolePlatform(Platform);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Default constructor. */
|
|
|
|
|
FPostProcessDofDownVS_ES2() {}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
FPostProcessPassParameters PostprocessParameter;
|
|
|
|
|
|
|
|
|
|
/** Initialization constructor. */
|
|
|
|
|
FPostProcessDofDownVS_ES2(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
|
|
|
|
|
: FGlobalShader(Initializer)
|
|
|
|
|
{
|
|
|
|
|
PostprocessParameter.Bind(Initializer.ParameterMap);
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void SetVS(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
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
PostprocessParameter.SetVS(ShaderRHI, Context, TStaticSamplerState<SF_Point,AM_Clamp,AM_Clamp,AM_Clamp>::GetRHI());
|
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);
|
|
|
|
|
Ar << PostprocessParameter;
|
|
|
|
|
return bShaderHasOutdatedParameters;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template<uint32 UseSun>
|
|
|
|
|
class FPostProcessDofDownPS_ES2 : public FGlobalShader
|
|
|
|
|
{
|
|
|
|
|
DECLARE_SHADER_TYPE(FPostProcessDofDownPS_ES2, Global);
|
|
|
|
|
|
|
|
|
|
static bool ShouldCache(EShaderPlatform Platform)
|
|
|
|
|
{
|
|
|
|
|
return !IsConsolePlatform(Platform);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void ModifyCompilationEnvironment(EShaderPlatform Platform, FShaderCompilerEnvironment& OutEnvironment)
|
|
|
|
|
{
|
|
|
|
|
FGlobalShader::ModifyCompilationEnvironment(Platform, OutEnvironment);
|
|
|
|
|
OutEnvironment.SetDefine(TEXT("ES2_USE_SUN"), UseSun ? (uint32)1 : (uint32)0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPostProcessDofDownPS_ES2() {}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
FPostProcessPassParameters PostprocessParameter;
|
|
|
|
|
|
|
|
|
|
FPostProcessDofDownPS_ES2(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
|
|
|
|
|
: FGlobalShader(Initializer)
|
|
|
|
|
{
|
|
|
|
|
PostprocessParameter.Bind(Initializer.ParameterMap);
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void SetPS(const FRenderingCompositePassContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
const FPixelShaderRHIParamRef ShaderRHI = GetPixelShader();
|
|
|
|
|
const FPostProcessSettings& Settings = Context.View.FinalPostProcessSettings;
|
2014-06-12 07:13:34 -04:00
|
|
|
FGlobalShader::SetParameters(Context.RHICmdList, ShaderRHI, Context.View);
|
|
|
|
|
PostprocessParameter.SetPS(ShaderRHI, Context, TStaticSamplerState<SF_Point,AM_Clamp,AM_Clamp,AM_Clamp>::GetRHI());
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
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);
|
|
|
|
|
Ar << PostprocessParameter;
|
|
|
|
|
return bShaderHasOutdatedParameters;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(,FPostProcessDofDownVS_ES2,TEXT("PostProcessMobile"),TEXT("DofDownVS_ES2"),SF_Vertex);
|
|
|
|
|
|
|
|
|
|
typedef FPostProcessDofDownPS_ES2<0> FPostProcessDofDownPS_ES2_0;
|
|
|
|
|
typedef FPostProcessDofDownPS_ES2<1> FPostProcessDofDownPS_ES2_1;
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(template<>,FPostProcessDofDownPS_ES2_0,TEXT("PostProcessMobile"),TEXT("DofDownPS_ES2"),SF_Pixel);
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(template<>,FPostProcessDofDownPS_ES2_1,TEXT("PostProcessMobile"),TEXT("DofDownPS_ES2"),SF_Pixel);
|
|
|
|
|
|
|
|
|
|
template <uint32 UseSun>
|
2014-06-12 07:13:34 -04:00
|
|
|
static void DofDown_SetShader(const FRenderingCompositePassContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2014-08-28 06:22:54 -04:00
|
|
|
TShaderMapRef<FPostProcessDofDownVS_ES2> VertexShader(Context.GetShaderMap());
|
|
|
|
|
TShaderMapRef<FPostProcessDofDownPS_ES2<UseSun> > PixelShader(Context.GetShaderMap());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
static FGlobalBoundShaderState BoundShaderState;
|
2014-06-27 11:07:13 -04:00
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
|
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
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
VertexShader->SetVS(Context);
|
|
|
|
|
PixelShader->SetPS(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void FRCPassPostProcessDofDownES2::SetShader(const FRenderingCompositePassContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
const FSceneView& View = Context.View;
|
|
|
|
|
if(Context.View.bLightShaftUse)
|
|
|
|
|
{
|
2014-06-12 07:13:34 -04:00
|
|
|
DofDown_SetShader<1>(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2014-06-12 07:13:34 -04:00
|
|
|
DofDown_SetShader<0>(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FRCPassPostProcessDofDownES2::Process(FRenderingCompositePassContext& Context)
|
|
|
|
|
{
|
2014-10-20 10:43:43 -04:00
|
|
|
SCOPED_DRAW_EVENT(Context.RHICmdList, PostProcessDofDown);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
const FPooledRenderTargetDesc* InputDesc = GetInputDesc(ePId_Input0);
|
2014-11-27 10:36:38 -05:00
|
|
|
FIntPoint PrePostSourceViewportSize = PrePostSourceViewportRect.Size();
|
2014-03-14 14:13:41 -04:00
|
|
|
uint32 DstX = FMath::Max(1, PrePostSourceViewportSize.X/2);
|
|
|
|
|
uint32 DstY = FMath::Max(1, PrePostSourceViewportSize.Y/2);
|
|
|
|
|
|
|
|
|
|
FIntRect DstRect;
|
|
|
|
|
DstRect.Min.X = 0;
|
|
|
|
|
DstRect.Min.Y = 0;
|
|
|
|
|
DstRect.Max.X = DstX;
|
|
|
|
|
DstRect.Max.Y = DstY;
|
|
|
|
|
|
|
|
|
|
FIntPoint DstSize = PrePostSourceViewportSize / 2;
|
|
|
|
|
|
|
|
|
|
FIntPoint SrcSize;
|
|
|
|
|
FIntRect SrcRect;
|
2014-09-17 09:30:48 -04:00
|
|
|
if(bUseViewRectSource)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
// Mobile with framebuffer fetch uses view rect as source.
|
|
|
|
|
const FSceneView& View = Context.View;
|
|
|
|
|
SrcSize = InputDesc->Extent;
|
|
|
|
|
// uint32 ScaleFactor = View.ViewRect.Width() / SrcSize.X;
|
|
|
|
|
// SrcRect = View.ViewRect / ScaleFactor;
|
|
|
|
|
// TODO: This won't work with scaled views.
|
2014-11-27 10:36:38 -05:00
|
|
|
SrcRect = PrePostSourceViewportRect;
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Otherwise using exact size texture.
|
|
|
|
|
SrcSize = DstSize;
|
|
|
|
|
SrcRect = DstRect;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const FSceneRenderTargetItem& DestRenderTarget = PassOutputs[0].RequestSurface(Context);
|
2014-06-12 07:13:34 -04:00
|
|
|
SetRenderTarget(Context.RHICmdList, DestRenderTarget.TargetableTexture, FTextureRHIRef());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
// is optimized away if possible (RT size=view size, )
|
2014-06-12 07:13:34 -04:00
|
|
|
Context.RHICmdList.Clear(true, FLinearColor::Black, false, 1.0f, false, 0, FIntRect());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
Context.SetViewportAndCallRHI(0, 0, 0.0f, DstX, DstY, 1.0f );
|
|
|
|
|
|
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
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
SetShader(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2014-08-28 06:22:54 -04:00
|
|
|
TShaderMapRef<FPostProcessDofDownVS_ES2> VertexShader(Context.GetShaderMap());
|
2014-04-23 17:26:59 -04:00
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
DrawRectangle(
|
2014-06-12 07:13:34 -04:00
|
|
|
Context.RHICmdList,
|
2014-03-14 14:13:41 -04:00
|
|
|
0, 0,
|
|
|
|
|
DstX, DstY,
|
|
|
|
|
SrcRect.Min.X, SrcRect.Min.Y,
|
|
|
|
|
SrcRect.Width(), SrcRect.Height(),
|
|
|
|
|
DstSize,
|
|
|
|
|
SrcSize,
|
2014-04-23 17:26:59 -04:00
|
|
|
*VertexShader,
|
2014-03-14 14:13:41 -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
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPooledRenderTargetDesc FRCPassPostProcessDofDownES2::ComputeOutputDesc(EPassOutputId InPassOutputId) const
|
|
|
|
|
{
|
|
|
|
|
FPooledRenderTargetDesc Ret;
|
|
|
|
|
Ret.Depth = 0;
|
|
|
|
|
Ret.ArraySize = 1;
|
|
|
|
|
Ret.bIsArray = false;
|
|
|
|
|
Ret.NumMips = 1;
|
|
|
|
|
Ret.TargetableFlags = TexCreate_RenderTargetable;
|
|
|
|
|
Ret.bForceSeparateTargetAndShaderResource = false;
|
2015-07-15 06:39:44 -04:00
|
|
|
Ret.Format = GetHDRPixelFormat();
|
2014-03-14 14:13:41 -04:00
|
|
|
Ret.NumSamples = 1;
|
2014-11-27 10:36:38 -05:00
|
|
|
FIntPoint PrePostSourceViewportSize = PrePostSourceViewportRect.Size();
|
2014-03-14 14:13:41 -04:00
|
|
|
Ret.Extent.X = FMath::Max(1, PrePostSourceViewportSize.X/2);
|
|
|
|
|
Ret.Extent.Y = FMath::Max(1, PrePostSourceViewportSize.Y/2);
|
|
|
|
|
Ret.DebugName = TEXT("DofDown");
|
|
|
|
|
return Ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// DOF NEAR
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
class FPostProcessDofNearVS_ES2 : public FGlobalShader
|
|
|
|
|
{
|
|
|
|
|
DECLARE_SHADER_TYPE(FPostProcessDofNearVS_ES2, Global);
|
|
|
|
|
|
|
|
|
|
static bool ShouldCache(EShaderPlatform Platform)
|
|
|
|
|
{
|
|
|
|
|
return !IsConsolePlatform(Platform);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Default constructor. */
|
|
|
|
|
FPostProcessDofNearVS_ES2() {}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
FPostProcessPassParameters PostprocessParameter;
|
|
|
|
|
|
|
|
|
|
/** Initialization constructor. */
|
|
|
|
|
FPostProcessDofNearVS_ES2(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
|
|
|
|
|
: FGlobalShader(Initializer)
|
|
|
|
|
{
|
|
|
|
|
PostprocessParameter.Bind(Initializer.ParameterMap);
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void SetVS(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
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
PostprocessParameter.SetVS(ShaderRHI, Context, TStaticSamplerState<SF_Point,AM_Clamp,AM_Clamp,AM_Clamp>::GetRHI());
|
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);
|
|
|
|
|
Ar << PostprocessParameter;
|
|
|
|
|
return bShaderHasOutdatedParameters;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template<uint32 UseSun>
|
|
|
|
|
class FPostProcessDofNearPS_ES2 : public FGlobalShader
|
|
|
|
|
{
|
|
|
|
|
DECLARE_SHADER_TYPE(FPostProcessDofNearPS_ES2, Global);
|
|
|
|
|
|
|
|
|
|
static bool ShouldCache(EShaderPlatform Platform)
|
|
|
|
|
{
|
|
|
|
|
return !IsConsolePlatform(Platform);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void ModifyCompilationEnvironment(EShaderPlatform Platform, FShaderCompilerEnvironment& OutEnvironment)
|
|
|
|
|
{
|
|
|
|
|
FGlobalShader::ModifyCompilationEnvironment(Platform, OutEnvironment);
|
|
|
|
|
OutEnvironment.SetDefine(TEXT("ES2_USE_SUN"), UseSun ? (uint32)1 : (uint32)0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPostProcessDofNearPS_ES2() {}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
FPostProcessPassParameters PostprocessParameter;
|
|
|
|
|
|
|
|
|
|
FPostProcessDofNearPS_ES2(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
|
|
|
|
|
: FGlobalShader(Initializer)
|
|
|
|
|
{
|
|
|
|
|
PostprocessParameter.Bind(Initializer.ParameterMap);
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void SetPS(const FRenderingCompositePassContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
const FPixelShaderRHIParamRef ShaderRHI = GetPixelShader();
|
|
|
|
|
const FPostProcessSettings& Settings = Context.View.FinalPostProcessSettings;
|
2014-06-12 07:13:34 -04:00
|
|
|
FGlobalShader::SetParameters(Context.RHICmdList, ShaderRHI, Context.View);
|
|
|
|
|
PostprocessParameter.SetPS(ShaderRHI, Context, TStaticSamplerState<SF_Point,AM_Clamp,AM_Clamp,AM_Clamp>::GetRHI());
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
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);
|
|
|
|
|
Ar << PostprocessParameter;
|
|
|
|
|
return bShaderHasOutdatedParameters;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(,FPostProcessDofNearVS_ES2,TEXT("PostProcessMobile"),TEXT("DofNearVS_ES2"),SF_Vertex);
|
|
|
|
|
|
|
|
|
|
typedef FPostProcessDofNearPS_ES2<0> FPostProcessDofNearPS_ES2_0;
|
|
|
|
|
typedef FPostProcessDofNearPS_ES2<1> FPostProcessDofNearPS_ES2_1;
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(template<>,FPostProcessDofNearPS_ES2_0,TEXT("PostProcessMobile"),TEXT("DofNearPS_ES2"),SF_Pixel);
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(template<>,FPostProcessDofNearPS_ES2_1,TEXT("PostProcessMobile"),TEXT("DofNearPS_ES2"),SF_Pixel);
|
|
|
|
|
|
|
|
|
|
template <uint32 UseSun>
|
2014-06-12 07:13:34 -04:00
|
|
|
static void DofNear_SetShader(const FRenderingCompositePassContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2014-08-28 06:22:54 -04:00
|
|
|
TShaderMapRef<FPostProcessDofNearVS_ES2> VertexShader(Context.GetShaderMap());
|
|
|
|
|
TShaderMapRef<FPostProcessDofNearPS_ES2<UseSun> > PixelShader(Context.GetShaderMap());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
static FGlobalBoundShaderState BoundShaderState;
|
2014-06-27 11:07:13 -04:00
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
|
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
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
VertexShader->SetVS(Context);
|
|
|
|
|
PixelShader->SetPS(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void FRCPassPostProcessDofNearES2::SetShader(const FRenderingCompositePassContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
const FSceneView& View = Context.View;
|
|
|
|
|
if(Context.View.bLightShaftUse)
|
|
|
|
|
{
|
2014-06-12 07:13:34 -04:00
|
|
|
DofNear_SetShader<1>(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2014-06-12 07:13:34 -04:00
|
|
|
DofNear_SetShader<0>(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FRCPassPostProcessDofNearES2::Process(FRenderingCompositePassContext& Context)
|
|
|
|
|
{
|
2014-10-20 10:43:43 -04:00
|
|
|
SCOPED_DRAW_EVENT(Context.RHICmdList, PostProcessDofNear);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2014-09-17 09:30:48 -04:00
|
|
|
const FPooledRenderTargetDesc* InputDesc = GetInputDesc(ePId_Input0);
|
|
|
|
|
FIntPoint SrcSize = InputDesc->Extent;
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
uint32 DstX = FMath::Max(1, PrePostSourceViewportSize.X/4);
|
|
|
|
|
uint32 DstY = FMath::Max(1, PrePostSourceViewportSize.Y/4);
|
|
|
|
|
|
|
|
|
|
FIntRect DstRect;
|
|
|
|
|
DstRect.Min.X = 0;
|
|
|
|
|
DstRect.Min.Y = 0;
|
|
|
|
|
DstRect.Max.X = DstX;
|
|
|
|
|
DstRect.Max.Y = DstY;
|
|
|
|
|
|
|
|
|
|
const FSceneRenderTargetItem& DestRenderTarget = PassOutputs[0].RequestSurface(Context);
|
2014-06-12 07:13:34 -04:00
|
|
|
SetRenderTarget(Context.RHICmdList, DestRenderTarget.TargetableTexture, FTextureRHIRef());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
// is optimized away if possible (RT size=view size, )
|
2014-06-12 07:13:34 -04:00
|
|
|
Context.RHICmdList.Clear(true, FLinearColor::Black, false, 1.0f, false, 0, FIntRect());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
Context.SetViewportAndCallRHI(0, 0, 0.0f, DstX, DstY, 1.0f );
|
|
|
|
|
|
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
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
SetShader(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
FIntPoint SrcDstSize = PrePostSourceViewportSize / 4;
|
2014-08-28 06:22:54 -04:00
|
|
|
TShaderMapRef<FPostProcessDofNearVS_ES2> VertexShader(Context.GetShaderMap());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
DrawRectangle(
|
2014-06-12 07:13:34 -04:00
|
|
|
Context.RHICmdList,
|
2014-03-14 14:13:41 -04:00
|
|
|
0, 0,
|
|
|
|
|
DstX, DstY,
|
|
|
|
|
0, 0,
|
|
|
|
|
DstX, DstY,
|
|
|
|
|
SrcDstSize,
|
2014-09-17 09:30:48 -04:00
|
|
|
SrcSize,
|
2014-04-23 17:26:59 -04:00
|
|
|
*VertexShader,
|
2014-03-14 14:13:41 -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
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPooledRenderTargetDesc FRCPassPostProcessDofNearES2::ComputeOutputDesc(EPassOutputId InPassOutputId) const
|
|
|
|
|
{
|
|
|
|
|
FPooledRenderTargetDesc Ret;
|
|
|
|
|
Ret.Depth = 0;
|
|
|
|
|
Ret.ArraySize = 1;
|
|
|
|
|
Ret.bIsArray = false;
|
|
|
|
|
Ret.NumMips = 1;
|
|
|
|
|
Ret.TargetableFlags = TexCreate_RenderTargetable;
|
|
|
|
|
Ret.bForceSeparateTargetAndShaderResource = false;
|
|
|
|
|
// Only need one 8-bit channel as output (but mobile hardware often doesn't support that as a render target format).
|
|
|
|
|
Ret.Format = PF_B8G8R8A8;
|
|
|
|
|
Ret.NumSamples = 1;
|
|
|
|
|
Ret.Extent.X = FMath::Max(1, PrePostSourceViewportSize.X/4);
|
|
|
|
|
Ret.Extent.Y = FMath::Max(1, PrePostSourceViewportSize.Y/4);
|
|
|
|
|
Ret.DebugName = TEXT("DofNear");
|
|
|
|
|
return Ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// DOF BLUR
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
class FPostProcessDofBlurPS_ES2 : public FGlobalShader
|
|
|
|
|
{
|
|
|
|
|
DECLARE_SHADER_TYPE(FPostProcessDofBlurPS_ES2, Global);
|
|
|
|
|
|
|
|
|
|
static bool ShouldCache(EShaderPlatform Platform)
|
|
|
|
|
{
|
|
|
|
|
return !IsConsolePlatform(Platform);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void ModifyCompilationEnvironment(EShaderPlatform Platform, FShaderCompilerEnvironment& OutEnvironment)
|
|
|
|
|
{
|
|
|
|
|
FGlobalShader::ModifyCompilationEnvironment(Platform, OutEnvironment);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPostProcessDofBlurPS_ES2() {}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
FPostProcessPassParameters PostprocessParameter;
|
|
|
|
|
|
|
|
|
|
FPostProcessDofBlurPS_ES2(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
|
|
|
|
|
: FGlobalShader(Initializer)
|
|
|
|
|
{
|
|
|
|
|
PostprocessParameter.Bind(Initializer.ParameterMap);
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void SetPS(const FRenderingCompositePassContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
const FPixelShaderRHIParamRef ShaderRHI = GetPixelShader();
|
|
|
|
|
const FPostProcessSettings& Settings = Context.View.FinalPostProcessSettings;
|
2014-06-12 07:13:34 -04:00
|
|
|
FGlobalShader::SetParameters(Context.RHICmdList, ShaderRHI, Context.View);
|
|
|
|
|
PostprocessParameter.SetPS(ShaderRHI, Context, TStaticSamplerState<SF_Bilinear,AM_Clamp,AM_Clamp,AM_Clamp>::GetRHI());
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
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);
|
|
|
|
|
Ar << PostprocessParameter;
|
|
|
|
|
return bShaderHasOutdatedParameters;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(,FPostProcessDofBlurPS_ES2,TEXT("PostProcessMobile"),TEXT("DofBlurPS_ES2"),SF_Pixel);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class FPostProcessDofBlurVS_ES2 : public FGlobalShader
|
|
|
|
|
{
|
|
|
|
|
DECLARE_SHADER_TYPE(FPostProcessDofBlurVS_ES2,Global);
|
|
|
|
|
|
|
|
|
|
static bool ShouldCache(EShaderPlatform Platform)
|
|
|
|
|
{
|
|
|
|
|
return !IsConsolePlatform(Platform);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPostProcessDofBlurVS_ES2(){}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
FPostProcessPassParameters PostprocessParameter;
|
|
|
|
|
|
|
|
|
|
FPostProcessDofBlurVS_ES2(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
|
|
|
|
|
: FGlobalShader(Initializer)
|
|
|
|
|
{
|
|
|
|
|
PostprocessParameter.Bind(Initializer.ParameterMap);
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void SetVS(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);
|
|
|
|
|
PostprocessParameter.SetVS(ShaderRHI, Context, TStaticSamplerState<SF_Point,AM_Clamp,AM_Clamp,AM_Clamp>::GetRHI());
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
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);
|
|
|
|
|
Ar << PostprocessParameter;
|
|
|
|
|
return bShaderHasOutdatedParameters;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(,FPostProcessDofBlurVS_ES2,TEXT("PostProcessMobile"),TEXT("DofBlurVS_ES2"),SF_Vertex);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void FRCPassPostProcessDofBlurES2::Process(FRenderingCompositePassContext& Context)
|
|
|
|
|
{
|
2014-10-20 10:43:43 -04:00
|
|
|
SCOPED_DRAW_EVENT(Context.RHICmdList, PostProcessDofBlur);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
uint32 DstX = FMath::Max(1, PrePostSourceViewportSize.X/2);
|
|
|
|
|
uint32 DstY = FMath::Max(1, PrePostSourceViewportSize.Y/2);
|
|
|
|
|
|
|
|
|
|
FIntRect DstRect;
|
|
|
|
|
DstRect.Min.X = 0;
|
|
|
|
|
DstRect.Min.Y = 0;
|
|
|
|
|
DstRect.Max.X = DstX;
|
|
|
|
|
DstRect.Max.Y = DstY;
|
|
|
|
|
|
|
|
|
|
const FSceneRenderTargetItem& DestRenderTarget = PassOutputs[0].RequestSurface(Context);
|
2014-06-12 07:13:34 -04:00
|
|
|
SetRenderTarget(Context.RHICmdList, DestRenderTarget.TargetableTexture, FTextureRHIRef());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
// is optimized away if possible (RT size=view size, )
|
2014-06-12 07:13:34 -04:00
|
|
|
Context.RHICmdList.Clear(true, FLinearColor::Black, false, 1.0f, false, 0, FIntRect());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
Context.SetViewportAndCallRHI(0, 0, 0.0f, DstX, DstY, 1.0f );
|
|
|
|
|
|
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
|
|
|
|
2014-08-28 06:22:54 -04:00
|
|
|
TShaderMapRef<FPostProcessDofBlurVS_ES2> VertexShader(Context.GetShaderMap());
|
|
|
|
|
TShaderMapRef<FPostProcessDofBlurPS_ES2> PixelShader(Context.GetShaderMap());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
static FGlobalBoundShaderState BoundShaderState;
|
2014-06-27 11:07:13 -04:00
|
|
|
|
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
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
VertexShader->SetVS(Context);
|
|
|
|
|
PixelShader->SetPS(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
FIntPoint SrcDstSize = PrePostSourceViewportSize / 2;
|
|
|
|
|
|
|
|
|
|
DrawRectangle(
|
2014-06-12 07:13:34 -04:00
|
|
|
Context.RHICmdList,
|
2014-03-14 14:13:41 -04:00
|
|
|
0, 0,
|
|
|
|
|
DstX, DstY,
|
|
|
|
|
0, 0,
|
|
|
|
|
DstX, DstY,
|
|
|
|
|
SrcDstSize,
|
|
|
|
|
SrcDstSize,
|
2014-04-23 17:26:59 -04:00
|
|
|
*VertexShader,
|
2014-03-14 14:13:41 -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
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPooledRenderTargetDesc FRCPassPostProcessDofBlurES2::ComputeOutputDesc(EPassOutputId InPassOutputId) const
|
|
|
|
|
{
|
|
|
|
|
FPooledRenderTargetDesc Ret;
|
|
|
|
|
Ret.Depth = 0;
|
|
|
|
|
Ret.ArraySize = 1;
|
|
|
|
|
Ret.bIsArray = false;
|
|
|
|
|
Ret.NumMips = 1;
|
|
|
|
|
Ret.TargetableFlags = TexCreate_RenderTargetable;
|
|
|
|
|
Ret.bForceSeparateTargetAndShaderResource = false;
|
2015-07-15 06:39:44 -04:00
|
|
|
Ret.Format = GetHDRPixelFormat();
|
2014-03-14 14:13:41 -04:00
|
|
|
Ret.NumSamples = 1;
|
|
|
|
|
Ret.Extent.X = FMath::Max(1, PrePostSourceViewportSize.X/2);
|
|
|
|
|
Ret.Extent.Y = FMath::Max(1, PrePostSourceViewportSize.Y/2);
|
|
|
|
|
Ret.DebugName = TEXT("DofBlur");
|
|
|
|
|
return Ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// SUN AVG
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
class FPostProcessSunAvgPS_ES2 : public FGlobalShader
|
|
|
|
|
{
|
|
|
|
|
DECLARE_SHADER_TYPE(FPostProcessSunAvgPS_ES2, Global);
|
|
|
|
|
|
|
|
|
|
static bool ShouldCache(EShaderPlatform Platform)
|
|
|
|
|
{
|
|
|
|
|
return !IsConsolePlatform(Platform);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void ModifyCompilationEnvironment(EShaderPlatform Platform, FShaderCompilerEnvironment& OutEnvironment)
|
|
|
|
|
{
|
|
|
|
|
FGlobalShader::ModifyCompilationEnvironment(Platform, OutEnvironment);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPostProcessSunAvgPS_ES2() {}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
FPostProcessPassParameters PostprocessParameter;
|
|
|
|
|
|
|
|
|
|
FPostProcessSunAvgPS_ES2(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
|
|
|
|
|
: FGlobalShader(Initializer)
|
|
|
|
|
{
|
|
|
|
|
PostprocessParameter.Bind(Initializer.ParameterMap);
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void SetPS(const FRenderingCompositePassContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
const FPixelShaderRHIParamRef ShaderRHI = GetPixelShader();
|
|
|
|
|
const FPostProcessSettings& Settings = Context.View.FinalPostProcessSettings;
|
2014-06-12 07:13:34 -04:00
|
|
|
FGlobalShader::SetParameters(Context.RHICmdList, ShaderRHI, Context.View);
|
|
|
|
|
PostprocessParameter.SetPS(ShaderRHI, Context, TStaticSamplerState<SF_Bilinear,AM_Clamp,AM_Clamp,AM_Clamp>::GetRHI());
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
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);
|
|
|
|
|
Ar << PostprocessParameter;
|
|
|
|
|
return bShaderHasOutdatedParameters;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(,FPostProcessSunAvgPS_ES2,TEXT("PostProcessMobile"),TEXT("SunAvgPS_ES2"),SF_Pixel);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class FPostProcessSunAvgVS_ES2 : public FGlobalShader
|
|
|
|
|
{
|
|
|
|
|
DECLARE_SHADER_TYPE(FPostProcessSunAvgVS_ES2,Global);
|
|
|
|
|
|
|
|
|
|
static bool ShouldCache(EShaderPlatform Platform)
|
|
|
|
|
{
|
|
|
|
|
return !IsConsolePlatform(Platform);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPostProcessSunAvgVS_ES2(){}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
FPostProcessPassParameters PostprocessParameter;
|
|
|
|
|
|
|
|
|
|
FPostProcessSunAvgVS_ES2(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
|
|
|
|
|
: FGlobalShader(Initializer)
|
|
|
|
|
{
|
|
|
|
|
PostprocessParameter.Bind(Initializer.ParameterMap);
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void SetVS(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);
|
|
|
|
|
PostprocessParameter.SetVS(ShaderRHI, Context, TStaticSamplerState<SF_Bilinear,AM_Clamp,AM_Clamp,AM_Clamp>::GetRHI());
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
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);
|
|
|
|
|
Ar << PostprocessParameter;
|
|
|
|
|
return bShaderHasOutdatedParameters;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(,FPostProcessSunAvgVS_ES2,TEXT("PostProcessMobile"),TEXT("SunAvgVS_ES2"),SF_Vertex);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
static void SunAvg_SetShader(const FRenderingCompositePassContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2014-08-28 06:22:54 -04:00
|
|
|
TShaderMapRef<FPostProcessSunAvgVS_ES2> VertexShader(Context.GetShaderMap());
|
|
|
|
|
TShaderMapRef<FPostProcessSunAvgPS_ES2> PixelShader(Context.GetShaderMap());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
static FGlobalBoundShaderState BoundShaderState;
|
2014-06-27 11:07:13 -04:00
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
|
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
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
VertexShader->SetVS(Context);
|
|
|
|
|
PixelShader->SetPS(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void FRCPassPostProcessSunAvgES2::SetShader(const FRenderingCompositePassContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2014-06-12 07:13:34 -04:00
|
|
|
SunAvg_SetShader(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FRCPassPostProcessSunAvgES2::Process(FRenderingCompositePassContext& Context)
|
|
|
|
|
{
|
2014-10-20 10:43:43 -04:00
|
|
|
SCOPED_DRAW_EVENT(Context.RHICmdList, PostProcessSunAvg);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
uint32 DstX = FMath::Max(1, PrePostSourceViewportSize.X/4);
|
|
|
|
|
uint32 DstY = FMath::Max(1, PrePostSourceViewportSize.Y/4);
|
|
|
|
|
|
|
|
|
|
FIntRect DstRect;
|
|
|
|
|
DstRect.Min.X = 0;
|
|
|
|
|
DstRect.Min.Y = 0;
|
|
|
|
|
DstRect.Max.X = DstX;
|
|
|
|
|
DstRect.Max.Y = DstY;
|
|
|
|
|
|
|
|
|
|
const FSceneRenderTargetItem& DestRenderTarget = PassOutputs[0].RequestSurface(Context);
|
2014-06-12 07:13:34 -04:00
|
|
|
SetRenderTarget(Context.RHICmdList, DestRenderTarget.TargetableTexture, FTextureRHIRef());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
// is optimized away if possible (RT size=view size, )
|
2014-06-12 07:13:34 -04:00
|
|
|
Context.RHICmdList.Clear(true, FLinearColor::Black, false, 1.0f, false, 0, FIntRect());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
Context.SetViewportAndCallRHI(0, 0, 0.0f, DstX, DstY, 1.0f );
|
|
|
|
|
|
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
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
SetShader(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
FIntPoint SrcDstSize = PrePostSourceViewportSize / 4;
|
2014-08-28 06:22:54 -04:00
|
|
|
TShaderMapRef<FPostProcessSunAvgVS_ES2> VertexShader(Context.GetShaderMap());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
DrawRectangle(
|
2014-06-12 07:13:34 -04:00
|
|
|
Context.RHICmdList,
|
2014-03-14 14:13:41 -04:00
|
|
|
0, 0,
|
|
|
|
|
DstX, DstY,
|
|
|
|
|
0, 0,
|
|
|
|
|
DstX, DstY,
|
|
|
|
|
SrcDstSize,
|
|
|
|
|
SrcDstSize,
|
2014-04-23 17:26:59 -04:00
|
|
|
*VertexShader,
|
2014-03-14 14:13:41 -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
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPooledRenderTargetDesc FRCPassPostProcessSunAvgES2::ComputeOutputDesc(EPassOutputId InPassOutputId) const
|
|
|
|
|
{
|
|
|
|
|
FPooledRenderTargetDesc Ret;
|
|
|
|
|
Ret.Depth = 0;
|
|
|
|
|
Ret.ArraySize = 1;
|
|
|
|
|
Ret.bIsArray = false;
|
|
|
|
|
Ret.NumMips = 1;
|
|
|
|
|
Ret.TargetableFlags = TexCreate_RenderTargetable;
|
|
|
|
|
Ret.bForceSeparateTargetAndShaderResource = false;
|
2015-07-15 06:39:44 -04:00
|
|
|
Ret.Format = GetHDRPixelFormat();
|
2014-03-14 14:13:41 -04:00
|
|
|
Ret.NumSamples = 1;
|
|
|
|
|
Ret.Extent.X = FMath::Max(1, PrePostSourceViewportSize.X/4);
|
|
|
|
|
Ret.Extent.Y = FMath::Max(1, PrePostSourceViewportSize.Y/4);
|
|
|
|
|
Ret.DebugName = TEXT("SunAvg");
|
|
|
|
|
return Ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// MOBILE AA
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
class FPostProcessAaPS_ES2 : public FGlobalShader
|
|
|
|
|
{
|
|
|
|
|
DECLARE_SHADER_TYPE(FPostProcessAaPS_ES2, Global);
|
|
|
|
|
|
|
|
|
|
static bool ShouldCache(EShaderPlatform Platform)
|
|
|
|
|
{
|
|
|
|
|
return !IsConsolePlatform(Platform);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void ModifyCompilationEnvironment(EShaderPlatform Platform, FShaderCompilerEnvironment& OutEnvironment)
|
|
|
|
|
{
|
|
|
|
|
FGlobalShader::ModifyCompilationEnvironment(Platform, OutEnvironment);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPostProcessAaPS_ES2() {}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
FPostProcessPassParameters PostprocessParameter;
|
|
|
|
|
FShaderParameter AaBlendAmount;
|
|
|
|
|
|
|
|
|
|
FPostProcessAaPS_ES2(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
|
|
|
|
|
: FGlobalShader(Initializer)
|
|
|
|
|
{
|
|
|
|
|
PostprocessParameter.Bind(Initializer.ParameterMap);
|
|
|
|
|
AaBlendAmount.Bind(Initializer.ParameterMap, TEXT("AaBlendAmount"));
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void SetPS(const FRenderingCompositePassContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
const FPixelShaderRHIParamRef ShaderRHI = GetPixelShader();
|
|
|
|
|
const FPostProcessSettings& Settings = Context.View.FinalPostProcessSettings;
|
2014-06-12 07:13:34 -04:00
|
|
|
FGlobalShader::SetParameters(Context.RHICmdList, ShaderRHI, Context.View);
|
|
|
|
|
PostprocessParameter.SetPS(ShaderRHI, Context, TStaticSamplerState<SF_Bilinear,AM_Clamp,AM_Clamp,AM_Clamp>::GetRHI());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
// Compute the blend factor which decides the trade off between ghosting in motion and flicker when not moving.
|
|
|
|
|
// This works by computing the screen space motion vector of distant point at the center of the screen.
|
|
|
|
|
// This factor will effectively provide an idea of the amount of camera rotation.
|
|
|
|
|
// Higher camera rotation = less blend factor (0.0).
|
|
|
|
|
// Lower or no camera rotation = high blend factor (0.25).
|
|
|
|
|
FSceneViewState* ViewState = (FSceneViewState*)Context.View.State;
|
|
|
|
|
if(ViewState)
|
|
|
|
|
{
|
2015-04-28 15:27:19 -04:00
|
|
|
const FViewInfo& View = Context.View;
|
|
|
|
|
|
2015-06-15 20:55:07 -04:00
|
|
|
FMatrix Proj = View.ViewMatrices.GetProjNoAAMatrix();
|
|
|
|
|
FMatrix PrevProj = ViewState->PrevViewMatrices.GetProjNoAAMatrix();
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
FMatrix ViewProj = ( Context.View.ViewMatrices.ViewMatrix * Proj ).GetTransposed();
|
|
|
|
|
FMatrix PrevViewProj = ( ViewState->PrevViewMatrices.ViewMatrix * PrevProj ).GetTransposed();
|
|
|
|
|
|
|
|
|
|
double InvViewProj[16];
|
|
|
|
|
Inverse4x4( InvViewProj, (float*)ViewProj.M );
|
|
|
|
|
|
|
|
|
|
const float* p = (float*)PrevViewProj.M;
|
|
|
|
|
|
|
|
|
|
const double cxx = InvViewProj[ 0]; const double cxy = InvViewProj[ 1]; const double cxz = InvViewProj[ 2]; const double cxw = InvViewProj[ 3];
|
|
|
|
|
const double cyx = InvViewProj[ 4]; const double cyy = InvViewProj[ 5]; const double cyz = InvViewProj[ 6]; const double cyw = InvViewProj[ 7];
|
|
|
|
|
const double czx = InvViewProj[ 8]; const double czy = InvViewProj[ 9]; const double czz = InvViewProj[10]; const double czw = InvViewProj[11];
|
|
|
|
|
const double cwx = InvViewProj[12]; const double cwy = InvViewProj[13]; const double cwz = InvViewProj[14]; const double cww = InvViewProj[15];
|
|
|
|
|
|
|
|
|
|
const double pxx = (double)(p[ 0]); const double pxy = (double)(p[ 1]); const double pxz = (double)(p[ 2]); const double pxw = (double)(p[ 3]);
|
|
|
|
|
const double pyx = (double)(p[ 4]); const double pyy = (double)(p[ 5]); const double pyz = (double)(p[ 6]); const double pyw = (double)(p[ 7]);
|
|
|
|
|
const double pwx = (double)(p[12]); const double pwy = (double)(p[13]); const double pwz = (double)(p[14]); const double pww = (double)(p[15]);
|
|
|
|
|
|
|
|
|
|
float CameraMotion0W = (float)(2.0*(cww*pww - cwx*pww + cwy*pww + (cxw - cxx + cxy)*pwx + (cyw - cyx + cyy)*pwy + (czw - czx + czy)*pwz));
|
|
|
|
|
float CameraMotion2Z = (float)(cwy*pww + cwy*pxw + cww*(pww + pxw) - cwx*(pww + pxw) + (cxw - cxx + cxy)*(pwx + pxx) + (cyw - cyx + cyy)*(pwy + pxy) + (czw - czx + czy)*(pwz + pxz));
|
|
|
|
|
float CameraMotion4Z = (float)(cwy*pww + cww*(pww - pyw) - cwy*pyw + cwx*((-pww) + pyw) + (cxw - cxx + cxy)*(pwx - pyx) + (cyw - cyx + cyy)*(pwy - pyy) + (czw - czx + czy)*(pwz - pyz));
|
|
|
|
|
|
|
|
|
|
// Depth surface 0=far, 1=near.
|
|
|
|
|
// This is simplified to compute camera motion with depth = 0.0 (infinitely far away).
|
|
|
|
|
// Camera motion for pixel (in ScreenPos space).
|
|
|
|
|
float ScaleM = 1.0f / CameraMotion0W;
|
|
|
|
|
// Back projection value (projected screen space).
|
|
|
|
|
float BackX = CameraMotion2Z * ScaleM;
|
|
|
|
|
float BackY = CameraMotion4Z * ScaleM;
|
|
|
|
|
|
|
|
|
|
// Start with the distance in screen space.
|
|
|
|
|
float BlendAmount = BackX * BackX + BackY * BackY;
|
|
|
|
|
if(BlendAmount > 0.0f)
|
|
|
|
|
{
|
|
|
|
|
BlendAmount = sqrt(BlendAmount);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Higher numbers truncate anti-aliasing and ghosting faster.
|
|
|
|
|
float BlendEffect = 8.0f;
|
|
|
|
|
BlendAmount = 0.25f - BlendAmount * BlendEffect;
|
|
|
|
|
if(BlendAmount < 0.0f)
|
|
|
|
|
{
|
|
|
|
|
BlendAmount = 0.0f;
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
SetShaderValue(Context.RHICmdList, ShaderRHI, AaBlendAmount, BlendAmount);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
float BlendAmount = 0.0;
|
2014-06-12 07:13:34 -04:00
|
|
|
SetShaderValue(Context.RHICmdList, ShaderRHI, AaBlendAmount, BlendAmount);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
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);
|
|
|
|
|
Ar << PostprocessParameter << AaBlendAmount;
|
|
|
|
|
return bShaderHasOutdatedParameters;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(,FPostProcessAaPS_ES2,TEXT("PostProcessMobile"),TEXT("AaPS_ES2"),SF_Pixel);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class FPostProcessAaVS_ES2 : public FGlobalShader
|
|
|
|
|
{
|
|
|
|
|
DECLARE_SHADER_TYPE(FPostProcessAaVS_ES2,Global);
|
|
|
|
|
|
|
|
|
|
static bool ShouldCache(EShaderPlatform Platform)
|
|
|
|
|
{
|
|
|
|
|
return !IsConsolePlatform(Platform);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPostProcessAaVS_ES2(){}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
FPostProcessPassParameters PostprocessParameter;
|
|
|
|
|
|
|
|
|
|
FPostProcessAaVS_ES2(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
|
|
|
|
|
: FGlobalShader(Initializer)
|
|
|
|
|
{
|
|
|
|
|
PostprocessParameter.Bind(Initializer.ParameterMap);
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void SetVS(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);
|
|
|
|
|
PostprocessParameter.SetVS(ShaderRHI, Context, TStaticSamplerState<SF_Bilinear,AM_Clamp,AM_Clamp,AM_Clamp>::GetRHI());
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
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);
|
|
|
|
|
Ar << PostprocessParameter;
|
|
|
|
|
return bShaderHasOutdatedParameters;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_SHADER_TYPE(,FPostProcessAaVS_ES2,TEXT("PostProcessMobile"),TEXT("AaVS_ES2"),SF_Vertex);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
static void Aa_SetShader(const FRenderingCompositePassContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2014-08-28 06:22:54 -04:00
|
|
|
TShaderMapRef<FPostProcessAaVS_ES2> VertexShader(Context.GetShaderMap());
|
|
|
|
|
TShaderMapRef<FPostProcessAaPS_ES2> PixelShader(Context.GetShaderMap());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
static FGlobalBoundShaderState BoundShaderState;
|
2014-06-27 11:07:13 -04:00
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
|
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
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
VertexShader->SetVS(Context);
|
|
|
|
|
PixelShader->SetPS(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
void FRCPassPostProcessAaES2::SetShader(const FRenderingCompositePassContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2014-06-12 07:13:34 -04:00
|
|
|
Aa_SetShader(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FRCPassPostProcessAaES2::Process(FRenderingCompositePassContext& Context)
|
|
|
|
|
{
|
2014-10-20 10:43:43 -04:00
|
|
|
SCOPED_DRAW_EVENT(Context.RHICmdList, PostProcessAa);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2014-09-17 09:30:48 -04:00
|
|
|
const FPooledRenderTargetDesc* InputDesc = GetInputDesc(ePId_Input0);
|
2014-03-14 14:13:41 -04:00
|
|
|
const FSceneRenderTargetItem& DestRenderTarget = PassOutputs[0].RequestSurface(Context);
|
2014-11-27 10:36:38 -05:00
|
|
|
const FPooledRenderTargetDesc& OutputDesc = PassOutputs[0].RenderTargetDesc;
|
|
|
|
|
|
|
|
|
|
const FIntPoint& SrcSize = InputDesc->Extent;
|
|
|
|
|
const FIntPoint& DestSize = OutputDesc.Extent;
|
|
|
|
|
|
|
|
|
|
check(SrcSize == DestSize);
|
|
|
|
|
|
2016-03-16 21:16:51 -04:00
|
|
|
SetRenderTarget(Context.RHICmdList, DestRenderTarget.TargetableTexture, FTextureRHIRef(), ESimpleRenderTargetMode::EClearColorAndDepth);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
// is optimized away if possible (RT size=view size, )
|
2014-06-12 07:13:34 -04:00
|
|
|
Context.RHICmdList.Clear(true, FLinearColor::Black, false, 1.0f, false, 0, FIntRect());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2014-11-27 10:36:38 -05:00
|
|
|
Context.SetViewportAndCallRHI(0, 0, 0.0f, DestSize.X, DestSize.Y, 1.0f);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
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
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
SetShader(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2014-12-08 09:45:54 -05:00
|
|
|
const FIntRect& ViewRect = Context.View.UnscaledViewRect; // Simple upscaling, ES2 post process does not currently have a specific upscaling pass.
|
2014-11-27 10:36:38 -05:00
|
|
|
float XPos = ViewRect.Min.X;
|
|
|
|
|
float YPos = ViewRect.Min.Y;
|
|
|
|
|
float Width = ViewRect.Width();
|
|
|
|
|
float Height = ViewRect.Height();
|
|
|
|
|
|
2014-08-28 06:22:54 -04:00
|
|
|
TShaderMapRef<FPostProcessAaVS_ES2> VertexShader(Context.GetShaderMap());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
DrawRectangle(
|
2014-06-12 07:13:34 -04:00
|
|
|
Context.RHICmdList,
|
2014-11-27 10:36:38 -05:00
|
|
|
XPos, YPos,
|
|
|
|
|
Width, Height,
|
|
|
|
|
XPos, YPos,
|
|
|
|
|
Width, Height,
|
|
|
|
|
DestSize,
|
2014-09-17 09:30:48 -04:00
|
|
|
SrcSize,
|
2014-04-23 17:26:59 -04:00
|
|
|
*VertexShader,
|
2014-03-14 14:13:41 -04:00
|
|
|
EDRF_UseTriangleOptimization);
|
|
|
|
|
|
2014-06-12 07:13:34 -04:00
|
|
|
Context.RHICmdList.CopyToResolveTarget(DestRenderTarget.TargetableTexture, DestRenderTarget.ShaderResourceTexture, false, FResolveParams());
|
2015-01-21 11:48:05 -05:00
|
|
|
|
2016-01-28 16:03:26 -05:00
|
|
|
if (FSceneRenderer::ShouldCompositeEditorPrimitives(Context.View))
|
2015-01-21 11:48:05 -05:00
|
|
|
{
|
2016-01-28 16:03:26 -05:00
|
|
|
FRHICommandListExecutor::GetImmediateCommandList().ImmediateFlush(EImmediateFlushType::WaitForOutstandingTasksOnly);
|
|
|
|
|
// because of the flush it's ok to remove the const, this is not ideal as the flush can cost performance
|
|
|
|
|
FViewInfo& NonConstView = (FViewInfo&)Context.View;
|
|
|
|
|
|
2015-01-21 11:48:05 -05:00
|
|
|
// Remove jitter (ensures editor prims are stable.)
|
2016-01-28 16:03:26 -05:00
|
|
|
NonConstView.ViewMatrices.RemoveTemporalJitter();
|
2015-01-21 11:48:05 -05:00
|
|
|
|
|
|
|
|
// Compute the view projection matrix and its inverse.
|
2016-01-28 16:03:26 -05:00
|
|
|
NonConstView.ViewProjectionMatrix = NonConstView.ViewMatrices.ViewMatrix * NonConstView.ViewMatrices.ProjMatrix;
|
|
|
|
|
NonConstView.InvViewProjectionMatrix = NonConstView.ViewMatrices.GetInvProjMatrix() * NonConstView.InvViewMatrix;
|
2015-01-21 11:48:05 -05:00
|
|
|
|
|
|
|
|
/** The view transform, starting from world-space points translated by -ViewOrigin. */
|
2016-01-28 16:03:26 -05:00
|
|
|
FMatrix TranslatedViewMatrix = FTranslationMatrix(-NonConstView.ViewMatrices.PreViewTranslation) * NonConstView.ViewMatrices.ViewMatrix;
|
2015-01-21 11:48:05 -05:00
|
|
|
|
|
|
|
|
// Compute a transform from view origin centered world-space to clip space.
|
2016-01-28 16:03:26 -05:00
|
|
|
NonConstView.ViewMatrices.TranslatedViewProjectionMatrix = TranslatedViewMatrix * NonConstView.ViewMatrices.ProjMatrix;
|
|
|
|
|
NonConstView.ViewMatrices.InvTranslatedViewProjectionMatrix = NonConstView.ViewMatrices.TranslatedViewProjectionMatrix.Inverse();
|
2015-01-21 11:48:05 -05:00
|
|
|
|
Copying //UE4/Dev-Mobile to //UE4/Dev-Main (Source: //UE4/Dev-Mobile @ 3056055)
#lockdown Nick.Penwarden
#rb None
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3011102 on 2016/06/13 by Steve.Cano
After taking a screenshot using glReadPixels, transfer the data to the target buffer from bottom row up to fix the "upside-down" render that OpenGL does. Confirmed with QA (owen.stupka_volt) that this does not appear to be happening on iOS (non-metal devices, inclusion of iOS in write-up was a mistake), verified on an ipod touch 5. Also confirmed that this does not happen on html5, and that Mobile HDR flag does not make a difference in function.
#jira UE-26421
#ue4
#android
Change 3015801 on 2016/06/16 by Dmitriy.Dyomin
Probbably fix for UE-30878, was not able to repro an actual crash(FFoliageInstanceBaseCache::AddInstanceBaseId). Added even more logging in case fix does not work.
#jira UE-30878
Change 3015903 on 2016/06/16 by Dmitriy.Dyomin
Fixed: Levels window has Refresh/UI issues when World Composition is active
#jira UE-26160
Change 3018352 on 2016/06/17 by Chris.Babcock
Handle Android media prepare failure (URL without internet for example)
#jira UE-32029
#ue4
#android
Change 3026387 on 2016/06/24 by Jack.Porter
Remove FFuncTestManager warning about PIE when running on a standalone game binary
Change 3026398 on 2016/06/24 by Jack.Porter
Prevent FSocketBSD::Recv returning false on SE_EWOULDBLOCK
Change 3027553 on 2016/06/25 by Niklas.Smedberg
OpenGL: Made some block size calculation work for arbitrary block sizes (e.g. not pow-of-two).
Change 3027554 on 2016/06/25 by Niklas.Smedberg
Metal: copyFromTexture now gets block-aligned size parameter (e.g. used for texture streaming)
Change 3028061 on 2016/06/26 by Jack.Porter
Fixed a problem where newly discovered instances were not added to an existing session in the Session Browser.
Fixed a problem where selecting an instance in a session with multiple instances didn't deselect the previously selected instance correctly.
Change 3029220 on 2016/06/27 by Steve.Cano
Change Android Tilt values to use GetRotationMatrix/GetOrientation logic, same as java-side android would use, and adjust slightly to match as closely as possible to iOS values for tilt. There is drift and some differences in the "Y" value but the same sort of inconsistencies are also seen on iOS.
#jira UE-6135
#ue4
#android
Change 3030420 on 2016/06/28 by Jack.Porter
Fix crash with RenderOutputValidation when running with cooked content
Change 3030426 on 2016/06/28 by Jack.Porter
Fix to CL 3026398 - make FSocketBSD(IPv6)::Recv(From) return false when recv returns 0.
A return value of 0 indicates the connection was shutdown in an orderly manner.
Change 3030973 on 2016/06/28 by Steve.Cano
Added a landscape downloader background along with the options to change it from within Android settings
#ue4
#android
#jira UE-32318
Change 3031757 on 2016/06/28 by Chris.Babcock
Remove unused methods from AndroidJNI header
#ue4
#android
Change 3032387 on 2016/06/29 by Allan.Bentham
Rename android es31+aep -> glesdeferred.
Change 3032711 on 2016/06/29 by Allan.Bentham
Rename GLSL_310_ES_EXT shader define:
ES31_AEP_PROFILE -> ESDEFERRED_PROFILE
bumped UE_SHADER_GLSL_310_ES_EXT_VER version number.
Change 3033698 on 2016/06/29 by Jack.Porter
Merging //UE4/Dev-Main to Dev-Mobile (//UE4/Dev-Mobile)
Change 3034210 on 2016/06/30 by Steve.Cano
Added a new AndroidRuntimeSettings variable that allows creation of installers for both Windows and Mac/Linux if set to true.
#jira UE-32302
#ue4
#android
Change 3034530 on 2016/06/30 by Chris.Babcock
Rename FManifestReader to FAndroidFileManifestReader in AndroidFile
#jira UE-32679
#ue4
#android
Change 3034612 on 2016/06/30 by Steve.Cano
Change Alpha from being set to a range of 0-255 to being in a range of 0-1 (which is the correct range of values)
#jira UE-25325
#ue4
#android
Change 3034679 on 2016/06/30 by Chris.Babcock
Fix tooltip (.command for mac, not .sh)
#jira UE-32302
#ue4
#android
Change 3038881 on 2016/07/05 by Jack.Porter
Package and launch on multiple Android devices simultaneously using the -Device=xxxxxxx+yyyyyyyy+zzzzzzzz format generated by a Project Launcher profile when you select multiple devices
#jira UEMOB-115
Change 3039240 on 2016/07/06 by Jack.Porter
TcpMessageTransport - connection-based message bus transport.
#jira UEMOB-112
#jira UEMOB-113
Change 3039252 on 2016/07/06 by Jack.Porter
Enable messaging and session services and functional testing on Android when launched with -messaging
Android device detection module support for adding port forwarding and connection announcement for TcpMessageTransport
#jira UEMOB-112
#jira UEMOB-113
Change 3039264 on 2016/07/06 by Jack.Porter
Merging //UE4/Dev-Main to Dev-Mobile (//UE4/Dev-Mobile)
Change 3040041 on 2016/07/06 by Chris.Babcock
Pass proper value to script generator functions
#jira UE-32861
#ue4
#android
Change 3040890 on 2016/07/07 by Allan.Bentham
Fix shadow crash
#jira UE-32884
Change 3041458 on 2016/07/07 by Peter.Sauerbrei
fix for IOS launch on failures
Change 3041542 on 2016/07/07 by Peter.Sauerbrei
better fix for the multi-device deployment issue
Change 3041774 on 2016/07/07 by Steve.Cano
Fixing crash that occurs when a games app id for Google Play is set before configuring the apk packaging. Also validating the value that is inserted and using it to override any values that have been hand-inserted into the GooglePlayAppID.xml
#jira UE-16992
#android
#ue4
Change 3042222 on 2016/07/08 by Dmitriy.Dyomin
Mobile packaging scenarious
Added a wizard for creating launcher profiles (Android & IOS) for scenario: Minimal App + Downloadable content
Added Archive step to launcher profiles to be able to store build product into specified directory
Changes to a cooker to be able to pack DLC based with a different flavor to a release App
Changes to DLC packaging to be able to build streaming data without chunking pak files
#jira UEMOB-119
Change 3042244 on 2016/07/08 by Dmitriy.Dyomin
Fixed crash in FTcpMessageTransportConnection::Stop
Change 3042270 on 2016/07/08 by Dmitriy.Dyomin
GitHub #2320 : [ULevelStreamingKismet] Load Level Instance, Enables UE4 Users to create multiple transformed instances of a .umap without having to include in persistent level's list ? Rama
contributed by: EverNewJoy
#jira UE-29867
Change 3042449 on 2016/07/08 by Dmitriy.Dyomin
Fixing Mac Editor build erros from CL# 3042222
Change 3042480 on 2016/07/08 by Allan.Bentham
Add ES3.1 profile & compiler_glsl_es3_1 to shaders.
Change 3042481 on 2016/07/08 by Allan.Bentham
hlslcc - ES3.1 changes.
set ES3.1 version number to 310
Do not use ES2 keywords for ES3.1.
Generate Layout Locations for ES3.1
bump version.
Change 3042483 on 2016/07/08 by Allan.Bentham
Add mobile ES3.1 support.
Recreates EGL and ES3.1 context during PlatformInitOpenGL if ES3.1 is required.
Change 3042485 on 2016/07/08 by Allan.Bentham
Undo android XGE change.
Change 3042506 on 2016/07/08 by Dmitriy.Dyomin
One more compile fix from CL# 3042222
Change 3044173 on 2016/07/10 by Dmitriy.Dyomin
UAT: Added support for building target platforms with multiple cook flavors
ex: -targetplatform=Android -cookflavor=ETC1+ETC2
Change 3044213 on 2016/07/11 by Dmitriy.Dyomin
Fixed: Can't stream in a level whose name is a substring of another streaming level
#jira UE-32999
Change 3044221 on 2016/07/11 by Jack.Porter
Merging //UE4/Dev-Main to Dev-Mobile (//UE4/Dev-Mobile)
Change 3044815 on 2016/07/11 by Allan.Bentham
Corrected NAME_GLSL_ES3_1_ANDROID format string.
Change 3046911 on 2016/07/12 by Chris.Babcock
Add handling of OnTextChanged for virtual keyboard input on Android
#jira UE-32348
#ue4
#android
Change 3046958 on 2016/07/12 by Chris.Babcock
Rename some functions with Error in the name to prevent false coloring in the logs
#jira UE-30541
#ue4
#android
Change 3047169 on 2016/07/12 by Chris.Babcock
Return player ID and handle auth token for Google Play Games on Android (contributed by gameDNAstudio)
#jira UE-30610
#pr #2372
#ue4
#android
Change 3047406 on 2016/07/12 by Jack.Porter
Add missing import to GameActivity.java
Change 3047442 on 2016/07/13 by Dmitriy.Dyomin
Added: Mobile custom post-process
Limitations: can fetch only from PostProcessInput0 (SceneColor) other scene textures are not supported. Does not support "Replacing the Tonemapper" blendable location.
#jira UEMOB-147
Change 3047466 on 2016/07/13 by Dmitriy.Dyomin
Disabled engine crash handler on Android, system crash handler works more reliably across different os versions/devices
Change 3047746 on 2016/07/13 by Jack.Porter
Rename FBasePassFowardDynamicPointLightInfo
Change 3047778 on 2016/07/13 by Jack.Porter
Missing file for rename FBasePassFowardDynamicPointLightInfo
Change 3047788 on 2016/07/13 by Allan.Bentham
Fix incorrect TargetPlatformDescriptor string generation.
Change 3047790 on 2016/07/13 by Allan.Bentham
Fixed half3x3 matrix use with ES3.1 glsl
Fixed couple of interpolator precision mismatch.
Fixed ES3.1 support detection issues
Change 3047816 on 2016/07/13 by Allan.Bentham
Remove AndroidGL4 remnants.
Change 3048926 on 2016/07/13 by Chris.Babcock
Added detection of Amazon Fire TV to disable requiring virtual joysticks
#ue4
#android
Change 3049335 on 2016/07/14 by Dmitriy.Dyomin
Fixing UAT crash when packaging project for iOS
Change 3049390 on 2016/07/14 by Jack.Porter
Disabled error for warning 4819 "The file contains a character that cannot be represented in the current code page (xxx). Save the file in Unicode format to prevent data loss"
This is triggered by European characters and copyright symbols in source saved as latin-1 when compiling on non-US windows. Seen often in 3rd party headers, eg nvapi.
#code_review: Ben.Marsh
Change 3049391 on 2016/07/14 by Jack.Porter
Fixed incorrect comment order in CL 3049390
Change 3049545 on 2016/07/14 by Dmitriy.Dyomin
Reworking some code from CL#3047442 to make static analizer happy
Change 3049626 on 2016/07/14 by Allan.Bentham
Automatic CSM shader toggling
#jira UE-27429
Change 3051574 on 2016/07/15 by Jack.Porter
Support for lighting channels on Mobile
- Multiple directional lights are supported in different channels but primitives are only affected by the directional light in the first channel they have set
- CSM shadows from stationary or movable directional lights correctly follow their lighting channels
- No channel limitations for dynamic point lights
Notes:
Removed mobile-specific directional light shadowing fields from View uniform buffer and mobile no longers uses SimpleDirectionalLight.
Separate uniform buffers for mobile directional light are generated for each lighting channel.
CSM culling information is now stored in FViewInfo and not per FVisibleLightViewInfo as the visibility bits are per view.
#code_review Daniel.Wright
#jira UEMOB-110
Change 3051699 on 2016/07/15 by Steve.Cano
Preserve the original, pre-transformed input vertices for Slate shaders, which is required to properly do anti-aliasing (the ViewProjection-transformed values were causing the lines to not be drawn).
#jira UE-20320
#ue4
#android
Change 3051744 on 2016/07/15 by Chris.Babcock
Fix Android Vulkan include path checks (contributed by kodomastro)
#jira UE-33311
#PR #2602
#ue4
#android
Change 3052023 on 2016/07/15 by Chris.Babcock
Fix shadowed variables
Change 3052110 on 2016/07/15 by Chris.Babcock
Compile fixes for light channel support on mobile
- missing template
- accessor function for MobileDirectionalLights from scene
Change 3052242 on 2016/07/15 by Chris.Babcock
Compile fixes for light channel support on mobile
- removed dependency on C++14 feature
Change 3052730 on 2016/07/16 by Dmitriy.Dyomin
Win32 build fix
Change 3053041 on 2016/07/17 by Jack.Porter
Merging //UE4/Dev-Main to Dev-Mobile (//UE4/Dev-Mobile)
Change 3053054 on 2016/07/17 by Jack.Porter
Changed use of old function ShouldUseDeferredRenderer() to new GetShadingPath()
Change 3053055 on 2016/07/17 by Jack.Porter
Fixed local variable aliasing in unity build
Change 3053206 on 2016/07/18 by Jack.Porter
Support ExecuteJavascript on iOS and Android
Expose ExecuteJavascript to widget blueprint
Fix ExecuteJavascript unicode string support on desktop platforms
#jira UEMOB-152
Change 3053323 on 2016/07/18 by Dmitriy.Dyomin
Added: Ability to set thread affinity for a device in Device Profiles (ex: +CVars=android.SetThreadAffinity=RT 0x02 GT 0x01)
#jira UEMOB-107
Change 3053723 on 2016/07/18 by Jack.Porter
Fix for UnrealTournamentProto.Automation.cs build errors
Change 3055090 on 2016/07/19 by Dmitriy.Dyomin
Junk OnlineBlueprintSupport module binaries
[CL 3056789 by Jack Porter in Main branch]
2016-07-19 19:13:01 -04:00
|
|
|
NonConstView.InitRHIResources();
|
2015-01-21 11:48:05 -05:00
|
|
|
}
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPooledRenderTargetDesc FRCPassPostProcessAaES2::ComputeOutputDesc(EPassOutputId InPassOutputId) const
|
|
|
|
|
{
|
|
|
|
|
FPooledRenderTargetDesc Ret;
|
|
|
|
|
Ret.Depth = 0;
|
|
|
|
|
Ret.ArraySize = 1;
|
|
|
|
|
Ret.bIsArray = false;
|
|
|
|
|
Ret.NumMips = 1;
|
|
|
|
|
Ret.TargetableFlags = TexCreate_RenderTargetable;
|
|
|
|
|
Ret.bForceSeparateTargetAndShaderResource = false;
|
|
|
|
|
Ret.Format = PF_B8G8R8A8;
|
|
|
|
|
Ret.NumSamples = 1;
|
|
|
|
|
Ret.DebugName = TEXT("Aa");
|
2015-07-06 18:04:49 -04:00
|
|
|
Ret.Extent = GetInput(ePId_Input0)->GetOutput()->RenderTargetDesc.Extent;
|
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;
|
|
|
|
|
}
|
|
|
|
|
|