Panda3D
|
Caches a GeomVertexArrayData in the DirectX device as a vertex buffer. More...
#include "dxVertexBufferContext9.h"
Public Member Functions | |
DXVertexBufferContext9 (PreparedGraphicsObjects *pgo, GeomVertexArrayData *data, DXScreenData &scrn) | |
void | allocate_vbuffer (DXScreenData &scrn, const GeomVertexArrayDataHandle *reader) |
Allocates vertex buffer memory. | |
CLP (ShaderContext)*_shader_context | |
void | create_vbuffer (DXScreenData &scrn, const GeomVertexArrayDataHandle *reader, string name) |
Creates a new vertex 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_vbuffer () |
Frees vertex buffer memory. | |
virtual TypeHandle | get_type () const |
bool | upload_data (const GeomVertexArrayDataHandle *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 | |
DIRECT_3D_VERTEX_DECLARATION | _direct_3d_vertex_declaration |
int | _fvf |
int | _managed |
IDirect3DVertexBuffer9 * | _vbuffer |
VERTEX_ELEMENT_TYPE * | _vertex_element_type_array |
Caches a GeomVertexArrayData in the DirectX device as a vertex buffer.
Definition at line 27 of file dxVertexBufferContext9.h.
void DXVertexBufferContext9::allocate_vbuffer | ( | DXScreenData & | scrn, |
const GeomVertexArrayDataHandle * | reader | ||
) |
Allocates vertex buffer memory.
Definition at line 340 of file dxVertexBufferContext9.cxx.
Referenced by create_vbuffer().
void DXVertexBufferContext9::create_vbuffer | ( | DXScreenData & | scrn, |
const GeomVertexArrayDataHandle * | reader, | ||
string | name | ||
) |
Creates a new vertex buffer (but does not upload data to it).
Definition at line 395 of file dxVertexBufferContext9.cxx.
References allocate_vbuffer(), free_vbuffer(), and VertexBufferContext::get_data().
Referenced by DXGraphicsStateGuardian9::apply_vertex_buffer().
void DXVertexBufferContext9::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 302 of file dxVertexBufferContext9.cxx.
References AdaptiveLruPage::dequeue_lru(), free_vbuffer(), VertexBufferContext::mark_unloaded(), and VertexBufferContext::update_data_size_bytes().
void DXVertexBufferContext9::free_vbuffer | ( | void | ) |
Frees vertex buffer memory.
Definition at line 315 of file dxVertexBufferContext9.cxx.
Referenced by create_vbuffer(), and evict_lru().
static void DXVertexBufferContext9::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 VertexBufferContext.
Definition at line 52 of file dxVertexBufferContext9.h.
References VertexBufferContext::init_type().
bool DXVertexBufferContext9::upload_data | ( | const GeomVertexArrayDataHandle * | reader, |
bool | force | ||
) |
Copies the latest data from the client store to DirectX.
Definition at line 420 of file dxVertexBufferContext9.cxx.
References VertexBufferContext::get_data(), and GeomVertexArrayDataHandle::get_read_pointer().
Referenced by DXGraphicsStateGuardian9::apply_vertex_buffer().