Clear out GPU texture/stateset cache

experimental
Kyle Cooley 7 years ago
parent 7914fd5c9c
commit b62cb0e2a4

@ -122,6 +122,13 @@ namespace Resource
{
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.
@ -710,6 +717,15 @@ namespace Resource
mSharedStateMutex.unlock();
}
void SceneManager::clearCache()
{
ResourceManager::clearCache();
mSharedStateMutex.lock();
mSharedStateManager->clearCache();
mSharedStateMutex.unlock();
}
void SceneManager::reportStats(unsigned int frameNumber, osg::Stats *stats) const
{
{

@ -143,6 +143,8 @@ namespace Resource
/// @see ResourceManager::updateCache
virtual void updateCache(double referenceTime);
virtual void clearCache();
virtual void reportStats(unsigned int frameNumber, osg::Stats* stats) const;
private:

Loading…
Cancel
Save