You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Cache TextureFormat on the BuildSettings so we don't have to look through the TPM whenever we want it.
#rb charles.bloom #preflight 638f926c5624e6da5e0afa93 [CL 23414304 by Dan Thompson in ue5-main branch]
This commit is contained in:
@@ -3468,14 +3468,7 @@ public:
|
||||
{
|
||||
//TRACE_CPUPROFILER_EVENT_SCOPE(Texture.BuildTexture);
|
||||
|
||||
const ITextureFormat* TextureFormat = nullptr;
|
||||
|
||||
ITextureFormatManagerModule* TFM = GetTextureFormatManager();
|
||||
if (TFM)
|
||||
{
|
||||
TextureFormat = TFM->FindTextureFormat(BuildSettings.TextureFormatName);
|
||||
}
|
||||
if (TextureFormat == nullptr)
|
||||
if (BuildSettings.TextureFormat == nullptr)
|
||||
{
|
||||
UE_LOG(LogTextureCompressor, Warning,
|
||||
TEXT("Failed to find compressor for texture format '%s'. [%.*s]"),
|
||||
@@ -3500,7 +3493,7 @@ public:
|
||||
|
||||
// allow to leave texture in sRGB in case compressor accepts other than non-F32 input source
|
||||
// otherwise linearizing will force format to be RGBA32F
|
||||
const bool bNeedLinearize = !TextureFormat->CanAcceptNonF32Source() || AssociatedNormalSourceMips.Num() != 0;
|
||||
const bool bNeedLinearize = !BuildSettings.TextureFormat->CanAcceptNonF32Source() || AssociatedNormalSourceMips.Num() != 0;
|
||||
if (!BuildTextureMips(SourceMips, BuildSettings, bNeedLinearize, IntermediateMipChain, DebugTexturePathName))
|
||||
{
|
||||
return false;
|
||||
@@ -3581,7 +3574,7 @@ public:
|
||||
OutMetadata->PreEncodeMipsHash = MipHashBuilder.Finalize();
|
||||
}
|
||||
|
||||
bool bCompressSucceeded = CompressMipChain(TextureFormat, IntermediateMipChain, BuildSettings, bImageHasAlphaChannel, DebugTexturePathName,
|
||||
bool bCompressSucceeded = CompressMipChain(BuildSettings.TextureFormat, IntermediateMipChain, BuildSettings, bImageHasAlphaChannel, DebugTexturePathName,
|
||||
OutTextureMips, OutNumMipsInTail, OutExtData);
|
||||
|
||||
return bCompressSucceeded;
|
||||
|
||||
Reference in New Issue
Block a user