64 INLINE
const std::string &get_name()
const;
66 void set_graphics_memory_limit(
size_t limit);
67 INLINE
size_t get_graphics_memory_limit()
const;
68 void show_graphics_memory_lru(std::ostream &out)
const;
69 void show_residency_trackers(std::ostream &out)
const;
71 INLINE
void release_all();
72 INLINE
int get_num_queued()
const;
73 INLINE
int get_num_prepared()
const;
75 void enqueue_texture(
Texture *tex);
76 bool is_texture_queued(
const Texture *tex)
const;
77 bool dequeue_texture(
Texture *tex);
78 bool is_texture_prepared(
const Texture *tex)
const;
80 void release_texture(
Texture *tex);
81 int release_all_textures();
82 int get_num_queued_textures()
const;
83 int get_num_prepared_textures()
const;
89 bool is_sampler_queued(
const SamplerState &sampler)
const;
91 bool is_sampler_prepared(
const SamplerState &sampler)
const;
94 int release_all_samplers();
95 int get_num_queued_samplers()
const;
96 int get_num_prepared_samplers()
const;
101 void enqueue_geom(
Geom *geom);
102 bool is_geom_queued(
const Geom *geom)
const;
103 bool dequeue_geom(
Geom *geom);
104 bool is_geom_prepared(
const Geom *geom)
const;
106 int release_all_geoms();
107 int get_num_queued_geoms()
const;
108 int get_num_prepared_geoms()
const;
112 void enqueue_shader(
Shader *shader);
113 bool is_shader_queued(
const Shader *shader)
const;
114 bool dequeue_shader(
Shader *shader);
115 bool is_shader_prepared(
const Shader *shader)
const;
117 int release_all_shaders();
118 int get_num_queued_shaders()
const;
119 int get_num_prepared_shaders()
const;
128 int release_all_vertex_buffers();
129 int get_num_queued_vertex_buffers()
const;
130 int get_num_prepared_vertex_buffers()
const;
137 bool is_index_buffer_queued(
const GeomPrimitive *data)
const;
139 bool is_index_buffer_prepared(
const GeomPrimitive *data)
const;
141 int release_all_index_buffers();
142 int get_num_queued_index_buffers()
const;
143 int get_num_prepared_index_buffers()
const;
150 bool is_shader_buffer_queued(
const ShaderBuffer *data)
const;
152 bool is_shader_buffer_prepared(
const ShaderBuffer *data)
const;
154 int release_all_shader_buffers();
155 int get_num_queued_shader_buffers()
const;
156 int get_num_prepared_shader_buffers()
const;
175 void notify_removed();
176 virtual bool cancel()
final;
179 MAKE_PROPERTY(
object, get_object);
189 static void init_type() {
190 AsyncFuture::init_type();
192 AsyncFuture::get_class_type());
195 return get_class_type();
197 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
215 void end_frame(
Thread *current_thread);
218 static std::string init_name();
221 typedef phash_set<TextureContext *, pointer_hash> Textures;
223 typedef phash_set<GeomContext *, pointer_hash> Geoms;
224 typedef phash_set< PT(
Geom) > EnqueuedGeoms;
225 typedef phash_set<ShaderContext *, pointer_hash> Shaders;
227 typedef phash_set<BufferContext *, pointer_hash> Buffers;
230 typedef phash_set< PT(
ShaderBuffer) > EnqueuedShaderBuffers;
238 class BufferCacheKey {
240 INLINE
bool operator < (
const BufferCacheKey &other)
const;
241 INLINE
bool operator == (
const BufferCacheKey &other)
const;
242 INLINE
bool operator != (
const BufferCacheKey &other)
const;
243 size_t _data_size_bytes;
244 GeomEnums::UsageHint _usage_hint;
250 void cache_unprepared_buffer(
BufferContext *buffer,
size_t data_size_bytes,
251 GeomEnums::UsageHint usage_hint,
252 BufferCache &buffer_cache,
253 BufferCacheLRU &buffer_cache_lru,
254 size_t &buffer_cache_size,
255 int released_buffer_cache_size,
256 Buffers &released_buffers);
258 GeomEnums::UsageHint usage_hint,
259 BufferCache &buffer_cache,
260 BufferCacheLRU &buffer_cache_lru,
261 size_t &buffer_cache_size);
265 Textures _prepared_textures, _released_textures;
266 EnqueuedTextures _enqueued_textures;
267 PreparedSamplers _prepared_samplers;
268 ReleasedSamplers _released_samplers;
269 EnqueuedSamplers _enqueued_samplers;
270 Geoms _prepared_geoms, _released_geoms;
271 EnqueuedGeoms _enqueued_geoms;
272 Shaders _prepared_shaders, _released_shaders;
273 EnqueuedShaders _enqueued_shaders;
274 Buffers _prepared_vertex_buffers, _released_vertex_buffers;
275 EnqueuedVertexBuffers _enqueued_vertex_buffers;
276 Buffers _prepared_index_buffers, _released_index_buffers;
277 EnqueuedIndexBuffers _enqueued_index_buffers;
278 Buffers _prepared_shader_buffers, _released_shader_buffers;
279 EnqueuedShaderBuffers _enqueued_shader_buffers;
281 BufferCache _vertex_buffer_cache;
282 BufferCacheLRU _vertex_buffer_cache_lru;
283 size_t _vertex_buffer_cache_size;
285 BufferCache _index_buffer_cache;
286 BufferCacheLRU _index_buffer_cache_lru;
287 size_t _index_buffer_cache_size;
301 bool _support_released_buffer_cache;
304 static int _name_index;
This is a base class for those kinds of SavedContexts that occupy an easily-measured (and substantial...
This is a special class object that holds all the information returned by a particular GSG to indicat...
This is a special class object that holds all the information returned by a particular GSG to indicat...
This is a special class object that holds a handle to the sampler state object given by the graphics ...
This is the base class for all GSG-specific context objects, such as TextureContext and GeomContext.
The ShaderContext is meant to contain the compiled version of a shader string.
This is a special class object that holds all the information returned by a particular GSG to indicat...
Represents a texture object, which is typically a single 2-d image but may also represent a 1-d or 3-...
This is a special class object that holds all the information returned by a particular GSG to indicat...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.