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
|
|
|
|
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 "GenericPlatform/GenericPlatformStackWalk.h"
|
|
|
|
|
#include "Misc/Paths.h"
|
2014-03-14 14:13:41 -04:00
|
|
|
#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"
|
2014-03-14 14:13:41 -04:00
|
|
|
#include "TextureCompressorModule.h"
|
|
|
|
|
#include "PixelFormat.h"
|
|
|
|
|
#include "TextureConverter.h"
|
|
|
|
|
|
|
|
|
|
DEFINE_LOG_CATEGORY_STATIC(LogTextureFormatAndroid, Log, All);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Macro trickery for supported format names.
|
|
|
|
|
*/
|
|
|
|
|
#define ENUM_SUPPORTED_FORMATS(op) \
|
|
|
|
|
op(ATC_RGB) \
|
|
|
|
|
op(ATC_RGBA_E) \
|
|
|
|
|
op(ATC_RGBA_I) \
|
|
|
|
|
op(AutoATC) \
|
|
|
|
|
op(ETC1) \
|
|
|
|
|
op(AutoETC1) \
|
|
|
|
|
op(ETC2_RGB) \
|
|
|
|
|
op(ETC2_RGBA) \
|
|
|
|
|
op(AutoETC2)
|
|
|
|
|
|
|
|
|
|
#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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Compresses an image using Qonvert.
|
|
|
|
|
* @param SourceData Source texture data to 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 OutCompressedData Compressed image data output by Qonvert.
|
|
|
|
|
*/
|
|
|
|
|
static bool CompressImageUsingQonvert(
|
|
|
|
|
const void* SourceData,
|
|
|
|
|
EPixelFormat PixelFormat,
|
|
|
|
|
int32 SizeX,
|
|
|
|
|
int32 SizeY,
|
|
|
|
|
TArray<uint8>& OutCompressedData
|
|
|
|
|
)
|
|
|
|
|
{
|
|
|
|
|
// Avoid dependency on GPixelFormats in RenderCore.
|
|
|
|
|
const int32 BlockSizeX = 4;
|
|
|
|
|
const int32 BlockSizeY = 4;
|
|
|
|
|
const int32 BlockBytes = (PixelFormat == PF_ATC_RGBA_E || PixelFormat == PF_ATC_RGBA_I || PixelFormat == PF_ETC2_RGBA) ? 16 : 8;
|
|
|
|
|
const int32 ImageBlocksX = FMath::Max(SizeX / BlockSizeX, 1);
|
|
|
|
|
const int32 ImageBlocksY = FMath::Max(SizeY / BlockSizeY, 1);
|
|
|
|
|
|
|
|
|
|
// Allocate space to store compressed data.
|
|
|
|
|
OutCompressedData.Empty(ImageBlocksX * ImageBlocksY * BlockBytes);
|
|
|
|
|
OutCompressedData.AddUninitialized(ImageBlocksX * ImageBlocksY * BlockBytes);
|
|
|
|
|
|
|
|
|
|
TQonvertImage SrcImg;
|
|
|
|
|
TQonvertImage DstImg;
|
2015-01-14 04:21:10 -05:00
|
|
|
|
|
|
|
|
FMemory::Memzero(SrcImg);
|
|
|
|
|
FMemory::Memzero(DstImg);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
SrcImg.nWidth = SizeX;
|
|
|
|
|
SrcImg.nHeight = SizeY;
|
|
|
|
|
SrcImg.nFormat = Q_FORMAT_BGRA_8888;
|
|
|
|
|
SrcImg.nDataSize = SizeX * SizeY * 4;
|
|
|
|
|
SrcImg.pData = (unsigned char*)SourceData;
|
|
|
|
|
|
|
|
|
|
DstImg.nWidth = SizeX;
|
|
|
|
|
DstImg.nHeight = SizeY;
|
|
|
|
|
DstImg.nDataSize = ImageBlocksX * ImageBlocksY * BlockBytes;
|
2014-09-29 04:23:44 -04:00
|
|
|
DstImg.pData = OutCompressedData.GetData();
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
switch (PixelFormat)
|
|
|
|
|
{
|
|
|
|
|
case PF_ETC1:
|
|
|
|
|
DstImg.nFormat = Q_FORMAT_ETC1_RGB8;
|
|
|
|
|
break;
|
|
|
|
|
case PF_ETC2_RGB:
|
|
|
|
|
DstImg.nFormat = Q_FORMAT_ETC2_RGB8;
|
|
|
|
|
break;
|
|
|
|
|
case PF_ETC2_RGBA:
|
|
|
|
|
DstImg.nFormat = Q_FORMAT_ETC2_RGBA8;
|
|
|
|
|
break;
|
|
|
|
|
case PF_ATC_RGB:
|
|
|
|
|
DstImg.nFormat = Q_FORMAT_ATC_RGB;
|
|
|
|
|
break;
|
|
|
|
|
case PF_ATC_RGBA_E:
|
|
|
|
|
DstImg.nFormat = Q_FORMAT_ATC_RGBA_EXPLICIT_ALPHA;
|
|
|
|
|
break;
|
|
|
|
|
case PF_ATC_RGBA_I:
|
|
|
|
|
DstImg.nFormat = Q_FORMAT_ATC_RGBA_INTERPOLATED_ALPHA;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
UE_LOG(LogTextureFormatAndroid, Fatal, TEXT("Unsupported EPixelFormat for compression: %u"), (uint32)PixelFormat);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Qonvert(&SrcImg, &DstImg) != Q_SUCCESS)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* ATITC and ETC1/2 texture format handler.
|
|
|
|
|
*/
|
|
|
|
|
class FTextureFormatAndroid : public ITextureFormat
|
|
|
|
|
{
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual bool AllowParallelBuild() const override
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual uint16 GetVersion(FName Format) const override
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual void GetSupportedFormats(TArray<FName>& OutFormats) const override
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
for (int32 i = 0; i < ARRAY_COUNT(GSupportedTextureFormatNames); ++i)
|
|
|
|
|
{
|
|
|
|
|
OutFormats.Add(GSupportedTextureFormatNames[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual FTextureFormatCompressorCaps GetFormatCapabilities() const override
|
2014-04-23 20:04:50 -04:00
|
|
|
{
|
|
|
|
|
return FTextureFormatCompressorCaps(); // Default capabilities.
|
|
|
|
|
}
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
virtual bool CompressImage(
|
|
|
|
|
const FImage& InImage,
|
|
|
|
|
const struct FTextureBuildSettings& BuildSettings,
|
|
|
|
|
bool bImageHasAlphaChannel,
|
|
|
|
|
FCompressedImage2D& OutCompressedImage
|
2014-06-13 06:14:46 -04:00
|
|
|
) const override
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
FImage Image;
|
Gamma Correction - Changing the way all FColors are converted into FLinearColor by default. Previously all sRGB textures coming into the engine along with all other usage of FColor -> FLinearColor used a lookup table that assumed the final gamma correction would simply be pow(color, 1/DisplayGamma). However, that's not the case, we use the IEC 61966-2-1 standard on most platforms for both the scene renderer, as well as for gamma correction in Slate. In Slate you should now see an image matching Photoshop instead of being slightly darker in the lower ranges. However, because we don't want to invalidate all existing textures that users have authored, all existing UTextures have a UseLegacyGamma flag set to true, all new textures will be set to false. The flag is part of the DDC key calculation, but steps were taken so that when legacy is true, keys match existing keys to prevent universally invalidating all games DDCs just to make this change.
To summarize,
Old Pipeline: sRGB-Pow(2.2) -> Linear -> sRGB-IEC 61966
New Pipeline: sRGB-IEC 61966 -> Linear -> sRGB-IEC 61966
#codereview gil.gribb, nick.penwarden, martin.mittring
[CL 2571070 by Nick Darnell in Main branch]
2015-05-29 16:03:43 -04:00
|
|
|
InImage.CopyTo(Image, ERawImageFormat::BGRA8, BuildSettings.GetGammaSpace());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
EPixelFormat CompressedPixelFormat = PF_Unknown;
|
|
|
|
|
|
|
|
|
|
if (BuildSettings.TextureFormatName == GTextureFormatNameAutoETC1)
|
|
|
|
|
{
|
|
|
|
|
if (bImageHasAlphaChannel)
|
|
|
|
|
{
|
|
|
|
|
// ETC1 can't support an alpha channel, store uncompressed
|
|
|
|
|
OutCompressedImage.SizeX = Image.SizeX;
|
|
|
|
|
OutCompressedImage.SizeY = Image.SizeY;
|
|
|
|
|
OutCompressedImage.PixelFormat = PF_B8G8R8A8;
|
|
|
|
|
OutCompressedImage.RawData = Image.RawData;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
CompressedPixelFormat = PF_ETC1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if (BuildSettings.TextureFormatName == GTextureFormatNameETC1)
|
|
|
|
|
{
|
|
|
|
|
CompressedPixelFormat = PF_ETC1;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if (BuildSettings.TextureFormatName == GTextureFormatNameETC2_RGB ||
|
|
|
|
|
(BuildSettings.TextureFormatName == GTextureFormatNameAutoETC2 && !bImageHasAlphaChannel))
|
|
|
|
|
{
|
|
|
|
|
CompressedPixelFormat = PF_ETC2_RGB;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if (BuildSettings.TextureFormatName == GTextureFormatNameETC2_RGBA ||
|
|
|
|
|
(BuildSettings.TextureFormatName == GTextureFormatNameAutoETC2 && bImageHasAlphaChannel))
|
|
|
|
|
{
|
|
|
|
|
CompressedPixelFormat = PF_ETC2_RGBA;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if (BuildSettings.TextureFormatName == GTextureFormatNameATC_RGB ||
|
|
|
|
|
(BuildSettings.TextureFormatName == GTextureFormatNameAutoATC && !bImageHasAlphaChannel))
|
|
|
|
|
{
|
|
|
|
|
CompressedPixelFormat = PF_ATC_RGB;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if (BuildSettings.TextureFormatName == GTextureFormatNameATC_RGBA_I ||
|
|
|
|
|
(BuildSettings.TextureFormatName == GTextureFormatNameAutoATC && bImageHasAlphaChannel) )
|
|
|
|
|
{
|
|
|
|
|
CompressedPixelFormat = PF_ATC_RGBA_I;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if (BuildSettings.TextureFormatName == GTextureFormatNameATC_RGBA_E)
|
|
|
|
|
{
|
|
|
|
|
CompressedPixelFormat = PF_ATC_RGBA_E;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
check(CompressedPixelFormat != PF_Unknown);
|
|
|
|
|
|
|
|
|
|
bool bCompressionSucceeded = true;
|
|
|
|
|
int32 SliceSize = Image.SizeX * Image.SizeY;
|
|
|
|
|
for (int32 SliceIndex = 0; SliceIndex < Image.NumSlices && bCompressionSucceeded; ++SliceIndex)
|
|
|
|
|
{
|
|
|
|
|
TArray<uint8> CompressedSliceData;
|
|
|
|
|
bCompressionSucceeded = CompressImageUsingQonvert(
|
|
|
|
|
Image.AsBGRA8() + SliceIndex * SliceSize,
|
|
|
|
|
CompressedPixelFormat,
|
|
|
|
|
Image.SizeX,
|
|
|
|
|
Image.SizeY,
|
|
|
|
|
CompressedSliceData
|
|
|
|
|
);
|
|
|
|
|
OutCompressedImage.RawData.Append(CompressedSliceData);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (bCompressionSucceeded)
|
|
|
|
|
{
|
|
|
|
|
OutCompressedImage.SizeX = FMath::Max(Image.SizeX, 4);
|
|
|
|
|
OutCompressedImage.SizeY = FMath::Max(Image.SizeY, 4);
|
|
|
|
|
OutCompressedImage.PixelFormat = CompressedPixelFormat;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return bCompressionSucceeded;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Module for ATITC and ETC1/2 texture compression.
|
|
|
|
|
*/
|
|
|
|
|
static ITextureFormat* Singleton = NULL;
|
|
|
|
|
|
2015-07-15 09:20:40 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
#if PLATFORM_WINDOWS
|
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
|
|
|
Windows::HMODULE TextureConverterHandle = NULL;
|
2015-07-15 09:20:40 -04:00
|
|
|
FString QualCommBinariesRoot = FPaths::EngineDir() / TEXT("Binaries/ThirdParty/QualComm/Win64/");
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
class FTextureFormatAndroidModule : public ITextureFormatModule
|
|
|
|
|
{
|
|
|
|
|
public:
|
2015-07-16 09:55:37 -04:00
|
|
|
|
|
|
|
|
FTextureFormatAndroidModule()
|
|
|
|
|
{
|
|
|
|
|
#if PLATFORM_WINDOWS
|
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
|
|
|
TextureConverterHandle = Windows::LoadLibraryW(*(QualCommBinariesRoot + "TextureConverter.dll"));
|
2015-07-16 09:55:37 -04:00
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
virtual ~FTextureFormatAndroidModule()
|
|
|
|
|
{
|
|
|
|
|
delete Singleton;
|
|
|
|
|
Singleton = NULL;
|
2015-07-15 09:20:40 -04:00
|
|
|
|
|
|
|
|
#if PLATFORM_WINDOWS
|
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
|
|
|
Windows::FreeLibrary(TextureConverterHandle);
|
2015-07-15 09:20:40 -04:00
|
|
|
#endif
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
virtual ITextureFormat* GetTextureFormat()
|
|
|
|
|
{
|
|
|
|
|
if (!Singleton)
|
|
|
|
|
{
|
2015-07-15 09:20:40 -04:00
|
|
|
#if PLATFORM_WINDOWS
|
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
|
|
|
TextureConverterHandle = Windows::LoadLibraryW(*(QualCommBinariesRoot + "TextureConverter.dll"));
|
2015-07-15 09:20:40 -04:00
|
|
|
#endif
|
2014-03-14 14:13:41 -04:00
|
|
|
Singleton = new FTextureFormatAndroid();
|
|
|
|
|
}
|
|
|
|
|
return Singleton;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_MODULE(FTextureFormatAndroidModule, TextureFormatAndroid);
|