mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 18:35:20 +00:00
Clear out GPU texture/stateset cache
This commit is contained in:
parent
7914fd5c9c
commit
b62cb0e2a4
@ -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…
x
Reference in New Issue
Block a user