Panda3D

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
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"`

## 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 GeomCacheManager * | get_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 37 of file geomCacheManager.h.

## Member Function Documentation

## ◆ evict_old_entries() [1/2]

void GeomCacheManager::evict_old_entries | ( |  | ) |
| inline

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 52 of file geomCacheManager.I.

References evict_old_entries(), and get_max_size().

Referenced by evict_old_entries(), flush(), and PT().

## ◆ evict_old_entries() [2/2]

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 81 of file geomCacheManager.cxx.

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

## ◆ flush()

void GeomCacheManager::flush | ( |  | ) |

Immediately empties all elements in the cache.

Definition at line 56 of file geomCacheManager.cxx.

References evict_old_entries().

## ◆ flush_level()

void GeomCacheManager::flush_level | ( |  | ) |
| inline static

Flushes the PStatCollectors used during traversal.

Definition at line 60 of file geomCacheManager.I.

Referenced by GraphicsEngine::render_frame().

## ◆ get_global_ptr()

GeomCacheManager * GeomCacheManager::get_global_ptr | ( |  | ) |
| static

Returns the global cache manager pointer.

Definition at line 68 of file geomCacheManager.cxx.

Referenced by PT(), and GeomCacheEntry::refresh().

## ◆ get_max_size()

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 34 of file geomCacheManager.I.

Referenced by evict_old_entries().

## ◆ get_total_size()

int GeomCacheManager::get_total_size | ( |  | ) | const
| inline

Returns the number of entries currently in the cache.

Definition at line 42 of file geomCacheManager.I.

## ◆ set_max_size()

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 24 of file geomCacheManager.I.

## Friends And Related Symbol Documentation

## ◆ GeomCacheEntry

friend class GeomCacheEntry
| friend

Definition at line 85 of file geomCacheManager.h.

## Member Data Documentation

## ◆ _geom_cache_active_pcollector

PStatCollector GeomCacheManager::_geom_cache_active_pcollector
| static

Definition at line 80 of file geomCacheManager.h.

## ◆ _geom_cache_erase_pcollector

PStatCollector GeomCacheManager::_geom_cache_erase_pcollector
| static

Definition at line 82 of file geomCacheManager.h.

## ◆ _geom_cache_evict_pcollector

PStatCollector GeomCacheManager::_geom_cache_evict_pcollector
| static

Definition at line 83 of file geomCacheManager.h.

## ◆ _geom_cache_record_pcollector

PStatCollector GeomCacheManager::_geom_cache_record_pcollector
| static

Definition at line 81 of file geomCacheManager.h.

## ◆ _geom_cache_size_pcollector

PStatCollector GeomCacheManager::_geom_cache_size_pcollector
| static

Definition at line 79 of file geomCacheManager.h.

The documentation for this class was generated from the following files:

- panda/src/gobj/geomCacheManager.h
- panda/src/gobj/geomCacheManager.cxx
- panda/src/gobj/geomCacheManager.I