Panda3D
|
This is a base class for those kinds of SavedContexts that occupy an easily-measured (and substantial) number of bytes in the video card's frame buffer memory or AGP memory. More...
#include "bufferContext.h"
Public Member Functions | |
BufferContext (BufferResidencyTracker *residency, TypedWritableReferenceCount *object) | |
virtual TypeHandle | force_init_type () |
bool | get_active () const |
size_t | get_data_size_bytes () const |
UpdateSeq | get_modified () const |
BufferContext * | get_next () const |
This can be used along with BufferContextChain::get_first() to walk through the list of objects stored on a tracker. | |
TypedWritableReferenceCount * | get_object () const |
bool | get_resident () const |
virtual TypeHandle | get_type () const |
void | set_active (bool flag) |
Changes the active flag associated with this object. | |
void | set_resident (bool flag) |
Changes the resident flag associated with this object. | |
void | update_data_size_bytes (size_t new_data_size_bytes) |
Should be called (usually by a derived class) when the on-card size of this object has changed. | |
void | update_modified (UpdateSeq new_modified) |
Should be called (usually by a derived class) when the modified counter for this object has changed. | |
![]() | |
virtual void | output (std::ostream &out) const |
virtual void | write (std::ostream &out, int indent_level) const |
![]() | |
TypedObject (const TypedObject ©)=default | |
TypedObject * | as_typed_object () |
Returns the object, upcast (if necessary) to a TypedObject pointer. | |
const TypedObject * | as_typed_object () const |
Returns the object, upcast (if necessary) to a TypedObject pointer. | |
int | get_best_parent_from_Set (const std::set< int > &) const |
int | get_type_index () const |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. | |
bool | is_exact_type (TypeHandle handle) const |
Returns true if the current object is the indicated type exactly. | |
bool | is_of_type (TypeHandle handle) const |
Returns true if the current object is or derives from the indicated type. | |
TypedObject & | operator= (const TypedObject ©)=default |
![]() | |
void | operator delete (void *, void *) |
void | operator delete (void *ptr) |
void | operator delete[] (void *, void *) |
void | operator delete[] (void *ptr) |
void * | operator new (size_t size) |
void * | operator new (size_t size, void *ptr) |
void * | operator new[] (size_t size) |
void * | operator new[] (size_t size, void *ptr) |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
This function is declared non-inline to work around a compiler bug in g++ 2.96. | |
Public Attributes | |
get_active | |
Returns the active flag associated with this object. | |
get_data_size_bytes | |
Returns the number of bytes previously reported for the data object. | |
get_modified | |
Returns the UpdateSeq that was recorded the last time mark_loaded() was called. | |
get_object | |
Returns the associated object. | |
get_resident | |
Returns the resident flag associated with this object. | |
![]() | |
get_type | |
Friends | |
class | BufferContextChain |
class | BufferResidencyTracker |
class | PreparedGraphicsObjects |
This is a base class for those kinds of SavedContexts that occupy an easily-measured (and substantial) number of bytes in the video card's frame buffer memory or AGP memory.
At the present, this includes most of the SavedContext types: VertexBufferContext and IndexBufferContext, as well as TextureContext.
This class provides methods for tracking the video memory utilization, as well as residency of each object, via PStats.
Definition at line 38 of file bufferContext.h.
BufferContext::BufferContext | ( | BufferResidencyTracker * | residency, |
TypedWritableReferenceCount * | object ) |
Definition at line 21 of file bufferContext.cxx.
|
virtual |
Definition at line 35 of file bufferContext.cxx.
|
inlinevirtual |
Reimplemented from SavedContext.
Definition at line 95 of file bufferContext.h.
|
inlinestatic |
Definition at line 84 of file bufferContext.h.
|
inline |
This can be used along with BufferContextChain::get_first() to walk through the list of objects stored on a tracker.
Definition at line 94 of file bufferContext.I.
|
inlinevirtual |
Reimplemented from SavedContext.
Definition at line 92 of file bufferContext.h.
|
inlinestatic |
Definition at line 87 of file bufferContext.h.
|
inline |
Changes the active flag associated with this object.
An object is considered "active" if it was rendered in the current frame.
Definition at line 64 of file bufferContext.I.
Referenced by DXGraphicsStateGuardian9::apply_index_buffer(), and DXGraphicsStateGuardian9::apply_texture().
|
inline |
Changes the resident flag associated with this object.
An object is considered "resident" if it appears to be resident in texture memory.
Definition at line 80 of file bufferContext.I.
Referenced by TextureContext::mark_loaded(), IndexBufferContext::mark_loaded(), VertexBufferContext::mark_loaded(), TextureContext::mark_simple_loaded(), IndexBufferContext::mark_unloaded(), TextureContext::mark_unloaded(), and VertexBufferContext::mark_unloaded().
|
inline |
Should be called (usually by a derived class) when the on-card size of this object has changed.
Definition at line 107 of file bufferContext.I.
Referenced by IndexBufferContext::update_data_size_bytes(), TextureContext::update_data_size_bytes(), and VertexBufferContext::update_data_size_bytes().
|
inline |
Should be called (usually by a derived class) when the modified counter for this object has changed.
Definition at line 119 of file bufferContext.I.
Referenced by TextureContext::mark_loaded(), IndexBufferContext::mark_loaded(), VertexBufferContext::mark_loaded(), TextureContext::mark_simple_loaded(), IndexBufferContext::mark_unloaded(), TextureContext::mark_unloaded(), and VertexBufferContext::mark_unloaded().
|
friend |
Definition at line 102 of file bufferContext.h.
|
friend |
Definition at line 101 of file bufferContext.h.
|
friend |
Definition at line 100 of file bufferContext.h.
|
inline |
Returns the active flag associated with this object.
An object is considered "active" if it was rendered in the current frame.
Definition at line 55 of file bufferContext.h.
Referenced by Texture::get_active().
|
inline |
Returns the number of bytes previously reported for the data object.
This is used to track changes in the data object's allocated size; if it changes from this, we need to create a new buffer. This is also used to track memory utilization in PStats.
Definition at line 53 of file bufferContext.h.
Referenced by IndexBufferContext::changed_size(), VertexBufferContext::changed_size(), and Texture::get_data_size_bytes().
|
inline |
Returns the UpdateSeq that was recorded the last time mark_loaded() was called.
Definition at line 54 of file bufferContext.h.
Referenced by IndexBufferContext::was_modified(), and VertexBufferContext::was_modified().
|
inline |
Returns the associated object.
Definition at line 51 of file bufferContext.h.
|
inline |
Returns the resident flag associated with this object.
An object is considered "resident" if it appears to be resident in texture memory.
Definition at line 56 of file bufferContext.h.
Referenced by Texture::get_resident().