Panda3D
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Friends | List of all members
IndexBufferContext Class Reference

This is a special class object that holds all the information returned by a particular GSG to indicate the vertex data array's internal context identifier. More...

#include "indexBufferContext.h"

Inheritance diagram for IndexBufferContext:
BufferContext AdaptiveLruPage SavedContext LinkedListNode AdaptiveLruPageDynamicList AdaptiveLruPageStaticList TypedObject LinkedListNode LinkedListNode MemoryBase DXIndexBufferContext9

Public Member Functions

 IndexBufferContext (PreparedGraphicsObjects *pgo, GeomPrimitive *data)
 
bool changed_size (const GeomPrimitivePipelineReader *reader) const
 Returns true if the data has changed size since the last time mark_loaded() was called.
 
bool changed_usage_hint (const GeomPrimitivePipelineReader *reader) const
 Returns true if the data has changed its usage hint since the last time mark_loaded() was called.
 
virtual TypeHandle force_init_type ()
 
GeomPrimitiveget_data () const
 Returns the pointer to the client-side array data object.
 
virtual TypeHandle get_type () const
 
void mark_loaded (const GeomPrimitivePipelineReader *reader)
 Should be called after the IndexBufferContext has been loaded into graphics memory, this updates the internal flags for changed_size() and modified().
 
void mark_unloaded ()
 Should be called after the buffer has been forced out of graphics memory.
 
virtual void output (std::ostream &out) const
 
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.
 
bool was_modified (const GeomPrimitivePipelineReader *reader) const
 Returns true if the data has been modified since the last time mark_loaded() was called.
 
virtual void write (std::ostream &out, int indent_level) const
 
- Public Member Functions inherited from BufferContext
 BufferContext (BufferResidencyTracker *residency, TypedWritableReferenceCount *object)
 
bool get_active () const
 
size_t get_data_size_bytes () const
 
UpdateSeq get_modified () const
 
BufferContextget_next () const
 This can be used along with BufferContextChain::get_first() to walk through the list of objects stored on a tracker.
 
TypedWritableReferenceCountget_object () const
 
bool get_resident () 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.
 
- Public Member Functions inherited from TypedObject
 TypedObject (const TypedObject &copy)=default
 
TypedObjectas_typed_object ()
 Returns the object, upcast (if necessary) to a TypedObject pointer.
 
const TypedObjectas_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.
 
TypedObjectoperator= (const TypedObject &copy)=default
 
- Public Member Functions inherited from MemoryBase
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)
 
- Public Member Functions inherited from AdaptiveLruPage
 AdaptiveLruPage (const AdaptiveLruPage &copy)
 
 AdaptiveLruPage (size_t lru_size)
 
void dequeue_lru ()
 Removes the page from its AdaptiveLru.
 
void enqueue_lru (AdaptiveLru *lru)
 Adds the page to the LRU for the first time, or marks it recently-accessed if it has already been added.
 
virtual void evict_lru ()
 Evicts the page from the LRU.
 
AdaptiveLruget_lru () const
 Returns the LRU that manages this page, or NULL if it is not currently managed by any LRU.
 
size_t get_lru_size () const
 Returns the size of this page as reported to the LRU, presumably in bytes.
 
unsigned int get_num_frames () const
 Returns the number of frames since the page was first added to its LRU.
 
unsigned int get_num_inactive_frames () const
 Returns the number of frames since the page was last accessed on its LRU.
 
void mark_used_lru () const
 To be called when the page is used; this will move it to the tail of the AdaptiveLru queue it is already on.
 
void mark_used_lru (AdaptiveLru *lru)
 To be called when the page is used; this will move it to the tail of the specified AdaptiveLru queue.
 
void operator= (const AdaptiveLruPage &copy)
 
void set_lru_size (size_t lru_size)
 Specifies the size of this page, presumably in bytes, although any unit is possible.
 

Static Public Member Functions

static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from BufferContext
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from SavedContext
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from TypedObject
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.
 

Friends

class PreparedGraphicsObjects
 

Additional Inherited Members

- Public Attributes inherited from BufferContext
 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.
 
- Public Attributes inherited from TypedObject
 get_type
 

Detailed Description

This is a special class object that holds all the information returned by a particular GSG to indicate the vertex data array's internal context identifier.

This allows the GSG to cache the vertex data array in whatever way makes sense. For instance, DirectX can allocate a vertex buffer for the array. OpenGL can create a buffer object.

Definition at line 33 of file indexBufferContext.h.

Constructor & Destructor Documentation

◆ IndexBufferContext()

IndexBufferContext::IndexBufferContext ( PreparedGraphicsObjects * pgo,
GeomPrimitive * data )
inline

Definition at line 17 of file indexBufferContext.I.

Member Function Documentation

◆ changed_size()

bool IndexBufferContext::changed_size ( const GeomPrimitivePipelineReader * reader) const
inline

Returns true if the data has changed size since the last time mark_loaded() was called.

Definition at line 36 of file indexBufferContext.I.

References get_data(), BufferContext::get_data_size_bytes, and GeomPrimitivePipelineReader::get_data_size_bytes().

Referenced by DXGraphicsStateGuardian9::apply_index_buffer().

◆ changed_usage_hint()

bool IndexBufferContext::changed_usage_hint ( const GeomPrimitivePipelineReader * reader) const
inline

Returns true if the data has changed its usage hint since the last time mark_loaded() was called.

Definition at line 46 of file indexBufferContext.I.

References get_data().

◆ force_init_type()

virtual TypeHandle IndexBufferContext::force_init_type ( )
inlinevirtual

Reimplemented from BufferContext.

Definition at line 67 of file indexBufferContext.h.

◆ get_class_type()

static TypeHandle IndexBufferContext::get_class_type ( )
inlinestatic

Definition at line 56 of file indexBufferContext.h.

◆ get_data()

GeomPrimitive * IndexBufferContext::get_data ( ) const
inline

◆ get_type()

virtual TypeHandle IndexBufferContext::get_type ( ) const
inlinevirtual

Reimplemented from BufferContext.

Definition at line 64 of file indexBufferContext.h.

◆ init_type()

static void IndexBufferContext::init_type ( )
inlinestatic

Definition at line 59 of file indexBufferContext.h.

◆ mark_loaded()

void IndexBufferContext::mark_loaded ( const GeomPrimitivePipelineReader * reader)
inline

Should be called after the IndexBufferContext has been loaded into graphics memory, this updates the internal flags for changed_size() and modified().

Definition at line 76 of file indexBufferContext.I.

References get_data(), GeomPrimitivePipelineReader::get_data_size_bytes(), BufferContext::set_resident(), update_data_size_bytes(), and BufferContext::update_modified().

Referenced by DXGraphicsStateGuardian9::apply_index_buffer().

◆ mark_unloaded()

void IndexBufferContext::mark_unloaded ( )
inline

Should be called after the buffer has been forced out of graphics memory.

Definition at line 90 of file indexBufferContext.I.

References BufferContext::set_resident(), and BufferContext::update_modified().

Referenced by DXIndexBufferContext9::evict_lru().

◆ output()

void IndexBufferContext::output ( std::ostream & out) const
virtual

Reimplemented from SavedContext.

Definition at line 21 of file indexBufferContext.cxx.

◆ update_data_size_bytes()

void IndexBufferContext::update_data_size_bytes ( size_t new_data_size_bytes)
inline

Should be called (usually by a derived class) when the on-card size of this object has changed.

Definition at line 66 of file indexBufferContext.I.

References AdaptiveLruPage::set_lru_size(), and BufferContext::update_data_size_bytes().

Referenced by DXIndexBufferContext9::evict_lru(), and mark_loaded().

◆ was_modified()

bool IndexBufferContext::was_modified ( const GeomPrimitivePipelineReader * reader) const
inline

Returns true if the data has been modified since the last time mark_loaded() was called.

Definition at line 56 of file indexBufferContext.I.

References get_data(), and BufferContext::get_modified.

Referenced by DXGraphicsStateGuardian9::apply_index_buffer().

◆ write()

void IndexBufferContext::write ( std::ostream & out,
int indent_level ) const
virtual

Reimplemented from SavedContext.

Definition at line 35 of file indexBufferContext.cxx.

Friends And Related Symbol Documentation

◆ PreparedGraphicsObjects

friend class PreparedGraphicsObjects
friend

Definition at line 72 of file indexBufferContext.h.


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