2016-01-07 08:17:16 -05:00
|
|
|
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
|
2014-09-18 17:49:40 -04:00
|
|
|
|
|
|
|
|
#include "Core.h"
|
|
|
|
|
#include "CoreMisc.h"
|
|
|
|
|
#include "ImageCore.h"
|
|
|
|
|
#include "ImageWrapper.h"
|
|
|
|
|
#include "ModuleInterface.h"
|
|
|
|
|
#include "ModuleManager.h"
|
|
|
|
|
#include "TargetPlatform.h"
|
|
|
|
|
#include "TextureCompressorModule.h"
|
|
|
|
|
#include "PixelFormat.h"
|
|
|
|
|
#include "GenericPlatformProcess.h"
|
|
|
|
|
|
2014-12-04 10:35:50 -05:00
|
|
|
|
2014-12-04 17:28:16 -05:00
|
|
|
// increment this if you change anything that will affect compression in this file, including FORCED_NORMAL_MAP_COMPRESSION_SIZE_VALUE
|
2016-06-13 12:20:22 -04:00
|
|
|
#define BASE_FORMAT_VERSION 35
|
2014-12-04 17:28:16 -05:00
|
|
|
|
2014-12-04 10:35:50 -05:00
|
|
|
#define MAX_QUALITY_BY_SIZE 4
|
|
|
|
|
#define MAX_QUALITY_BY_SPEED 3
|
2014-12-04 17:28:16 -05:00
|
|
|
#define FORCED_NORMAL_MAP_COMPRESSION_SIZE_VALUE 4
|
2014-12-04 10:35:50 -05:00
|
|
|
|
|
|
|
|
|
2014-09-18 17:49:40 -04:00
|
|
|
DEFINE_LOG_CATEGORY_STATIC(LogTextureFormatASTC, Log, All);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Macro trickery for supported format names.
|
|
|
|
|
*/
|
|
|
|
|
#define ENUM_SUPPORTED_FORMATS(op) \
|
|
|
|
|
op(ASTC_RGB) \
|
|
|
|
|
op(ASTC_RGBA) \
|
|
|
|
|
op(ASTC_RGBAuto) \
|
|
|
|
|
op(ASTC_NormalAG) \
|
|
|
|
|
op(ASTC_NormalRG)
|
|
|
|
|
|
|
|
|
|
#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
|
|
|
|
|
|
|
|
|
|
// ASTC file header format
|
|
|
|
|
#if PLATFORM_SUPPORTS_PRAGMA_PACK
|
|
|
|
|
#pragma pack(push, 4)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#define ASTC_MAGIC_CONSTANT 0x5CA1AB13
|
|
|
|
|
struct FASTCHeader
|
|
|
|
|
{
|
|
|
|
|
uint32 Magic;
|
|
|
|
|
uint8 BlockSizeX;
|
|
|
|
|
uint8 BlockSizeY;
|
|
|
|
|
uint8 BlockSizeZ;
|
|
|
|
|
uint8 TexelCountX[3];
|
|
|
|
|
uint8 TexelCountY[3];
|
|
|
|
|
uint8 TexelCountZ[3];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#if PLATFORM_SUPPORTS_PRAGMA_PACK
|
|
|
|
|
#pragma pack(pop)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
IImageWrapperModule& ImageWrapperModule = FModuleManager::LoadModuleChecked<IImageWrapperModule>(FName("ImageWrapper"));
|
|
|
|
|
|
2014-12-04 10:35:50 -05:00
|
|
|
|
|
|
|
|
static int32 GetDefaultCompressionBySizeValue()
|
|
|
|
|
{
|
|
|
|
|
// start at default quality, then lookup in .ini file
|
|
|
|
|
int32 CompressionModeValue = 0;
|
|
|
|
|
GConfig->GetInt(TEXT("/Script/UnrealEd.CookerSettings"), TEXT("DefaultASTCQualityBySize"), CompressionModeValue, GEngineIni);
|
|
|
|
|
|
|
|
|
|
FParse::Value(FCommandLine::Get(), TEXT("-astcqualitybysize="), CompressionModeValue);
|
|
|
|
|
CompressionModeValue = FMath::Min<uint32>(CompressionModeValue, MAX_QUALITY_BY_SIZE);
|
|
|
|
|
|
|
|
|
|
return CompressionModeValue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int32 GetDefaultCompressionBySpeedValue()
|
|
|
|
|
{
|
|
|
|
|
// start at default quality, then lookup in .ini file
|
|
|
|
|
int32 CompressionModeValue = 0;
|
|
|
|
|
GConfig->GetInt(TEXT("/Script/UnrealEd.CookerSettings"), TEXT("DefaultASTCQualityBySpeed"), CompressionModeValue, GEngineIni);
|
|
|
|
|
|
|
|
|
|
FParse::Value(FCommandLine::Get(), TEXT("-astcqualitybyspeed="), CompressionModeValue);
|
|
|
|
|
CompressionModeValue = FMath::Min<uint32>(CompressionModeValue, MAX_QUALITY_BY_SPEED);
|
|
|
|
|
|
|
|
|
|
return CompressionModeValue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static FString GetQualityString(int32 OverrideSizeValue=-1, int32 OverrideSpeedValue=-1)
|
|
|
|
|
{
|
|
|
|
|
// convert to a string
|
|
|
|
|
FString CompressionMode;
|
|
|
|
|
switch (OverrideSizeValue >= 0 ? OverrideSizeValue : GetDefaultCompressionBySizeValue())
|
|
|
|
|
{
|
|
|
|
|
case 0: CompressionMode = TEXT("12x12"); break;
|
|
|
|
|
case 1: CompressionMode = TEXT("10x10"); break;
|
|
|
|
|
case 2: CompressionMode = TEXT("8x8"); break;
|
|
|
|
|
case 3: CompressionMode = TEXT("6x6"); break;
|
|
|
|
|
case 4: CompressionMode = TEXT("4x4"); break;
|
|
|
|
|
default: UE_LOG(LogTemp, Fatal, TEXT("ASTC size quality higher than expected"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch (OverrideSpeedValue >= 0 ? OverrideSpeedValue : GetDefaultCompressionBySpeedValue())
|
|
|
|
|
{
|
|
|
|
|
case 0: CompressionMode += TEXT(" -veryfast"); break;
|
|
|
|
|
case 1: CompressionMode += TEXT(" -fast"); break;
|
|
|
|
|
case 2: CompressionMode += TEXT(" -medium"); break;
|
|
|
|
|
case 3: CompressionMode += TEXT(" -thorough"); break;
|
|
|
|
|
default: UE_LOG(LogTemp, Fatal, TEXT("ASTC speed quality higher than expected"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return CompressionMode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static EPixelFormat GetQualityFormat(int32 OverrideSizeValue=-1)
|
|
|
|
|
{
|
|
|
|
|
// convert to a string
|
|
|
|
|
EPixelFormat Format = PF_Unknown;
|
|
|
|
|
switch (OverrideSizeValue >= 0 ? OverrideSizeValue : GetDefaultCompressionBySizeValue())
|
|
|
|
|
{
|
|
|
|
|
case 0: Format = PF_ASTC_12x12; break;
|
|
|
|
|
case 1: Format = PF_ASTC_10x10; break;
|
|
|
|
|
case 2: Format = PF_ASTC_8x8; break;
|
|
|
|
|
case 3: Format = PF_ASTC_6x6; break;
|
|
|
|
|
case 4: Format = PF_ASTC_4x4; break;
|
|
|
|
|
default: UE_LOG(LogTemp, Fatal, TEXT("Max quality higher than expected"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Format;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static uint16 GetQualityVersion()
|
|
|
|
|
{
|
|
|
|
|
// top 3 bits for size compression value, and next 3 for speed
|
|
|
|
|
return (GetDefaultCompressionBySizeValue() << 13) | (GetDefaultCompressionBySpeedValue() << 10);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2014-09-18 17:49:40 -04:00
|
|
|
static bool CompressSliceToASTC(
|
|
|
|
|
const void* SourceData,
|
|
|
|
|
int32 SizeX,
|
|
|
|
|
int32 SizeY,
|
|
|
|
|
FString CompressionParameters,
|
|
|
|
|
TArray<uint8>& OutCompressedData
|
|
|
|
|
)
|
|
|
|
|
{
|
|
|
|
|
// Always Y-invert the image prior to compression for proper orientation post-compression
|
2015-03-11 17:28:22 -04:00
|
|
|
TArray<uint8> LineBuffer;
|
|
|
|
|
LineBuffer.AddUninitialized(16384 * 4);
|
2014-09-18 17:49:40 -04:00
|
|
|
uint32 LineSize = SizeX * 4;
|
|
|
|
|
for (int32 LineIndex = 0; LineIndex < (SizeY / 2); LineIndex++)
|
|
|
|
|
{
|
|
|
|
|
uint8* LineData0 = ((uint8*)SourceData) + (LineSize * LineIndex);
|
|
|
|
|
uint8* LineData1 = ((uint8*)SourceData) + (LineSize * (SizeY - LineIndex - 1));
|
2015-03-11 17:28:22 -04:00
|
|
|
FMemory::Memcpy(LineBuffer.GetData(), LineData0, LineSize);
|
|
|
|
|
FMemory::Memcpy(LineData0, LineData1, LineSize);
|
|
|
|
|
FMemory::Memcpy(LineData1, LineBuffer.GetData(), LineSize);
|
2014-09-18 17:49:40 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Compress and retrieve the PNG data to write out to disk
|
|
|
|
|
IImageWrapperPtr ImageWrapper = ImageWrapperModule.CreateImageWrapper(EImageFormat::PNG);
|
2014-12-04 10:35:50 -05:00
|
|
|
ImageWrapper->SetRaw(SourceData, SizeX * SizeY * 4, SizeX, SizeY, ERGBFormat::RGBA, 8);
|
2014-09-18 17:49:40 -04:00
|
|
|
const TArray<uint8>& FileData = ImageWrapper->GetCompressed();
|
|
|
|
|
int32 FileDataSize = FileData.Num();
|
|
|
|
|
|
|
|
|
|
FGuid Guid;
|
|
|
|
|
FPlatformMisc::CreateGuid(Guid);
|
|
|
|
|
FString InputFilePath = FString::Printf(TEXT("Cache/%08x-%08x-%08x-%08x-RGBToASTCIn.png"), Guid.A, Guid.B, Guid.C, Guid.D);
|
|
|
|
|
FString OutputFilePath = FString::Printf(TEXT("Cache/%08x-%08x-%08x-%08x-RGBToASTCOut.astc"), Guid.A, Guid.B, Guid.C, Guid.D);
|
|
|
|
|
|
|
|
|
|
InputFilePath = FPaths::GameIntermediateDir() + InputFilePath;
|
|
|
|
|
OutputFilePath = FPaths::GameIntermediateDir() + OutputFilePath;
|
|
|
|
|
|
|
|
|
|
FArchive* PNGFile = NULL;
|
|
|
|
|
while (!PNGFile)
|
|
|
|
|
{
|
2014-12-04 10:35:50 -05:00
|
|
|
PNGFile = IFileManager::Get().CreateFileWriter(*InputFilePath); // Occasionally returns NULL due to error code ERROR_SHARING_VIOLATION
|
2014-09-18 17:49:40 -04:00
|
|
|
FPlatformProcess::Sleep(0.01f); // ... no choice but to wait for the file to become free to access
|
|
|
|
|
}
|
|
|
|
|
PNGFile->Serialize((void*)&FileData[0], FileDataSize);
|
|
|
|
|
delete PNGFile;
|
|
|
|
|
|
|
|
|
|
// Compress PNG file to ASTC (using the reference astcenc.exe from ARM)
|
2015-03-11 17:28:22 -04:00
|
|
|
FString Params = FString::Printf(TEXT("-c \"%s\" \"%s\" %s"),
|
2014-09-18 17:49:40 -04:00
|
|
|
*InputFilePath,
|
|
|
|
|
*OutputFilePath,
|
|
|
|
|
*CompressionParameters
|
|
|
|
|
);
|
|
|
|
|
|
Copying //UE4/Dev-Platform to Dev-Main (//UE4/Dev-Main) (Source: //UE4/Dev-Platform @ 3061622)
#rb none
#lockdown nick.penwarden
Change 3046743 on 2016/07/12 by Mark.Satterthwaite
Revert Metal workaround for AtmosphericFog rendering on Intel & AMD from 2897082 and instead change the MetalBackend to emit a precise::sqrt(max(0.0, value)) instruction instead of sqrt(value) to avoid the NaN from -ve values. This may still be technically incorrect versus D3D, but it matches the existing OpenGL appearance.
#rb ben.woodhouse
#jira UE-33028
Change 3046820 on 2016/07/12 by Peter.Sauerbrei
PR#2594 - fix for analog input, courtesy of CleanCut
#rb daniel.lamb
Change 3046826 on 2016/07/12 by Peter.Sauerbrei
PR#2561 - addition of code to limit architecture in required caps for IOS, courtesy of derekvanvliet
#rb daniel.lamb
Change 3046835 on 2016/07/12 by Peter.Sauerbrei
PR#2559 - Increase the stack size on IOS and Mac, courtesy of derekvanvliet
PR#2552 - Addition for Apple ReplayKit Framework, courtesy of JoshuaKaiser
#rb daniel.lamb
Change 3046838 on 2016/07/12 by Peter.Sauerbrei
PR#2548 - Adding Log information when an unsupported audio type is used, courtesy of derekvanvliet
#rb daniel.lamb
Change 3046854 on 2016/07/12 by Peter.Sauerbrei
PR#2547 - fix for unrecognize selector crash on iOS, couretesy of derekvanvliet
PR#2384 - prevent crashes when initializing push notifications on IOS 7, courtesy of alk3ovation
#rb daniel.lamb
Change 3046858 on 2016/07/12 by Peter.Sauerbrei
PR#2475, #1868 - fix for mapping of iOS device name, courtesy of wingedrobin, derekvanvliet
PR#2567 - fix name of IPhoneSE in names array, courtesy of rohanliston
#rb daniel.lamb
Change 3046862 on 2016/07/12 by Peter.Sauerbrei
fix for type in tooltip
#jira UE-27123
#rb daniel.lamb
Change 3046919 on 2016/07/12 by Daniel.Lamb
Stop texture derived data from loading it's bulk data when the linker is destoryed.
#rb Peter.Sauerbrei
Change 3046922 on 2016/07/12 by Daniel.Lamb
Updated the default cooker gc settings so that it can have more resources.
Added support for cooker markup package and objects as (new flag) disregard for gc if it's still in use by the cooker.
Changed the way reentry data is stored in the cooker.
Cook only editor content flag in project settings now works again.
#rb Josh.Adams
#test cook Paragon
Change 3046924 on 2016/07/12 by Daniel.Lamb
Added support for encrypting ini files.
Added new project setting in the editor and setting in ufe.
Also added ForDistribution flag to ufe.
#rb Peter.Sauerbrei
Change 3046936 on 2016/07/12 by Mark.Satterthwaite
Fix compute shader TLV clear for async. compute on Mac.
#rb chris.babcock
Change 3047207 on 2016/07/12 by Mark.Satterthwaite
It is illegal to use a reference to an element within a TMap to initialise a new value that is to be added to the TMap as it causes heap-use-after-free.
#rb chris.babcock
Change 3047208 on 2016/07/12 by Mark.Satterthwaite
When removing a vertex don't attempt to copy from one element beyond the end of the array to fill the last element - that's a heap-buffer-overflow and is unnecessary because that element will no longer be used.
#rb chris.babcock
Change 3047209 on 2016/07/12 by Mark.Satterthwaite
Don't attempt to update Metal class counts if the MetalRHI is uninitalised - it will attempt to double-free the TMap.
#rb chris.babcock
Change 3047641 on 2016/07/13 by Lee.Clark
PS4 - Improve SDK Version checking messages
#rb none
Change 3047663 on 2016/07/13 by Keith.Judge
Orion - Various minor PS4-only things activated for XB1.
#rb none
Change 3047664 on 2016/07/13 by Keith.Judge
XB1 - Fix analysis warning of shadowing a member variable.
#rb none
Change 3047784 on 2016/07/13 by Keith.Judge
Xbox One - Memory and perf saving in query handling. Store 8 queries per allocation, rather than 1 so we're making the maximum use of the 256byte allocation granularity.
#rb None
Change 3047834 on 2016/07/13 by Keith.Judge
XB1 - Release underlying memory of 3D textures when destroying them. Oops!
#rb none
Change 3048190 on 2016/07/13 by Josh.Adams
- Now leave around the ASTC encoder input file on error, for reproing outside of the engine
#rb none
Change 3048256 on 2016/07/13 by Daniel.Lamb
Removed warning about missing file when using cook on the fly.
#rb Peter.Sauerbrei
Change 3048409 on 2016/07/13 by Daniel.Lamb
Improved output for saving packages in unattended builds.
#rb Jonathan.Fitzpatrick
Change 3048763 on 2016/07/13 by Peter.Sauerbrei
switch AppleTV to tvOS in the editor
#jira UE-30532
#rb michael.trepka
Change 3049608 on 2016/07/14 by Keith.Judge
XB1 - Optimize vertex/index buffer dynamic memory usage.
#rb none
Change 3049609 on 2016/07/14 by Keith.Judge
Xbox One CPU Perf - Add _RenderThread versions of Lock/Unlock Texture 2D to stop more RHI thread stalls.
#rb None
Change 3049610 on 2016/07/14 by Keith.Judge
Xbox One - Reduce latency of deferred deletions to two frames.
#rb None
Change 3049730 on 2016/07/14 by Keith.Judge
Xbox One - Disable _RenderThread versions of Lock/Unlock Texture 2D for now as they're causing hangs.
#rb None
Change 3049732 on 2016/07/14 by Keith.Judge
Xbox One - Add critical section to the query slot incrementing code as this wa causing a hang after running for a while as it can be done on any of the parallel rendering threads (not just the RHI thread.
Also remove optimization pragmas accidentally left in.
#rb none
Change 3049791 on 2016/07/14 by Keith.Judge
Xbox One - Made the occlusion query multithreading even more robust. Can play for ages now in a large level without a crash.
#rb None
Change 3049968 on 2016/07/14 by Jeremiah.Waldron
Adding AndroidDisableThreadedRendering CVar and device profiles for 4 specific devices that need to have threaded rendering disabled on them due to swap buffer issues.
Leaving previous checks in FAndroidMisc::AllowRenderThread as they are, but any new devices that need threaded rendering disabled should use the CVar
#jira UE-24954, UE-27685, UE-20067
#rb chris.babcock
Change 3050428 on 2016/07/14 by Jeremiah.Waldron
Fix for application window being terminated if an AlertDialog is showing onPause
Repro'd and fix tested on Samsung Galaxy Note 3
#android
#jira UE-32998
#rb chris.babcock
Change 3050642 on 2016/07/14 by Peter.Sauerbrei
fix for invalid generated plist
#rb daniel.lamb
Change 3050718 on 2016/07/14 by Josh.Adams
Merging //UE4/Dev-Main to Dev-Platform (//UE4/Dev-Platform)
#rb none
Change 3051327 on 2016/07/15 by Keith.Judge
Xbox One - Save memory when locking 2D textures by only allocating a linear copy of the mip/array slice we're locking, rather than the entire mip chain. I'll do the same for 3D textures next.
#rb None
Change 3051346 on 2016/07/15 by Keith.Judge
Xbox One - Same memory savings for UpdateTexture2D/3D. Only allocate for the mip/slice that we're updating, not the entire texture.
#rb None.
Change 3051530 on 2016/07/15 by Nick.Shin
github: minor typo fixes
#jira UE-32129 - GitHub 2513 : Update default output of HTML5 packaging
#rb none
Change 3053631 on 2016/07/18 by Mark.Satterthwaite
Don't attempt to bind a 2D texture to the FOnePassPointShadowProjectionShaderParameters because it just won't work on Metal - instead bind the black-cube. This fixes validation errors that prevent running projects under the debugger.
#codereview daniel.wright
#rb josh.adams
#jira UE-33350
Change 3053816 on 2016/07/18 by Mark.Satterthwaite
Fixes for iOS Metal:
- Depth-clip mode was erroneously exported on iOS SDK 9, it wasn't ever actually available.
- Stencil texture views are only required on Mac.
- State cache shouldn't suggest a render target change is required if the current state is clear and the new state is load/don't care as this breaks iOS rendering with MSAA.
- Instead the debug submissions should just directly invoke submit and switch to rendering so that its SetRenderTarget call always succeeds.
#rb michael.trepka
Change 3053818 on 2016/07/18 by Mark.Satterthwaite
Explicit casts for Metal precise::sqrt required for iOS to work with ffast-math workaround.
#rb michael.trepka
Change 3054426 on 2016/07/18 by Dmitry.Rekman
Fix case-sensitive compilation problems (UE-33420).
#codereview Olaf.Piesche
#rb none
Change 3054434 on 2016/07/18 by Mark.Satterthwaite
Silence delete-non-virtual-dtor warnings on iOS as we do on Mac.
#rb none
Change 3054719 on 2016/07/18 by Jeremiah.Waldron
Adding ShowHiddenAlertDialog JNI function to be called from native code after the render thread is resumed after pausing.
Tested locally on Galaxy Note 3. Tested on LG G4 by nick.shin. Tested on Galaxy S6 by chris.babcock
#jira UE-32998
#android
#rb chris.babcock
Change 3054742 on 2016/07/18 by Josh.Adams
Merging //UE4/Dev-Main to Dev-Platform (//UE4/Dev-Platform)
#rb none
Change 3054850 on 2016/07/18 by Dmitry.Rekman
Replace Fatal->Error so messagebox can be shown (UE-22818).
- Incorporates PR #1714 by zaps166.
#rb none
#tests Tried to create an invalid context, made sure messagebox is popping up.
Change 3055317 on 2016/07/19 by Lee.Clark
PS4 - Fix render target memory allocation
#jira UE-32988
#rb Marcus.Wassmer
Change 3055682 on 2016/07/19 by Brent.Pease
+ Fix Debug builds by removing force inline attribute only on debug builds to prevent a warning that is treated as an error
#rb michael.trepka
Change 3056065 on 2016/07/19 by Josh.Adams
Merging //UE4/Dev-Main to Dev-Platform (//UE4/Dev-Platform)
#rb none
Change 3056256 on 2016/07/19 by Chris.Babcock
Add optional log spew filtering callback to Run
#jira UE-33468
#ue4
#android
#rb Ben.Marsh
#codereview Jack.Porter
Change 3056727 on 2016/07/19 by Chris.Babcock
Added addition scope (plus.login) to Google Play Games builder
#jira UE-33480
#ue4
#android
#rb none
#codereview ryan.gerleve
Change 3056811 on 2016/07/19 by Jeff.Campeau
Xbox One now accepts client configs.
#rb none
Change 3057152 on 2016/07/20 by Dmitry.Rekman
Linux: use libc++ instead of libstdc++.
- Needed to solve problems with third-party C++ libraries (e.g. WebRTC).
- Bundled libc++ 3.8.1 (TPS cleared).
- Turned off ICU compilation (needs recompile against libc++).
- Some libraries (e.g. FBX sdk) still need libstdc++, so in practice it is going to be a mix.
#rb none
#tests Built and ran a number of Linux targets.
Change 3057362 on 2016/07/20 by Keith.Judge
XB1 - Fix busted merge from yesterday
#rb None
Change 3057647 on 2016/07/20 by Josh.Adams
Merging //UE4/Dev-Main to Dev-Platform (//UE4/Dev-Platform)
#rb none
Change 3057655 on 2016/07/20 by Daniel.Lamb
Added test cooking flag.
#rb Peter.Sauerbrei
#test Cook paragon.
Change 3058779 on 2016/07/20 by Dmitry.Rekman
Fix crash on cooker exit (UE-33583).
- Global/static tickable objects could outlive the collection and trigger asserts when removing themselves from it.
#rb Josh.Adams
#codereview Josh.Adams, Jamie.Dale
#tests Compiled and ran Linux editor.
#lockdown Josh.Adams
Change 3058835 on 2016/07/20 by Chris.Babcock
Enable GooglePlay and GameCenter plugins by default
#jira UE-33605
#ue4
#android
#ios
#rb mark.satterthwaite
#codereview Peter.Sauerbrei
#lockdown Josh.Adams
Change 3058847 on 2016/07/20 by Chris.Babcock
Fix Android device rule for AlcatelPixi3
#jira UE-33606
#ue4
#android
#rb none
#codereview Jeremiah.Walron
#lockdown Josh.Adams
Change 3059693 on 2016/07/21 by Josh.Adams
Merging //UE4/Dev-Main to Dev-Platform (//UE4/Dev-Platform)
#rb none
#lockdown nick.penwarden
Change 3060139 on 2016/07/21 by Chris.Babcock
Fix proguard entry for Android mediaplayer tracks
#jira UE-33644
#ue4
#android
#rb Josh.Adams
#lockdown Josh.Adams
Change 3061151 on 2016/07/22 by Niklas.Smedberg
Fast ASTC texture compression, using ISPC.
#jira UE-32308
#rb chris.babcock
#lockdown josh.adams
Change 3061428 on 2016/07/22 by Peter.Sauerbrei
Back out changelist 3061151 as it wasn't approved for submission
#rb none
#lockdown josh.adams
Change 3061436 on 2016/07/22 by Lee.Clark
PS4 - Back out render target mem allocation changes and put in a temp hack
#jira UE-33657
#codereview Marcus.Wassmer
#lockdown josh.adams
#rb none
[CL 3061637 by Josh Adams in Main branch]
2016-07-22 11:36:47 -04:00
|
|
|
UE_LOG(LogTextureFormatASTC, Display, TEXT("Compressing to ASTC (options = '%s')..."), *CompressionParameters);
|
2014-09-18 17:49:40 -04:00
|
|
|
|
|
|
|
|
// Start Compressor
|
2014-12-04 10:35:50 -05:00
|
|
|
#if PLATFORM_MAC
|
|
|
|
|
FString CompressorPath(FPaths::EngineDir() + TEXT("Binaries/ThirdParty/ARM/Mac/astcenc"));
|
|
|
|
|
#elif PLATFORM_LINUX
|
|
|
|
|
FString CompressorPath(FPaths::EngineDir() + TEXT("Binaries/ThirdParty/ARM/Linux32/astcenc"));
|
|
|
|
|
#elif PLATFORM_WINDOWS
|
|
|
|
|
FString CompressorPath(FPaths::EngineDir() + TEXT("Binaries/ThirdParty/ARM/Win32/astcenc.exe"));
|
|
|
|
|
#else
|
|
|
|
|
#error Unsupported platform
|
|
|
|
|
#endif
|
|
|
|
|
FProcHandle Proc = FPlatformProcess::CreateProc(*CompressorPath, *Params, true, false, false, NULL, -1, NULL, NULL);
|
2014-09-18 17:49:40 -04:00
|
|
|
|
|
|
|
|
// Failed to start the compressor process
|
2014-12-04 10:35:50 -05:00
|
|
|
if (!Proc.IsValid())
|
2014-09-18 17:49:40 -04:00
|
|
|
{
|
2014-12-04 10:35:50 -05:00
|
|
|
UE_LOG(LogTextureFormatASTC, Error, TEXT("Failed to start astcenc for compressing images (%s)"), *CompressorPath);
|
2014-09-18 17:49:40 -04:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Wait for the process to complete
|
|
|
|
|
int ReturnCode;
|
|
|
|
|
while (!FPlatformProcess::GetProcReturnCode(Proc, &ReturnCode))
|
|
|
|
|
{
|
|
|
|
|
FPlatformProcess::Sleep(0.01f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Did it work?
|
|
|
|
|
bool bConversionWasSuccessful = (ReturnCode == 0);
|
|
|
|
|
|
|
|
|
|
// Open compressed file and put the data in OutCompressedImage
|
|
|
|
|
if (bConversionWasSuccessful)
|
|
|
|
|
{
|
|
|
|
|
// Get raw file data
|
|
|
|
|
TArray<uint8> ASTCData;
|
|
|
|
|
FFileHelper::LoadFileToArray(ASTCData, *OutputFilePath);
|
|
|
|
|
|
|
|
|
|
// Process it
|
|
|
|
|
FASTCHeader* Header = (FASTCHeader*)ASTCData.GetData();
|
|
|
|
|
|
|
|
|
|
// Fiddle with the texel count data to get the right value
|
|
|
|
|
uint32 TexelCountX =
|
|
|
|
|
(Header->TexelCountX[0] << 0) +
|
|
|
|
|
(Header->TexelCountX[1] << 8) +
|
|
|
|
|
(Header->TexelCountX[2] << 16);
|
|
|
|
|
uint32 TexelCountY =
|
|
|
|
|
(Header->TexelCountY[0] << 0) +
|
|
|
|
|
(Header->TexelCountY[1] << 8) +
|
|
|
|
|
(Header->TexelCountY[2] << 16);
|
|
|
|
|
uint32 TexelCountZ =
|
|
|
|
|
(Header->TexelCountZ[0] << 0) +
|
|
|
|
|
(Header->TexelCountZ[1] << 8) +
|
|
|
|
|
(Header->TexelCountZ[2] << 16);
|
|
|
|
|
|
2014-12-04 10:35:50 -05:00
|
|
|
// UE_LOG(LogTextureFormatASTC, Display, TEXT(" Compressed Texture Header:"));
|
|
|
|
|
// UE_LOG(LogTextureFormatASTC, Display, TEXT(" Magic: %x"), Header->Magic);
|
|
|
|
|
// UE_LOG(LogTextureFormatASTC, Display, TEXT(" BlockSizeX: %u"), Header->BlockSizeX);
|
|
|
|
|
// UE_LOG(LogTextureFormatASTC, Display, TEXT(" BlockSizeY: %u"), Header->BlockSizeY);
|
|
|
|
|
// UE_LOG(LogTextureFormatASTC, Display, TEXT(" BlockSizeZ: %u"), Header->BlockSizeZ);
|
|
|
|
|
// UE_LOG(LogTextureFormatASTC, Display, TEXT(" TexelCountX: %u"), TexelCountX);
|
|
|
|
|
// UE_LOG(LogTextureFormatASTC, Display, TEXT(" TexelCountY: %u"), TexelCountY);
|
|
|
|
|
// UE_LOG(LogTextureFormatASTC, Display, TEXT(" TexelCountZ: %u"), TexelCountZ);
|
2014-09-18 17:49:40 -04:00
|
|
|
|
|
|
|
|
// Calculate size of this mip in blocks
|
|
|
|
|
uint32 MipSizeX = (TexelCountX + Header->BlockSizeX - 1) / Header->BlockSizeX;
|
|
|
|
|
uint32 MipSizeY = (TexelCountY + Header->BlockSizeY - 1) / Header->BlockSizeY;
|
|
|
|
|
|
|
|
|
|
// A block is always 16 bytes
|
|
|
|
|
uint32 MipSize = MipSizeX * MipSizeY * 16;
|
|
|
|
|
|
|
|
|
|
// Copy the compressed data
|
|
|
|
|
OutCompressedData.Empty(MipSize);
|
|
|
|
|
OutCompressedData.AddUninitialized(MipSize);
|
2014-12-04 10:35:50 -05:00
|
|
|
void* MipData = OutCompressedData.GetData();
|
2014-09-18 17:49:40 -04:00
|
|
|
|
|
|
|
|
// Calculate the offset to get to the mip data
|
|
|
|
|
check(sizeof(FASTCHeader) == 16);
|
|
|
|
|
check(ASTCData.Num() == (sizeof(FASTCHeader) + MipSize));
|
|
|
|
|
FMemory::Memcpy(MipData, ASTCData.GetData() + sizeof(FASTCHeader), MipSize);
|
Copying //UE4/Dev-Platform to Dev-Main (//UE4/Dev-Main) (Source: //UE4/Dev-Platform @ 3061622)
#rb none
#lockdown nick.penwarden
Change 3046743 on 2016/07/12 by Mark.Satterthwaite
Revert Metal workaround for AtmosphericFog rendering on Intel & AMD from 2897082 and instead change the MetalBackend to emit a precise::sqrt(max(0.0, value)) instruction instead of sqrt(value) to avoid the NaN from -ve values. This may still be technically incorrect versus D3D, but it matches the existing OpenGL appearance.
#rb ben.woodhouse
#jira UE-33028
Change 3046820 on 2016/07/12 by Peter.Sauerbrei
PR#2594 - fix for analog input, courtesy of CleanCut
#rb daniel.lamb
Change 3046826 on 2016/07/12 by Peter.Sauerbrei
PR#2561 - addition of code to limit architecture in required caps for IOS, courtesy of derekvanvliet
#rb daniel.lamb
Change 3046835 on 2016/07/12 by Peter.Sauerbrei
PR#2559 - Increase the stack size on IOS and Mac, courtesy of derekvanvliet
PR#2552 - Addition for Apple ReplayKit Framework, courtesy of JoshuaKaiser
#rb daniel.lamb
Change 3046838 on 2016/07/12 by Peter.Sauerbrei
PR#2548 - Adding Log information when an unsupported audio type is used, courtesy of derekvanvliet
#rb daniel.lamb
Change 3046854 on 2016/07/12 by Peter.Sauerbrei
PR#2547 - fix for unrecognize selector crash on iOS, couretesy of derekvanvliet
PR#2384 - prevent crashes when initializing push notifications on IOS 7, courtesy of alk3ovation
#rb daniel.lamb
Change 3046858 on 2016/07/12 by Peter.Sauerbrei
PR#2475, #1868 - fix for mapping of iOS device name, courtesy of wingedrobin, derekvanvliet
PR#2567 - fix name of IPhoneSE in names array, courtesy of rohanliston
#rb daniel.lamb
Change 3046862 on 2016/07/12 by Peter.Sauerbrei
fix for type in tooltip
#jira UE-27123
#rb daniel.lamb
Change 3046919 on 2016/07/12 by Daniel.Lamb
Stop texture derived data from loading it's bulk data when the linker is destoryed.
#rb Peter.Sauerbrei
Change 3046922 on 2016/07/12 by Daniel.Lamb
Updated the default cooker gc settings so that it can have more resources.
Added support for cooker markup package and objects as (new flag) disregard for gc if it's still in use by the cooker.
Changed the way reentry data is stored in the cooker.
Cook only editor content flag in project settings now works again.
#rb Josh.Adams
#test cook Paragon
Change 3046924 on 2016/07/12 by Daniel.Lamb
Added support for encrypting ini files.
Added new project setting in the editor and setting in ufe.
Also added ForDistribution flag to ufe.
#rb Peter.Sauerbrei
Change 3046936 on 2016/07/12 by Mark.Satterthwaite
Fix compute shader TLV clear for async. compute on Mac.
#rb chris.babcock
Change 3047207 on 2016/07/12 by Mark.Satterthwaite
It is illegal to use a reference to an element within a TMap to initialise a new value that is to be added to the TMap as it causes heap-use-after-free.
#rb chris.babcock
Change 3047208 on 2016/07/12 by Mark.Satterthwaite
When removing a vertex don't attempt to copy from one element beyond the end of the array to fill the last element - that's a heap-buffer-overflow and is unnecessary because that element will no longer be used.
#rb chris.babcock
Change 3047209 on 2016/07/12 by Mark.Satterthwaite
Don't attempt to update Metal class counts if the MetalRHI is uninitalised - it will attempt to double-free the TMap.
#rb chris.babcock
Change 3047641 on 2016/07/13 by Lee.Clark
PS4 - Improve SDK Version checking messages
#rb none
Change 3047663 on 2016/07/13 by Keith.Judge
Orion - Various minor PS4-only things activated for XB1.
#rb none
Change 3047664 on 2016/07/13 by Keith.Judge
XB1 - Fix analysis warning of shadowing a member variable.
#rb none
Change 3047784 on 2016/07/13 by Keith.Judge
Xbox One - Memory and perf saving in query handling. Store 8 queries per allocation, rather than 1 so we're making the maximum use of the 256byte allocation granularity.
#rb None
Change 3047834 on 2016/07/13 by Keith.Judge
XB1 - Release underlying memory of 3D textures when destroying them. Oops!
#rb none
Change 3048190 on 2016/07/13 by Josh.Adams
- Now leave around the ASTC encoder input file on error, for reproing outside of the engine
#rb none
Change 3048256 on 2016/07/13 by Daniel.Lamb
Removed warning about missing file when using cook on the fly.
#rb Peter.Sauerbrei
Change 3048409 on 2016/07/13 by Daniel.Lamb
Improved output for saving packages in unattended builds.
#rb Jonathan.Fitzpatrick
Change 3048763 on 2016/07/13 by Peter.Sauerbrei
switch AppleTV to tvOS in the editor
#jira UE-30532
#rb michael.trepka
Change 3049608 on 2016/07/14 by Keith.Judge
XB1 - Optimize vertex/index buffer dynamic memory usage.
#rb none
Change 3049609 on 2016/07/14 by Keith.Judge
Xbox One CPU Perf - Add _RenderThread versions of Lock/Unlock Texture 2D to stop more RHI thread stalls.
#rb None
Change 3049610 on 2016/07/14 by Keith.Judge
Xbox One - Reduce latency of deferred deletions to two frames.
#rb None
Change 3049730 on 2016/07/14 by Keith.Judge
Xbox One - Disable _RenderThread versions of Lock/Unlock Texture 2D for now as they're causing hangs.
#rb None
Change 3049732 on 2016/07/14 by Keith.Judge
Xbox One - Add critical section to the query slot incrementing code as this wa causing a hang after running for a while as it can be done on any of the parallel rendering threads (not just the RHI thread.
Also remove optimization pragmas accidentally left in.
#rb none
Change 3049791 on 2016/07/14 by Keith.Judge
Xbox One - Made the occlusion query multithreading even more robust. Can play for ages now in a large level without a crash.
#rb None
Change 3049968 on 2016/07/14 by Jeremiah.Waldron
Adding AndroidDisableThreadedRendering CVar and device profiles for 4 specific devices that need to have threaded rendering disabled on them due to swap buffer issues.
Leaving previous checks in FAndroidMisc::AllowRenderThread as they are, but any new devices that need threaded rendering disabled should use the CVar
#jira UE-24954, UE-27685, UE-20067
#rb chris.babcock
Change 3050428 on 2016/07/14 by Jeremiah.Waldron
Fix for application window being terminated if an AlertDialog is showing onPause
Repro'd and fix tested on Samsung Galaxy Note 3
#android
#jira UE-32998
#rb chris.babcock
Change 3050642 on 2016/07/14 by Peter.Sauerbrei
fix for invalid generated plist
#rb daniel.lamb
Change 3050718 on 2016/07/14 by Josh.Adams
Merging //UE4/Dev-Main to Dev-Platform (//UE4/Dev-Platform)
#rb none
Change 3051327 on 2016/07/15 by Keith.Judge
Xbox One - Save memory when locking 2D textures by only allocating a linear copy of the mip/array slice we're locking, rather than the entire mip chain. I'll do the same for 3D textures next.
#rb None
Change 3051346 on 2016/07/15 by Keith.Judge
Xbox One - Same memory savings for UpdateTexture2D/3D. Only allocate for the mip/slice that we're updating, not the entire texture.
#rb None.
Change 3051530 on 2016/07/15 by Nick.Shin
github: minor typo fixes
#jira UE-32129 - GitHub 2513 : Update default output of HTML5 packaging
#rb none
Change 3053631 on 2016/07/18 by Mark.Satterthwaite
Don't attempt to bind a 2D texture to the FOnePassPointShadowProjectionShaderParameters because it just won't work on Metal - instead bind the black-cube. This fixes validation errors that prevent running projects under the debugger.
#codereview daniel.wright
#rb josh.adams
#jira UE-33350
Change 3053816 on 2016/07/18 by Mark.Satterthwaite
Fixes for iOS Metal:
- Depth-clip mode was erroneously exported on iOS SDK 9, it wasn't ever actually available.
- Stencil texture views are only required on Mac.
- State cache shouldn't suggest a render target change is required if the current state is clear and the new state is load/don't care as this breaks iOS rendering with MSAA.
- Instead the debug submissions should just directly invoke submit and switch to rendering so that its SetRenderTarget call always succeeds.
#rb michael.trepka
Change 3053818 on 2016/07/18 by Mark.Satterthwaite
Explicit casts for Metal precise::sqrt required for iOS to work with ffast-math workaround.
#rb michael.trepka
Change 3054426 on 2016/07/18 by Dmitry.Rekman
Fix case-sensitive compilation problems (UE-33420).
#codereview Olaf.Piesche
#rb none
Change 3054434 on 2016/07/18 by Mark.Satterthwaite
Silence delete-non-virtual-dtor warnings on iOS as we do on Mac.
#rb none
Change 3054719 on 2016/07/18 by Jeremiah.Waldron
Adding ShowHiddenAlertDialog JNI function to be called from native code after the render thread is resumed after pausing.
Tested locally on Galaxy Note 3. Tested on LG G4 by nick.shin. Tested on Galaxy S6 by chris.babcock
#jira UE-32998
#android
#rb chris.babcock
Change 3054742 on 2016/07/18 by Josh.Adams
Merging //UE4/Dev-Main to Dev-Platform (//UE4/Dev-Platform)
#rb none
Change 3054850 on 2016/07/18 by Dmitry.Rekman
Replace Fatal->Error so messagebox can be shown (UE-22818).
- Incorporates PR #1714 by zaps166.
#rb none
#tests Tried to create an invalid context, made sure messagebox is popping up.
Change 3055317 on 2016/07/19 by Lee.Clark
PS4 - Fix render target memory allocation
#jira UE-32988
#rb Marcus.Wassmer
Change 3055682 on 2016/07/19 by Brent.Pease
+ Fix Debug builds by removing force inline attribute only on debug builds to prevent a warning that is treated as an error
#rb michael.trepka
Change 3056065 on 2016/07/19 by Josh.Adams
Merging //UE4/Dev-Main to Dev-Platform (//UE4/Dev-Platform)
#rb none
Change 3056256 on 2016/07/19 by Chris.Babcock
Add optional log spew filtering callback to Run
#jira UE-33468
#ue4
#android
#rb Ben.Marsh
#codereview Jack.Porter
Change 3056727 on 2016/07/19 by Chris.Babcock
Added addition scope (plus.login) to Google Play Games builder
#jira UE-33480
#ue4
#android
#rb none
#codereview ryan.gerleve
Change 3056811 on 2016/07/19 by Jeff.Campeau
Xbox One now accepts client configs.
#rb none
Change 3057152 on 2016/07/20 by Dmitry.Rekman
Linux: use libc++ instead of libstdc++.
- Needed to solve problems with third-party C++ libraries (e.g. WebRTC).
- Bundled libc++ 3.8.1 (TPS cleared).
- Turned off ICU compilation (needs recompile against libc++).
- Some libraries (e.g. FBX sdk) still need libstdc++, so in practice it is going to be a mix.
#rb none
#tests Built and ran a number of Linux targets.
Change 3057362 on 2016/07/20 by Keith.Judge
XB1 - Fix busted merge from yesterday
#rb None
Change 3057647 on 2016/07/20 by Josh.Adams
Merging //UE4/Dev-Main to Dev-Platform (//UE4/Dev-Platform)
#rb none
Change 3057655 on 2016/07/20 by Daniel.Lamb
Added test cooking flag.
#rb Peter.Sauerbrei
#test Cook paragon.
Change 3058779 on 2016/07/20 by Dmitry.Rekman
Fix crash on cooker exit (UE-33583).
- Global/static tickable objects could outlive the collection and trigger asserts when removing themselves from it.
#rb Josh.Adams
#codereview Josh.Adams, Jamie.Dale
#tests Compiled and ran Linux editor.
#lockdown Josh.Adams
Change 3058835 on 2016/07/20 by Chris.Babcock
Enable GooglePlay and GameCenter plugins by default
#jira UE-33605
#ue4
#android
#ios
#rb mark.satterthwaite
#codereview Peter.Sauerbrei
#lockdown Josh.Adams
Change 3058847 on 2016/07/20 by Chris.Babcock
Fix Android device rule for AlcatelPixi3
#jira UE-33606
#ue4
#android
#rb none
#codereview Jeremiah.Walron
#lockdown Josh.Adams
Change 3059693 on 2016/07/21 by Josh.Adams
Merging //UE4/Dev-Main to Dev-Platform (//UE4/Dev-Platform)
#rb none
#lockdown nick.penwarden
Change 3060139 on 2016/07/21 by Chris.Babcock
Fix proguard entry for Android mediaplayer tracks
#jira UE-33644
#ue4
#android
#rb Josh.Adams
#lockdown Josh.Adams
Change 3061151 on 2016/07/22 by Niklas.Smedberg
Fast ASTC texture compression, using ISPC.
#jira UE-32308
#rb chris.babcock
#lockdown josh.adams
Change 3061428 on 2016/07/22 by Peter.Sauerbrei
Back out changelist 3061151 as it wasn't approved for submission
#rb none
#lockdown josh.adams
Change 3061436 on 2016/07/22 by Lee.Clark
PS4 - Back out render target mem allocation changes and put in a temp hack
#jira UE-33657
#codereview Marcus.Wassmer
#lockdown josh.adams
#rb none
[CL 3061637 by Josh Adams in Main branch]
2016-07-22 11:36:47 -04:00
|
|
|
|
|
|
|
|
// Delete intermediate files
|
|
|
|
|
IFileManager::Get().Delete(*InputFilePath);
|
|
|
|
|
IFileManager::Get().Delete(*OutputFilePath);
|
2014-09-18 17:49:40 -04:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
Copying //UE4/Dev-Platform to Dev-Main (//UE4/Dev-Main) (Source: //UE4/Dev-Platform @ 3061622)
#rb none
#lockdown nick.penwarden
Change 3046743 on 2016/07/12 by Mark.Satterthwaite
Revert Metal workaround for AtmosphericFog rendering on Intel & AMD from 2897082 and instead change the MetalBackend to emit a precise::sqrt(max(0.0, value)) instruction instead of sqrt(value) to avoid the NaN from -ve values. This may still be technically incorrect versus D3D, but it matches the existing OpenGL appearance.
#rb ben.woodhouse
#jira UE-33028
Change 3046820 on 2016/07/12 by Peter.Sauerbrei
PR#2594 - fix for analog input, courtesy of CleanCut
#rb daniel.lamb
Change 3046826 on 2016/07/12 by Peter.Sauerbrei
PR#2561 - addition of code to limit architecture in required caps for IOS, courtesy of derekvanvliet
#rb daniel.lamb
Change 3046835 on 2016/07/12 by Peter.Sauerbrei
PR#2559 - Increase the stack size on IOS and Mac, courtesy of derekvanvliet
PR#2552 - Addition for Apple ReplayKit Framework, courtesy of JoshuaKaiser
#rb daniel.lamb
Change 3046838 on 2016/07/12 by Peter.Sauerbrei
PR#2548 - Adding Log information when an unsupported audio type is used, courtesy of derekvanvliet
#rb daniel.lamb
Change 3046854 on 2016/07/12 by Peter.Sauerbrei
PR#2547 - fix for unrecognize selector crash on iOS, couretesy of derekvanvliet
PR#2384 - prevent crashes when initializing push notifications on IOS 7, courtesy of alk3ovation
#rb daniel.lamb
Change 3046858 on 2016/07/12 by Peter.Sauerbrei
PR#2475, #1868 - fix for mapping of iOS device name, courtesy of wingedrobin, derekvanvliet
PR#2567 - fix name of IPhoneSE in names array, courtesy of rohanliston
#rb daniel.lamb
Change 3046862 on 2016/07/12 by Peter.Sauerbrei
fix for type in tooltip
#jira UE-27123
#rb daniel.lamb
Change 3046919 on 2016/07/12 by Daniel.Lamb
Stop texture derived data from loading it's bulk data when the linker is destoryed.
#rb Peter.Sauerbrei
Change 3046922 on 2016/07/12 by Daniel.Lamb
Updated the default cooker gc settings so that it can have more resources.
Added support for cooker markup package and objects as (new flag) disregard for gc if it's still in use by the cooker.
Changed the way reentry data is stored in the cooker.
Cook only editor content flag in project settings now works again.
#rb Josh.Adams
#test cook Paragon
Change 3046924 on 2016/07/12 by Daniel.Lamb
Added support for encrypting ini files.
Added new project setting in the editor and setting in ufe.
Also added ForDistribution flag to ufe.
#rb Peter.Sauerbrei
Change 3046936 on 2016/07/12 by Mark.Satterthwaite
Fix compute shader TLV clear for async. compute on Mac.
#rb chris.babcock
Change 3047207 on 2016/07/12 by Mark.Satterthwaite
It is illegal to use a reference to an element within a TMap to initialise a new value that is to be added to the TMap as it causes heap-use-after-free.
#rb chris.babcock
Change 3047208 on 2016/07/12 by Mark.Satterthwaite
When removing a vertex don't attempt to copy from one element beyond the end of the array to fill the last element - that's a heap-buffer-overflow and is unnecessary because that element will no longer be used.
#rb chris.babcock
Change 3047209 on 2016/07/12 by Mark.Satterthwaite
Don't attempt to update Metal class counts if the MetalRHI is uninitalised - it will attempt to double-free the TMap.
#rb chris.babcock
Change 3047641 on 2016/07/13 by Lee.Clark
PS4 - Improve SDK Version checking messages
#rb none
Change 3047663 on 2016/07/13 by Keith.Judge
Orion - Various minor PS4-only things activated for XB1.
#rb none
Change 3047664 on 2016/07/13 by Keith.Judge
XB1 - Fix analysis warning of shadowing a member variable.
#rb none
Change 3047784 on 2016/07/13 by Keith.Judge
Xbox One - Memory and perf saving in query handling. Store 8 queries per allocation, rather than 1 so we're making the maximum use of the 256byte allocation granularity.
#rb None
Change 3047834 on 2016/07/13 by Keith.Judge
XB1 - Release underlying memory of 3D textures when destroying them. Oops!
#rb none
Change 3048190 on 2016/07/13 by Josh.Adams
- Now leave around the ASTC encoder input file on error, for reproing outside of the engine
#rb none
Change 3048256 on 2016/07/13 by Daniel.Lamb
Removed warning about missing file when using cook on the fly.
#rb Peter.Sauerbrei
Change 3048409 on 2016/07/13 by Daniel.Lamb
Improved output for saving packages in unattended builds.
#rb Jonathan.Fitzpatrick
Change 3048763 on 2016/07/13 by Peter.Sauerbrei
switch AppleTV to tvOS in the editor
#jira UE-30532
#rb michael.trepka
Change 3049608 on 2016/07/14 by Keith.Judge
XB1 - Optimize vertex/index buffer dynamic memory usage.
#rb none
Change 3049609 on 2016/07/14 by Keith.Judge
Xbox One CPU Perf - Add _RenderThread versions of Lock/Unlock Texture 2D to stop more RHI thread stalls.
#rb None
Change 3049610 on 2016/07/14 by Keith.Judge
Xbox One - Reduce latency of deferred deletions to two frames.
#rb None
Change 3049730 on 2016/07/14 by Keith.Judge
Xbox One - Disable _RenderThread versions of Lock/Unlock Texture 2D for now as they're causing hangs.
#rb None
Change 3049732 on 2016/07/14 by Keith.Judge
Xbox One - Add critical section to the query slot incrementing code as this wa causing a hang after running for a while as it can be done on any of the parallel rendering threads (not just the RHI thread.
Also remove optimization pragmas accidentally left in.
#rb none
Change 3049791 on 2016/07/14 by Keith.Judge
Xbox One - Made the occlusion query multithreading even more robust. Can play for ages now in a large level without a crash.
#rb None
Change 3049968 on 2016/07/14 by Jeremiah.Waldron
Adding AndroidDisableThreadedRendering CVar and device profiles for 4 specific devices that need to have threaded rendering disabled on them due to swap buffer issues.
Leaving previous checks in FAndroidMisc::AllowRenderThread as they are, but any new devices that need threaded rendering disabled should use the CVar
#jira UE-24954, UE-27685, UE-20067
#rb chris.babcock
Change 3050428 on 2016/07/14 by Jeremiah.Waldron
Fix for application window being terminated if an AlertDialog is showing onPause
Repro'd and fix tested on Samsung Galaxy Note 3
#android
#jira UE-32998
#rb chris.babcock
Change 3050642 on 2016/07/14 by Peter.Sauerbrei
fix for invalid generated plist
#rb daniel.lamb
Change 3050718 on 2016/07/14 by Josh.Adams
Merging //UE4/Dev-Main to Dev-Platform (//UE4/Dev-Platform)
#rb none
Change 3051327 on 2016/07/15 by Keith.Judge
Xbox One - Save memory when locking 2D textures by only allocating a linear copy of the mip/array slice we're locking, rather than the entire mip chain. I'll do the same for 3D textures next.
#rb None
Change 3051346 on 2016/07/15 by Keith.Judge
Xbox One - Same memory savings for UpdateTexture2D/3D. Only allocate for the mip/slice that we're updating, not the entire texture.
#rb None.
Change 3051530 on 2016/07/15 by Nick.Shin
github: minor typo fixes
#jira UE-32129 - GitHub 2513 : Update default output of HTML5 packaging
#rb none
Change 3053631 on 2016/07/18 by Mark.Satterthwaite
Don't attempt to bind a 2D texture to the FOnePassPointShadowProjectionShaderParameters because it just won't work on Metal - instead bind the black-cube. This fixes validation errors that prevent running projects under the debugger.
#codereview daniel.wright
#rb josh.adams
#jira UE-33350
Change 3053816 on 2016/07/18 by Mark.Satterthwaite
Fixes for iOS Metal:
- Depth-clip mode was erroneously exported on iOS SDK 9, it wasn't ever actually available.
- Stencil texture views are only required on Mac.
- State cache shouldn't suggest a render target change is required if the current state is clear and the new state is load/don't care as this breaks iOS rendering with MSAA.
- Instead the debug submissions should just directly invoke submit and switch to rendering so that its SetRenderTarget call always succeeds.
#rb michael.trepka
Change 3053818 on 2016/07/18 by Mark.Satterthwaite
Explicit casts for Metal precise::sqrt required for iOS to work with ffast-math workaround.
#rb michael.trepka
Change 3054426 on 2016/07/18 by Dmitry.Rekman
Fix case-sensitive compilation problems (UE-33420).
#codereview Olaf.Piesche
#rb none
Change 3054434 on 2016/07/18 by Mark.Satterthwaite
Silence delete-non-virtual-dtor warnings on iOS as we do on Mac.
#rb none
Change 3054719 on 2016/07/18 by Jeremiah.Waldron
Adding ShowHiddenAlertDialog JNI function to be called from native code after the render thread is resumed after pausing.
Tested locally on Galaxy Note 3. Tested on LG G4 by nick.shin. Tested on Galaxy S6 by chris.babcock
#jira UE-32998
#android
#rb chris.babcock
Change 3054742 on 2016/07/18 by Josh.Adams
Merging //UE4/Dev-Main to Dev-Platform (//UE4/Dev-Platform)
#rb none
Change 3054850 on 2016/07/18 by Dmitry.Rekman
Replace Fatal->Error so messagebox can be shown (UE-22818).
- Incorporates PR #1714 by zaps166.
#rb none
#tests Tried to create an invalid context, made sure messagebox is popping up.
Change 3055317 on 2016/07/19 by Lee.Clark
PS4 - Fix render target memory allocation
#jira UE-32988
#rb Marcus.Wassmer
Change 3055682 on 2016/07/19 by Brent.Pease
+ Fix Debug builds by removing force inline attribute only on debug builds to prevent a warning that is treated as an error
#rb michael.trepka
Change 3056065 on 2016/07/19 by Josh.Adams
Merging //UE4/Dev-Main to Dev-Platform (//UE4/Dev-Platform)
#rb none
Change 3056256 on 2016/07/19 by Chris.Babcock
Add optional log spew filtering callback to Run
#jira UE-33468
#ue4
#android
#rb Ben.Marsh
#codereview Jack.Porter
Change 3056727 on 2016/07/19 by Chris.Babcock
Added addition scope (plus.login) to Google Play Games builder
#jira UE-33480
#ue4
#android
#rb none
#codereview ryan.gerleve
Change 3056811 on 2016/07/19 by Jeff.Campeau
Xbox One now accepts client configs.
#rb none
Change 3057152 on 2016/07/20 by Dmitry.Rekman
Linux: use libc++ instead of libstdc++.
- Needed to solve problems with third-party C++ libraries (e.g. WebRTC).
- Bundled libc++ 3.8.1 (TPS cleared).
- Turned off ICU compilation (needs recompile against libc++).
- Some libraries (e.g. FBX sdk) still need libstdc++, so in practice it is going to be a mix.
#rb none
#tests Built and ran a number of Linux targets.
Change 3057362 on 2016/07/20 by Keith.Judge
XB1 - Fix busted merge from yesterday
#rb None
Change 3057647 on 2016/07/20 by Josh.Adams
Merging //UE4/Dev-Main to Dev-Platform (//UE4/Dev-Platform)
#rb none
Change 3057655 on 2016/07/20 by Daniel.Lamb
Added test cooking flag.
#rb Peter.Sauerbrei
#test Cook paragon.
Change 3058779 on 2016/07/20 by Dmitry.Rekman
Fix crash on cooker exit (UE-33583).
- Global/static tickable objects could outlive the collection and trigger asserts when removing themselves from it.
#rb Josh.Adams
#codereview Josh.Adams, Jamie.Dale
#tests Compiled and ran Linux editor.
#lockdown Josh.Adams
Change 3058835 on 2016/07/20 by Chris.Babcock
Enable GooglePlay and GameCenter plugins by default
#jira UE-33605
#ue4
#android
#ios
#rb mark.satterthwaite
#codereview Peter.Sauerbrei
#lockdown Josh.Adams
Change 3058847 on 2016/07/20 by Chris.Babcock
Fix Android device rule for AlcatelPixi3
#jira UE-33606
#ue4
#android
#rb none
#codereview Jeremiah.Walron
#lockdown Josh.Adams
Change 3059693 on 2016/07/21 by Josh.Adams
Merging //UE4/Dev-Main to Dev-Platform (//UE4/Dev-Platform)
#rb none
#lockdown nick.penwarden
Change 3060139 on 2016/07/21 by Chris.Babcock
Fix proguard entry for Android mediaplayer tracks
#jira UE-33644
#ue4
#android
#rb Josh.Adams
#lockdown Josh.Adams
Change 3061151 on 2016/07/22 by Niklas.Smedberg
Fast ASTC texture compression, using ISPC.
#jira UE-32308
#rb chris.babcock
#lockdown josh.adams
Change 3061428 on 2016/07/22 by Peter.Sauerbrei
Back out changelist 3061151 as it wasn't approved for submission
#rb none
#lockdown josh.adams
Change 3061436 on 2016/07/22 by Lee.Clark
PS4 - Back out render target mem allocation changes and put in a temp hack
#jira UE-33657
#codereview Marcus.Wassmer
#lockdown josh.adams
#rb none
[CL 3061637 by Josh Adams in Main branch]
2016-07-22 11:36:47 -04:00
|
|
|
UE_LOG(LogTextureFormatASTC, Error, TEXT("ASTC encoder failed with return code %d, mip size (%d, %d). Leaving '%s' for testing."), ReturnCode, SizeX, SizeY, *InputFilePath);
|
|
|
|
|
// IFileManager::Get().Delete(*InputFilePath);
|
|
|
|
|
// IFileManager::Get().Delete(*OutputFilePath);
|
2014-09-18 17:49:40 -04:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Delete intermediate files
|
2014-12-04 10:35:50 -05:00
|
|
|
IFileManager::Get().Delete(*InputFilePath);
|
|
|
|
|
IFileManager::Get().Delete(*OutputFilePath);
|
2014-09-18 17:49:40 -04:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* ASTC texture format handler.
|
|
|
|
|
*/
|
|
|
|
|
class FTextureFormatASTC : public ITextureFormat
|
|
|
|
|
{
|
2014-12-04 10:46:04 -05:00
|
|
|
virtual bool AllowParallelBuild() const override
|
2014-09-18 17:49:40 -04:00
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2014-12-04 10:46:04 -05:00
|
|
|
virtual uint16 GetVersion(FName Format) const override
|
2014-09-18 17:49:40 -04:00
|
|
|
{
|
2014-12-04 17:28:16 -05:00
|
|
|
return GetQualityVersion() + BASE_FORMAT_VERSION;
|
2014-12-04 10:35:50 -05:00
|
|
|
}
|
|
|
|
|
|
2014-12-04 17:28:16 -05:00
|
|
|
// // Since we want to have per texture [group] compression settings, we need to have the key based on the texture
|
|
|
|
|
// virtual FString GetDerivedDataKeyString(const class UTexture& Texture) const override
|
|
|
|
|
// {
|
2015-03-17 09:50:32 -04:00
|
|
|
// const int32 LODBias = UDeviceProfileManager::Get().GetActiveProfile()->GetTextureLODSettings()->CalculateLODBias(Texture.Source.GetSizeX(), Texture.Source.GetSizeY(), Texture.LODGroup, Texture.LODBias, Texture.NumCinematicMipLevels, Texture.MipGenSettings);
|
2014-12-04 17:28:16 -05:00
|
|
|
// check(LODBias >= 0);
|
|
|
|
|
// return FString::Printf(TEXT("%02u%d_"), (uint32)LODBias, CVarVirtualTextureReducedMemoryEnabled->GetValueOnGameThread());
|
|
|
|
|
// }
|
|
|
|
|
|
2014-12-04 10:35:50 -05:00
|
|
|
virtual FTextureFormatCompressorCaps GetFormatCapabilities() const override
|
|
|
|
|
{
|
|
|
|
|
FTextureFormatCompressorCaps RetCaps;
|
|
|
|
|
// use defaults
|
|
|
|
|
return RetCaps;
|
2014-09-18 17:49:40 -04:00
|
|
|
}
|
|
|
|
|
|
2014-12-04 10:46:04 -05:00
|
|
|
virtual void GetSupportedFormats(TArray<FName>& OutFormats) const override
|
2014-09-18 17:49:40 -04:00
|
|
|
{
|
|
|
|
|
for (int32 i = 0; i < ARRAY_COUNT(GSupportedTextureFormatNames); ++i)
|
|
|
|
|
{
|
|
|
|
|
OutFormats.Add(GSupportedTextureFormatNames[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
virtual bool CompressImage(
|
|
|
|
|
const FImage& InImage,
|
|
|
|
|
const struct FTextureBuildSettings& BuildSettings,
|
|
|
|
|
bool bImageHasAlphaChannel,
|
|
|
|
|
FCompressedImage2D& OutCompressedImage
|
2014-12-04 10:46:04 -05:00
|
|
|
) const override
|
2014-09-18 17:49:40 -04:00
|
|
|
{
|
|
|
|
|
// Get Raw Image Data from passed in FImage
|
|
|
|
|
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-09-18 17:49:40 -04:00
|
|
|
|
|
|
|
|
// Determine the compressed pixel format and compression parameters
|
|
|
|
|
EPixelFormat CompressedPixelFormat = PF_Unknown;
|
|
|
|
|
FString CompressionParameters = TEXT("");
|
|
|
|
|
|
|
|
|
|
if (BuildSettings.TextureFormatName == GTextureFormatNameASTC_RGB ||
|
|
|
|
|
((BuildSettings.TextureFormatName == GTextureFormatNameASTC_RGBAuto) && !bImageHasAlphaChannel))
|
|
|
|
|
{
|
2014-12-04 10:35:50 -05:00
|
|
|
CompressedPixelFormat = GetQualityFormat();
|
2015-03-11 17:28:22 -04:00
|
|
|
CompressionParameters = FString::Printf(TEXT("%s %s -esw bgra -ch 1 1 1 0"), *GetQualityString(), /*BuildSettings.bSRGB ? TEXT("-srgb") :*/ TEXT("") );
|
2014-09-18 17:49:40 -04:00
|
|
|
}
|
|
|
|
|
else if (BuildSettings.TextureFormatName == GTextureFormatNameASTC_RGBA ||
|
|
|
|
|
((BuildSettings.TextureFormatName == GTextureFormatNameASTC_RGBAuto) && bImageHasAlphaChannel))
|
|
|
|
|
{
|
2014-12-04 10:35:50 -05:00
|
|
|
CompressedPixelFormat = GetQualityFormat();
|
2016-03-16 21:16:51 -04:00
|
|
|
CompressionParameters = FString::Printf(TEXT("%s %s -esw bgra -ch 1 1 1 1"), *GetQualityString(), /*BuildSettings.bSRGB ? TEXT("-srgb") :*/ TEXT("") );
|
2014-09-18 17:49:40 -04:00
|
|
|
}
|
|
|
|
|
else if (BuildSettings.TextureFormatName == GTextureFormatNameASTC_NormalAG)
|
|
|
|
|
{
|
2014-12-04 10:35:50 -05:00
|
|
|
CompressedPixelFormat = GetQualityFormat(FORCED_NORMAL_MAP_COMPRESSION_SIZE_VALUE);
|
|
|
|
|
CompressionParameters = FString::Printf(TEXT("%s -esw 0g0b -ch 0 1 0 1 -oplimit 1000 -mincorrel 0.99 -dblimit 60 -b 2.5 -v 3 1 1 0 50 0 -va 1 1 0 50"), *GetQualityString(FORCED_NORMAL_MAP_COMPRESSION_SIZE_VALUE, -1));
|
2014-09-18 17:49:40 -04:00
|
|
|
}
|
|
|
|
|
else if (BuildSettings.TextureFormatName == GTextureFormatNameASTC_NormalRG)
|
|
|
|
|
{
|
2014-12-04 10:35:50 -05:00
|
|
|
CompressedPixelFormat = GetQualityFormat(FORCED_NORMAL_MAP_COMPRESSION_SIZE_VALUE);
|
|
|
|
|
CompressionParameters = FString::Printf(TEXT("%s -esw bg00 -ch 1 1 0 0 -oplimit 1000 -mincorrel 0.99 -dblimit 60 -b 2.5 -v 3 1 1 0 50 0 -va 1 1 0 50"), *GetQualityString(FORCED_NORMAL_MAP_COMPRESSION_SIZE_VALUE, -1));
|
2014-09-18 17:49:40 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Compress the image, slice by slice
|
|
|
|
|
bool bCompressionSucceeded = true;
|
|
|
|
|
int32 SliceSizeInTexels = Image.SizeX * Image.SizeY;
|
|
|
|
|
for (int32 SliceIndex = 0; SliceIndex < Image.NumSlices && bCompressionSucceeded; ++SliceIndex)
|
|
|
|
|
{
|
|
|
|
|
TArray<uint8> CompressedSliceData;
|
|
|
|
|
bCompressionSucceeded = CompressSliceToASTC(
|
|
|
|
|
Image.AsBGRA8() + (SliceIndex * SliceSizeInTexels),
|
|
|
|
|
Image.SizeX,
|
|
|
|
|
Image.SizeY,
|
|
|
|
|
CompressionParameters,
|
|
|
|
|
CompressedSliceData
|
|
|
|
|
);
|
|
|
|
|
OutCompressedImage.RawData.Append(CompressedSliceData);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (bCompressionSucceeded)
|
|
|
|
|
{
|
|
|
|
|
OutCompressedImage.SizeX = Image.SizeX;
|
|
|
|
|
OutCompressedImage.SizeY = Image.SizeY;
|
|
|
|
|
OutCompressedImage.PixelFormat = CompressedPixelFormat;
|
|
|
|
|
}
|
|
|
|
|
return bCompressionSucceeded;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Module for ASTC texture compression.
|
|
|
|
|
*/
|
|
|
|
|
static ITextureFormat* Singleton = NULL;
|
|
|
|
|
|
|
|
|
|
class FTextureFormatASTCModule : public ITextureFormatModule
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
virtual ~FTextureFormatASTCModule()
|
|
|
|
|
{
|
|
|
|
|
delete Singleton;
|
|
|
|
|
Singleton = NULL;
|
|
|
|
|
}
|
|
|
|
|
virtual ITextureFormat* GetTextureFormat()
|
|
|
|
|
{
|
|
|
|
|
if (!Singleton)
|
|
|
|
|
{
|
|
|
|
|
Singleton = new FTextureFormatASTC();
|
|
|
|
|
}
|
|
|
|
|
return Singleton;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_MODULE(FTextureFormatASTCModule, TextureFormatASTC);
|