Panda3D
Classes | Public Member Functions | Public Attributes | Friends | List of all members
PreparedGraphicsObjects Class Reference

A table of objects that are saved within the graphics context for reference by handle later. More...

#include "preparedGraphicsObjects.h"

Inheritance diagram for PreparedGraphicsObjects:
ReferenceCount MemoryBase

Classes

class  EnqueuedObject
 This is a handle to an enqueued object, from which the result can be obtained upon completion. More...
 

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_shader_buffer (ShaderBuffer *data)
 Removes a buffer from the queued list of data arrays 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_shader_buffer (ShaderBuffer *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_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 std::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_shader_buffers () const
 Returns the number of index buffers 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_shader_buffers () const
 Returns the number of index buffers 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_buffer_prepared (const ShaderBuffer *data) const
 Returns true if the index buffer has been prepared on this GSG, false otherwise. More...
 
bool is_shader_buffer_queued (const ShaderBuffer *data) const
 Returns true if the index buffer 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...
 
GeomContextprepare_geom_now (Geom *geom, GraphicsStateGuardianBase *gsg)
 Immediately creates a new GeomContext for the indicated geom and returns it. More...
 
IndexBufferContextprepare_index_buffer_now (GeomPrimitive *data, GraphicsStateGuardianBase *gsg)
 Immediately creates a new IndexBufferContext for the indicated data and returns it. More...
 
SamplerContextprepare_sampler_now (const SamplerState &sampler, GraphicsStateGuardianBase *gsg)
 Immediately creates a new SamplerContext for the indicated sampler and returns it. More...
 
BufferContextprepare_shader_buffer_now (ShaderBuffer *data, GraphicsStateGuardianBase *gsg)
 Immediately creates a new BufferContext for the indicated data and returns it. More...
 
ShaderContextprepare_shader_now (Shader *shader, GraphicsStateGuardianBase *gsg)
 Immediately creates a new ShaderContext for the indicated shader and returns it. More...
 
TextureContextprepare_texture_now (Texture *tex, int view, GraphicsStateGuardianBase *gsg)
 Immediately creates a new TextureContext for the indicated texture and returns it. More...
 
VertexBufferContextprepare_vertex_buffer_now (GeomVertexArrayData *data, GraphicsStateGuardianBase *gsg)
 Immediately creates a new VertexBufferContext for the indicated data and returns it. More...
 
 PT (EnqueuedObject) enqueue_texture_future(Texture *tex)
 
 PT (EnqueuedObject) enqueue_shader_future(Shader *shader)
 
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_shader_buffers ()
 Releases all datas 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_shader_buffer (BufferContext *bc)
 Indicates that a data context, created by a previous call to prepare_shader_buffer(), 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 (std::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 (std::ostream &out) const
 Writes to the indicated ostream a report of how the various textures and vertex buffers are allocated in the LRU. More...
 
- Public Member Functions inherited from ReferenceCount
int get_ref_count () const
 
WeakReferenceListget_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 ref_if_nonzero () const
 Atomically increases the reference count of this object if it is not zero. 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...
 
WeakReferenceListweak_ref ()
 Adds the indicated PointerToVoid as a weak reference to this object. More...
 
void weak_unref ()
 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
 
BufferResidencyTracker _sbuffer_residency
 
bool _support_released_buffer_cache
 
BufferResidencyTracker _texture_residency
 
BufferResidencyTracker _vbuffer_residency
 
- Public Attributes inherited from ReferenceCount
 get_ref_count
 Returns the current reference count. More...
 

Friends

class GraphicsStateGuardian
 

Additional Inherited Members

- Static Public Member Functions inherited from ReferenceCount
static TypeHandle get_class_type ()
 
static void init_type ()
 

Detailed Description

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.

Member Function Documentation

◆ begin_frame()

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 1510 of file preparedGraphicsObjects.cxx.

References BufferResidencyTracker::begin_frame(), Texture::get_num_views, Shader::prepare_now(), SamplerState::prepare_now(), Geom::prepare_now(), and Texture::prepare_now().

◆ dequeue_geom()

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 574 of file preparedGraphicsObjects.cxx.

Referenced by Geom::release().

◆ dequeue_index_buffer()

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 1114 of file preparedGraphicsObjects.cxx.

Referenced by GeomPrimitive::release().

◆ dequeue_sampler()

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 415 of file preparedGraphicsObjects.cxx.

◆ dequeue_shader()

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 747 of file preparedGraphicsObjects.cxx.

Referenced by Shader::release().

◆ dequeue_shader_buffer()

bool PreparedGraphicsObjects::dequeue_shader_buffer ( ShaderBuffer 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 1311 of file preparedGraphicsObjects.cxx.

Referenced by ShaderBuffer::release().

◆ dequeue_texture()

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 238 of file preparedGraphicsObjects.cxx.

Referenced by Texture::release().

◆ dequeue_vertex_buffer()

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 916 of file preparedGraphicsObjects.cxx.

Referenced by GeomVertexArrayData::release().

◆ end_frame()

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 1666 of file preparedGraphicsObjects.cxx.

References BufferResidencyTracker::end_frame().

◆ enqueue_geom()

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 547 of file preparedGraphicsObjects.cxx.

Referenced by Geom::prepare().

◆ enqueue_index_buffer()

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 1086 of file preparedGraphicsObjects.cxx.

Referenced by GeomPrimitive::prepare().

◆ enqueue_sampler()

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 388 of file preparedGraphicsObjects.cxx.

Referenced by SamplerState::prepare().

◆ enqueue_shader()

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 702 of file preparedGraphicsObjects.cxx.

◆ enqueue_shader_buffer()

void PreparedGraphicsObjects::enqueue_shader_buffer ( ShaderBuffer 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 1283 of file preparedGraphicsObjects.cxx.

Referenced by ShaderBuffer::prepare().

◆ enqueue_texture()

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 193 of file preparedGraphicsObjects.cxx.

◆ enqueue_vertex_buffer()

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 888 of file preparedGraphicsObjects.cxx.

Referenced by GeomVertexArrayData::prepare().

◆ get_graphics_memory_limit()

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 29 of file preparedGraphicsObjects.I.

References AdaptiveLru::get_max_size().

◆ get_name()

const std::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 20 of file preparedGraphicsObjects.I.

Referenced by ShaderBuffer::write_datagram(), and InternalName::write_datagram().

◆ get_num_prepared()

int PreparedGraphicsObjects::get_num_prepared ( ) const
inline

◆ get_num_prepared_geoms()

int PreparedGraphicsObjects::get_num_prepared_geoms ( ) const

Returns the number of geoms that have already been prepared on this GSG.

Definition at line 660 of file preparedGraphicsObjects.cxx.

Referenced by get_num_prepared().

◆ get_num_prepared_index_buffers()

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 1229 of file preparedGraphicsObjects.cxx.

Referenced by get_num_prepared().

◆ get_num_prepared_samplers()

int PreparedGraphicsObjects::get_num_prepared_samplers ( ) const

Returns the number of samplers that have already been prepared on this GSG.

Definition at line 503 of file preparedGraphicsObjects.cxx.

Referenced by get_num_prepared().

◆ get_num_prepared_shader_buffers()

int PreparedGraphicsObjects::get_num_prepared_shader_buffers ( ) const

Returns the number of index buffers that have already been prepared on this GSG.

Definition at line 1397 of file preparedGraphicsObjects.cxx.

Referenced by get_num_prepared().

◆ get_num_prepared_shaders()

int PreparedGraphicsObjects::get_num_prepared_shaders ( ) const

Returns the number of shaders that have already been prepared on this GSG.

Definition at line 846 of file preparedGraphicsObjects.cxx.

Referenced by get_num_prepared().

◆ get_num_prepared_textures()

int PreparedGraphicsObjects::get_num_prepared_textures ( ) const

Returns the number of textures that have already been prepared on this GSG.

Definition at line 346 of file preparedGraphicsObjects.cxx.

Referenced by get_num_prepared().

◆ get_num_prepared_vertex_buffers()

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 1031 of file preparedGraphicsObjects.cxx.

Referenced by get_num_prepared().

◆ get_num_queued()

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 56 of file preparedGraphicsObjects.I.

References get_num_queued_geoms(), get_num_queued_index_buffers(), get_num_queued_samplers(), get_num_queued_shader_buffers(), get_num_queued_shaders(), get_num_queued_textures(), and get_num_queued_vertex_buffers().

◆ get_num_queued_geoms()

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 652 of file preparedGraphicsObjects.cxx.

Referenced by get_num_queued().

◆ get_num_queued_index_buffers()

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 1220 of file preparedGraphicsObjects.cxx.

Referenced by get_num_queued().

◆ get_num_queued_samplers()

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 495 of file preparedGraphicsObjects.cxx.

Referenced by get_num_queued().

◆ get_num_queued_shader_buffers()

int PreparedGraphicsObjects::get_num_queued_shader_buffers ( ) const

Returns the number of index buffers that have been enqueued to be prepared on this GSG.

Definition at line 1388 of file preparedGraphicsObjects.cxx.

Referenced by get_num_queued().

◆ get_num_queued_shaders()

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 838 of file preparedGraphicsObjects.cxx.

Referenced by get_num_queued().

◆ get_num_queued_textures()

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 338 of file preparedGraphicsObjects.cxx.

Referenced by get_num_queued().

◆ get_num_queued_vertex_buffers()

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 1022 of file preparedGraphicsObjects.cxx.

Referenced by get_num_queued().

◆ is_geom_prepared()

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 590 of file preparedGraphicsObjects.cxx.

References Geom::is_prepared().

◆ is_geom_queued()

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 557 of file preparedGraphicsObjects.cxx.

Referenced by Geom::is_prepared().

◆ is_index_buffer_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 1130 of file preparedGraphicsObjects.cxx.

◆ is_index_buffer_queued()

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 1097 of file preparedGraphicsObjects.cxx.

Referenced by GeomPrimitive::is_prepared().

◆ is_sampler_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 430 of file preparedGraphicsObjects.cxx.

Referenced by SamplerState::is_prepared().

◆ is_sampler_queued()

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 398 of file preparedGraphicsObjects.cxx.

Referenced by SamplerState::is_prepared().

◆ is_shader_buffer_prepared()

bool PreparedGraphicsObjects::is_shader_buffer_prepared ( const ShaderBuffer data) const

Returns true if the index buffer has been prepared on this GSG, false otherwise.

Definition at line 1327 of file preparedGraphicsObjects.cxx.

◆ is_shader_buffer_queued()

bool PreparedGraphicsObjects::is_shader_buffer_queued ( const ShaderBuffer data) const

Returns true if the index buffer has been queued on this GSG, false otherwise.

Definition at line 1294 of file preparedGraphicsObjects.cxx.

Referenced by ShaderBuffer::is_prepared().

◆ is_shader_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 765 of file preparedGraphicsObjects.cxx.

References Shader::is_prepared().

◆ is_shader_queued()

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 730 of file preparedGraphicsObjects.cxx.

Referenced by Shader::is_prepared().

◆ is_texture_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 256 of file preparedGraphicsObjects.cxx.

References Texture::is_prepared().

◆ is_texture_queued()

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 221 of file preparedGraphicsObjects.cxx.

Referenced by Texture::is_prepared().

◆ is_vertex_buffer_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 932 of file preparedGraphicsObjects.cxx.

◆ is_vertex_buffer_queued()

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 899 of file preparedGraphicsObjects.cxx.

Referenced by GeomVertexArrayData::is_prepared().

◆ prepare_geom_now()

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 681 of file preparedGraphicsObjects.cxx.

Referenced by Geom::prepare_now().

◆ prepare_index_buffer_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 1250 of file preparedGraphicsObjects.cxx.

◆ prepare_sampler_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 524 of file preparedGraphicsObjects.cxx.

Referenced by SamplerState::prepare_now().

◆ prepare_shader_buffer_now()

BufferContext * PreparedGraphicsObjects::prepare_shader_buffer_now ( ShaderBuffer data,
GraphicsStateGuardianBase gsg 
)

Immediately creates a new BufferContext 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_shader_buffer() instead.

Normally, this function is not called directly. Call Data::prepare_now() instead.

The BufferContext 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 BufferContext will be deleted.

Definition at line 1418 of file preparedGraphicsObjects.cxx.

Referenced by ShaderBuffer::prepare_now().

◆ prepare_shader_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 867 of file preparedGraphicsObjects.cxx.

Referenced by Shader::prepare_now().

◆ prepare_texture_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 367 of file preparedGraphicsObjects.cxx.

Referenced by Texture::prepare_now().

◆ prepare_vertex_buffer_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 1053 of file preparedGraphicsObjects.cxx.

Referenced by GeomVertexArrayData::prepare_now().

◆ release_all()

void PreparedGraphicsObjects::release_all ( )
inline

◆ release_all_geoms()

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 625 of file preparedGraphicsObjects.cxx.

Referenced by release_all().

◆ release_all_index_buffers()

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 1176 of file preparedGraphicsObjects.cxx.

References IndexBufferContext::get_data().

Referenced by release_all().

◆ release_all_samplers()

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 472 of file preparedGraphicsObjects.cxx.

Referenced by release_all().

◆ release_all_shader_buffers()

int PreparedGraphicsObjects::release_all_shader_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 1363 of file preparedGraphicsObjects.cxx.

◆ release_all_shaders()

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 800 of file preparedGraphicsObjects.cxx.

Referenced by release_all().

◆ release_all_textures()

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 300 of file preparedGraphicsObjects.cxx.

References TextureContext::get_texture(), and TextureContext::get_view().

Referenced by release_all().

◆ release_all_vertex_buffers()

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 978 of file preparedGraphicsObjects.cxx.

References VertexBufferContext::get_data().

Referenced by release_all().

◆ release_geom()

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 604 of file preparedGraphicsObjects.cxx.

Referenced by Geom::release(), and Geom::release_all().

◆ release_index_buffer()

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 1144 of file preparedGraphicsObjects.cxx.

References IndexBufferContext::get_data(), GeomPrimitive::get_data_size_bytes, and GeomPrimitive::get_usage_hint.

Referenced by GeomPrimitive::release(), and GeomPrimitive::release_all().

◆ release_sampler() [1/2]

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 SamplerState::release().

◆ release_sampler() [2/2]

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 455 of file preparedGraphicsObjects.cxx.

◆ release_shader()

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 779 of file preparedGraphicsObjects.cxx.

Referenced by Shader::release(), and Shader::release_all().

◆ release_shader_buffer()

void PreparedGraphicsObjects::release_shader_buffer ( BufferContext bc)

Indicates that a data context, created by a previous call to prepare_shader_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_shader_buffer is called).

Definition at line 1341 of file preparedGraphicsObjects.cxx.

Referenced by ShaderBuffer::release(), and ShaderBuffer::release_all().

◆ release_texture() [1/2]

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 270 of file preparedGraphicsObjects.cxx.

References TextureContext::get_texture(), and TextureContext::get_view().

Referenced by Texture::release(), and Texture::release_all().

◆ release_texture() [2/2]

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 290 of file preparedGraphicsObjects.cxx.

References Texture::release().

◆ release_vertex_buffer()

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 946 of file preparedGraphicsObjects.cxx.

References VertexBufferContext::get_data(), GeomVertexArrayData::get_data_size_bytes, and GeomVertexArrayData::get_usage_hint.

Referenced by GeomVertexArrayData::release(), and GeomVertexArrayData::release_all().

◆ set_graphics_memory_limit()

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 150 of file preparedGraphicsObjects.cxx.

References AdaptiveLru::get_max_size(), and AdaptiveLru::set_max_size().

◆ show_graphics_memory_lru()

void PreparedGraphicsObjects::show_graphics_memory_lru ( std::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 165 of file preparedGraphicsObjects.cxx.

◆ show_residency_trackers()

void PreparedGraphicsObjects::show_residency_trackers ( std::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 174 of file preparedGraphicsObjects.cxx.


The documentation for this class was generated from the following files: