You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3028958 on 2016/06/27 by Ben.Woodhouse Fix for perf issue with GetSingleFinalDataConst This was caused by the LPV integration/switch to blendables. Now we cache the flag for the directionalocclusion in the LPV class. This reduces calls to GetSingleFinalDataConst on the blendable data (potentially slow), and makes things a bit cleaner and consistent. Tested in QAGame editor (with LPV enabled in ConsoleSettings.ini) #jira UE-26179 Change 3029401 on 2016/06/27 by Rolando.Caloca DR - More vk logging Change 3029549 on 2016/06/27 by Uriel.Doyon Refactored "r.OnlyStreamInTextures" into "r.Streaming.FullyLoadUsedTextures", making it fully load every used textures, as an alternative to disabling texture streaming. New options "r.Streaming.UsePerTextureBias" that assign a bias between 0 and MipBias to each texture in order to fit in budget. Fixed crash when disabling texture streaming. Fixed issue when disabling texture streaming that would make current loaded texture low res. New logic to prevent retrying to cancel a streaming request more than once. Pending load request of one extra mip will not be cancelled anymore. Changed UTexture2D from float to double. Also using FApp::GetCurrentTime() instead of FPlatformTime::Seconds(). #jira UE-32197 #jira UE-31102 Change 3029837 on 2016/06/27 by David.Hill Fixed Shutter SM4 not working when using compute shader eye-adaptation #jira UE-32443 The default eye adaptation value was missing. Change 3030039 on 2016/06/27 by Uriel.Doyon Fix for crash when landscape materials are used in the Texture Streaming Build. #jira UE-32196 Change 3030081 on 2016/06/27 by Uriel.Doyon Updated MaterialTexCoordScalesPixelShader to use PackedEyeIndex, preventing crash when building the map with stereo rendering enabled. Change 3030401 on 2016/06/28 by Ben.Woodhouse Perf Monitor: Fix for perf warning due to cvar FindConsoleVariable being called too frequently. Tested in QAGame editor (DX11) #jira UE-31238 Change 3030607 on 2016/06/28 by Marc.Olano Random Number generators: fixed bug in TEA, added integer and float Blum-Blum-Shub. BBS is way cheaper for similar quality, suggest it for future use. Change 3030627 on 2016/06/28 by Ben.Woodhouse Fix for warning. CVar naming scope clash (doesn't appear to happen in vs2015). Change 3030809 on 2016/06/28 by Marc.Olano Noise shader function rename & perf improvement. Due to incorrect terminology in internet soruces, previous "Perlin" noise was not, in fact, Perlin noise. Now more accurately called "Value" noise. 6x perf improvement for value noise by changing random number function to BBS. Also updated instruction counts in UI tooltips. Change 3030850 on 2016/06/28 by Marc.Olano Rename & redirect noise material enums. At some point these got switched around and no longer accurately described the noise options the selected. Redirect, so all existing content will continue to work as-is. Updated UDN docs to match. Change 3030981 on 2016/06/28 by Rolando.Caloca DR - vk - More logging Change 3031056 on 2016/06/28 by Marc.Olano Introduce new pure-ALU gradient shader noise. Add noise samples to RenderTest map Change 3031398 on 2016/06/28 by Benjamin.Hyder updating TM-Shadermodels (correcting Mt Rushmore) Change 3031441 on 2016/06/28 by Marc.Olano Use only float version of BBS shader rand function for ES2 Change 3031463 on 2016/06/28 by John.Billon Fixed F4 changing the viewmode in Fortnite editor. The detailed lighting viewmode (detaillighting) named in DefaultInput.ini differed from the one in BaseInput.ini(lit_detaillighting). #Jira UE-32020 Change 3031512 on 2016/06/28 by Zabir.Hoque Relax clear flags for DX12 RHIs. Properly flush pending commands before residency is updated. Change 3031517 on 2016/06/28 by Rolando.Caloca DR - vk logging using r.Vulkan.DumpLayer Change 3032359 on 2016/06/29 by Allan.Bentham Fix mobile shadows crash. Change 3032431 on 2016/06/29 by Gil.Gribb Merging //UE4/Dev-Main@3032394 to Dev-Rendering (//UE4/Dev-Rendering) Change 3032757 on 2016/06/29 by Uriel.Doyon Fixed global mip bias being applied twice following integration with main. Change 3033121 on 2016/06/29 by Rolando.Caloca DR - vk - Logging Change 3033529 on 2016/06/29 by Daniel.Wright Null world guard on UReflectionCaptureComponent::ReadbackFromGPU Change 3033668 on 2016/06/29 by Uriel.Doyon Grouped texture streaming settings to simplify logic. New options "r.Streaming.UseAllMips" to ignores the different lod and cinematic bias #jira UE-32118 Change 3034403 on 2016/06/30 by Rolando.Caloca DR - Shorten dumped shader debug strings Change 3034475 on 2016/06/30 by Rolando.Caloca DR - Missing logging Change 3034722 on 2016/06/30 by Uriel.Doyon Improved StreamingAccuracy viewmodes with alpha test and translucent materials #jira UE-32656 Change 3034797 on 2016/06/30 by Rolando.Caloca DR - vk - 'fix' RHIClear but causes a CPU hang on AMD, so disabled again Change 3034799 on 2016/06/30 by Rolando.Caloca DR - vk - missed file Change 3034905 on 2016/06/30 by Rolando.Caloca DR - vk - Fix for render passes being reused with wrong dimensions Change 3035503 on 2016/07/01 by Simon.Tovey Async compute version of translucency lighting volume clear. Change 3035577 on 2016/07/01 by Marc.Olano Tiling noise. Adds tiling option for gradient, gradient texture, and value noise in the noise material node. Tiling is more expensive, but allows noise functions to be baked into a seamless repeating texture. Change 3035587 on 2016/07/01 by Ben.Woodhouse Fix for async SSAO bug (SSAO Async Compute results are used before the async job wait) #jira UE-32709 Change 3035618 on 2016/07/01 by Olaf.Piesche Asset fixes Change 3035692 on 2016/07/01 by Rolando.Caloca DR - vk - Deferred deletion queue Change 3035808 on 2016/07/01 by Rolando.Caloca DR - vk - Stat for deletion time, fixed some logging Change 3036012 on 2016/07/01 by John.Billon Alpha Coverage Preservation -Textures have a Alpha Preservation Vec4 property which dictates about much of that channel to preserve down the mip chain during mip generation. #Jira UE-31986 Change 3036041 on 2016/07/01 by Rolando.Caloca DR - vk - Fix for 32bit Change 3036433 on 2016/07/01 by Rolando.Caloca DR - More vk logging Change 3036935 on 2016/07/04 by Simon.Tovey Removing Data Objects Change 3036942 on 2016/07/04 by Ben.Woodhouse Fix for decal rendering resource leak The cause was that FD3D11BoundRenderTargets doesn't support setting RTs sparsely. So if one element is NULL, it won't release the ones after it. The sparse RT layout happened as a result of a change back in October, which meant that GBuffers for decals could be set sparsely, dependent on whether the decal wrote to the normalbuffer This change adds support for sparsely bound rendertargets in FD3D11BoundRenderTargets. #jira UE-32602 Change 3037563 on 2016/07/05 by Chris.Bunner HLOD self-shadowing in baked lighting fix. Change 3037640 on 2016/07/05 by Marcus.Wassmer Fix bug in USE_GPU_OVERWRITE_CHECKING Change 3037927 on 2016/07/05 by Rolando.Caloca DR - Fix touch pads not showing on Vulkan #jira UE-32062 Change 3038085 on 2016/07/05 by Chris.Bunner HLOD dynamic shadowing support. #jira UE-22627 Change 3038209 on 2016/07/05 by Rolando.Caloca DR - vk - Android compile fix Change 3038644 on 2016/07/05 by Uriel.Doyon Added LerpRange that allows to lerp between two rotators without taking the sortest path. Change 3038820 on 2016/07/05 by Uriel.Doyon Selecting streaming accuracy view modes will not automatically generate missing visualization data. Change 3039332 on 2016/07/06 by John.Billon -Made MaxGPUSkinBonesCvar a FAutoConsoleVariableRef and moved it to mesh utilitles from console manager to fix a thread initialization problem. #Jira UE-31710 Change 3039454 on 2016/07/06 by Simon.Tovey Moved all Niagara files from Engine and UnrealEd to remove dependancies and increase compile times. Niagara is now 99.999% decoupled from engine and editor so development should be much streamlined. Plus a few other edits to remove Curves/DataObjects that I missed in last CL. Change 3039517 on 2016/07/06 by Gil.Gribb Merging //UE4/Dev-Main@3039013 to Dev-Rendering (//UE4/Dev-Rendering) Change 3039587 on 2016/07/06 by Rolando.Caloca DR - vk logging, submit counter Change 3039603 on 2016/07/06 by Rolando.Caloca DR - Allow more samplers on GL4 #jira UE-32628 #jira UE-32744 Change 3039661 on 2016/07/06 by Daniel.Wright Fixed non-directional DFAO occlusion on specular 'r.AOSpecularOcclusionMode 0' Skylight occlusion tint now applies to specular Skylight occlusion tint on diffuse is now correctly affected by DiffuseColor Change 3039960 on 2016/07/06 by Daniel.Wright Forward renderer initial implementation * Point and spot lights are culled to a frustum space grid, base pass loops over culled lights. * Light culling uses a reverse linked list to avoid a per-cell limit, and the linked list is compacted to an array before the base pass. * New cvars to control light culling: r.Forward.MaxCulledLightsPerCell, r.Forward.LightGridSizeZ, r.Forward.LightGridPixelSize * A full Z Prepass is forced with forward shading. This allows deferred rendering before the base pass of shadow projection methods that only rely on depth. * Dynamic shadows are packed based on the assigned stationary light ShadowMapChannel, since stationary lights are already restricted to 4 overlapping. * GBuffer render targets are still allocated * Fixed several issues in parallax corrected base pass reflections - not blending out box shape, discontinuity in reflection vector, not blending with stationary skylight properly * Forward shading is now used for TLM_SurfacePerPixelLighting translucency in the deferred path * Notable missing features: shadowing of translucency, support for various translucency lighting modes, multiple blended reflection captures Change 3040050 on 2016/07/06 by Daniel.Wright Added r.Shadow.WholeSceneShadowCacheMb, which defaults to 150, to limit how much memory can be spent caching whole scene shadowmaps Change 3040160 on 2016/07/06 by Daniel.Wright Fixed tile artifacts in indirect capsule shadows from doing the scaled sphere vs tile bounding sphere intersection in the wrong space Change 3040163 on 2016/07/06 by Rolando.Caloca DR - vk - More logging Change 3040257 on 2016/07/06 by Daniel.Wright Skylights aren't captured until their level is made visible- fixes the case where skylights capture too early Change 3040316 on 2016/07/06 by Daniel.Wright PerObject shadows from point / spot lights do the light source pull back based on subject box size, not subject radius, since the box is used to find a valid < 90 degree projection. Fix from licensee Change 3040361 on 2016/07/06 by Daniel.Wright Fixed TexCreate_UAV being used on translucency volume textures in SM4 Change 3040402 on 2016/07/06 by Rolando.Caloca DR - vk - Make host mem accesses coherent Change 3040486 on 2016/07/06 by Daniel.Wright CIS fixes Change 3041028 on 2016/07/07 by Gil.Gribb Merging //UE4/Dev-Main@3040917 to Dev-Rendering (//UE4/Dev-Rendering) Change 3041235 on 2016/07/07 by Simon.Tovey Compile fix for FName conflict on UProperty (hopefully). Change 3041666 on 2016/07/07 by Daniel.Wright Fixed TLM_SurfacePerPixelLighting in SM4, falls back to lighting volume Change 3041731 on 2016/07/07 by Olaf.Piesche Adding Niagara to dynamically loaded module list; should fix UE-32915 Change 3042181 on 2016/07/07 by Daniel.Wright CIS fix [CL 3045471 by Gil Gribb in Main branch]
223 lines
6.4 KiB
C++
223 lines
6.4 KiB
C++
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
|
|
//
|
|
|
|
#include "ShaderFormatOpenGL.h"
|
|
#include "Core.h"
|
|
#include "ModuleInterface.h"
|
|
#include "ModuleManager.h"
|
|
#include "TargetPlatform.h"
|
|
#include "hlslcc.h"
|
|
#include "ShaderCore.h"
|
|
|
|
static FName NAME_GLSL_150(TEXT("GLSL_150"));
|
|
static FName NAME_GLSL_150_MAC(TEXT("GLSL_150_MAC"));
|
|
static FName NAME_GLSL_430(TEXT("GLSL_430"));
|
|
static FName NAME_GLSL_ES2(TEXT("GLSL_ES2"));
|
|
static FName NAME_GLSL_ES2_WEBGL(TEXT("GLSL_ES2_WEBGL"));
|
|
static FName NAME_GLSL_150_ES2(TEXT("GLSL_150_ES2"));
|
|
static FName NAME_GLSL_150_ES2_NOUB(TEXT("GLSL_150_ES2_NOUB"));
|
|
static FName NAME_GLSL_150_ES3_1(TEXT("GLSL_150_ES31"));
|
|
static FName NAME_GLSL_ES2_IOS(TEXT("GLSL_ES2_IOS"));
|
|
static FName NAME_GLSL_310_ES_EXT(TEXT("GLSL_310_ES_EXT"));
|
|
|
|
class FShaderFormatGLSL : public IShaderFormat
|
|
{
|
|
enum
|
|
{
|
|
/** Version for shader format, this becomes part of the DDC key. */
|
|
UE_SHADER_GLSL_150_VER = 60,
|
|
UE_SHADER_GLSL_150_MAC_VER = 60,
|
|
UE_SHADER_GLSL_430_VER = 61,
|
|
UE_SHADER_GLSL_ES2_VER = 60,
|
|
UE_SHADER_GLSL_150ES2_VER = 60,
|
|
UE_SHADER_GLSL_150ES2NOUB_VER = 60,
|
|
UE_SHADER_GLSL_150ES3_1_VER = 60,
|
|
UE_SHADER_GLSL_ES2_VER_WEBGL = 60,
|
|
UE_SHADER_GLSL_ES2_IOS_VER = 60,
|
|
UE_SHADER_GLSL_310_ES_EXT_VER = 60,
|
|
};
|
|
|
|
void CheckFormat(FName Format) const
|
|
{
|
|
check( Format == NAME_GLSL_150 ||
|
|
Format == NAME_GLSL_150_MAC ||
|
|
Format == NAME_GLSL_430 ||
|
|
Format == NAME_GLSL_ES2 ||
|
|
Format == NAME_GLSL_150_ES2 ||
|
|
Format == NAME_GLSL_150_ES2_NOUB ||
|
|
Format == NAME_GLSL_150_ES3_1 ||
|
|
Format == NAME_GLSL_ES2_WEBGL ||
|
|
Format == NAME_GLSL_ES2_IOS ||
|
|
Format == NAME_GLSL_310_ES_EXT
|
|
);
|
|
}
|
|
|
|
public:
|
|
virtual uint16 GetVersion(FName Format) const override
|
|
{
|
|
CheckFormat(Format);
|
|
uint32 GLSLVersion = 0;
|
|
if (Format == NAME_GLSL_150)
|
|
{
|
|
GLSLVersion = UE_SHADER_GLSL_150_VER;
|
|
}
|
|
else if (Format == NAME_GLSL_150_MAC)
|
|
{
|
|
GLSLVersion = UE_SHADER_GLSL_150_MAC_VER;
|
|
}
|
|
else if (Format == NAME_GLSL_430)
|
|
{
|
|
GLSLVersion = UE_SHADER_GLSL_430_VER;
|
|
}
|
|
else if (Format == NAME_GLSL_ES2)
|
|
{
|
|
GLSLVersion = UE_SHADER_GLSL_ES2_VER;
|
|
}
|
|
else if (Format == NAME_GLSL_150_ES2)
|
|
{
|
|
GLSLVersion = UE_SHADER_GLSL_150ES2_VER;
|
|
}
|
|
else if (Format == NAME_GLSL_150_ES3_1)
|
|
{
|
|
GLSLVersion = UE_SHADER_GLSL_150ES3_1_VER;
|
|
}
|
|
else if (Format == NAME_GLSL_150_ES2_NOUB)
|
|
{
|
|
GLSLVersion = UE_SHADER_GLSL_150ES2NOUB_VER;
|
|
}
|
|
else if (Format == NAME_GLSL_ES2_WEBGL)
|
|
{
|
|
GLSLVersion = UE_SHADER_GLSL_ES2_VER_WEBGL;
|
|
}
|
|
else if (Format == NAME_GLSL_ES2_IOS)
|
|
{
|
|
GLSLVersion = UE_SHADER_GLSL_ES2_IOS_VER;
|
|
}
|
|
else if (Format == NAME_GLSL_310_ES_EXT)
|
|
{
|
|
GLSLVersion = UE_SHADER_GLSL_310_ES_EXT_VER;
|
|
}
|
|
else
|
|
{
|
|
check(0);
|
|
}
|
|
const uint16 Version = ((HLSLCC_VersionMinor & 0xff) << 8) | (GLSLVersion & 0xff);
|
|
return Version;
|
|
}
|
|
virtual void GetSupportedFormats(TArray<FName>& OutFormats) const override
|
|
{
|
|
OutFormats.Add(NAME_GLSL_150);
|
|
OutFormats.Add(NAME_GLSL_150_MAC);
|
|
OutFormats.Add(NAME_GLSL_430);
|
|
OutFormats.Add(NAME_GLSL_ES2);
|
|
OutFormats.Add(NAME_GLSL_ES2_WEBGL);
|
|
OutFormats.Add(NAME_GLSL_150_ES2);
|
|
OutFormats.Add(NAME_GLSL_150_ES3_1);
|
|
OutFormats.Add(NAME_GLSL_ES2_IOS);
|
|
OutFormats.Add(NAME_GLSL_310_ES_EXT);
|
|
OutFormats.Add(NAME_GLSL_150_ES2_NOUB);
|
|
}
|
|
virtual void CompileShader(FName Format, const struct FShaderCompilerInput& Input, struct FShaderCompilerOutput& Output,const FString& WorkingDirectory) const override
|
|
{
|
|
CheckFormat(Format);
|
|
|
|
if (Format == NAME_GLSL_150)
|
|
{
|
|
CompileShader_Windows_OGL(Input, Output, WorkingDirectory, GLSL_150);
|
|
}
|
|
else if (Format == NAME_GLSL_150_MAC)
|
|
{
|
|
CompileShader_Windows_OGL(Input, Output, WorkingDirectory, GLSL_150_MAC);
|
|
}
|
|
else if (Format == NAME_GLSL_430)
|
|
{
|
|
CompileShader_Windows_OGL(Input, Output, WorkingDirectory, GLSL_430);
|
|
}
|
|
else if (Format == NAME_GLSL_ES2)
|
|
{
|
|
CompileShader_Windows_OGL(Input, Output, WorkingDirectory, GLSL_ES2);
|
|
|
|
if (Input.DumpDebugInfoPath != TEXT("") && IFileManager::Get().DirectoryExists(*Input.DumpDebugInfoPath))
|
|
{
|
|
FShaderCompilerInput ES2Input = Input;
|
|
ES2Input.DumpDebugInfoPath = ES2Input.DumpDebugInfoPath.Replace(TEXT("GLSL_150_ES2"), TEXT("GLSL_ES2"), ESearchCase::CaseSensitive);
|
|
if (!IFileManager::Get().DirectoryExists(*ES2Input.DumpDebugInfoPath))
|
|
{
|
|
verifyf(IFileManager::Get().MakeDirectory(*ES2Input.DumpDebugInfoPath, true), TEXT("Failed to create directory for shader debug info '%s'"), *ES2Input.DumpDebugInfoPath);
|
|
}
|
|
|
|
FShaderCompilerOutput ES2Output;
|
|
CompileShader_Windows_OGL(ES2Input, ES2Output, WorkingDirectory, GLSL_ES2);
|
|
}
|
|
|
|
}
|
|
else if (Format == NAME_GLSL_ES2_WEBGL )
|
|
{
|
|
CompileShader_Windows_OGL(Input, Output, WorkingDirectory, GLSL_ES2_WEBGL);
|
|
}
|
|
else if (Format == NAME_GLSL_ES2_IOS )
|
|
{
|
|
CompileShader_Windows_OGL(Input, Output, WorkingDirectory, GLSL_ES2_IOS);
|
|
}
|
|
else if (Format == NAME_GLSL_150_ES3_1)
|
|
{
|
|
CompileShader_Windows_OGL(Input, Output, WorkingDirectory, GLSL_150_ES3_1);
|
|
}
|
|
else if (Format == NAME_GLSL_150_ES2_NOUB)
|
|
{
|
|
CompileShader_Windows_OGL(Input, Output, WorkingDirectory, GLSL_150_ES2_NOUB);
|
|
}
|
|
else if (Format == NAME_GLSL_150_ES2)
|
|
{
|
|
CompileShader_Windows_OGL(Input, Output, WorkingDirectory, GLSL_150_ES2);
|
|
|
|
if (Input.DumpDebugInfoPath != TEXT("") && IFileManager::Get().DirectoryExists(*Input.DumpDebugInfoPath))
|
|
{
|
|
FShaderCompilerInput ES2Input = Input;
|
|
ES2Input.DumpDebugInfoPath = ES2Input.DumpDebugInfoPath.Replace(TEXT("GLSL_150_ES2"), TEXT("GLSL_ES2_150"), ESearchCase::CaseSensitive);
|
|
if (!IFileManager::Get().DirectoryExists(*ES2Input.DumpDebugInfoPath))
|
|
{
|
|
verifyf(IFileManager::Get().MakeDirectory(*ES2Input.DumpDebugInfoPath, true), TEXT("Failed to create directory for shader debug info '%s'"), *ES2Input.DumpDebugInfoPath);
|
|
}
|
|
|
|
FShaderCompilerOutput ES2Output;
|
|
CompileShader_Windows_OGL(ES2Input, ES2Output, WorkingDirectory, GLSL_ES2);
|
|
}
|
|
}
|
|
else if (Format == NAME_GLSL_310_ES_EXT)
|
|
{
|
|
CompileShader_Windows_OGL(Input, Output, WorkingDirectory, GLSL_310_ES_EXT);
|
|
}
|
|
else
|
|
{
|
|
check(0);
|
|
}
|
|
}
|
|
};
|
|
|
|
/**
|
|
* Module for OpenGL shaders
|
|
*/
|
|
|
|
static IShaderFormat* Singleton = NULL;
|
|
|
|
class FShaderFormatOpenGLModule : public IShaderFormatModule
|
|
{
|
|
public:
|
|
virtual ~FShaderFormatOpenGLModule()
|
|
{
|
|
delete Singleton;
|
|
Singleton = NULL;
|
|
}
|
|
virtual IShaderFormat* GetShaderFormat()
|
|
{
|
|
if (!Singleton)
|
|
{
|
|
Singleton = new FShaderFormatGLSL();
|
|
}
|
|
return Singleton;
|
|
}
|
|
};
|
|
|
|
IMPLEMENT_MODULE( FShaderFormatOpenGLModule, ShaderFormatOpenGL);
|