Panda3D
Loading...
Searching...
No Matches
geomCacheManager.I
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file geomCacheManager.I
10 * @author drose
11 * @date 2005-03-11
12 */
13
14/**
15 * Specifies the maximum number of entries in the cache for storing pre-
16 * processed data for rendering vertices. This limit is flexible, and may be
17 * temporarily exceeded if many different Geoms are pre-processed during the
18 * space of a single frame.
19 *
20 * This is not a limit on the actual vertex data, which is what it is; it is
21 * also not a limit on the amount of memory used by the video driver or the
22 * system graphics interface, which Panda has no control over.
23 */
25set_max_size(int max_size) const {
26 // We directly change the config variable.
27 geom_cache_size = max_size;
28}
29
30/**
31 * Returns the maximum number of entries in the cache for storing pre-
32 * processed data for rendering vertices. See set_max_size().
33 */
35get_max_size() const {
36 return geom_cache_size;
37}
38
39/**
40 * Returns the number of entries currently in the cache.
41 */
43get_total_size() const {
44 return _total_size;
45}
46
47/**
48 * Trims the cache size down to get_max_size() by evicting old cache entries
49 * as needed. It is assumed that you already hold the lock before calling
50 * this method.
51 */
56
57/**
58 * Flushes the PStatCollectors used during traversal.
59 */
62 _geom_cache_size_pcollector.flush_level();
63 _geom_cache_active_pcollector.flush_level();
64 _geom_cache_record_pcollector.flush_level();
65 _geom_cache_erase_pcollector.flush_level();
66 _geom_cache_evict_pcollector.flush_level();
67}
int get_max_size() const
Returns the maximum number of entries in the cache for storing pre- processed data for rendering vert...
void evict_old_entries()
Trims the cache size down to get_max_size() by evicting old cache entries as needed.
void set_max_size(int max_size) const
Specifies the maximum number of entries in the cache for storing pre- processed data for rendering ve...
int get_total_size() const
Returns the number of entries currently in the cache.
static void flush_level()
Flushes the PStatCollectors used during traversal.