Panda3D
|
A table of objects that are saved within the graphics context for reference by handle later. More...
#include "preparedGraphicsObjects.h"
Classes | |
class | BufferCacheKey |
Public Member Functions | |
void | begin_frame (GraphicsStateGuardianBase *gsg, Thread *current_thread) |
This is called by the GraphicsStateGuardian to indicate that it is about to begin processing of the frame. | |
bool | dequeue_geom (Geom *geom) |
Removes a geom from the queued list of geoms to be prepared. | |
bool | dequeue_index_buffer (GeomPrimitive *data) |
Removes a buffer from the queued list of data arrays to be prepared. | |
bool | dequeue_shader (Shader *shader) |
Removes a shader from the queued list of shaders to be prepared. | |
bool | dequeue_texture (Texture *tex) |
Removes a texture from the queued list of textures to be prepared. | |
bool | dequeue_vertex_buffer (GeomVertexArrayData *data) |
Removes a buffer from the queued list of data arrays to be prepared. | |
void | end_frame (Thread *current_thread) |
This is called by the GraphicsStateGuardian to indicate that it has finished processing of the frame. | |
void | enqueue_geom (Geom *geom) |
Indicates that a geom would like to be put on the list to be prepared when the GSG is next ready to do this (presumably at the next frame). | |
void | enqueue_index_buffer (GeomPrimitive *data) |
Indicates that a buffer would like to be put on the list to be prepared when the GSG is next ready to do this (presumably at the next frame). | |
void | enqueue_shader (Shader *shader) |
Indicates that a shader would like to be put on the list to be prepared when the GSG is next ready to do this (presumably at the next frame). | |
void | enqueue_texture (Texture *tex) |
Indicates that a texture would like to be put on the list to be prepared when the GSG is next ready to do this (presumably at the next frame). | |
void | enqueue_vertex_buffer (GeomVertexArrayData *data) |
Indicates that a buffer would like to be put on the list to be prepared when the GSG is next ready to do this (presumably at the next frame). | |
size_t | get_graphics_memory_limit () const |
Returns the artificial cap on graphics memory that will be imposed on this GSG. | |
const string & | get_name () const |
Returns the name of the PreparedGraphicsObjects structure. | |
int | get_num_prepared () const |
Returns the number of objects of any kind that have already been prepared on this GSG. | |
int | get_num_prepared_geoms () const |
Returns the number of geoms that have already been prepared on this GSG. | |
int | get_num_prepared_index_buffers () const |
Returns the number of index buffers that have already been prepared on this GSG. | |
int | get_num_prepared_shaders () const |
Returns the number of shaders that have already been prepared on this GSG. | |
int | get_num_prepared_textures () const |
Returns the number of textures that have already been prepared on this GSG. | |
int | get_num_prepared_vertex_buffers () const |
Returns the number of vertex buffers that have already been prepared on this GSG. | |
int | get_num_queued () const |
Returns the number of objects of any kind that have been enqueued to be prepared on this GSG. | |
int | get_num_queued_geoms () const |
Returns the number of geoms that have been enqueued to be prepared on this GSG. | |
int | get_num_queued_index_buffers () const |
Returns the number of index buffers that have been enqueued to be prepared on this GSG. | |
int | get_num_queued_shaders () const |
Returns the number of shaders that have been enqueued to be prepared on this GSG. | |
int | get_num_queued_textures () const |
Returns the number of textures that have been enqueued to be prepared on this GSG. | |
int | get_num_queued_vertex_buffers () const |
Returns the number of vertex buffers that have been enqueued to be prepared on this GSG. | |
bool | is_geom_prepared (const Geom *geom) const |
Returns true if the vertex buffer has been prepared on this GSG, false otherwise. | |
bool | is_geom_queued (const Geom *geom) const |
Returns true if the geom has been queued on this GSG, false otherwise. | |
bool | is_index_buffer_prepared (const GeomPrimitive *data) const |
Returns true if the index buffer has been prepared on this GSG, false otherwise. | |
bool | is_index_buffer_queued (const GeomPrimitive *data) const |
Returns true if the index buffer has been queued on this GSG, false otherwise. | |
bool | is_shader_prepared (const Shader *shader) const |
Returns true if the shader has been prepared on this GSG, false otherwise. | |
bool | is_shader_queued (const Shader *shader) const |
Returns true if the shader has been queued on this GSG, false otherwise. | |
bool | is_texture_prepared (const Texture *tex) const |
Returns true if the texture has been prepared on this GSG, false otherwise. | |
bool | is_texture_queued (const Texture *tex) const |
Returns true if the texture has been queued on this GSG, false otherwise. | |
bool | is_vertex_buffer_prepared (const GeomVertexArrayData *data) const |
Returns true if the vertex buffer has been prepared on this GSG, false otherwise. | |
bool | is_vertex_buffer_queued (const GeomVertexArrayData *data) const |
Returns true if the vertex buffer has been queued on this GSG, false otherwise. | |
GeomContext * | prepare_geom_now (Geom *geom, GraphicsStateGuardianBase *gsg) |
Immediately creates a new GeomContext for the indicated geom and returns it. | |
IndexBufferContext * | prepare_index_buffer_now (GeomPrimitive *data, GraphicsStateGuardianBase *gsg) |
Immediately creates a new IndexBufferContext for the indicated data and returns it. | |
ShaderContext * | prepare_shader_now (Shader *shader, GraphicsStateGuardianBase *gsg) |
Immediately creates a new ShaderContext for the indicated shader and returns it. | |
TextureContext * | prepare_texture_now (Texture *tex, int view, GraphicsStateGuardianBase *gsg) |
Immediately creates a new TextureContext for the indicated texture and returns it. | |
VertexBufferContext * | prepare_vertex_buffer_now (GeomVertexArrayData *data, GraphicsStateGuardianBase *gsg) |
Immediately creates a new VertexBufferContext for the indicated data and returns it. | |
void | release_all () |
Releases all prepared objects of all kinds at once. | |
int | release_all_geoms () |
Releases all geoms at once. | |
int | release_all_index_buffers () |
Releases all datas at once. | |
int | release_all_shaders () |
Releases all shaders at once. | |
int | release_all_textures () |
Releases all textures at once. | |
int | release_all_vertex_buffers () |
Releases all datas at once. | |
void | release_geom (GeomContext *gc) |
Indicates that a geom context, created by a previous call to prepare_geom(), is no longer needed. | |
void | release_index_buffer (IndexBufferContext *ibc) |
Indicates that a data context, created by a previous call to prepare_index_buffer(), is no longer needed. | |
void | release_shader (ShaderContext *sc) |
Indicates that a shader context, created by a previous call to prepare_shader(), is no longer needed. | |
void | release_texture (Texture *tex) |
Releases a texture if it has already been prepared, or removes it from the preparation queue. | |
void | release_texture (TextureContext *tc) |
Indicates that a texture context, created by a previous call to prepare_texture(), is no longer needed. | |
void | release_vertex_buffer (VertexBufferContext *vbc) |
Indicates that a data context, created by a previous call to prepare_vertex_buffer(), is no longer needed. | |
void | set_graphics_memory_limit (size_t limit) |
Sets an artificial cap on graphics memory that will be imposed on this GSG. | |
void | show_graphics_memory_lru (ostream &out) const |
Writes to the indicated ostream a report of how the various textures and vertex buffers are allocated in the LRU. | |
void | show_residency_trackers (ostream &out) const |
Writes to the indicated ostream a report of how the various textures and vertex buffers are allocated in the LRU. | |
Public Attributes | |
AdaptiveLru | _graphics_memory_lru |
BufferResidencyTracker | _ibuffer_residency |
bool | _support_released_buffer_cache |
BufferResidencyTracker | _texture_residency |
BufferResidencyTracker | _vbuffer_residency |
Friends | |
class | GraphicsStateGuardian |
A table of objects that are saved within the graphics context for reference by handle later.
Generally, this represents things like OpenGL texture objects or display lists (or their equivalent on other platforms).
This object simply records the pointers to the context objects created by the individual GSG's; these context objects will contain enough information to reference or release the actual object stored within the graphics context.
These tables may potentially be shared between related graphics contexts, hence their storage here in a separate object rather than as a part of the GraphicsStateGuardian.
Definition at line 58 of file preparedGraphicsObjects.h.
void PreparedGraphicsObjects::begin_frame | ( | GraphicsStateGuardianBase * | gsg, |
Thread * | current_thread | ||
) |
This is called by the GraphicsStateGuardian to indicate that it is about to begin processing of the frame.
Any texture contexts that were previously passed to release_texture() are actually passed to the GSG to be freed at this point; textures that were previously passed to prepare_texture are actually loaded.
Definition at line 1208 of file preparedGraphicsObjects.cxx.
References BufferResidencyTracker::begin_frame(), Texture::get_num_views(), GeomPrimitive::prepare_now(), GeomVertexArrayData::prepare_now(), Geom::prepare_now(), and Texture::prepare_now().
bool PreparedGraphicsObjects::dequeue_geom | ( | Geom * | geom | ) |
Removes a geom from the queued list of geoms to be prepared.
Normally it is not necessary to call this, unless you change your mind about preparing it at the last minute, since the geom will automatically be dequeued and prepared at the next frame.
The return value is true if the geom is successfully dequeued, false if it had not been queued.
Definition at line 404 of file preparedGraphicsObjects.cxx.
Referenced by Geom::release().
bool PreparedGraphicsObjects::dequeue_index_buffer | ( | GeomPrimitive * | data | ) |
Removes a buffer from the queued list of data arrays to be prepared.
Normally it is not necessary to call this, unless you change your mind about preparing it at the last minute, since the data will automatically be dequeued and prepared at the next frame.
The return value is true if the buffer is successfully dequeued, false if it had not been queued.
Definition at line 1009 of file preparedGraphicsObjects.cxx.
Referenced by GeomPrimitive::release().
bool PreparedGraphicsObjects::dequeue_shader | ( | Shader * | se | ) |
Removes a shader from the queued list of shaders to be prepared.
Normally it is not necessary to call this, unless you change your mind about preparing it at the last minute, since the shader will automatically be dequeued and prepared at the next frame.
The return value is true if the shader is successfully dequeued, false if it had not been queued.
Definition at line 592 of file preparedGraphicsObjects.cxx.
bool PreparedGraphicsObjects::dequeue_texture | ( | Texture * | tex | ) |
Removes a texture from the queued list of textures to be prepared.
Normally it is not necessary to call this, unless you change your mind about preparing it at the last minute, since the texture will automatically be dequeued and prepared at the next frame.
The return value is true if the texture is successfully dequeued, false if it had not been queued.
Definition at line 205 of file preparedGraphicsObjects.cxx.
Referenced by Texture::release().
bool PreparedGraphicsObjects::dequeue_vertex_buffer | ( | GeomVertexArrayData * | data | ) |
Removes a buffer from the queued list of data arrays to be prepared.
Normally it is not necessary to call this, unless you change your mind about preparing it at the last minute, since the data will automatically be dequeued and prepared at the next frame.
The return value is true if the buffer is successfully dequeued, false if it had not been queued.
Definition at line 780 of file preparedGraphicsObjects.cxx.
Referenced by GeomVertexArrayData::release().
void PreparedGraphicsObjects::end_frame | ( | Thread * | current_thread | ) |
This is called by the GraphicsStateGuardian to indicate that it has finished processing of the frame.
Definition at line 1336 of file preparedGraphicsObjects.cxx.
References BufferResidencyTracker::end_frame().
void PreparedGraphicsObjects::enqueue_geom | ( | Geom * | geom | ) |
Indicates that a geom would like to be put on the list to be prepared when the GSG is next ready to do this (presumably at the next frame).
Definition at line 369 of file preparedGraphicsObjects.cxx.
Referenced by Geom::prepare().
void PreparedGraphicsObjects::enqueue_index_buffer | ( | GeomPrimitive * | data | ) |
Indicates that a buffer would like to be put on the list to be prepared when the GSG is next ready to do this (presumably at the next frame).
Definition at line 974 of file preparedGraphicsObjects.cxx.
Referenced by GeomPrimitive::prepare().
void PreparedGraphicsObjects::enqueue_shader | ( | Shader * | shader | ) |
Indicates that a shader would like to be put on the list to be prepared when the GSG is next ready to do this (presumably at the next frame).
Definition at line 557 of file preparedGraphicsObjects.cxx.
void PreparedGraphicsObjects::enqueue_texture | ( | Texture * | tex | ) |
Indicates that a texture would like to be put on the list to be prepared when the GSG is next ready to do this (presumably at the next frame).
Definition at line 170 of file preparedGraphicsObjects.cxx.
Referenced by Texture::prepare().
void PreparedGraphicsObjects::enqueue_vertex_buffer | ( | GeomVertexArrayData * | data | ) |
Indicates that a buffer would like to be put on the list to be prepared when the GSG is next ready to do this (presumably at the next frame).
Definition at line 745 of file preparedGraphicsObjects.cxx.
Referenced by GeomVertexArrayData::prepare().
size_t PreparedGraphicsObjects::get_graphics_memory_limit | ( | ) | const [inline] |
Returns the artificial cap on graphics memory that will be imposed on this GSG.
See set_graphics_memory_limit().
Definition at line 36 of file preparedGraphicsObjects.I.
References AdaptiveLru::get_max_size().
const string & PreparedGraphicsObjects::get_name | ( | ) | const [inline] |
Returns the name of the PreparedGraphicsObjects structure.
This is an arbitrary name that serves mainly to uniquify the context for PStats reporting.
Definition at line 24 of file preparedGraphicsObjects.I.
int PreparedGraphicsObjects::get_num_prepared | ( | ) | const [inline] |
Returns the number of objects of any kind that have already been prepared on this GSG.
Definition at line 80 of file preparedGraphicsObjects.I.
References get_num_prepared_geoms(), get_num_prepared_index_buffers(), get_num_prepared_shaders(), get_num_prepared_textures(), and get_num_prepared_vertex_buffers().
int PreparedGraphicsObjects::get_num_prepared_geoms | ( | ) | const |
Returns the number of geoms that have already been prepared on this GSG.
Definition at line 505 of file preparedGraphicsObjects.cxx.
Referenced by get_num_prepared().
int PreparedGraphicsObjects::get_num_prepared_index_buffers | ( | ) | const |
Returns the number of index buffers that have already been prepared on this GSG.
Definition at line 1138 of file preparedGraphicsObjects.cxx.
Referenced by get_num_prepared().
int PreparedGraphicsObjects::get_num_prepared_shaders | ( | ) | const |
Returns the number of shaders that have already been prepared on this GSG.
Definition at line 693 of file preparedGraphicsObjects.cxx.
Referenced by get_num_prepared().
int PreparedGraphicsObjects::get_num_prepared_textures | ( | ) | const |
Returns the number of textures that have already been prepared on this GSG.
Definition at line 317 of file preparedGraphicsObjects.cxx.
Referenced by get_num_prepared().
int PreparedGraphicsObjects::get_num_prepared_vertex_buffers | ( | ) | const |
Returns the number of vertex buffers that have already been prepared on this GSG.
Definition at line 909 of file preparedGraphicsObjects.cxx.
Referenced by get_num_prepared().
int PreparedGraphicsObjects::get_num_queued | ( | ) | const [inline] |
Returns the number of objects of any kind that have been enqueued to be prepared on this GSG.
Definition at line 65 of file preparedGraphicsObjects.I.
References get_num_queued_geoms(), get_num_queued_index_buffers(), get_num_queued_shaders(), get_num_queued_textures(), and get_num_queued_vertex_buffers().
int PreparedGraphicsObjects::get_num_queued_geoms | ( | ) | const |
Returns the number of geoms that have been enqueued to be prepared on this GSG.
Definition at line 494 of file preparedGraphicsObjects.cxx.
Referenced by get_num_queued().
int PreparedGraphicsObjects::get_num_queued_index_buffers | ( | ) | const |
Returns the number of index buffers that have been enqueued to be prepared on this GSG.
Definition at line 1127 of file preparedGraphicsObjects.cxx.
Referenced by get_num_queued().
int PreparedGraphicsObjects::get_num_queued_shaders | ( | ) | const |
Returns the number of shaders that have been enqueued to be prepared on this GSG.
Definition at line 682 of file preparedGraphicsObjects.cxx.
Referenced by get_num_queued().
int PreparedGraphicsObjects::get_num_queued_textures | ( | ) | const |
Returns the number of textures that have been enqueued to be prepared on this GSG.
Definition at line 306 of file preparedGraphicsObjects.cxx.
Referenced by get_num_queued().
int PreparedGraphicsObjects::get_num_queued_vertex_buffers | ( | ) | const |
Returns the number of vertex buffers that have been enqueued to be prepared on this GSG.
Definition at line 898 of file preparedGraphicsObjects.cxx.
Referenced by get_num_queued().
bool PreparedGraphicsObjects::is_geom_prepared | ( | const Geom * | geom | ) | const |
Returns true if the vertex buffer has been prepared on this GSG, false otherwise.
Definition at line 422 of file preparedGraphicsObjects.cxx.
References Geom::is_prepared().
bool PreparedGraphicsObjects::is_geom_queued | ( | const Geom * | geom | ) | const |
Returns true if the geom has been queued on this GSG, false otherwise.
Definition at line 382 of file preparedGraphicsObjects.cxx.
Referenced by Geom::is_prepared().
bool PreparedGraphicsObjects::is_index_buffer_prepared | ( | const GeomPrimitive * | data | ) | const |
Returns true if the index buffer has been prepared on this GSG, false otherwise.
Definition at line 1027 of file preparedGraphicsObjects.cxx.
References GeomPrimitive::is_prepared().
bool PreparedGraphicsObjects::is_index_buffer_queued | ( | const GeomPrimitive * | data | ) | const |
Returns true if the index buffer has been queued on this GSG, false otherwise.
Definition at line 987 of file preparedGraphicsObjects.cxx.
Referenced by GeomPrimitive::is_prepared().
bool PreparedGraphicsObjects::is_shader_prepared | ( | const Shader * | shader | ) | const |
Returns true if the shader has been prepared on this GSG, false otherwise.
Definition at line 610 of file preparedGraphicsObjects.cxx.
bool PreparedGraphicsObjects::is_shader_queued | ( | const Shader * | shader | ) | const |
Returns true if the shader has been queued on this GSG, false otherwise.
Definition at line 570 of file preparedGraphicsObjects.cxx.
bool PreparedGraphicsObjects::is_texture_prepared | ( | const Texture * | tex | ) | const |
Returns true if the texture has been prepared on this GSG, false otherwise.
Definition at line 223 of file preparedGraphicsObjects.cxx.
References Texture::is_prepared().
bool PreparedGraphicsObjects::is_texture_queued | ( | const Texture * | tex | ) | const |
Returns true if the texture has been queued on this GSG, false otherwise.
Definition at line 183 of file preparedGraphicsObjects.cxx.
Referenced by Texture::is_prepared().
bool PreparedGraphicsObjects::is_vertex_buffer_prepared | ( | const GeomVertexArrayData * | data | ) | const |
Returns true if the vertex buffer has been prepared on this GSG, false otherwise.
Definition at line 798 of file preparedGraphicsObjects.cxx.
References GeomVertexArrayData::is_prepared().
bool PreparedGraphicsObjects::is_vertex_buffer_queued | ( | const GeomVertexArrayData * | data | ) | const |
Returns true if the vertex buffer has been queued on this GSG, false otherwise.
Definition at line 758 of file preparedGraphicsObjects.cxx.
Referenced by GeomVertexArrayData::is_prepared().
GeomContext * PreparedGraphicsObjects::prepare_geom_now | ( | Geom * | geom, |
GraphicsStateGuardianBase * | gsg | ||
) |
Immediately creates a new GeomContext for the indicated geom and returns it.
This assumes that the GraphicsStateGuardian is the currently active rendering context and that it is ready to accept new geoms. If this is not necessarily the case, you should use enqueue_geom() instead.
Normally, this function is not called directly. Call Geom::prepare_now() instead.
The GeomContext contains all of the pertinent information needed by the GSG to keep track of this one particular geom, and will exist as long as the geom is ready to be rendered.
When either the Geom or the PreparedGraphicsObjects object destructs, the GeomContext will be deleted.
Definition at line 532 of file preparedGraphicsObjects.cxx.
Referenced by Geom::prepare_now().
IndexBufferContext * PreparedGraphicsObjects::prepare_index_buffer_now | ( | GeomPrimitive * | data, |
GraphicsStateGuardianBase * | gsg | ||
) |
Immediately creates a new IndexBufferContext for the indicated data and returns it.
This assumes that the GraphicsStateGuardian is the currently active rendering context and that it is ready to accept new datas. If this is not necessarily the case, you should use enqueue_index_buffer() instead.
Normally, this function is not called directly. Call Data::prepare_now() instead.
The IndexBufferContext contains all of the pertinent information needed by the GSG to keep track of this one particular data, and will exist as long as the data is ready to be rendered.
When either the Data or the PreparedGraphicsObjects object destructs, the IndexBufferContext will be deleted.
Definition at line 1165 of file preparedGraphicsObjects.cxx.
References GeomPrimitive::get_data_size_bytes(), and GeomPrimitive::get_usage_hint().
Referenced by GeomPrimitive::prepare_now().
ShaderContext * PreparedGraphicsObjects::prepare_shader_now | ( | Shader * | se, |
GraphicsStateGuardianBase * | gsg | ||
) |
Immediately creates a new ShaderContext for the indicated shader and returns it.
This assumes that the GraphicsStateGuardian is the currently active rendering context and that it is ready to accept new shaders. If this is not necessarily the case, you should use enqueue_shader() instead.
Normally, this function is not called directly. Call Shader::prepare_now() instead.
The ShaderContext contains all of the pertinent information needed by the GSG to keep track of this one particular shader, and will exist as long as the shader is ready to be rendered.
When either the Shader or the PreparedGraphicsObjects object destructs, the ShaderContext will be deleted.
Definition at line 720 of file preparedGraphicsObjects.cxx.
TextureContext * PreparedGraphicsObjects::prepare_texture_now | ( | Texture * | tex, |
int | view, | ||
GraphicsStateGuardianBase * | gsg | ||
) |
Immediately creates a new TextureContext for the indicated texture and returns it.
This assumes that the GraphicsStateGuardian is the currently active rendering context and that it is ready to accept new textures. If this is not necessarily the case, you should use enqueue_texture() instead.
Normally, this function is not called directly. Call Texture::prepare_now() instead.
The TextureContext contains all of the pertinent information needed by the GSG to keep track of this one particular texture, and will exist as long as the texture is ready to be rendered.
When either the Texture or the PreparedGraphicsObjects object destructs, the TextureContext will be deleted.
Definition at line 344 of file preparedGraphicsObjects.cxx.
Referenced by Texture::prepare_now().
VertexBufferContext * PreparedGraphicsObjects::prepare_vertex_buffer_now | ( | GeomVertexArrayData * | data, |
GraphicsStateGuardianBase * | gsg | ||
) |
Immediately creates a new VertexBufferContext for the indicated data and returns it.
This assumes that the GraphicsStateGuardian is the currently active rendering context and that it is ready to accept new datas. If this is not necessarily the case, you should use enqueue_vertex_buffer() instead.
Normally, this function is not called directly. Call Data::prepare_now() instead.
The VertexBufferContext contains all of the pertinent information needed by the GSG to keep track of this one particular data, and will exist as long as the data is ready to be rendered.
When either the Data or the PreparedGraphicsObjects object destructs, the VertexBufferContext will be deleted.
Definition at line 936 of file preparedGraphicsObjects.cxx.
References GeomVertexArrayData::get_data_size_bytes(), and GeomVertexArrayData::get_usage_hint().
Referenced by GeomVertexArrayData::prepare_now().
void PreparedGraphicsObjects::release_all | ( | ) | [inline] |
Releases all prepared objects of all kinds at once.
Definition at line 46 of file preparedGraphicsObjects.I.
References release_all_geoms(), release_all_index_buffers(), release_all_shaders(), release_all_textures(), release_all_vertex_buffers(), and BufferResidencyTracker::set_levels().
Referenced by GraphicsEngine::remove_window().
int PreparedGraphicsObjects::release_all_geoms | ( | ) |
Releases all geoms at once.
This will force them to be reloaded into geom memory for all GSG's that share this object. Returns the number of geoms released.
Definition at line 465 of file preparedGraphicsObjects.cxx.
Referenced by release_all().
int PreparedGraphicsObjects::release_all_index_buffers | ( | ) |
Releases all datas at once.
This will force them to be reloaded into data memory for all GSG's that share this object. Returns the number of datas released.
Definition at line 1081 of file preparedGraphicsObjects.cxx.
Referenced by release_all().
int PreparedGraphicsObjects::release_all_shaders | ( | ) |
Releases all shaders at once.
This will force them to be reloaded into shader memory for all GSG's that share this object. Returns the number of shaders released.
Definition at line 653 of file preparedGraphicsObjects.cxx.
Referenced by release_all().
int PreparedGraphicsObjects::release_all_textures | ( | ) |
Releases all textures at once.
This will force them to be reloaded into texture memory for all GSG's that share this object. Returns the number of textures released.
Definition at line 277 of file preparedGraphicsObjects.cxx.
References TextureContext::get_view().
Referenced by release_all().
int PreparedGraphicsObjects::release_all_vertex_buffers | ( | ) |
Releases all datas at once.
This will force them to be reloaded into data memory for all GSG's that share this object. Returns the number of datas released.
Definition at line 852 of file preparedGraphicsObjects.cxx.
Referenced by release_all().
void PreparedGraphicsObjects::release_geom | ( | GeomContext * | gc | ) |
Indicates that a geom context, created by a previous call to prepare_geom(), is no longer needed.
The driver resources will not be freed until some GSG calls update(), indicating it is at a stage where it is ready to release geoms--this prevents conflicts from threading or multiple GSG's sharing geoms (we have no way of knowing which graphics context is currently active, or what state it's in, at the time release_geom is called).
Definition at line 440 of file preparedGraphicsObjects.cxx.
Referenced by Geom::release(), and Geom::release_all().
void PreparedGraphicsObjects::release_index_buffer | ( | IndexBufferContext * | ibc | ) |
Indicates that a data context, created by a previous call to prepare_index_buffer(), is no longer needed.
The driver resources will not be freed until some GSG calls update(), indicating it is at a stage where it is ready to release datas--this prevents conflicts from threading or multiple GSG's sharing datas (we have no way of knowing which graphics context is currently active, or what state it's in, at the time release_index_buffer is called).
Definition at line 1045 of file preparedGraphicsObjects.cxx.
References GeomPrimitive::get_data_size_bytes(), and GeomPrimitive::get_usage_hint().
Referenced by GeomPrimitive::release(), and GeomPrimitive::release_all().
void PreparedGraphicsObjects::release_shader | ( | ShaderContext * | sc | ) |
Indicates that a shader context, created by a previous call to prepare_shader(), is no longer needed.
The driver resources will not be freed until some GSG calls update(), indicating it is at a stage where it is ready to release shaders--this prevents conflicts from threading or multiple GSG's sharing shaders (we have no way of knowing which graphics context is currently active, or what state it's in, at the time release_shader is called).
Definition at line 628 of file preparedGraphicsObjects.cxx.
void PreparedGraphicsObjects::release_texture | ( | Texture * | tex | ) |
Releases a texture if it has already been prepared, or removes it from the preparation queue.
Definition at line 264 of file preparedGraphicsObjects.cxx.
References Texture::release().
void PreparedGraphicsObjects::release_texture | ( | TextureContext * | tc | ) |
Indicates that a texture context, created by a previous call to prepare_texture(), is no longer needed.
The driver resources will not be freed until some GSG calls update(), indicating it is at a stage where it is ready to release textures--this prevents conflicts from threading or multiple GSG's sharing textures (we have no way of knowing which graphics context is currently active, or what state it's in, at the time release_texture is called).
Definition at line 241 of file preparedGraphicsObjects.cxx.
References TextureContext::get_view().
Referenced by Texture::release(), and Texture::release_all().
void PreparedGraphicsObjects::release_vertex_buffer | ( | VertexBufferContext * | vbc | ) |
Indicates that a data context, created by a previous call to prepare_vertex_buffer(), is no longer needed.
The driver resources will not be freed until some GSG calls update(), indicating it is at a stage where it is ready to release datas--this prevents conflicts from threading or multiple GSG's sharing datas (we have no way of knowing which graphics context is currently active, or what state it's in, at the time release_vertex_buffer is called).
Definition at line 816 of file preparedGraphicsObjects.cxx.
References GeomVertexArrayData::get_data_size_bytes(), and GeomVertexArrayData::get_usage_hint().
Referenced by GeomVertexArrayData::release(), and GeomVertexArrayData::release_all().
void PreparedGraphicsObjects::set_graphics_memory_limit | ( | size_t | limit | ) |
Sets an artificial cap on graphics memory that will be imposed on this GSG.
This limits the total amount of graphics memory, including texture memory and vertex buffer memory, that will be consumed by the GSG, regardless of whether the hardware claims to provide more graphics memory than this. It is useful to put a ceiling on graphics memory consumed, since some drivers seem to allow the application to consume more memory than the hardware can realistically support.
Definition at line 121 of file preparedGraphicsObjects.cxx.
References AdaptiveLru::get_max_size(), and AdaptiveLru::set_max_size().
void PreparedGraphicsObjects::show_graphics_memory_lru | ( | ostream & | out | ) | const |
Writes to the indicated ostream a report of how the various textures and vertex buffers are allocated in the LRU.
Definition at line 139 of file preparedGraphicsObjects.cxx.
void PreparedGraphicsObjects::show_residency_trackers | ( | ostream & | out | ) | const |
Writes to the indicated ostream a report of how the various textures and vertex buffers are allocated in the LRU.
Definition at line 151 of file preparedGraphicsObjects.cxx.