More aggressively decimate the second texcache.

This commit is contained in:
Unknown W. Brackets 2013-04-23 23:02:55 -07:00
parent 5bdf91ea43
commit fd34a2e74d

View file

@ -28,6 +28,8 @@
// If a texture hasn't been seen for this many frames, get rid of it.
#define TEXTURE_KILL_AGE 200
// These are cache misses, kill them quicker.
#define TEXTURE_SECOND_KILL_AGE 30
u32 RoundUpToPowerOf2(u32 v)
{
@ -89,7 +91,7 @@ void TextureCache::Decimate() {
++iter;
}
for (TexCache::iterator iter = secondCache.begin(), end = secondCache.end(); iter != end; ) {
if (iter->second.lastFrame + TEXTURE_KILL_AGE < gpuStats.numFrames) {
if (iter->second.lastFrame + TEXTURE_SECOND_KILL_AGE < gpuStats.numFrames) {
glDeleteTextures(1, &iter->second.texture);
secondCache.erase(iter++);
}