forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgeomCacheManager.I
More file actions
67 lines (62 loc) · 1.92 KB
/
geomCacheManager.I
File metadata and controls
67 lines (62 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/**
* PANDA 3D SOFTWARE
* Copyright (c) Carnegie Mellon University. All rights reserved.
*
* All use of this software is subject to the terms of the revised BSD
* license. You should have received a copy of this license along
* with this source code in a file named "LICENSE."
*
* @file geomCacheManager.I
* @author drose
* @date 2005-03-11
*/
/**
* 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.
*/
INLINE void GeomCacheManager::
set_max_size(int max_size) const {
// We directly change the config variable.
geom_cache_size = max_size;
}
/**
* Returns the maximum number of entries in the cache for storing pre-
* processed data for rendering vertices. See set_max_size().
*/
INLINE int GeomCacheManager::
get_max_size() const {
return geom_cache_size;
}
/**
* Returns the number of entries currently in the cache.
*/
INLINE int GeomCacheManager::
get_total_size() const {
return _total_size;
}
/**
* 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.
*/
INLINE void GeomCacheManager::
evict_old_entries() {
evict_old_entries(get_max_size(), true);
}
/**
* Flushes the PStatCollectors used during traversal.
*/
INLINE void GeomCacheManager::
flush_level() {
_geom_cache_size_pcollector.flush_level();
_geom_cache_active_pcollector.flush_level();
_geom_cache_record_pcollector.flush_level();
_geom_cache_erase_pcollector.flush_level();
_geom_cache_evict_pcollector.flush_level();
}