Panda3D
|
A table of objects that are saved within the graphics context for reference by handle later. More...
#include "preparedGraphicsObjects.h"
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. More... | |
bool | dequeue_geom (Geom *geom) |
Removes a geom from the queued list of geoms to be prepared. More... | |
bool | dequeue_index_buffer (GeomPrimitive *data) |
Removes a buffer from the queued list of data arrays to be prepared. More... | |
bool | dequeue_sampler (const SamplerState &sampler) |
Removes a sampler from the queued list of samplers to be prepared. More... | |
bool | dequeue_shader (Shader *shader) |
Removes a shader from the queued list of shaders to be prepared. More... | |
bool | dequeue_texture (Texture *tex) |
Removes a texture from the queued list of textures to be prepared. More... | |
bool | dequeue_vertex_buffer (GeomVertexArrayData *data) |
Removes a buffer from the queued list of data arrays to be prepared. More... | |
void | end_frame (Thread *current_thread) |
This is called by the GraphicsStateGuardian to indicate that it has finished processing of the frame. More... | |
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). More... | |
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). More... | |
void | enqueue_sampler (const SamplerState &sampler) |
Indicates that a sampler 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). More... | |
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). More... | |
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). More... | |
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). More... | |
size_t | get_graphics_memory_limit () const |
Returns the artificial cap on graphics memory that will be imposed on this GSG. More... | |
const string & | get_name () const |
Returns the name of the PreparedGraphicsObjects structure. More... | |
int | get_num_prepared () const |
Returns the number of objects of any kind that have already been prepared on this GSG. More... | |
int | get_num_prepared_geoms () const |
Returns the number of geoms that have already been prepared on this GSG. More... | |
int | get_num_prepared_index_buffers () const |
Returns the number of index buffers that have already been prepared on this GSG. More... | |
int | get_num_prepared_samplers () const |
Returns the number of samplers that have already been prepared on this GSG. More... | |
int | get_num_prepared_shaders () const |
Returns the number of shaders that have already been prepared on this GSG. More... | |
int | get_num_prepared_textures () const |
Returns the number of textures that have already been prepared on this GSG. More... | |
int | get_num_prepared_vertex_buffers () const |
Returns the number of vertex buffers that have already been prepared on this GSG. More... | |
int | get_num_queued () const |
Returns the number of objects of any kind that have been enqueued to be prepared on this GSG. More... | |
int | get_num_queued_geoms () const |
Returns the number of geoms that have been enqueued to be prepared on this GSG. More... | |
int | get_num_queued_index_buffers () const |
Returns the number of index buffers that have been enqueued to be prepared on this GSG. More... | |
int | get_num_queued_samplers () const |
Returns the number of samplers that have been enqueued to be prepared on this GSG. More... | |
int | get_num_queued_shaders () const |
Returns the number of shaders that have been enqueued to be prepared on this GSG. More... | |
int | get_num_queued_textures () const |
Returns the number of textures that have been enqueued to be prepared on this GSG. More... | |
int | get_num_queued_vertex_buffers () const |
Returns the number of vertex buffers that have been enqueued to be prepared on this GSG. More... | |
bool | is_geom_prepared (const Geom *geom) const |
Returns true if the vertex buffer has been prepared on this GSG, false otherwise. More... | |
bool | is_geom_queued (const Geom *geom) const |
Returns true if the geom has been queued on this GSG, false otherwise. More... | |
bool | is_index_buffer_prepared (const GeomPrimitive *data) const |
Returns true if the index buffer has been prepared on this GSG, false otherwise. More... | |
bool | is_index_buffer_queued (const GeomPrimitive *data) const |
Returns true if the index buffer has been queued on this GSG, false otherwise. More... | |
bool | is_sampler_prepared (const SamplerState &sampler) const |
Returns true if the sampler has been prepared on this GSG, false otherwise. More... | |
bool | is_sampler_queued (const SamplerState &sampler) const |
Returns true if the sampler has been queued on this GSG, false otherwise. More... | |
bool | is_shader_prepared (const Shader *shader) const |
Returns true if the shader has been prepared on this GSG, false otherwise. More... | |
bool | is_shader_queued (const Shader *shader) const |
Returns true if the shader has been queued on this GSG, false otherwise. More... | |
bool | is_texture_prepared (const Texture *tex) const |
Returns true if the texture has been prepared on this GSG, false otherwise. More... | |
bool | is_texture_queued (const Texture *tex) const |
Returns true if the texture has been queued on this GSG, false otherwise. More... | |
bool | is_vertex_buffer_prepared (const GeomVertexArrayData *data) const |
Returns true if the vertex buffer has been prepared on this GSG, false otherwise. More... | |
bool | is_vertex_buffer_queued (const GeomVertexArrayData *data) const |
Returns true if the vertex buffer has been queued on this GSG, false otherwise. More... | |
GeomContext * | prepare_geom_now (Geom *geom, GraphicsStateGuardianBase *gsg) |
Immediately creates a new GeomContext for the indicated geom and returns it. More... | |
IndexBufferContext * | prepare_index_buffer_now (GeomPrimitive *data, GraphicsStateGuardianBase *gsg) |
Immediately creates a new IndexBufferContext for the indicated data and returns it. More... | |
SamplerContext * | prepare_sampler_now (const SamplerState &sampler, GraphicsStateGuardianBase *gsg) |
Immediately creates a new SamplerContext for the indicated sampler and returns it. More... | |
ShaderContext * | prepare_shader_now (Shader *shader, GraphicsStateGuardianBase *gsg) |
Immediately creates a new ShaderContext for the indicated shader and returns it. More... | |
TextureContext * | prepare_texture_now (Texture *tex, int view, GraphicsStateGuardianBase *gsg) |
Immediately creates a new TextureContext for the indicated texture and returns it. More... | |
VertexBufferContext * | prepare_vertex_buffer_now (GeomVertexArrayData *data, GraphicsStateGuardianBase *gsg) |
Immediately creates a new VertexBufferContext for the indicated data and returns it. More... | |
void | release_all () |
Releases all prepared objects of all kinds at once. More... | |
int | release_all_geoms () |
Releases all geoms at once. More... | |
int | release_all_index_buffers () |
Releases all datas at once. More... | |
int | release_all_samplers () |
Releases all samplers at once. More... | |
int | release_all_shaders () |
Releases all shaders at once. More... | |
int | release_all_textures () |
Releases all textures at once. More... | |
int | release_all_vertex_buffers () |
Releases all datas at once. More... | |
void | release_geom (GeomContext *gc) |
Indicates that a geom context, created by a previous call to prepare_geom(), is no longer needed. More... | |
void | release_index_buffer (IndexBufferContext *ibc) |
Indicates that a data context, created by a previous call to prepare_index_buffer(), is no longer needed. More... | |
void | release_sampler (SamplerContext *sc) |
Indicates that a sampler context, created by a previous call to prepare_sampler(), is no longer needed. More... | |
void | release_sampler (const SamplerState &sampler) |
Releases a sampler if it has already been prepared, or removes it from the preparation queue. More... | |
void | release_shader (ShaderContext *sc) |
Indicates that a shader context, created by a previous call to prepare_shader(), is no longer needed. More... | |
void | release_texture (TextureContext *tc) |
Indicates that a texture context, created by a previous call to prepare_texture(), is no longer needed. More... | |
void | release_texture (Texture *tex) |
Releases a texture if it has already been prepared, or removes it from the preparation queue. More... | |
void | release_vertex_buffer (VertexBufferContext *vbc) |
Indicates that a data context, created by a previous call to prepare_vertex_buffer(), is no longer needed. More... | |
void | set_graphics_memory_limit (size_t limit) |
Sets an artificial cap on graphics memory that will be imposed on this GSG. More... | |
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. More... | |
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. More... | |
![]() | |
int | get_ref_count () const |
Returns the current reference count. More... | |
WeakReferenceList * | get_weak_list () const |
Returns the WeakReferenceList associated with this ReferenceCount object. More... | |
bool | has_weak_list () const |
Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. More... | |
void | local_object () |
This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. More... | |
void | ref () const |
Explicitly increments the reference count. More... | |
bool | test_ref_count_integrity () const |
Does some easy checks to make sure that the reference count isn't completely bogus. More... | |
bool | test_ref_count_nonzero () const |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More... | |
virtual bool | unref () const |
Explicitly decrements the reference count. More... | |
void | weak_ref (WeakPointerToVoid *ptv) |
Adds the indicated PointerToVoid as a weak reference to this object. More... | |
void | weak_unref (WeakPointerToVoid *ptv) |
Removes the indicated PointerToVoid as a weak reference to this object. More... | |
Public Attributes | |
AdaptiveLru | _graphics_memory_lru |
BufferResidencyTracker | _ibuffer_residency |
SimpleLru | _sampler_object_lru |
bool | _support_released_buffer_cache |
BufferResidencyTracker | _texture_residency |
BufferResidencyTracker | _vbuffer_residency |
Friends | |
class | GraphicsStateGuardian |
Additional Inherited Members | |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
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 60 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 1405 of file preparedGraphicsObjects.cxx.
References end_frame(), Texture::get_num_views(), GeomPrimitive::is_indexed(), GeomVertexArrayData::prepare_now(), Shader::prepare_now(), SamplerState::prepare_now(), Geom::prepare_now(), GeomPrimitive::prepare_now(), and Texture::prepare_now().
Referenced by prepare_index_buffer_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 601 of file preparedGraphicsObjects.cxx.
References is_geom_prepared().
Referenced by is_geom_queued(), and 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 1206 of file preparedGraphicsObjects.cxx.
References is_index_buffer_prepared().
Referenced by is_index_buffer_queued(), and GeomPrimitive::release().
bool PreparedGraphicsObjects::dequeue_sampler | ( | const SamplerState & | sampler | ) |
Removes a sampler from the queued list of samplers 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 sampler will automatically be dequeued and prepared at the next frame.
The return value is true if the sampler is successfully dequeued, false if it had not been queued.
Definition at line 409 of file preparedGraphicsObjects.cxx.
References is_sampler_prepared().
Referenced by is_sampler_queued().
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 789 of file preparedGraphicsObjects.cxx.
References is_shader_prepared().
Referenced by is_shader_queued(), and Shader::release().
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 210 of file preparedGraphicsObjects.cxx.
References is_texture_prepared().
Referenced by is_texture_queued(), and 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 977 of file preparedGraphicsObjects.cxx.
References is_vertex_buffer_prepared().
Referenced by is_vertex_buffer_queued(), and 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 1559 of file preparedGraphicsObjects.cxx.
Referenced by begin_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 566 of file preparedGraphicsObjects.cxx.
References is_geom_queued().
Referenced by Geom::prepare(), and prepare_sampler_now().
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 1171 of file preparedGraphicsObjects.cxx.
References is_index_buffer_queued().
Referenced by GeomPrimitive::prepare(), and prepare_vertex_buffer_now().
void PreparedGraphicsObjects::enqueue_sampler | ( | const SamplerState & | sampler | ) |
Indicates that a sampler 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 374 of file preparedGraphicsObjects.cxx.
References is_sampler_queued().
Referenced by SamplerState::prepare(), and prepare_texture_now().
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 754 of file preparedGraphicsObjects.cxx.
References is_shader_queued().
Referenced by Shader::prepare(), and prepare_geom_now().
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 175 of file preparedGraphicsObjects.cxx.
References is_texture_queued().
Referenced by Texture::prepare(), and show_residency_trackers().
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 942 of file preparedGraphicsObjects.cxx.
References is_vertex_buffer_queued().
Referenced by GeomVertexArrayData::prepare(), and prepare_shader_now().
|
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(), and release_all().
Referenced by get_name().
|
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.
References get_graphics_memory_limit().
|
inline |
Returns the number of objects of any kind that have already been prepared on this GSG.
Definition at line 82 of file preparedGraphicsObjects.I.
References get_num_prepared_geoms(), get_num_prepared_index_buffers(), get_num_prepared_samplers(), get_num_prepared_shaders(), get_num_prepared_textures(), and get_num_prepared_vertex_buffers().
Referenced by get_num_queued().
int PreparedGraphicsObjects::get_num_prepared_geoms | ( | ) | const |
Returns the number of geoms that have already been prepared on this GSG.
Definition at line 702 of file preparedGraphicsObjects.cxx.
References prepare_geom_now().
Referenced by get_num_prepared(), and get_num_queued_geoms().
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 1335 of file preparedGraphicsObjects.cxx.
References prepare_index_buffer_now().
Referenced by get_num_prepared(), and get_num_queued_index_buffers().
int PreparedGraphicsObjects::get_num_prepared_samplers | ( | ) | const |
Returns the number of samplers that have already been prepared on this GSG.
Definition at line 513 of file preparedGraphicsObjects.cxx.
References prepare_sampler_now().
Referenced by get_num_prepared(), and get_num_queued_samplers().
int PreparedGraphicsObjects::get_num_prepared_shaders | ( | ) | const |
Returns the number of shaders that have already been prepared on this GSG.
Definition at line 890 of file preparedGraphicsObjects.cxx.
References prepare_shader_now().
Referenced by get_num_prepared(), and get_num_queued_shaders().
int PreparedGraphicsObjects::get_num_prepared_textures | ( | ) | const |
Returns the number of textures that have already been prepared on this GSG.
Definition at line 322 of file preparedGraphicsObjects.cxx.
References prepare_texture_now().
Referenced by get_num_prepared(), and get_num_queued_textures().
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 1106 of file preparedGraphicsObjects.cxx.
References prepare_vertex_buffer_now().
Referenced by get_num_prepared(), and get_num_queued_vertex_buffers().
|
inline |
Returns the number of objects of any kind that have been enqueued to be prepared on this GSG.
Definition at line 66 of file preparedGraphicsObjects.I.
References get_num_prepared(), get_num_queued_geoms(), get_num_queued_index_buffers(), get_num_queued_samplers(), get_num_queued_shaders(), get_num_queued_textures(), and get_num_queued_vertex_buffers().
Referenced by release_all().
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 691 of file preparedGraphicsObjects.cxx.
References get_num_prepared_geoms().
Referenced by get_num_queued(), and release_all_geoms().
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 1324 of file preparedGraphicsObjects.cxx.
References get_num_prepared_index_buffers().
Referenced by get_num_queued(), and release_all_index_buffers().
int PreparedGraphicsObjects::get_num_queued_samplers | ( | ) | const |
Returns the number of samplers that have been enqueued to be prepared on this GSG.
Definition at line 502 of file preparedGraphicsObjects.cxx.
References get_num_prepared_samplers().
Referenced by get_num_queued(), and release_all_samplers().
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 879 of file preparedGraphicsObjects.cxx.
References get_num_prepared_shaders().
Referenced by get_num_queued(), and release_all_shaders().
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 311 of file preparedGraphicsObjects.cxx.
References get_num_prepared_textures().
Referenced by get_num_queued(), and release_all_textures().
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 1095 of file preparedGraphicsObjects.cxx.
References get_num_prepared_vertex_buffers().
Referenced by get_num_queued(), and release_all_vertex_buffers().
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 619 of file preparedGraphicsObjects.cxx.
References Geom::is_prepared(), and release_geom().
Referenced by dequeue_geom().
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 579 of file preparedGraphicsObjects.cxx.
References dequeue_geom().
Referenced by enqueue_geom(), and 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 1224 of file preparedGraphicsObjects.cxx.
References GeomPrimitive::is_prepared(), and release_index_buffer().
Referenced by dequeue_index_buffer().
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 1184 of file preparedGraphicsObjects.cxx.
References dequeue_index_buffer().
Referenced by enqueue_index_buffer(), and GeomPrimitive::is_prepared().
bool PreparedGraphicsObjects::is_sampler_prepared | ( | const SamplerState & | sampler | ) | const |
Returns true if the sampler has been prepared on this GSG, false otherwise.
Definition at line 427 of file preparedGraphicsObjects.cxx.
References release_sampler().
Referenced by dequeue_sampler(), and SamplerState::is_prepared().
bool PreparedGraphicsObjects::is_sampler_queued | ( | const SamplerState & | sampler | ) | const |
Returns true if the sampler has been queued on this GSG, false otherwise.
Definition at line 387 of file preparedGraphicsObjects.cxx.
References dequeue_sampler().
Referenced by enqueue_sampler(), and SamplerState::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 807 of file preparedGraphicsObjects.cxx.
References Shader::is_prepared(), and release_shader().
Referenced by dequeue_shader().
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 767 of file preparedGraphicsObjects.cxx.
References dequeue_shader().
Referenced by enqueue_shader(), and Shader::is_prepared().
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 228 of file preparedGraphicsObjects.cxx.
References Texture::is_prepared(), and release_texture().
Referenced by dequeue_texture().
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 188 of file preparedGraphicsObjects.cxx.
References dequeue_texture().
Referenced by enqueue_texture(), and 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 995 of file preparedGraphicsObjects.cxx.
References GeomVertexArrayData::is_prepared(), and release_vertex_buffer().
Referenced by dequeue_vertex_buffer().
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 955 of file preparedGraphicsObjects.cxx.
References dequeue_vertex_buffer().
Referenced by enqueue_vertex_buffer(), and 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 729 of file preparedGraphicsObjects.cxx.
References enqueue_shader().
Referenced by get_num_prepared_geoms(), and 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 1362 of file preparedGraphicsObjects.cxx.
References begin_frame(), GeomPrimitive::get_data_size_bytes(), and GeomPrimitive::get_usage_hint().
Referenced by get_num_prepared_index_buffers(), and GeomPrimitive::prepare_now().
SamplerContext * PreparedGraphicsObjects::prepare_sampler_now | ( | const SamplerState & | sampler, |
GraphicsStateGuardianBase * | gsg | ||
) |
Immediately creates a new SamplerContext for the indicated sampler and returns it.
This assumes that the GraphicsStateGuardian is the currently active rendering context and that it is ready to accept new samplers. If this is not necessarily the case, you should use enqueue_sampler() instead.
Normally, this function is not called directly. Call Sampler::prepare_now() instead.
The SamplerContext contains all of the pertinent information needed by the GSG to keep track of this one particular sampler, and will exist as long as the sampler is ready to be rendered.
When either the Sampler or the PreparedGraphicsObjects object destructs, the SamplerContext will be deleted.
Definition at line 540 of file preparedGraphicsObjects.cxx.
References enqueue_geom().
Referenced by get_num_prepared_samplers(), and SamplerState::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 917 of file preparedGraphicsObjects.cxx.
References enqueue_vertex_buffer().
Referenced by get_num_prepared_shaders(), and Shader::prepare_now().
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 349 of file preparedGraphicsObjects.cxx.
References enqueue_sampler().
Referenced by get_num_prepared_textures(), and 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 1133 of file preparedGraphicsObjects.cxx.
References enqueue_index_buffer(), GeomVertexArrayData::get_data_size_bytes(), and GeomVertexArrayData::get_usage_hint().
Referenced by get_num_prepared_vertex_buffers(), and GeomVertexArrayData::prepare_now().
|
inline |
Releases all prepared objects of all kinds at once.
Definition at line 46 of file preparedGraphicsObjects.I.
References get_num_queued(), release_all_geoms(), release_all_index_buffers(), release_all_samplers(), release_all_shaders(), release_all_textures(), release_all_vertex_buffers(), and BufferResidencyTracker::set_levels().
Referenced by get_graphics_memory_limit(), and 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 662 of file preparedGraphicsObjects.cxx.
References get_num_queued_geoms().
Referenced by release_all(), and release_geom().
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 1278 of file preparedGraphicsObjects.cxx.
References get_num_queued_index_buffers().
Referenced by release_all(), and release_index_buffer().
int PreparedGraphicsObjects::release_all_samplers | ( | ) |
Releases all samplers at once.
This will force them to be reloaded for all GSG's that share this object. Returns the number of samplers released.
Definition at line 477 of file preparedGraphicsObjects.cxx.
References get_num_queued_samplers().
Referenced by release_all(), and release_sampler().
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 850 of file preparedGraphicsObjects.cxx.
References get_num_queued_shaders().
Referenced by release_all(), and release_shader().
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 282 of file preparedGraphicsObjects.cxx.
References get_num_queued_textures(), and TextureContext::get_view().
Referenced by release_all(), and release_texture().
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 1049 of file preparedGraphicsObjects.cxx.
References get_num_queued_vertex_buffers().
Referenced by release_all(), and release_vertex_buffer().
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 637 of file preparedGraphicsObjects.cxx.
References release_all_geoms().
Referenced by is_geom_prepared(), 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 1242 of file preparedGraphicsObjects.cxx.
References GeomPrimitive::get_data_size_bytes(), GeomPrimitive::get_usage_hint(), and release_all_index_buffers().
Referenced by is_index_buffer_prepared(), GeomPrimitive::release(), and GeomPrimitive::release_all().
void PreparedGraphicsObjects::release_sampler | ( | SamplerContext * | sc | ) |
Indicates that a sampler context, created by a previous call to prepare_sampler(), 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 samplers.
Definition at line 444 of file preparedGraphicsObjects.cxx.
Referenced by is_sampler_prepared(), and SamplerState::release().
void PreparedGraphicsObjects::release_sampler | ( | const SamplerState & | sampler | ) |
Releases a sampler if it has already been prepared, or removes it from the preparation queue.
Definition at line 457 of file preparedGraphicsObjects.cxx.
References release_all_samplers().
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 825 of file preparedGraphicsObjects.cxx.
References release_all_shaders().
Referenced by is_shader_prepared(), Shader::release(), and Shader::release_all().
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 246 of file preparedGraphicsObjects.cxx.
References TextureContext::get_view().
Referenced by is_texture_prepared(), Texture::release(), and Texture::release_all().
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 269 of file preparedGraphicsObjects.cxx.
References Texture::release(), and release_all_textures().
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 1013 of file preparedGraphicsObjects.cxx.
References GeomVertexArrayData::get_data_size_bytes(), GeomVertexArrayData::get_usage_hint(), and release_all_vertex_buffers().
Referenced by is_vertex_buffer_prepared(), 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 126 of file preparedGraphicsObjects.cxx.
References show_graphics_memory_lru().
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 144 of file preparedGraphicsObjects.cxx.
References show_residency_trackers().
Referenced by set_graphics_memory_limit().
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 156 of file preparedGraphicsObjects.cxx.
References enqueue_texture().
Referenced by show_graphics_memory_lru().