TexCache: Check alpha before scaling.

This will be faster when scaling.  We no longer need to wait, since we
only care about full alpha now.
This commit is contained in:
Unknown W. Brackets
2017-11-12 16:19:28 -08:00
parent 9fbcc01afa
commit e3b3828b15
4 changed files with 28 additions and 26 deletions

View File

@@ -867,11 +867,9 @@ void TextureCacheGLES::LoadTextureLevel(TexCacheEntry &entry, ReplacedTexture &r
// Textures are always aligned to 16 bytes bufw, so this could safely be 4 always.
texByteAlign = dstFmt == GL_UNSIGNED_BYTE ? 4 : 2;
pixelData = (u32 *)finalBuf;
if (scaleFactor > 1)
scaler.Scale(pixelData, dstFmt, w, h, scaleFactor);
// We check before scaling since scaling shouldn't invent alpha from a full alpha texture.
if ((entry.status & TexCacheEntry::STATUS_CHANGE_FREQUENT) == 0) {
TexCacheEntry::Status alphaStatus = CheckAlpha(pixelData, dstFmt, useUnpack ? bufw : w, w, h);
entry.SetAlphaStatus(alphaStatus, level);
@@ -879,6 +877,9 @@ void TextureCacheGLES::LoadTextureLevel(TexCacheEntry &entry, ReplacedTexture &r
entry.SetAlphaStatus(TexCacheEntry::STATUS_ALPHA_UNKNOWN);
}
if (scaleFactor > 1)
scaler.Scale(pixelData, dstFmt, w, h, scaleFactor);
if (replacer_.Enabled()) {
ReplacedTextureDecodeInfo replacedInfo;
replacedInfo.cachekey = entry.CacheKey();