mirror of
https://github.com/libretro/ppsspp.git
synced 2025-02-24 10:53:11 +00:00
Merge pull request #652 from unknownbrackets/texcache
Don't blacklist an invalidated texture forever
This commit is contained in:
commit
a76d1e26de
@ -94,7 +94,9 @@ void TextureCache::Invalidate(u32 addr, int size, bool force) {
|
||||
}
|
||||
if (force) {
|
||||
gpuStats.numTextureInvalidations++;
|
||||
iter->second.status = TexCacheEntry::STATUS_UNRELIABLE;
|
||||
// Start it over from 0.
|
||||
iter->second.numFrames = 0;
|
||||
iter->second.framesUntilNextFullHash = 0;
|
||||
} else {
|
||||
iter->second.invalidHint++;
|
||||
}
|
||||
@ -771,6 +773,9 @@ void TextureCache::SetTexture() {
|
||||
match = false;
|
||||
gpuStats.numTextureInvalidations++;
|
||||
entry->status = TexCacheEntry::STATUS_UNRELIABLE;
|
||||
entry->numFrames = 0;
|
||||
} else if (entry->status == TexCacheEntry::STATUS_UNRELIABLE && entry->numFrames > TexCacheEntry::FRAMES_REGAIN_TRUST) {
|
||||
entry->status = TexCacheEntry::STATUS_HASHING;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,6 +45,9 @@ public:
|
||||
private:
|
||||
|
||||
struct TexCacheEntry {
|
||||
// After marking STATUS_UNRELIABLE, if it stays the same this many frames we'll trust it again.
|
||||
const static int FRAMES_REGAIN_TRUST = 1000;
|
||||
|
||||
enum Status {
|
||||
STATUS_HASHING,
|
||||
STATUS_RELIABLE, // cache, don't hash
|
||||
|
Loading…
x
Reference in New Issue
Block a user