mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-02 10:43:44 +01:00
Cache based on the full clutformat.
Not just 2 bits of it. Oops. Simpler this way.
This commit is contained in:
1 parent
2076b00c9d
commit
3efe7ae24d
2 files changed
+3
-10
No files matched your search
@@ -767,12 +767,6 @@ inline bool TextureCache::TexCacheEntry::Matches(u16 dim2, u32 hash2, u8 format2
|
||||
return dim == dim2 && hash == hash2 && format == format2 && maxLevel == maxLevel2;
|
||||
}
|
||||
|
||||
inline bool TextureCache::TexCacheEntry::MatchesClut(bool hasClut, u8 clutformat2) {
|
||||
if (!hasClut)
|
||||
return true;
|
||||
return clutformat == clutformat2;
|
||||
}
|
||||
|
||||
void TextureCache::LoadClut() {
|
||||
u32 clutAddr = GetClutAddr();
|
||||
u32 clutTotalBytes = (gstate.loadclut & 0x3f) * 32;
|
||||
@@ -848,7 +842,7 @@ void TextureCache::SetTexture() {
|
||||
clutDirty_ = false;
|
||||
}
|
||||
clutformat = gstate.clutformat & 3;
|
||||
cluthash = GetCurrentClutHash();
|
||||
cluthash = GetCurrentClutHash() ^ gstate.clutformat;
|
||||
cachekey |= (u64)cluthash << 32;
|
||||
} else {
|
||||
clutformat = 0;
|
||||
@@ -898,7 +892,7 @@ void TextureCache::SetTexture() {
|
||||
//Validate the texture here (width, height etc)
|
||||
|
||||
int dim = gstate.texsize[0] & 0xF0F;
|
||||
bool match = entry->Matches(dim, texhash, format, maxLevel) && entry->MatchesClut(hasClut, clutformat);
|
||||
bool match = entry->Matches(dim, texhash, format, maxLevel);
|
||||
bool rehash = (entry->status & TexCacheEntry::STATUS_MASK) == TexCacheEntry::STATUS_UNRELIABLE;
|
||||
bool doDelete = true;
|
||||
|
||||
@@ -936,7 +930,7 @@ void TextureCache::SetTexture() {
|
||||
TexCache::iterator secondIter = secondCache.find(secondKey);
|
||||
if (secondIter != secondCache.end()) {
|
||||
TexCacheEntry *secondEntry = &secondIter->second;
|
||||
if (secondEntry->Matches(dim, texhash, format, maxLevel) && secondEntry->MatchesClut(hasClut, clutformat)) {
|
||||
if (secondEntry->Matches(dim, texhash, format, maxLevel)) {
|
||||
// Reset the numInvalidated value lower, we got a match.
|
||||
if (entry->numInvalidated > 8) {
|
||||
--entry->numInvalidated;
|
||||
|
||||
@@ -98,7 +98,6 @@ private:
|
||||
bool tClamp;
|
||||
|
||||
bool Matches(u16 dim2, u32 hash2, u8 format2, int maxLevel2);
|
||||
bool MatchesClut(bool hasClut, u8 clutformat2);
|
||||
};
|
||||
|
||||
void Decimate(); // Run this once per frame to get rid of old textures.
|
||||
|
||||
Reference in new issue
Block a user