Panda3D
Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends
GeomCacheManager Class Reference

This is used to keep track of, and limit the size of, the cache of munged vertices, which would otherwise be distributed through all of the GeomVertexData objects in the system. More...

#include "geomCacheManager.h"

List of all members.

Public Member Functions

void evict_old_entries ()
 Trims the cache size down to get_max_size() by evicting old cache entries as needed.
void evict_old_entries (int max_size, bool keep_current)
 Trims the cache size down to the specified size by evicting old cache entries as needed.
void flush ()
 Immediately empties all elements in the cache.
int get_max_size () const
 Returns the maximum number of entries in the cache for storing pre-processed data for rendering vertices.
int get_total_size () const
 Returns the number of entries currently in the cache.
void set_max_size (int max_size) const
 Specifies the maximum number of entries in the cache for storing pre-processed data for rendering vertices.

Static Public Member Functions

static void flush_level ()
 Flushes the PStatCollectors used during traversal.
static GeomCacheManagerget_global_ptr ()
 Returns the global cache manager pointer.

Static Public Attributes

static PStatCollector _geom_cache_active_pcollector
static PStatCollector _geom_cache_erase_pcollector
static PStatCollector _geom_cache_evict_pcollector
static PStatCollector _geom_cache_record_pcollector
static PStatCollector _geom_cache_size_pcollector

Friends

class GeomCacheEntry

Detailed Description

This is used to keep track of, and limit the size of, the cache of munged vertices, which would otherwise be distributed through all of the GeomVertexData objects in the system.

The actual data in the cache is not stored here, but rather it is distributed among the various GeomVertexData source objects. This allows the cache data to propagate through the multiprocess pipeline.

This structure actually caches any of a number of different types of pointers, and mixes them all up in the same LRU cache list. Some of them (such as GeomMunger) are reference-counted here in the cache; most are not.

Definition at line 43 of file geomCacheManager.h.


Member Function Documentation

Trims the cache size down to get_max_size() by evicting old cache entries as needed.

It is assumed that you already hold the lock before calling this method.

Definition at line 67 of file geomCacheManager.I.

References get_max_size().

Referenced by flush().

void GeomCacheManager::evict_old_entries ( int  max_size,
bool  keep_current 
)

Trims the cache size down to the specified size by evicting old cache entries as needed.

It is assumed that you already hold the lock before calling this method.

Definition at line 88 of file geomCacheManager.cxx.

References ClockObject::get_frame_count(), ClockObject::get_global_clock(), and PStatClient::is_connected().

void GeomCacheManager::flush ( void  )

Immediately empties all elements in the cache.

Definition at line 61 of file geomCacheManager.cxx.

References evict_old_entries().

void GeomCacheManager::flush_level ( ) [inline, static]

Flushes the PStatCollectors used during traversal.

Definition at line 77 of file geomCacheManager.I.

Referenced by GraphicsEngine::render_frame().

Returns the global cache manager pointer.

Definition at line 72 of file geomCacheManager.cxx.

Referenced by GeomCacheEntry::refresh().

int GeomCacheManager::get_max_size ( ) const [inline]

Returns the maximum number of entries in the cache for storing pre-processed data for rendering vertices.

See set_max_size().

Definition at line 44 of file geomCacheManager.I.

Referenced by evict_old_entries().

int GeomCacheManager::get_total_size ( ) const [inline]

Returns the number of entries currently in the cache.

Definition at line 54 of file geomCacheManager.I.

void GeomCacheManager::set_max_size ( int  max_size) const [inline]

Specifies the maximum number of entries in the cache for storing pre-processed data for rendering vertices.

This limit is flexible, and may be temporarily exceeded if many different Geoms are pre-processed during the space of a single frame.

This is not a limit on the actual vertex data, which is what it is; it is also not a limit on the amount of memory used by the video driver or the system graphics interface, which Panda has no control over.

Definition at line 31 of file geomCacheManager.I.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations