10 #include <osgEarth/Common>
11 #include <osgEarth/Threading>
12 #include <osg/StateSet>
39 bool eligible( osg::StateSet* stateSet )
const;
44 bool eligible( osg::StateAttribute* attr )
const;
114 return lhs->compare( *(rhs.get()),
true ) < 0;
126 return lhs->compare( *rhs.get() ) < 0;
bool eligible(osg::StateSet *stateSet) const
Check whether a StateSet is eligible for sharing.
unsigned _attrShareMisses
Definition: DtCDBStateSetCache.h:146
void setProtectAfterCache(bool protect)
Definition: DtCDBStateSetCache.h:120
Definition: DtCDBStateSetCache.h:108
void consolidateStateSets(osg::Node *node)
Scans a graph and combines equivalent statesets into a single shared stateset.
std::set< osg::ref_ptr< osg::StateSet >, CompareStateSets > StateSetSet
Definition: DtCDBStateSetCache.h:117
std::set< osg::ref_ptr< osg::StateAttribute >, CompareStateAttributes > StateAttributeSet
Definition: DtCDBStateSetCache.h:129
bool operator()(const osg::ref_ptr< osg::StateSet > &lhs, const osg::ref_ptr< osg::StateSet > &rhs) const
Definition: DtCDBStateSetCache.h:110
voidpf void uLong size
Definition: ioapi.h:39
unsigned _attrsIneligible
Definition: DtCDBStateSetCache.h:144
StateAttributeSet _stateAttributeCache
Definition: DtCDBStateSetCache.h:130
bool _protectAfterCache
Definition: DtCDBStateSetCache.h:139
void optimize(osg::Node *node)
Calls consolidateStateAttributes followed by consolidateStateSets.
unsigned _pruneCount
Definition: DtCDBStateSetCache.h:137
bool _traverseProxies
Definition: DtCDBStateSetCache.h:140
virtual ~DtCDBStateSetCache()
bool optimizeTextureAttributes() const
bool traverseProxies() const
StateSetSet _stateSetCache
Definition: DtCDBStateSetCache.h:118
void setOptimizeTextureAttributes(bool optimizeTexAtt)
bool share(osg::ref_ptr< osg::StateSet > &input)
Looks in the cache for a stateset matching the input.
bool protectAfterCache() const
void setTraverseProxies(bool traverseProxies)
unsigned _attrShareAttempts
Definition: DtCDBStateSetCache.h:143
bool operator()(const osg::ref_ptr< osg::StateAttribute > &lhs, const osg::ref_ptr< osg::StateAttribute > &rhs) const
Definition: DtCDBStateSetCache.h:122
std::mutex _mutex
Definition: DtCDBStateSetCache.h:132
void clear()
Clears out the cache.
void setMaxSize(unsigned maxSize)
Caps the size of the cache.
void releaseGLObjects(osg::State *state) const
unsigned _maxSize
Definition: DtCDBStateSetCache.h:136
Custom implementation of osgEarth::StateSetCache as it is not virtually extensible.
Definition: DtCDBStateSetCache.h:23
unsigned _attrShareHits
Definition: DtCDBStateSetCache.h:145
bool _optimizeTextureState
Definition: DtCDBStateSetCache.h:141
void resizeGLObjectBuffers(unsigned size)
void consolidateStateAttributes(osg::Node *node)
Scans a graph and combines equivalents state attributes into single shared attribute.
void protect()
marks all caches statesets as DYNAMIC so they cannot be shared again.
DtCDBStateSetCache()
Constructs a new cache.