mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-26 19:58:36 +01:00
Convert all CLUT entries ever loaded.
Some games reuse previously loaded bytes, like World Neverland. We displayed bad colors in these cases when we don't convert all the entries. Technically, this means we're hashing less than used in these cases, but if we hash more we will get lots of false cache misses. Fixes #6752.
This commit is contained in:
1 parent
2de6b471ce
commit
1e057a76b5
2 files changed
+5
-2
No files matched your search
@@ -63,7 +63,7 @@
|
||||
|
||||
extern int g_iNumVideos;
|
||||
|
||||
TextureCache::TextureCache() : clearCacheNextFrame_(false), lowMemoryMode_(false), clutBuf_(NULL), texelsScaledThisFrame_(0) {
|
||||
TextureCache::TextureCache() : clearCacheNextFrame_(false), lowMemoryMode_(false), clutBuf_(NULL), clutMaxBytes_(0), texelsScaledThisFrame_(0) {
|
||||
timesInvalidatedAllThisFrame_ = 0;
|
||||
lastBoundTexture = -1;
|
||||
decimationCounter_ = TEXCACHE_DECIMATION_INTERVAL;
|
||||
@@ -909,6 +909,7 @@ void TextureCache::LoadClut() {
|
||||
}
|
||||
// Reload the clut next time.
|
||||
clutLastFormat_ = 0xFFFFFFFF;
|
||||
clutMaxBytes_ = std::max(clutMaxBytes_, clutTotalBytes_);
|
||||
}
|
||||
|
||||
void TextureCache::UpdateCurrentClut() {
|
||||
@@ -923,7 +924,8 @@ void TextureCache::UpdateCurrentClut() {
|
||||
|
||||
// Avoid a copy when we don't need to convert colors.
|
||||
if (UseBGRA8888() || clutFormat != GE_CMODE_32BIT_ABGR8888) {
|
||||
ConvertColors(clutBufConverted_, clutBufRaw_, getClutDestFormat(clutFormat), clutExtendedBytes / sizeof(u16));
|
||||
const int numColors = (clutMaxBytes_ + clutBaseBytes) / (clutFormat == GE_CMODE_32BIT_ABGR8888 ? sizeof(u32) : sizeof(u16));
|
||||
ConvertColors(clutBufConverted_, clutBufRaw_, getClutDestFormat(clutFormat), numColors);
|
||||
clutBuf_ = clutBufConverted_;
|
||||
} else {
|
||||
clutBuf_ = clutBufRaw_;
|
||||
|
||||
@@ -226,6 +226,7 @@ private:
|
||||
u32 *clutBuf_;
|
||||
u32 clutHash_;
|
||||
u32 clutTotalBytes_;
|
||||
u32 clutMaxBytes_;
|
||||
// True if the clut is just alpha values in the same order (RGBA4444-bit only.)
|
||||
bool clutAlphaLinear_;
|
||||
u16 clutAlphaLinearColor_;
|
||||
|
||||
Reference in new issue
Block a user