mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-07 03:13:49 +00:00
Texture Cache performance improvements
This commit is contained in:
parent
a118a2e3dc
commit
6c32d5cd8f
|
@ -551,11 +551,7 @@ void TextureCache::destroy()
|
||||||
|
|
||||||
void TextureCache::_checkCacheSize()
|
void TextureCache::_checkCacheSize()
|
||||||
{
|
{
|
||||||
#ifdef VC
|
const size_t maxCacheSize = 8000;
|
||||||
const size_t maxCacheSize = 15000;
|
|
||||||
#else
|
|
||||||
const size_t maxCacheSize = 16384;
|
|
||||||
#endif
|
|
||||||
if (m_textures.size() >= maxCacheSize) {
|
if (m_textures.size() >= maxCacheSize) {
|
||||||
CachedTexture& clsTex = m_textures.back();
|
CachedTexture& clsTex = m_textures.back();
|
||||||
m_cachedBytes -= clsTex.textureBytes;
|
m_cachedBytes -= clsTex.textureBytes;
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#define TEXTURES_H
|
#define TEXTURES_H
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <unordered_map>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
#include "CRC.h"
|
#include "CRC.h"
|
||||||
|
@ -84,7 +85,7 @@ private:
|
||||||
void _getTextureDestData(CachedTexture& tmptex, u32* pDest, graphics::Parameter glInternalFormat, GetTexelFunc GetTexel, u16* pLine);
|
void _getTextureDestData(CachedTexture& tmptex, u32* pDest, graphics::Parameter glInternalFormat, GetTexelFunc GetTexel, u16* pLine);
|
||||||
|
|
||||||
typedef std::list<CachedTexture> Textures;
|
typedef std::list<CachedTexture> Textures;
|
||||||
typedef std::map<u32, Textures::iterator> Texture_Locations;
|
typedef std::unordered_map<u32, Textures::iterator> Texture_Locations;
|
||||||
typedef std::map<graphics::ObjectHandle, CachedTexture> FBTextures;
|
typedef std::map<graphics::ObjectHandle, CachedTexture> FBTextures;
|
||||||
Textures m_textures;
|
Textures m_textures;
|
||||||
Texture_Locations m_lruTextureLocations;
|
Texture_Locations m_lruTextureLocations;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user