Include texture size in cache key.
This makes Tales of Destiny 2's towns significantly faster. It may however cause us to keep textures around for longer - but we still account for them in our metrics and invalidation.
This commit is contained in:
parent
49783edf6d
commit
58563324bd
2 changed files with 10 additions and 8 deletions
|
@ -1195,7 +1195,8 @@ bool TextureCache::SetOffsetTexture(u32 offset) {
|
|||
return false;
|
||||
}
|
||||
|
||||
u64 cachekey = (u64)(texaddr & 0x3FFFFFFF) << 32;
|
||||
const u16 dim = gstate.getTextureDimension(0);
|
||||
u64 cachekey = ((u64)(texaddr & 0x3FFFFFFF) << 32) | dim;
|
||||
TexCache::iterator iter = cache.find(cachekey);
|
||||
if (iter == cache.end()) {
|
||||
return false;
|
||||
|
@ -1241,6 +1242,7 @@ void TextureCache::SetTexture(bool force) {
|
|||
return;
|
||||
}
|
||||
|
||||
const u16 dim = gstate.getTextureDimension(0);
|
||||
int w = gstate.getTextureWidth(0);
|
||||
int h = gstate.getTextureHeight(0);
|
||||
|
||||
|
@ -1253,7 +1255,7 @@ void TextureCache::SetTexture(bool force) {
|
|||
bool hasClut = gstate.isTextureFormatIndexed();
|
||||
|
||||
// Ignore uncached/kernel when caching.
|
||||
u64 cachekey = (u64)(texaddr & 0x3FFFFFFF) << 32;
|
||||
u64 cachekey = ((u64)(texaddr & 0x3FFFFFFF) << 32) | dim;
|
||||
u32 cluthash;
|
||||
if (hasClut) {
|
||||
if (clutLastFormat_ != gstate.clutformat) {
|
||||
|
@ -1261,7 +1263,7 @@ void TextureCache::SetTexture(bool force) {
|
|||
UpdateCurrentClut();
|
||||
}
|
||||
cluthash = GetCurrentClutHash() ^ gstate.clutformat;
|
||||
cachekey |= cluthash;
|
||||
cachekey ^= cluthash;
|
||||
} else {
|
||||
cluthash = 0;
|
||||
}
|
||||
|
@ -1282,7 +1284,6 @@ void TextureCache::SetTexture(bool force) {
|
|||
if (iter != cache.end()) {
|
||||
entry = &iter->second;
|
||||
// Validate the texture still matches the cache entry.
|
||||
u16 dim = gstate.getTextureDimension(0);
|
||||
bool match = entry->Matches(dim, format, maxLevel);
|
||||
|
||||
// Check for FBO - slow!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue