Cache based on the full clutformat.
Not just 2 bits of it. Oops. Simpler this way.
This commit is contained in:
parent
2076b00c9d
commit
3efe7ae24d
2 changed files with 3 additions and 10 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue