Files
UnrealEngineUWP/Engine/Source/Developer/TextureFormatDXT/Private/TextureFormatDXT.cpp

575 lines
15 KiB
C++
Raw Normal View History

// Copyright Epic Games, Inc. All Rights Reserved.
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3209340 on 2016/11/23 by Ben.Marsh Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h. Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms. * Every header now includes everything it needs to compile. * There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first. * There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h. * Every .cpp file includes its matching .h file first. * This helps validate that each header is including everything it needs to compile. * No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more. * You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there. * There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible. * No engine code explicitly includes a precompiled header any more. * We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies. * PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files. Tool used to generate this transform is at Engine\Source\Programs\IncludeTool. [CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
#include "CoreMinimal.h"
#include "Misc/ScopeLock.h"
#include "Containers/IndirectArray.h"
#include "Stats/Stats.h"
#include "Async/AsyncWork.h"
#include "HAL/IConsoleManager.h"
#include "ImageCore.h"
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3209340 on 2016/11/23 by Ben.Marsh Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h. Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms. * Every header now includes everything it needs to compile. * There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first. * There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h. * Every .cpp file includes its matching .h file first. * This helps validate that each header is including everything it needs to compile. * No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more. * You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there. * There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible. * No engine code explicitly includes a precompiled header any more. * We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies. * PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files. Tool used to generate this transform is at Engine\Source\Programs\IncludeTool. [CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
#include "Modules/ModuleManager.h"
#include "Interfaces/ITextureFormat.h"
#include "Interfaces/ITextureFormatModule.h"
#include "TextureCompressorModule.h"
#include "PixelFormat.h"
#include "EngineLogs.h"
#include "Async/ParallelFor.h"
#include "TextureBuildFunction.h"
#include "DerivedDataBuildFunctionFactory.h"
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3232619) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3121996 on 2016/09/12 by Ben.Marsh Add support for Visual Studio 2017 (aka "15"; assuming consistent naming with other versions until final name is announced). * Compiler, STL implementation and CRT are binary compatible with VS2015 (see https://blogs.msdn.microsoft.com/vcblog/2016/08/24/c1417-features-and-stl-fixes-in-vs-15-preview-4/), so no new third-party libraries needed so far. WindowsPlatform.GetVisualStudioCompilerVersionName() returns "2015" as a result. * Default compiler for compiling and generating project files is still VS 2015 for now. Pass -2017 on the command line to GenerateProjectFiles.bat to generate VS2017 projects. Projects generated for VS2017 will use the 2017 compiler by default. * Visual Studio source code accessor can talk to VS 2017 instances. * Added a VS2017 configuration for UnrealVS, and added precompiled vsix package. * Switched GetVSComnTools to check the SOFTWARE\Microsoft\VisualStudio\SxS\VS7 registry key rather than the individual product install registry key. "15" doesn't seem to have it's own "InstallDir" key, but this system seems to work for all versions of Visual Studio (including previous releases of VS Express). * Removed ATL dependency from VisualStudioSourceCodeAccessor. It's not installed with VS by default any more, and is only used for a couple of smart pointer classes. Tested running the editor and packaging TP_Flying for Win64. Packaging from the editor still defaults to using the 2015 compiler, so ConfigureToolchain() needs to be overriden from the .target.cs file if multiple Visual Studio versions are installed. Change 3189363 on 2016/11/07 by Ben.Marsh Consolidate functionality for determining the path to MSBuild.exe to use for compiling UE4 tools into a single batch file (GetMSBuildToolPath) and fix "Clean" not working on PS4 due to include/library paths being set to something by the Visual Studio environment. Change 3210598 on 2016/11/27 by Ben.Marsh UBT: Prevent the name of each file compiled being output twice on XboxOne. Compiler already outputs this string; the action doesn't need to. Change 3210601 on 2016/11/27 by Ben.Marsh PR #2967: Add silent version of switch game version (Contributed by EricLeeFriedman) Change 3210602 on 2016/11/27 by Ben.Marsh PR #2964: GitDependencies shouldn't try to clean up working directory files that are excluded or ignored (Contributed by joelmcginnis) Change 3210605 on 2016/11/27 by Ben.Marsh UGS: Add a warning when syncing latest would remove changes that have been authored locally. Typically happens when working with precompiled binaries. Change 3211656 on 2016/11/28 by Ben.Marsh UBT: Move ModuleRules and TargetRules into their own file. Change 3211797 on 2016/11/28 by Ben.Marsh UBT: Remove utility functions from TargetRules for checking different classes of target types. Moving TargetRules to be data-only. Change 3211833 on 2016/11/28 by Ben.Marsh UBT: Remove overridable configuration name from target rules. This feature is not used anywhere. Change 3211859 on 2016/11/28 by Ben.Marsh UBT: Deprecate the GetGeneratedCodeVersion() callback in favor of a member variable instead. Change 3211942 on 2016/11/28 by Ben.Marsh UBT: Remove legacy code which tries to change the output paths for console binaries. Output paths for monolithic binaries are always in the project folder now. Change 3215333 on 2016/11/30 by Ben.Marsh UBT: Replace the GetSupportedPlatforms() callback on TargetRules with a SupportedPlatforms attribute. Since a TargetRules object can only be instantiated with an actual platform, it doesn't make sense for it to be an instance method. Change 3215482 on 2016/11/30 by Ben.Marsh UBT: Remove the GetSupportedConfigurations() callback on the TargetRules class. A configuration is required to construct a TargetRules instance, so it doesn't make sense to need to call an instance method to find out which configurations are supported. Change 3215743 on 2016/11/30 by Ben.Marsh UBT: Deprecate the TargetRules.ShouldCompileMonolithic() function: this function requires access to the global command line to operate correctly, which prevents creating target-specific instances, and does not use the platform/configuration passed into the TargetRules constructor. Rather than being a callback, the LinkType field can now be set to TargetLinkType.Modular or TargetLinkType.Monolithic from the constructor as appropriate. The default value (TargetLinkType.Default) results in the default link type for the target type being used. Parsing of the command-line overrides is now done when building the TargetDescriptor. Change 3215778 on 2016/11/30 by Ben.Marsh UBT: Mark overrides of the TargetRules.GetModulesToPrecompile method as obsolete. Change 3217681 on 2016/12/01 by Ben.Marsh UAT: Prevent UE4Build deleting .modules files when running with the -Clean argument; these files are artifacts generated by UBT itself, not by the exported XGE script. Change 3217723 on 2016/12/01 by Ben.Marsh UBT: Run pre- and post-build steps for all plugins that are being built, not just those that are enabled. Change 3217930 on 2016/12/01 by Ben.Marsh UGS: Add a perforce settings window, allowing users to set optional values for tuning Perforce performance on unreliable connections. Change 3218762 on 2016/12/02 by Ben.Marsh Enable warnings whenever an undefined macro is used in a constant expression inside an #if or #elif directive, and fix existing violations. Change 3219161 on 2016/12/02 by Ben.Marsh Core: Use the directory containing the current module to derive the UE4 base directory, rather than the executable directory. Allows UE4 to be hosted by a process in a different directory. Change 3219197 on 2016/12/02 by Ben.Marsh Core: When loading a DLL from disk, convert any relative paths to absolute before calling LoadLibrary. The OS resolves these paths relative to the directory containing the process executable -- not the working directory -- so paths need to be absolute to allow UE4 to be hosted by a process elsewhere. Change 3219209 on 2016/12/02 by Ben.Marsh Replace some calls to LoadLibrary() with FPlatformProcess::GetDllHandle(). The UE4 function makes sure that relative paths are resolved relative to the correct base directory, which is important when the host executable is not in Engine/Binaries/Win64. Change 3219610 on 2016/12/02 by Ben.Marsh Add the -q (quiet) option to the Mac unzip command, since it's creating too much log output to be useful. Change 3219731 on 2016/12/02 by Ben.Marsh UBT: Add option to disable IWYU checks regarding the use of monolithic headers (Engine.h, UnrealEd.h, etc...) and including the matching header for a cpp file first. bEnforceIWYU can be set to false in UEBuildConfiguration or on a per-module basis in the module rules. Change 3220796 on 2016/12/04 by Ben.Marsh Remove PrepForUATPackageOrDeploy from the UEBuildDeploy base class. It never has to be accessed through the base class anyway. Change 3220825 on 2016/12/04 by Ben.Marsh UBT: Change all executors to derive from a common base class (ActionExecutor). Change 3220834 on 2016/12/04 by Ben.Marsh UBT: Remove the global CommandLineContains() function. Change 3222706 on 2016/12/05 by Ben.Marsh Merging CL 3221949 from //UE4/Release-4.14: Fixes to code analysis template causing problems with stock install of VS2017. Change 3222712 on 2016/12/05 by Ben.Marsh Merging CL 3222021 from //UE4/Release-4.14: Change detection of MSBuild.exe path to match GetMSBuildPath.bat Change 3223628 on 2016/12/06 by Ben.Marsh Merging CL 3223369 from 4.14 branch: Use the same logic as GetMsBuildPath.bat inside FDesktopPlatformBase to determine path to MSBuild.exe Change 3223817 on 2016/12/06 by Ben.Marsh Remove non-ANSI characters from source files. Compiler/P4 support is patchy for this, and we want to avoid failing prey to different codepages resulting in different interpretations of the source text. Change 3224046 on 2016/12/06 by Ben.Marsh Remove the need for the iOS/TVOS deployment instances to have an IOSPlatformContext instance. The only dependency between the two -- a call to GetRequiredCapabilities() -- is now implemented by querying the INI file for the supported architectures when neeeded. Change 3224792 on 2016/12/07 by Ben.Marsh UBT: Touch PCH wrapper files whenever the file they include is newer rather than writing the timestamp for the included file into it as a comment. Allows use of ccache and similar tools. Change 3225212 on 2016/12/07 by Ben.Marsh UBT: Move settings required for deployment into the UEBuildDeployTarget class, allowing them to be serialized to and from a file the intermediate directory without having to construct a phony UEBuildTarget to deploy. Deployment is now performed by a method on UEBuildPlatform, rather than having to create a UEBuildPlatformContext and using that to create a UEBuildDeploy object. The -prepfordeploy UBT invocation from UAT, previously done by the per-platform PostBuildTarget() callback when building with XGE, is replaced by running UBT with a path to the serialized UEBuildDeployTarget object, and can be done in a platform agnostic manner. Change 3226310 on 2016/12/07 by Ben.Marsh PR #3015: Fixes wrong VSC++ flags being passed for .c files (Contributed by badlogic) Change 3228273 on 2016/12/08 by Ben.Marsh Update copyright notices for QAGame. Change 3229166 on 2016/12/09 by Ben.Marsh UBT: Rewritten config file parser. No longer requires hard-coded list of sections to be parsed, but parses them on demand. Measured 2x faster read speeds (largely due to eliminating construction of temporary string objects when parsing each line, to trim whitespace and so on). Also includes an attribute-driven parser, which allows reading named config values for marked up fields in an object. Change 3230601 on 2016/12/12 by Ben.Marsh Swarm: Change Swarm AgentInterface to target .NET framework 4.5, to remove dependency on having 4.0 framework installed. Change 3230737 on 2016/12/12 by Ben.Marsh UAT: Stop UE4Build deriving from CommandUtils. Confusing pattern, and causes problems trying to access instance variables that are only set for build commands. Change 3230751 on 2016/12/12 by Ben.Marsh UAT: Move ParseParam*() functions which use the instanced parameter list from CommandUtils to BuildCommand, since that's the only thing that it's instanced for. Change 3230804 on 2016/12/12 by Ben.Marsh UBT: Add the IsPromotedBuild flag to Build.version, and only set the bFormalBuild flag in UBT if it's set. This allows UGS users to avoid having to compile separate RC files for each output binary. Change 3230831 on 2016/12/12 by Ben.Marsh UGS: Warn when trying to switch streams if files are checked out. Change 3231281 on 2016/12/12 by Chad.Garyet Fixing a bug where .modules files were getting put into receipts with their absolute path instead of their relative one Change 3231496 on 2016/12/12 by Ben.Marsh Disable code analysis in CrashReportProcess; causes warnings when compiled with VS2015. Change 3231979 on 2016/12/12 by Ben.Marsh UBT: Suppress LNK4221 when generating import libraries. This can happen often when generating import libraries separately to linking. Change 3232619 on 2016/12/13 by Ben.Marsh Fix "#pragma once in main file" errors on Mac, which are occurring in //UE4/Main. [CL 3232653 by Ben Marsh in Main branch]
2016-12-13 11:58:16 -05:00
THIRD_PARTY_INCLUDES_START
#include "nvtt/nvtt.h"
THIRD_PARTY_INCLUDES_END
DEFINE_LOG_CATEGORY_STATIC(LogTextureFormatDXT, Log, All);
class FDXTTextureBuildFunction final : public FTextureBuildFunction
{
FStringView GetName() const final { return TEXT("DXTTexture"); }
void GetVersion(UE::DerivedData::FBuildVersionBuilder& Builder, ITextureFormat*& OutTextureFormatVersioning) const final
{
static FGuid Version(TEXT("c2d5dbc5-131c-4525-a332-843230076d99"));
Builder << Version;
OutTextureFormatVersioning = FModuleManager::GetModuleChecked<ITextureFormatModule>(TEXT("TextureFormatDXT")).GetTextureFormat();
}
};
/**
* Macro trickery for supported format names.
*/
#define ENUM_SUPPORTED_FORMATS(op) \
op(DXT1) \
op(DXT3) \
op(DXT5) \
op(AutoDXT) \
op(DXT5n) \
op(BC4) \
op(BC5)
#define DECL_FORMAT_NAME(FormatName) static FName GTextureFormatName##FormatName = FName(TEXT(#FormatName));
ENUM_SUPPORTED_FORMATS(DECL_FORMAT_NAME);
#undef DECL_FORMAT_NAME
#define DECL_FORMAT_NAME_ENTRY(FormatName) GTextureFormatName##FormatName ,
static FName GSupportedTextureFormatNames[] =
{
ENUM_SUPPORTED_FORMATS(DECL_FORMAT_NAME_ENTRY)
};
#undef DECL_FORMAT_NAME_ENTRY
#undef ENUM_SUPPORTED_FORMATS
/**
* NVTT output handler.
*/
struct FNVOutputHandler : public nvtt::OutputHandler
{
explicit FNVOutputHandler( uint8* InBuffer, int32 InBufferSize )
: Buffer(InBuffer)
, BufferEnd(InBuffer + InBufferSize)
{
}
~FNVOutputHandler()
{
}
virtual void beginImage( int size, int width, int height, int depth, int face, int miplevel )
{
}
virtual bool writeData( const void* data, int size )
{
check(data);
check(Buffer + size <= BufferEnd);
FMemory::Memcpy(Buffer, data, size);
Buffer += size;
return true;
}
virtual void endImage()
{
}
uint8* Buffer;
uint8* BufferEnd;
};
/**
* NVTT error handler.
*/
struct FNVErrorHandler : public nvtt::ErrorHandler
{
FNVErrorHandler() :
bSuccess(true)
{}
virtual void error(nvtt::Error e)
{
UE_LOG(LogTextureFormatDXT, Warning, TEXT("nvtt::compress() failed with error '%s'"), ANSI_TO_TCHAR(nvtt::errorString(e)));
bSuccess = false;
}
bool bSuccess;
};
/**
* All state objects needed for NVTT.
*/
class FNVTTCompressor
{
FNVOutputHandler OutputHandler;
FNVErrorHandler ErrorHandler;
nvtt::InputOptions InputOptions;
nvtt::CompressionOptions CompressionOptions;
nvtt::OutputOptions OutputOptions;
nvtt::Compressor Compressor;
public:
/** Initialization constructor. */
FNVTTCompressor(
const void* SourceData,
EPixelFormat PixelFormat,
int32 SizeX,
int32 SizeY,
bool bSRGB,
bool bIsNormalMap,
uint8* OutBuffer,
Copying //UE4/Orion-Staging (Orion Main @ CL-2792706 to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2792706 on 2015/12/07 by Terence.Burns Rebuild lightmaps automation changes - Sync and Build binary files for execution - Much improved error handling - Email notification support added. #Note - This should massively simplify the batch script we use to rebuild lightmaps. #rb none #Tests Run the RebuildLightmaps commandlet many times to ensure it runs and errors correctly. Change 2791950 on 2015/12/05 by Matt.Kuhlenschmidt Added settings to toggle on and off display of Ping and FPS values. Server FPS will be disabled before ship #rb none #test pc/ps4 golden path, pie Change 2791827 on 2015/12/05 by Marcus.Wassmer Fix texture memory leak. Fixes automation using too much memory. #rb Brad.Angelcyk #codereview bob.ferreira #test automation runs, editor. Change 2791313 on 2015/12/04 by Martin.Mittring fixed PS4 compiling #rb:Michael.Noland #test:not Change 2791014 on 2015/12/04 by Martin.Mittring nicer cvar help for r.PS4ContinuousSubmits #rb:Olaf.Piesche #code_review:Marcus.Wassmer #test:PC Change 2791011 on 2015/12/04 by Martin.Mittring fixed compile error when disabling ENABLE_TEXTURE_TRACKING #rb:Olaf.Piesche #test:run Paragon on PC Change 2790848 on 2015/12/04 by Martin.Mittring missing changes nicer cvar help, optimized unneccessary referencecounting, removed redundant code #rb:Olaf.Piesche #test:PC Paragon Change 2790840 on 2015/12/04 by Martin.Mittring nicer cvar help, optimized unneccessary referencecounting, removed redundant code #rb:Olaf.Piesche #test:PC Paragon Change 2791585 on 2015/12/04 by Michael.Noland Rendering: Added a more actionable error message to a check() failure for a FStaticLightingMesh that has already been processed when building lighting in a map that contains HLOD #rb None #tests Built lighting in a map that was crashing at this check() and verified that the message indicated the problematic mesh Change 2791244 on 2015/12/04 by Ryan.Brucks Submitting all my Paragon Content before the new Agora Branch. Change 2791240 on 2015/12/04 by Marcus.Wassmer Bump to .061 patch and new pub tools to pass cert #rb non #test compile ps4 Change 2791132 on 2015/12/04 by ryan.brucks RenderToTextureMacros: fixed issue with polygon index being +1 on accident Change 2790747 on 2015/12/04 by Terence.Burns Rebuild Lightmaps Automation Script - Adding the -unattended switch for build machines. #rb None #tests Run through the Rebuild Lightmaps UAT script process. Change 2790589 on 2015/12/04 by Bart.Bressler - Invite PS4 friend option for add party member button now works properly, also fixes crash. Fixes OR-10359. #rb sam.zamani #tests invited ps4 player using Invite PS4 Friend option, confirmed that player joined mcp party and ps4 session Change 2790418 on 2015/12/04 by James.Golding Roll back HLOD lightmap UV change, Oz reporting issues when building lighting, need more investigation #rb none #tests none Change 2790333 on 2015/12/04 by James.Golding Add fallback to FMeshUtilities::PropagatePaintedColorsToRawMesh when mesh has been reduced in engine and WedgeMap is missing #rb martin.wilson #codereview jurre.debaare #tests Built HLOD meshes in the editor Change 2790292 on 2015/12/04 by Olaf.Piesche Free the new particle array at the beginning of the tick for each instance; that way, even if we're not rendering the array will be cleared and we don't keep injecting new particles that never get killed until rendering resumes #rb marcus.wassmer #tests Editor, PIE Change 2790003 on 2015/12/04 by James.Golding Fix possible crash in ALODActor::RemoveSubActor #rb keith.judge #codereview jurre.debaare #tests Generated HLOD proxy in editor Change 2789998 on 2015/12/04 by James.Golding
2015-12-08 09:25:02 -05:00
int32 BufferSize,
bool bPreview = false)
: OutputHandler(OutBuffer, BufferSize)
{
// CUDA acceleration currently disabled, needs more robust error handling
// With one core of a Xeon 3GHz CPU, compressing a 2048^2 normal map to DXT1 with NVTT 2.0.4 takes 7.49s.
// With the same settings but using CUDA and a Geforce 8800 GTX it takes 1.66s.
// To use CUDA, a CUDA 2.0 capable driver is required (178.08 or greater) and a Geforce 8 or higher.
const bool bUseCUDAAcceleration = false;
// DXT1a support is currently not exposed.
const bool bSupportDXT1a = false;
// Quality level is hardcoded to production quality for now.
Copying //UE4/Orion-Staging (Orion Main @ CL-2792706 to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2792706 on 2015/12/07 by Terence.Burns Rebuild lightmaps automation changes - Sync and Build binary files for execution - Much improved error handling - Email notification support added. #Note - This should massively simplify the batch script we use to rebuild lightmaps. #rb none #Tests Run the RebuildLightmaps commandlet many times to ensure it runs and errors correctly. Change 2791950 on 2015/12/05 by Matt.Kuhlenschmidt Added settings to toggle on and off display of Ping and FPS values. Server FPS will be disabled before ship #rb none #test pc/ps4 golden path, pie Change 2791827 on 2015/12/05 by Marcus.Wassmer Fix texture memory leak. Fixes automation using too much memory. #rb Brad.Angelcyk #codereview bob.ferreira #test automation runs, editor. Change 2791313 on 2015/12/04 by Martin.Mittring fixed PS4 compiling #rb:Michael.Noland #test:not Change 2791014 on 2015/12/04 by Martin.Mittring nicer cvar help for r.PS4ContinuousSubmits #rb:Olaf.Piesche #code_review:Marcus.Wassmer #test:PC Change 2791011 on 2015/12/04 by Martin.Mittring fixed compile error when disabling ENABLE_TEXTURE_TRACKING #rb:Olaf.Piesche #test:run Paragon on PC Change 2790848 on 2015/12/04 by Martin.Mittring missing changes nicer cvar help, optimized unneccessary referencecounting, removed redundant code #rb:Olaf.Piesche #test:PC Paragon Change 2790840 on 2015/12/04 by Martin.Mittring nicer cvar help, optimized unneccessary referencecounting, removed redundant code #rb:Olaf.Piesche #test:PC Paragon Change 2791585 on 2015/12/04 by Michael.Noland Rendering: Added a more actionable error message to a check() failure for a FStaticLightingMesh that has already been processed when building lighting in a map that contains HLOD #rb None #tests Built lighting in a map that was crashing at this check() and verified that the message indicated the problematic mesh Change 2791244 on 2015/12/04 by Ryan.Brucks Submitting all my Paragon Content before the new Agora Branch. Change 2791240 on 2015/12/04 by Marcus.Wassmer Bump to .061 patch and new pub tools to pass cert #rb non #test compile ps4 Change 2791132 on 2015/12/04 by ryan.brucks RenderToTextureMacros: fixed issue with polygon index being +1 on accident Change 2790747 on 2015/12/04 by Terence.Burns Rebuild Lightmaps Automation Script - Adding the -unattended switch for build machines. #rb None #tests Run through the Rebuild Lightmaps UAT script process. Change 2790589 on 2015/12/04 by Bart.Bressler - Invite PS4 friend option for add party member button now works properly, also fixes crash. Fixes OR-10359. #rb sam.zamani #tests invited ps4 player using Invite PS4 Friend option, confirmed that player joined mcp party and ps4 session Change 2790418 on 2015/12/04 by James.Golding Roll back HLOD lightmap UV change, Oz reporting issues when building lighting, need more investigation #rb none #tests none Change 2790333 on 2015/12/04 by James.Golding Add fallback to FMeshUtilities::PropagatePaintedColorsToRawMesh when mesh has been reduced in engine and WedgeMap is missing #rb martin.wilson #codereview jurre.debaare #tests Built HLOD meshes in the editor Change 2790292 on 2015/12/04 by Olaf.Piesche Free the new particle array at the beginning of the tick for each instance; that way, even if we're not rendering the array will be cleared and we don't keep injecting new particles that never get killed until rendering resumes #rb marcus.wassmer #tests Editor, PIE Change 2790003 on 2015/12/04 by James.Golding Fix possible crash in ALODActor::RemoveSubActor #rb keith.judge #codereview jurre.debaare #tests Generated HLOD proxy in editor Change 2789998 on 2015/12/04 by James.Golding
2015-12-08 09:25:02 -05:00
const nvtt::Quality QualityLevel = bPreview ? nvtt::Quality_Fastest : nvtt::Quality_Production;
nvtt::Format TextureFormat = nvtt::Format_DXT1;
if (PixelFormat == PF_DXT1)
{
TextureFormat = bSupportDXT1a ? nvtt::Format_DXT1a : nvtt::Format_DXT1;
}
else if (PixelFormat == PF_DXT3)
{
TextureFormat = nvtt::Format_DXT3;
}
else if (PixelFormat == PF_DXT5 && bIsNormalMap)
{
TextureFormat = nvtt::Format_DXT5n;
}
else if (PixelFormat == PF_DXT5)
{
TextureFormat = nvtt::Format_DXT5;
}
else if (PixelFormat == PF_B8G8R8A8)
{
TextureFormat = nvtt::Format_RGBA;
}
else if (PixelFormat == PF_BC4)
{
TextureFormat = nvtt::Format_BC4;
}
else if (PixelFormat == PF_BC5)
{
TextureFormat = nvtt::Format_BC5;
}
else
{
UE_LOG(LogTextureFormatDXT,Fatal,
TEXT("Unsupported EPixelFormat for compression: %u"),
(uint32)PixelFormat
);
}
InputOptions.setTextureLayout(nvtt::TextureType_2D, SizeX, SizeY);
// Not generating mips with NVTT, we will pass each mip in and compress it individually
InputOptions.setMipmapGeneration(false, -1);
verify(InputOptions.setMipmapData(SourceData, SizeX, SizeY));
if (bSRGB)
{
InputOptions.setGamma(2.2f, 2.2f);
}
else
{
InputOptions.setGamma(1.0f, 1.0f);
}
// Only used for mip and normal map generation
InputOptions.setWrapMode(nvtt::WrapMode_Mirror);
InputOptions.setFormat(nvtt::InputFormat_BGRA_8UB);
// Highest quality is 2x slower with only a small visual difference
// Might be worthwhile for normal maps though
CompressionOptions.setQuality(QualityLevel);
CompressionOptions.setFormat(TextureFormat);
if ( bIsNormalMap )
{
// For BC5 normal maps we don't care about the blue channel.
CompressionOptions.setColorWeights( 1.0f, 1.0f, 0.0f );
// Don't tell NVTT it's a normal map. It was producing noticeable artifacts during BC5 compression.
//InputOptions.setNormalMap(true);
}
else
{
CompressionOptions.setColorWeights(1, 1, 1);
}
Compressor.enableCudaAcceleration(bUseCUDAAcceleration);
//OutputHandler.ReserveMemory( Compressor.estimateSize(InputOptions, CompressionOptions) );
check(OutputHandler.BufferEnd - OutputHandler.Buffer <= Compressor.estimateSize(InputOptions, CompressionOptions));
// We're not outputting a dds file so disable the header
OutputOptions.setOutputHeader( false );
OutputOptions.setOutputHandler( &OutputHandler );
OutputOptions.setErrorHandler( &ErrorHandler );
}
/** Run the compressor. */
bool Compress()
{
TRACE_CPUPROFILER_EVENT_SCOPE(FNVTTCompressor::Compress);
return Compressor.process(InputOptions, CompressionOptions, OutputOptions) && ErrorHandler.bSuccess;
}
};
/**
* Asynchronous NVTT worker.
*/
class FAsyncNVTTWorker
{
public:
/**
* Initializes the data and creates the async compression task.
*/
FAsyncNVTTWorker(FNVTTCompressor* InCompressor)
: Compressor(InCompressor)
{
check(Compressor);
}
/** Compresses the texture. */
void DoWork()
{
bCompressionResults = Compressor->Compress();
}
/** Retrieve compression results. */
bool GetCompressionResults() const { return bCompressionResults; }
private:
/** The NVTT compressor. */
FNVTTCompressor* Compressor;
/** true if compression was successful. */
bool bCompressionResults;
};
namespace CompressionSettings
{
int32 BlocksPerBatch = 2048;
FAutoConsoleVariableRef BlocksPerBatch_CVar(
TEXT("Tex.AsyncDXTBlocksPerBatch"),
BlocksPerBatch,
TEXT("The number of blocks to compress in parallel for DXT compression.")
);
}
/**
* Compresses an image using NVTT.
* @param SourceData Source texture data to DXT compress, in BGRA 8bit per channel unsigned format.
* @param PixelFormat Texture format
* @param SizeX Number of texels along the X-axis
* @param SizeY Number of texels along the Y-axis
* @param bSRGB Whether the texture is in SRGB space
* @param bIsNormalMap Whether the texture is a normal map
* @param OutCompressedData Compressed image data output by nvtt.
*/
static bool CompressImageUsingNVTT(
const void* SourceData,
EPixelFormat PixelFormat,
int32 SizeX,
int32 SizeY,
bool bSRGB,
bool bIsNormalMap,
Copying //UE4/Orion-Staging (Orion Main @ CL-2792706 to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2792706 on 2015/12/07 by Terence.Burns Rebuild lightmaps automation changes - Sync and Build binary files for execution - Much improved error handling - Email notification support added. #Note - This should massively simplify the batch script we use to rebuild lightmaps. #rb none #Tests Run the RebuildLightmaps commandlet many times to ensure it runs and errors correctly. Change 2791950 on 2015/12/05 by Matt.Kuhlenschmidt Added settings to toggle on and off display of Ping and FPS values. Server FPS will be disabled before ship #rb none #test pc/ps4 golden path, pie Change 2791827 on 2015/12/05 by Marcus.Wassmer Fix texture memory leak. Fixes automation using too much memory. #rb Brad.Angelcyk #codereview bob.ferreira #test automation runs, editor. Change 2791313 on 2015/12/04 by Martin.Mittring fixed PS4 compiling #rb:Michael.Noland #test:not Change 2791014 on 2015/12/04 by Martin.Mittring nicer cvar help for r.PS4ContinuousSubmits #rb:Olaf.Piesche #code_review:Marcus.Wassmer #test:PC Change 2791011 on 2015/12/04 by Martin.Mittring fixed compile error when disabling ENABLE_TEXTURE_TRACKING #rb:Olaf.Piesche #test:run Paragon on PC Change 2790848 on 2015/12/04 by Martin.Mittring missing changes nicer cvar help, optimized unneccessary referencecounting, removed redundant code #rb:Olaf.Piesche #test:PC Paragon Change 2790840 on 2015/12/04 by Martin.Mittring nicer cvar help, optimized unneccessary referencecounting, removed redundant code #rb:Olaf.Piesche #test:PC Paragon Change 2791585 on 2015/12/04 by Michael.Noland Rendering: Added a more actionable error message to a check() failure for a FStaticLightingMesh that has already been processed when building lighting in a map that contains HLOD #rb None #tests Built lighting in a map that was crashing at this check() and verified that the message indicated the problematic mesh Change 2791244 on 2015/12/04 by Ryan.Brucks Submitting all my Paragon Content before the new Agora Branch. Change 2791240 on 2015/12/04 by Marcus.Wassmer Bump to .061 patch and new pub tools to pass cert #rb non #test compile ps4 Change 2791132 on 2015/12/04 by ryan.brucks RenderToTextureMacros: fixed issue with polygon index being +1 on accident Change 2790747 on 2015/12/04 by Terence.Burns Rebuild Lightmaps Automation Script - Adding the -unattended switch for build machines. #rb None #tests Run through the Rebuild Lightmaps UAT script process. Change 2790589 on 2015/12/04 by Bart.Bressler - Invite PS4 friend option for add party member button now works properly, also fixes crash. Fixes OR-10359. #rb sam.zamani #tests invited ps4 player using Invite PS4 Friend option, confirmed that player joined mcp party and ps4 session Change 2790418 on 2015/12/04 by James.Golding Roll back HLOD lightmap UV change, Oz reporting issues when building lighting, need more investigation #rb none #tests none Change 2790333 on 2015/12/04 by James.Golding Add fallback to FMeshUtilities::PropagatePaintedColorsToRawMesh when mesh has been reduced in engine and WedgeMap is missing #rb martin.wilson #codereview jurre.debaare #tests Built HLOD meshes in the editor Change 2790292 on 2015/12/04 by Olaf.Piesche Free the new particle array at the beginning of the tick for each instance; that way, even if we're not rendering the array will be cleared and we don't keep injecting new particles that never get killed until rendering resumes #rb marcus.wassmer #tests Editor, PIE Change 2790003 on 2015/12/04 by James.Golding Fix possible crash in ALODActor::RemoveSubActor #rb keith.judge #codereview jurre.debaare #tests Generated HLOD proxy in editor Change 2789998 on 2015/12/04 by James.Golding
2015-12-08 09:25:02 -05:00
bool bIsPreview,
TArray64<uint8>& OutCompressedData
)
{
check(PixelFormat == PF_DXT1 || PixelFormat == PF_DXT3 || PixelFormat == PF_DXT5 || PixelFormat == PF_BC4 || PixelFormat == PF_BC5);
// Avoid dependency on GPixelFormats in RenderCore.
const int32 BlockSizeX = 4;
const int32 BlockSizeY = 4;
const int32 BlockBytes = (PixelFormat == PF_DXT1 || PixelFormat == PF_BC4) ? 8 : 16;
const int32 ImageBlocksX = FMath::Max(SizeX / BlockSizeX, 1);
const int32 ImageBlocksY = FMath::Max(SizeY / BlockSizeY, 1);
const int32 BlocksPerBatch = FMath::Max<int32>(ImageBlocksX, FMath::RoundUpToPowerOfTwo(CompressionSettings::BlocksPerBatch));
const int32 RowsPerBatch = BlocksPerBatch / ImageBlocksX;
const int32 NumBatches = ImageBlocksY / RowsPerBatch;
// nvtt doesn't support 64-bit output sizes.
int64 OutDataSize = (int64)ImageBlocksX * ImageBlocksY * BlockBytes;
if (OutDataSize > MAX_uint32)
{
return false;
}
// Allocate space to store compressed data.
OutCompressedData.Empty(OutDataSize);
OutCompressedData.AddUninitialized(OutDataSize);
if (ImageBlocksX * ImageBlocksY <= BlocksPerBatch ||
BlocksPerBatch % ImageBlocksX != 0 ||
RowsPerBatch * NumBatches != ImageBlocksY)
{
FNVTTCompressor* Compressor = NULL;
{
Compressor = new FNVTTCompressor(
SourceData,
PixelFormat,
SizeX,
SizeY,
bSRGB,
bIsNormalMap,
OutCompressedData.GetData(),
Copying //UE4/Orion-Staging (Orion Main @ CL-2792706 to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2792706 on 2015/12/07 by Terence.Burns Rebuild lightmaps automation changes - Sync and Build binary files for execution - Much improved error handling - Email notification support added. #Note - This should massively simplify the batch script we use to rebuild lightmaps. #rb none #Tests Run the RebuildLightmaps commandlet many times to ensure it runs and errors correctly. Change 2791950 on 2015/12/05 by Matt.Kuhlenschmidt Added settings to toggle on and off display of Ping and FPS values. Server FPS will be disabled before ship #rb none #test pc/ps4 golden path, pie Change 2791827 on 2015/12/05 by Marcus.Wassmer Fix texture memory leak. Fixes automation using too much memory. #rb Brad.Angelcyk #codereview bob.ferreira #test automation runs, editor. Change 2791313 on 2015/12/04 by Martin.Mittring fixed PS4 compiling #rb:Michael.Noland #test:not Change 2791014 on 2015/12/04 by Martin.Mittring nicer cvar help for r.PS4ContinuousSubmits #rb:Olaf.Piesche #code_review:Marcus.Wassmer #test:PC Change 2791011 on 2015/12/04 by Martin.Mittring fixed compile error when disabling ENABLE_TEXTURE_TRACKING #rb:Olaf.Piesche #test:run Paragon on PC Change 2790848 on 2015/12/04 by Martin.Mittring missing changes nicer cvar help, optimized unneccessary referencecounting, removed redundant code #rb:Olaf.Piesche #test:PC Paragon Change 2790840 on 2015/12/04 by Martin.Mittring nicer cvar help, optimized unneccessary referencecounting, removed redundant code #rb:Olaf.Piesche #test:PC Paragon Change 2791585 on 2015/12/04 by Michael.Noland Rendering: Added a more actionable error message to a check() failure for a FStaticLightingMesh that has already been processed when building lighting in a map that contains HLOD #rb None #tests Built lighting in a map that was crashing at this check() and verified that the message indicated the problematic mesh Change 2791244 on 2015/12/04 by Ryan.Brucks Submitting all my Paragon Content before the new Agora Branch. Change 2791240 on 2015/12/04 by Marcus.Wassmer Bump to .061 patch and new pub tools to pass cert #rb non #test compile ps4 Change 2791132 on 2015/12/04 by ryan.brucks RenderToTextureMacros: fixed issue with polygon index being +1 on accident Change 2790747 on 2015/12/04 by Terence.Burns Rebuild Lightmaps Automation Script - Adding the -unattended switch for build machines. #rb None #tests Run through the Rebuild Lightmaps UAT script process. Change 2790589 on 2015/12/04 by Bart.Bressler - Invite PS4 friend option for add party member button now works properly, also fixes crash. Fixes OR-10359. #rb sam.zamani #tests invited ps4 player using Invite PS4 Friend option, confirmed that player joined mcp party and ps4 session Change 2790418 on 2015/12/04 by James.Golding Roll back HLOD lightmap UV change, Oz reporting issues when building lighting, need more investigation #rb none #tests none Change 2790333 on 2015/12/04 by James.Golding Add fallback to FMeshUtilities::PropagatePaintedColorsToRawMesh when mesh has been reduced in engine and WedgeMap is missing #rb martin.wilson #codereview jurre.debaare #tests Built HLOD meshes in the editor Change 2790292 on 2015/12/04 by Olaf.Piesche Free the new particle array at the beginning of the tick for each instance; that way, even if we're not rendering the array will be cleared and we don't keep injecting new particles that never get killed until rendering resumes #rb marcus.wassmer #tests Editor, PIE Change 2790003 on 2015/12/04 by James.Golding Fix possible crash in ALODActor::RemoveSubActor #rb keith.judge #codereview jurre.debaare #tests Generated HLOD proxy in editor Change 2789998 on 2015/12/04 by James.Golding
2015-12-08 09:25:02 -05:00
OutCompressedData.Num(),
bIsPreview
);
}
bool bSuccess = Compressor->Compress();
{
delete Compressor;
Compressor = NULL;
}
return bSuccess;
}
int64 UncompressedStride = (int64)RowsPerBatch * BlockSizeY * SizeX * sizeof(FColor);
int32 CompressedStride = RowsPerBatch * ImageBlocksX * BlockBytes;
// Create compressors for each batch.
TIndirectArray<FNVTTCompressor> Compressors;
Compressors.Empty(NumBatches);
{
const uint8* Src = (const uint8*)SourceData;
uint8* Dest = OutCompressedData.GetData();
for (int32 BatchIndex = 0; BatchIndex < NumBatches; ++BatchIndex)
{
Compressors.Add(new FNVTTCompressor(
Src,
PixelFormat,
SizeX,
RowsPerBatch * BlockSizeY,
bSRGB,
bIsNormalMap,
Dest,
CompressedStride
));
Src += UncompressedStride;
Dest += CompressedStride;
}
}
// Asynchronously compress each batch.
bool bSuccess = true;
{
TArray<FAsyncNVTTWorker> AsyncTasks;
AsyncTasks.Reserve(NumBatches);
for (int32 BatchIndex = 0; BatchIndex < NumBatches; ++BatchIndex)
{
AsyncTasks.Emplace(&Compressors[BatchIndex]);
}
ParallelForTemplate(AsyncTasks.Num(), [&AsyncTasks](int32 TaskIndex)
{
AsyncTasks[TaskIndex].DoWork();
}, EParallelForFlags::Unbalanced);
for (int32 BatchIndex = 0; BatchIndex < NumBatches; ++BatchIndex)
{
bSuccess = bSuccess && AsyncTasks[BatchIndex].GetCompressionResults();
}
}
// Release compressors
{
Compressors.Empty();
}
return bSuccess;
}
/**
* DXT texture format handler.
*/
class FTextureFormatDXT : public ITextureFormat
{
virtual bool AllowParallelBuild() const override
{
return true;
}
virtual FName GetEncoderName(FName Format) const override
{
static const FName DXTName("EngineDXT");
return DXTName;
}
Copying //UE4/Dev-Mobile to //UE4/Main (Source: //UE4/Dev-Mobile @ 3600060) #rb none #lockdown nick.penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 3292215 on 2017/02/08 by Nick.Shin HTML5 emscripten: wasm and wbegl2 support - emscripten toolchain #jira UEPLAT-1437 Switch [to] web assembly #rb none Change 3293994 on 2017/02/09 by Nick.Shin HTML5 emscripten: wasm and webgl2 support - OSX toolchain #jira UEPLAT-1437 Switch [to] web assembly #rb none Change 3317951 on 2017/02/22 by Nick.Shin HTML5 emscripten: wasm & webgl2 support - RC1 - emscripten toolchain WARNING: emscripten/incoming/source/include/libc/bit (the file) might need to be deleted first #jira UEMOB-263 Switch [to] web assembly #jira UEMOB-201 Support ES3 / WebGL2 in HTML5 #rb none Change 3318669 on 2017/02/23 by Nick.Shin HTML5 emscripten: wasm & webgl2 support - RC1 - OSX toolchain #jira UEMOB-263 Switch [to] web assembly #jira UEMOB-201 Support ES3 / WebGL2 in HTML5 #rb none Change 3462146 on 2017/05/26 by Nick.Shin HTML5 - merge from Release-4.16 to Dev-Mobile #jira none #rb none #rnx Change 3504996 on 2017/06/22 by Cosmin.Sulea UEMOB-362 - Add per-texture and per-format compression quality override settings #rb Dmitriy.Dyomin #jira UEMOB-362 #codereview Dmitriy.Dyomin #codereview Jack.Porter Change 3505056 on 2017/06/22 by Cosmin.Sulea Back out changelist 3504996 - due to errors generated in xboxOne, PS4 and Switch versions #rb none Change 3508049 on 2017/06/23 by Nick.Shin HTML5 toolchain notes corrections #jira none #rb none #rnx Change 3508663 on 2017/06/24 by Nick.Shin HTML5LaunchHelper.exe on linux - redo - it seems that i need to also check-in the exe and pdb file instead of having CIS make and checking-in them itself... - modified c# program to output a version number to help track which version of HTML5LaunchHelper is running... #jira UE-45302 HTML5LaunchHelper.exe hosts the files in the current working directory on Linux #rnx #rb none Change 3509210 on 2017/06/26 by Dmitriy.Dyomin ExposureScale will be applied during tonemap pass when MobileHDR is on #rb jack.porter #codereview Allan.Bentham Change 3511058 on 2017/06/27 by Cosmin.Sulea UEMOB-362 - Add per-texture and per-format compression quality override settings - resubmitted #rb Dmitriy.Dyomin #jira UEMOB-362 #codereview Dmitriy.Dyomin Change 3511069 on 2017/06/27 by Jack.Porter PS4, XboxOne and Switch fixes for changes to ITextureFormat interface #rb Dmitriy.Dyomin #jira UEMOB-362 Change 3513028 on 2017/06/28 by Jack.Porter Merging //UE4/Dev-Main to Dev-Mobile (//UE4/Dev-Mobile) #rb None Change 3517409 on 2017/06/30 by Jack.Porter Merging //UE4/Dev-Main to Dev-Mobile (//UE4/Dev-Mobile) #rb None Change 3517730 on 2017/06/30 by Cosmin.Sulea UEMOB-328 - Improve handling of iOS signing key on remote Mac system keychain when using remote toolchain #rb Jack.Porter #jira UEMOB-328 #codereview: peter.sauerbrei Change 3517757 on 2017/06/30 by Cosmin.Sulea UE-46245 - Building with remote toolchain does not use Project Setting for iOS signing identity which can cause signing errors #rb Jack.Porter #jira UE-46245 #codereview: peter.sauerbrei Change 3518149 on 2017/06/30 by Adrian.Chelu UE-43035 Tilt axis for X and Z are not consistent between Android and iOS devices #rb Jack.Porter #jira UE-46245 #codereview: Chris Babcock <chris.babcock@epicgames.com> Change 3524242 on 2017/07/06 by Nick.Shin HTML5 - refraction shader note: this CL also contains fixes to webgl2 [float4 vs half2] and a [% vs Mod()] material custom function changes to some TM-ShaderModels shaders specifically: fixes to and similar with: DitherTemporalAA #jria UE-46434 No Refraction in QA Game TM-Shadermodels HTML5 #rb none #rn #codereview jack.porter dmitriy.dyomin Change 3535295 on 2017/07/13 by Allan.Bentham #jira UEMOB-390 Add Android cpu stats. add 'stat AndroidCPU' to android's console spinner UI. increase GetCPUState's core count support to 16. #jira UE-45888 Use cvar value to limit android cpu stat update rate. #rb none Change 3535306 on 2017/07/13 by Allan.Bentham Add missing pragma once #rb none Change 3537047 on 2017/07/13 by Ben.Marsh Fixing case of iOS directories, pt1 #rb none Change 3537051 on 2017/07/13 by Ben.Marsh Fixing case of iOS directories, pt2 #rb none Change 3537373 on 2017/07/14 by Allan.Bentham Add scope level android egl error verification. work around minor issue with invalid egl config property. #rb chris.babcock Change 3541735 on 2017/07/18 by Allan.Bentham Add 'sustained performance mode' support for API 24+ devices. #jira UEMOB-386 #rb chris.babcock Change 3543001 on 2017/07/18 by Sorin.Gradinaru #jira UE-45766 Improved Virtual Keyboard cannot receive non-English characters. - for Android, add an native EditBox above the virtual keyboard to receive the text and pass it to the object from the slate #rb Chris.Babcock Change 3554399 on 2017/07/25 by Nick.Shin STATS disabled for non multi-threaded platforms #jira UE-47485 ( Pri:1 - 4.18 ) Crash running Stat Command test in TM-Core on Firefox #rnx #rb none Change 3554402 on 2017/07/25 by Nick.Shin STATS TaskGraph disabled for non multi-threaded platforms #jira UE-47486 ( Pri:1 - 4.18 ) QAGame hard locks on Firefox when triggering Task Graph Benchmark test #rb none #rnx Change 3556957 on 2017/07/26 by Nick.Shin HTML5 - WASM enabled by default - part 1 -- commenting out asmjs stuff begin sunsetting ASM.JS note to self: CL#3462146 "backout" asmjs #jira UEMOB-416 WASM enabled by default #rnx #rb none Change 3557654 on 2017/07/26 by Nick.Shin HTML5 - WASM enabled by default - part 2 -- remove asmjs code sunsetting ASM.JS note to self: CL#3462146 "backout" asmjs #jira UEMOB-416 WASM enabled by default #rn #rb none Change 3557910 on 2017/07/27 by Jack.Porter Support Client configuration when packaging in the editor #jira UE-39973 #rb Dmitriy.Dyomin Change 3557917 on 2017/07/27 by Jack.Porter Missing file from CL 3557910 #rb trivial Change 3559642 on 2017/07/27 by Nick.Shin STATS TaskGraph disabled for non multi-threaded platforms - both "LockFree stress test" and "task graph benchmark" are disabled - no multi-threading for WASM exist yet (note: ASM.JS has been sunsetted) - stat command crash "fixed" - but, font size are totally broken - i can look at this (much) later... - new bug: physx will crash on "gc and level load stress test" -- please bug this as a new jira #jira UE-47486 ( Pri:1 - 4.18 ) QAGame hard locks on Firefox when triggering Task Graph Benchmark test #rb none #rnx Change 3565656 on 2017/07/31 by Dmitriy.Dyomin Added a way to lock level position in Word Composition #jira UE-47713 #rb none Change 3565757 on 2017/08/01 by Dmitriy.Dyomin compile fix #rb none Change 3567446 on 2017/08/01 by Chris.Babcock Allow addElement and addElements to only insert once with once="true" attribute in UPL #jira UE-47951 #ue4 #android #rb Peter.Sauerbrei Change 3567592 on 2017/08/01 by Chris.Babcock Use absolute path for repositories for Gradle #jira UE-47952 #ue4 #android #rb Tim.Lincoln Change 3568690 on 2017/08/02 by Chris.Babcock Removed warnings for once attribute in UPL #ue4 #android #rb none Change 3569975 on 2017/08/02 by Chris.Babcock Add <baseBuildGradleAdditions> to UPL to allow additions to the root-level build.gradle #jira UE-47995 #ue4 #android #rb Tim.Lincoln Change 3570117 on 2017/08/02 by Chris.Babcock Add <setBoolFromPropertyContains> to UPL - sets bool to true if string list in ini matches contains attribute #jira UE-47996 #ue4 #android #rb Jack.Porter Change 3571552 on 2017/08/03 by Chris.Babcock Removed unneeded settings.gradle file (generated) #jira UE-48041 #ue4 #android #rb none Change 3572224 on 2017/08/04 by Dmitriy.Dyomin Better selection tracking in world composition #rb none Change 3573662 on 2017/08/04 by Nick.Shin HTML5 remove PreLoadMap "feature" (was only available/used with HTML5) - asyncronous loads are not allowed during UEngine::LoadMap() - the files/code will be repurposed for pakfile CHUNK support #jira UEMOB-425 HTML5 streaming content investigation (part 1 of 2) #rn #rb none Change 3574471 on 2017/08/07 by Dmitriy.Dyomin Export ULevelStreamingKismet::LoadLevelInstance function #rb none Change 3576262 on 2017/08/08 by Dmitriy.Dyomin Fixed: widget clipping issues in world composition #rb none Change 3576845 on 2017/08/08 by Nick.Shin set HTML5LaunchHelper application's icon to UE4.ico #jira UE-19225 HTML5LaunchHelper application does not have an unreal icon #rb none #rnx Change 3578313 on 2017/08/09 by Dmitriy.Dyomin Added: an RHI call to invalidate/clear cached state, RHIInvalidateCachedState #jira UEMOB-435 #rb jack.porter Change 3578364 on 2017/08/09 by Dmitriy.Dyomin Vertex Fog is disabled on mobile by default. If scene uses vertex fog - Mobile preview and device will show on screen message: PROJECT HAS VERTEX FOG ON MOBILE DISABLED This saves about 90 instructions in VS and a few in PS #jira UEMOB-166 #rb jack.porter Change 3578703 on 2017/08/09 by Nick.Shin set HTML5LaunchHelper application's icon to UE4.ico forgot to check in exe and pdb file #jira UE-19225 HTML5LaunchHelper application does not have an unreal icon #rb none #rnx Change 3578961 on 2017/08/09 by Peter.Sauerbrei deprecate IOS 8 as the minimum OS supported. #jira UEMOB-429 #rb chris.babcock Change 3579319 on 2017/08/09 by Peter.Sauerbrei fixes for compile errors with Xcode 9 beta 4 #rb none Change 3579356 on 2017/08/09 by Peter.Sauerbrei modified minimum IOS to build with #rb chris.babcock Change 3579687 on 2017/08/09 by Chris.Babcock Fix GoogleVR Gradle packaging #jira UE-48239 #ue4 #android #rb none Change 3579921 on 2017/08/10 by Dmitriy.Dyomin GitHub 3670 : More zoom levels for World Composition (300) #contributedby: user37337 #jira UE-45977 #3670 #rb none Change 3580576 on 2017/08/10 by Peter.Sauerbrei detection of iPad Pro 10.5 and IPad Pro 12.9 (2nd Gen) #rb chris.babcock Change 3580611 on 2017/08/10 by Chris.Babcock Set online provider back to GooglePlay and remove forcing IAP permission (contributed by umerov1999) #jira UE-48185 #PR #3876 #ue4 #android #rb Peter.Sauerbrei Change 3582166 on 2017/08/11 by Nick.Shin nuke PLATFORM_HTML5_WIN32 PLATFORM_HTML5_WIN32 code removal tested successfully with (force rebuild and repackaging): * Win64 server (WindowsServer) * Win64 client (WindowsNoEditor) * HTML5 client all playing together via websocket net driver (i've attached a screen shot of this in jira) code changes touches: physics, audio and main build files #jira UEMOB-433 Remove Win32 SDL "HTML5 Simulator" code #rb ben.marsh #rnx #codereview josh.adams #fyi ori.cohen, aaron.mclera Change 3582474 on 2017/08/11 by Chris.Babcock Don't use V2 signing for Gear VR APKs #jira UE-48354 #ue4 #android #rb Peter.Sauerbrei Change 3582614 on 2017/08/11 by Chris.Babcock Filter out unneeded architectures from APK for Gradle builds #jira UE-48355 #ue4 #android #rb Peter.Sauerbrei Change 3582923 on 2017/08/11 by Nick.Shin backport release 4.17 to dev-mobile #jira none #rb none #rnx Change 3582924 on 2017/08/11 by Nick.Shin FNetworkFileServerHttp - error gracefully when port is already in use #jira UE-46409 [CrashReport] Assertion on Mac: Could not create a libwebsocket - FNetworkFileServerHttp::Init() #rnx #rb none Change 3582925 on 2017/08/11 by Nick.Shin HTML5 - turn off pak file compression in favor of gzip packages #jira UE-46729 HTML5 - on shipping builds - turn off pak file compression in favor of gzip packages #rn #rb none Change 3583943 on 2017/08/14 by Cosmin.Sulea UEMOB-363 - second iteration - Project wide texture quality control by texture group #rb Dmitriy Dyomin #jira UEMOB-363 Change 3583967 on 2017/08/14 by Cosmin.Sulea Back out changelist 3583943 #rb none Change 3584121 on 2017/08/14 by Peter.Sauerbrei fix for mac compile failure #rb none Change 3587877 on 2017/08/15 by Peter.Sauerbrei josh's suggested fix is not working for Xcode 8.3, so brute forcing for now #rb none Change 3588612 on 2017/08/15 by Peter.Sauerbrei Xcode 9 project compatbility updates #rb chris.babcock #codereview michael.trepka Change 3589223 on 2017/08/15 by Dmitriy.Dyomin Fixed: bNavigationAutoUpdateEnabled was not always working when reopeinig the map Fixed: Navigation Build was not clearing some mesh tiles when bNavigationAutoUpdateEnabled is enabled Fixed: Streaming out a level in editor was not always updating NavMesh debug draw #rb lukasz.furman Change 3589900 on 2017/08/16 by Dmitriy.Dyomin Support vulkan validation layers on Android, only in Debug and Development configuration (requires r.Vulkan.EnableValidation=1) #codereview chris.babcock, rolando.caloca #rb none Change 3590592 on 2017/08/16 by Nick.Shin HTML5 emscripten 1.37.19 OSX #jira UE-47813 #rb none #rn HTML5 emscripten 1.37.19 OSX Change 3590597 on 2017/08/16 by Nick.Shin HTML5 emscripten 1.37.19 Linux #jira UE-47813 #rb none #rn HTML5 emscripten 1.37.19 Linux Change 3590624 on 2017/08/16 by Nick.Shin HTML5 emscripten 1.37.19 toolchain #jira UE-47813 #rb none #rn HTML5 emscripten 1.37.19 toolchain Change 3591720 on 2017/08/16 by Chris.Babcock Enable Gradle by default and add button to accept Android SDK license to project settings #jira UE-48519 #ue4 #android #rb Tim.Lincoln #fyi Peter.Sauerbrei Change 3591998 on 2017/08/16 by Chris.Babcock Fix nonunity build #ue4 #android #rb none Change 3592407 on 2017/08/17 by Nick.Shin HTML5 emscripten 1.37.19 Win64 #jira UE-47813 #rb none #rn HTML5 emscripten 1.37.19 Win64 Change 3592479 on 2017/08/17 by Nick.Shin HTML5 3rd Party Libs - compiled with emscripten 1.37.19 #jira UE-47813 #rb none #rn HTML5 3rd Party Libs - compiled with emscripten 1.37.19 toolchain Change 3592480 on 2017/08/17 by Nick.Shin HTML5 emscripten 1.37.19 toolchain Epic edits as well as setting UE4 HTML c# scripts to use new toolchain #jira UE-47813 #rb none #rn HTML5 emscripten 1.37.19 toolchain Epic edits Change 3592481 on 2017/08/17 by Nick.Shin HTML5 remove old emscripten toolchain #jira UE-47813 #rb none #rn HTML5 remove old emscripten toolchain Change 3592485 on 2017/08/17 by Nick.Shin HTML5 undo CanUseXGE - this might be breaking CIS for HTML5 builds... #jira UE-47813 #rb none #rnx Change 3592549 on 2017/08/17 by Dmitriy.Dyomin Added GetDiskTotalAndFreeSpace for IOS and Android #jira UE-46479 #codereview chris.babcock, peter.sauerbrei #rb none Change 3594045 on 2017/08/17 by Peter.Sauerbrei comment about potential failure case in the remote tool chain #rb none Change 3594342 on 2017/08/17 by Peter.Sauerbrei Merging //UE4/Main/... to //UE4/Dev-Mobile/... #rb none Change 3594920 on 2017/08/17 by Peter.Sauerbrei fix for non-unity builds (accidentally merged something incorrectly) #rb none Change 3595347 on 2017/08/17 by Chris.Babcock merge fixes for Android #ue4 #android #rb Peter.Sauerbrei #lockdown Peter.Sauerbrei Change 3595752 on 2017/08/17 by Chris.Babcock Update Facebook plugin to support Gradle #jira UE-48569 #ue4 #android #fyi Josh.Markiewicz #rb none #lockdown Peter.Sauerbrei Change 3595849 on 2017/08/17 by Chris.Babcock Fix issue with libovrplatformloader.so for non armv7 targets #jira UE-48533 #ue4 #android #rb none #lockdown Peter.Sauerbrei Change 3596419 on 2017/08/18 by Peter.Sauerbrei fix for Mac Editor build failure #rb none Change 3597023 on 2017/08/18 by Peter.Sauerbrei fix for game editor build failure #rb none Change 3597032 on 2017/08/18 by Peter.Sauerbrei fix for app bundle id in Info-Editor.plist #rb none Change 3597034 on 2017/08/18 by Peter.Sauerbrei put back the info.plist, found the real problem #rb none Change 3597197 on 2017/08/18 by Peter.Sauerbrei pull Info.plist from the build products #rb none [CL 3600450 by Chris Babcock in Main branch]
2017-08-21 15:05:19 -04:00
virtual uint16 GetVersion(
FName Format,
const struct FTextureBuildSettings* BuildSettings = nullptr
) const override
{
return 0;
}
virtual void GetSupportedFormats(TArray<FName>& OutFormats) const override
{
for (int32 i = 0; i < UE_ARRAY_COUNT(GSupportedTextureFormatNames); ++i)
{
OutFormats.Add(GSupportedTextureFormatNames[i]);
}
}
virtual FTextureFormatCompressorCaps GetFormatCapabilities() const override
{
return FTextureFormatCompressorCaps(); // Default capabilities.
}
virtual EPixelFormat GetPixelFormatForImage(const struct FTextureBuildSettings& BuildSettings, const struct FImage& Image, bool bImageHasAlphaChannel) const override
{
if (BuildSettings.TextureFormatName == GTextureFormatNameDXT1)
{
return PF_DXT1;
}
else if (BuildSettings.TextureFormatName == GTextureFormatNameDXT3)
{
return PF_DXT3;
}
else if (BuildSettings.TextureFormatName == GTextureFormatNameDXT5)
{
return PF_DXT5;
}
else if (BuildSettings.TextureFormatName == GTextureFormatNameAutoDXT)
{
return bImageHasAlphaChannel ? PF_DXT5 : PF_DXT1;
}
else if (BuildSettings.TextureFormatName == GTextureFormatNameDXT5n)
{
return PF_DXT5;
}
else if (BuildSettings.TextureFormatName == GTextureFormatNameBC5)
{
return PF_BC5;
}
else if (BuildSettings.TextureFormatName == GTextureFormatNameBC4)
{
return PF_BC4;
}
UE_LOG(LogTextureFormatDXT, Fatal, TEXT("Unhandled texture format '%s' given to FTextureFormatDXT::GetPixelFormatForImage()"), *BuildSettings.TextureFormatName.ToString());
return PF_Unknown;
}
virtual bool CompressImage(
const FImage& InImage,
const struct FTextureBuildSettings& BuildSettings,
FStringView DebugTexturePathName,
bool bImageHasAlphaChannel,
FCompressedImage2D& OutCompressedImage
) const override
{
TRACE_CPUPROFILER_EVENT_SCOPE(FTextureFormatDXT::CompressImage);
FImage Image;
InImage.CopyTo(Image, ERawImageFormat::BGRA8, BuildSettings.GetGammaSpace());
EPixelFormat CompressedPixelFormat = GetPixelFormatForImage(BuildSettings, InImage, bImageHasAlphaChannel);
bool bIsNormalMap = BuildSettings.TextureFormatName == GTextureFormatNameDXT5n || BuildSettings.TextureFormatName == GTextureFormatNameBC5;
bool bCompressionSucceeded = true;
int64 SliceSize = (int64)Image.SizeX * Image.SizeY;
if (Image.NumSlices == 1 && OutCompressedImage.RawData.Num() == 0)
{
// Avoid using a temp buffer when it's not needed
bCompressionSucceeded = CompressImageUsingNVTT(
(&Image.AsBGRA8()[0]),
CompressedPixelFormat,
Image.SizeX,
Image.SizeY,
Image.IsGammaCorrected(),
bIsNormalMap,
Copying //UE4/Orion-Staging (Orion Main @ CL-2792706 to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2792706 on 2015/12/07 by Terence.Burns Rebuild lightmaps automation changes - Sync and Build binary files for execution - Much improved error handling - Email notification support added. #Note - This should massively simplify the batch script we use to rebuild lightmaps. #rb none #Tests Run the RebuildLightmaps commandlet many times to ensure it runs and errors correctly. Change 2791950 on 2015/12/05 by Matt.Kuhlenschmidt Added settings to toggle on and off display of Ping and FPS values. Server FPS will be disabled before ship #rb none #test pc/ps4 golden path, pie Change 2791827 on 2015/12/05 by Marcus.Wassmer Fix texture memory leak. Fixes automation using too much memory. #rb Brad.Angelcyk #codereview bob.ferreira #test automation runs, editor. Change 2791313 on 2015/12/04 by Martin.Mittring fixed PS4 compiling #rb:Michael.Noland #test:not Change 2791014 on 2015/12/04 by Martin.Mittring nicer cvar help for r.PS4ContinuousSubmits #rb:Olaf.Piesche #code_review:Marcus.Wassmer #test:PC Change 2791011 on 2015/12/04 by Martin.Mittring fixed compile error when disabling ENABLE_TEXTURE_TRACKING #rb:Olaf.Piesche #test:run Paragon on PC Change 2790848 on 2015/12/04 by Martin.Mittring missing changes nicer cvar help, optimized unneccessary referencecounting, removed redundant code #rb:Olaf.Piesche #test:PC Paragon Change 2790840 on 2015/12/04 by Martin.Mittring nicer cvar help, optimized unneccessary referencecounting, removed redundant code #rb:Olaf.Piesche #test:PC Paragon Change 2791585 on 2015/12/04 by Michael.Noland Rendering: Added a more actionable error message to a check() failure for a FStaticLightingMesh that has already been processed when building lighting in a map that contains HLOD #rb None #tests Built lighting in a map that was crashing at this check() and verified that the message indicated the problematic mesh Change 2791244 on 2015/12/04 by Ryan.Brucks Submitting all my Paragon Content before the new Agora Branch. Change 2791240 on 2015/12/04 by Marcus.Wassmer Bump to .061 patch and new pub tools to pass cert #rb non #test compile ps4 Change 2791132 on 2015/12/04 by ryan.brucks RenderToTextureMacros: fixed issue with polygon index being +1 on accident Change 2790747 on 2015/12/04 by Terence.Burns Rebuild Lightmaps Automation Script - Adding the -unattended switch for build machines. #rb None #tests Run through the Rebuild Lightmaps UAT script process. Change 2790589 on 2015/12/04 by Bart.Bressler - Invite PS4 friend option for add party member button now works properly, also fixes crash. Fixes OR-10359. #rb sam.zamani #tests invited ps4 player using Invite PS4 Friend option, confirmed that player joined mcp party and ps4 session Change 2790418 on 2015/12/04 by James.Golding Roll back HLOD lightmap UV change, Oz reporting issues when building lighting, need more investigation #rb none #tests none Change 2790333 on 2015/12/04 by James.Golding Add fallback to FMeshUtilities::PropagatePaintedColorsToRawMesh when mesh has been reduced in engine and WedgeMap is missing #rb martin.wilson #codereview jurre.debaare #tests Built HLOD meshes in the editor Change 2790292 on 2015/12/04 by Olaf.Piesche Free the new particle array at the beginning of the tick for each instance; that way, even if we're not rendering the array will be cleared and we don't keep injecting new particles that never get killed until rendering resumes #rb marcus.wassmer #tests Editor, PIE Change 2790003 on 2015/12/04 by James.Golding Fix possible crash in ALODActor::RemoveSubActor #rb keith.judge #codereview jurre.debaare #tests Generated HLOD proxy in editor Change 2789998 on 2015/12/04 by James.Golding
2015-12-08 09:25:02 -05:00
false, // Daniel Lamb: Testing with this set to true didn't give large performance gain to lightmaps. Encoding of 140 lightmaps was 19.2seconds with preview 20.1 without preview. 11/30/2015
OutCompressedImage.RawData
);
}
else
{
for (int32 SliceIndex = 0; SliceIndex < Image.NumSlices && bCompressionSucceeded; ++SliceIndex)
{
TArray64<uint8> CompressedSliceData;
bCompressionSucceeded = CompressImageUsingNVTT(
(&Image.AsBGRA8()[0]) + SliceIndex * SliceSize,
CompressedPixelFormat,
Image.SizeX,
Image.SizeY,
Image.IsGammaCorrected(),
bIsNormalMap,
false, // Daniel Lamb: Testing with this set to true didn't give large performance gain to lightmaps. Encoding of 140 lightmaps was 19.2seconds with preview 20.1 without preview. 11/30/2015
CompressedSliceData
);
OutCompressedImage.RawData.Append(MoveTemp(CompressedSliceData));
}
}
if (bCompressionSucceeded)
{
OutCompressedImage.SizeX = FMath::Max(Image.SizeX, 4);
OutCompressedImage.SizeY = FMath::Max(Image.SizeY, 4);
OutCompressedImage.SizeZ = (BuildSettings.bVolume || BuildSettings.bTextureArray) ? Image.NumSlices : 1;
OutCompressedImage.PixelFormat = CompressedPixelFormat;
}
return bCompressionSucceeded;
}
};
/**
* Module for DXT texture compression.
*/
static ITextureFormat* Singleton = NULL;
class FTextureFormatDXTModule : public ITextureFormatModule
{
public:
virtual ~FTextureFormatDXTModule()
{
delete Singleton;
Singleton = NULL;
}
virtual ITextureFormat* GetTextureFormat()
{
if (!Singleton)
{
Singleton = new FTextureFormatDXT();
}
return Singleton;
}
static inline UE::DerivedData::TBuildFunctionFactory<FDXTTextureBuildFunction> BuildFunctionFactory;
};
IMPLEMENT_MODULE(FTextureFormatDXTModule, TextureFormatDXT);