Panda3D
|
Caches a GeomPrimitive in the DirectX device as an index buffer. More...
#include "dxIndexBufferContext9.h"
Public Member Functions | |
DXIndexBufferContext9 (PreparedGraphicsObjects *pgo, GeomPrimitive *data) | |
void | allocate_ibuffer (DXScreenData &scrn, const GeomPrimitivePipelineReader *reader) |
Allocates index buffer memory. | |
void | create_ibuffer (DXScreenData &scrn, const GeomPrimitivePipelineReader *reader) |
Creates a new index buffer (but does not upload data to it). | |
virtual void | evict_lru () |
Evicts the page from the LRU. | |
virtual TypeHandle | force_init_type () |
void | free_ibuffer () |
Free index buffer. | |
virtual TypeHandle | get_type () const |
bool | upload_data (const GeomPrimitivePipelineReader *reader, bool force) |
Copies the latest data from the client store to DirectX. | |
Static Public Member Functions | |
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 | |
IDirect3DIndexBuffer9 * | _ibuffer |
int | _managed |
Caches a GeomPrimitive in the DirectX device as an index buffer.
Definition at line 27 of file dxIndexBufferContext9.h.
void DXIndexBufferContext9::allocate_ibuffer | ( | DXScreenData & | scrn, |
const GeomPrimitivePipelineReader * | reader | ||
) |
Allocates index buffer memory.
Definition at line 104 of file dxIndexBufferContext9.cxx.
References GeomVertexArrayFormat::get_column(), GeomPrimitivePipelineReader::get_data_size_bytes(), DXGraphicsStateGuardian9::get_index_type(), and GeomVertexColumn::get_numeric_type().
Referenced by create_ibuffer().
void DXIndexBufferContext9::create_ibuffer | ( | DXScreenData & | scrn, |
const GeomPrimitivePipelineReader * | reader | ||
) |
Creates a new index buffer (but does not upload data to it).
Definition at line 162 of file dxIndexBufferContext9.cxx.
References allocate_ibuffer(), free_ibuffer(), IndexBufferContext::get_data(), and GeomPrimitivePipelineReader::get_data_size_bytes().
Referenced by DXGraphicsStateGuardian9::apply_index_buffer().
void DXIndexBufferContext9::evict_lru | ( | ) | [virtual] |
Evicts the page from the LRU.
Called internally when the LRU determines that it is full. May also be called externally when necessary to explicitly evict the page.
It is legal for this method to either evict the page as requested, do nothing (in which case the eviction will be requested again at the next epoch), or requeue itself on the tail of the queue (in which case the eviction will be requested again much later).
Reimplemented from AdaptiveLruPage.
Definition at line 65 of file dxIndexBufferContext9.cxx.
References AdaptiveLruPage::dequeue_lru(), free_ibuffer(), IndexBufferContext::mark_unloaded(), and IndexBufferContext::update_data_size_bytes().
void DXIndexBufferContext9::free_ibuffer | ( | void | ) |
Free index buffer.
Definition at line 78 of file dxIndexBufferContext9.cxx.
Referenced by create_ibuffer(), and evict_lru().
static void DXIndexBufferContext9::init_type | ( | ) | [inline, static] |
This function is declared non-inline to work around a compiler bug in g++ 2.96.
Making it inline seems to cause problems in the optimizer.
Reimplemented from IndexBufferContext.
Definition at line 46 of file dxIndexBufferContext9.h.
References IndexBufferContext::init_type().
bool DXIndexBufferContext9::upload_data | ( | const GeomPrimitivePipelineReader * | reader, |
bool | force | ||
) |
Copies the latest data from the client store to DirectX.
Definition at line 186 of file dxIndexBufferContext9.cxx.
References IndexBufferContext::get_data(), and GeomPrimitivePipelineReader::get_data_size_bytes().
Referenced by DXGraphicsStateGuardian9::apply_index_buffer().