forked from mirror/openmw-tes3mp
Clear out GPU texture/stateset cache
This commit is contained in:
parent
7914fd5c9c
commit
b62cb0e2a4
2 changed files with 18 additions and 0 deletions
|
@ -122,6 +122,13 @@ namespace Resource
|
||||||
{
|
{
|
||||||
return _sharedStateSetList.size();
|
return _sharedStateSetList.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void clearCache()
|
||||||
|
{
|
||||||
|
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_listMutex);
|
||||||
|
_sharedTextureList.clear();
|
||||||
|
_sharedStateSetList.clear();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Set texture filtering settings on textures contained in a FlipController.
|
/// Set texture filtering settings on textures contained in a FlipController.
|
||||||
|
@ -710,6 +717,15 @@ namespace Resource
|
||||||
mSharedStateMutex.unlock();
|
mSharedStateMutex.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SceneManager::clearCache()
|
||||||
|
{
|
||||||
|
ResourceManager::clearCache();
|
||||||
|
|
||||||
|
mSharedStateMutex.lock();
|
||||||
|
mSharedStateManager->clearCache();
|
||||||
|
mSharedStateMutex.unlock();
|
||||||
|
}
|
||||||
|
|
||||||
void SceneManager::reportStats(unsigned int frameNumber, osg::Stats *stats) const
|
void SceneManager::reportStats(unsigned int frameNumber, osg::Stats *stats) const
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
|
|
@ -143,6 +143,8 @@ namespace Resource
|
||||||
/// @see ResourceManager::updateCache
|
/// @see ResourceManager::updateCache
|
||||||
virtual void updateCache(double referenceTime);
|
virtual void updateCache(double referenceTime);
|
||||||
|
|
||||||
|
virtual void clearCache();
|
||||||
|
|
||||||
virtual void reportStats(unsigned int frameNumber, osg::Stats* stats) const;
|
virtual void reportStats(unsigned int frameNumber, osg::Stats* stats) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in a new issue