1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-04 10:03:36 +00:00

Optimize TextureCache::_clear()

This commit is contained in:
Sergey Lipskiy 2016-07-02 13:07:45 +06:00
parent 5efd89ccd2
commit 006218c708

View File

@ -1368,10 +1368,13 @@ void TextureCache::_clear()
{
current[0] = current[1] = nullptr;
std::vector<GLuint> textureNames;
textureNames.reserve(m_textures.size());
for (Textures::const_iterator cur = m_textures.cbegin(); cur != m_textures.cend(); ++cur) {
m_cachedBytes -= cur->textureBytes;
glDeleteTextures(1, &cur->glName);
textureNames.push_back(cur->glName);
}
glDeleteTextures(textureNames.size(), textureNames.data());
m_textures.clear();
m_lruTextureLocations.clear();
}