mirror of
https://github.com/izzy2lost/ppsspp.git
synced 2026-03-10 12:43:04 -07:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user