Public Member Functions | |
DXTextureContext9 (PreparedGraphicsObjects *pgo, Texture *tex, int view) | |
bool | create_simple_texture (DXScreenData &scrn) |
bool | create_texture (DXScreenData &scrn) |
Use panda texture's pixelbuffer to create a texture for the specified device. More... | |
void | delete_texture () |
Release the surface used to store the texture. More... | |
virtual void | evict_lru () |
Evicts the page from the LRU. More... | |
bool | extract_texture_data (DXScreenData &scrn) |
This method will be called in the draw thread to download the texture memory's image into its ram_image value. More... | |
virtual TypeHandle | force_init_type () |
IDirect3DTexture9 * | get_d3d_2d_texture () const |
Returns the Direct3D object that represents the texture, in the case of a 1-d or 2-d texture. More... | |
IDirect3DCubeTexture9 * | get_d3d_cube_texture () const |
Returns the Direct3D object that represents the texture, in the case of a cube map texture. More... | |
IDirect3DBaseTexture9 * | get_d3d_texture () const |
Returns the Direct3D object that represents the texture, whatever kind of texture it is. More... | |
IDirect3DVolumeTexture9 * | get_d3d_volume_texture () const |
Returns the Direct3D object that represents the texture, in the case of a 3-d texture. More... | |
virtual TypeHandle | get_type () const |
bool | has_mipmaps () const |
Returns true if the texture was created with mipmaps, false otherwise. More... | |
Public Member Functions inherited from TextureContext | |
TextureContext (PreparedGraphicsObjects *pgo, Texture *tex, int view) | |
UpdateSeq | get_image_modified () const |
Returns a sequence number which is guaranteed to change at least every time the texture image data (including mipmap levels) are modified. More... | |
virtual uint64_t | get_native_buffer_id () const |
Similar to get_native_id, but some implementations use a separate identifier for the buffer object associated with buffer textures. More... | |
virtual uint64_t | get_native_id () const |
Returns an implementation-defined handle or pointer that can be used to interface directly with the underlying API. More... | |
UpdateSeq | get_properties_modified () const |
Returns a sequence number which is guaranteed to change at least every time the texture properties (unrelated to the image) are modified. More... | |
UpdateSeq | get_simple_image_modified () const |
Returns a sequence number which is guaranteed to change at least every time the texture's "simple" image data is modified. More... | |
Texture * | get_texture () const |
Returns the pointer to the associated Texture object. More... | |
int | get_view () const |
Returns the specific view of a multiview texture this context represents. More... | |
void | mark_loaded () |
Should be called after the texture has been loaded into graphics memory, this updates the internal flags for changed_size() and modified(). More... | |
void | mark_needs_reload () |
Should be called to indicate the texture should be reloaded at the nearest opportunity. More... | |
void | mark_simple_loaded () |
Should be called after the texture's "simple" image has been loaded into graphics memory. More... | |
void | mark_unloaded () |
Should be called after the texture has been forced out of texture memory. More... | |
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. More... | |
bool | was_image_modified () const |
Returns true if the texture image has been modified since the last time mark_loaded() was called. More... | |
bool | was_modified () const |
Returns true if the texture properties or image have been modified since the last time mark_loaded() was called. More... | |
bool | was_properties_modified () const |
Returns true if the texture properties (unrelated to the image) have been modified since the last time mark_loaded() was called. More... | |
bool | was_simple_image_modified () const |
Returns true if the texture's "simple" image has been modified since the last time mark_simple_loaded() was called. More... | |
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 |
BufferContext * | get_next () const |
This can be used along with BufferContextChain::get_first() to walk through the list of objects stored on a tracker. More... | |
TypedWritableReferenceCount * | get_object () const |
bool | get_resident () const |
void | set_active (bool flag) |
Changes the active flag associated with this object. More... | |
void | set_resident (bool flag) |
Changes the resident flag associated with this object. More... | |
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. More... | |
void | update_modified (UpdateSeq new_modified) |
Should be called (usually by a derived class) when the modified counter for this object has changed. More... | |
Public Member Functions inherited from TypedObject | |
TypedObject (const TypedObject ©)=default | |
TypedObject * | as_typed_object () |
Returns the object, upcast (if necessary) to a TypedObject pointer. More... | |
const TypedObject * | as_typed_object () const |
Returns the object, upcast (if necessary) to a TypedObject pointer. More... | |
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. More... | |
bool | is_exact_type (TypeHandle handle) const |
Returns true if the current object is the indicated type exactly. More... | |
bool | is_of_type (TypeHandle handle) const |
Returns true if the current object is or derives from the indicated type. More... | |
TypedObject & | operator= (const TypedObject ©)=default |
Public Member Functions inherited from AdaptiveLruPage | |
AdaptiveLruPage (size_t lru_size) | |
AdaptiveLruPage (const AdaptiveLruPage ©) | |
void | dequeue_lru () |
Removes the page from its AdaptiveLru. More... | |
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. More... | |
AdaptiveLru * | get_lru () const |
Returns the LRU that manages this page, or NULL if it is not currently managed by any LRU. More... | |
size_t | get_lru_size () const |
Returns the size of this page as reported to the LRU, presumably in bytes. More... | |
unsigned int | get_num_frames () const |
Returns the number of frames since the page was first added to its LRU. More... | |
unsigned int | get_num_inactive_frames () const |
Returns the number of frames since the page was last accessed on its LRU. More... | |
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. More... | |
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. More... | |
void | operator= (const AdaptiveLruPage ©) |
void | set_lru_size (size_t lru_size) |
Specifies the size of this page, presumably in bytes, although any unit is possible. More... | |
Static Public Member Functions | |
static HRESULT | d3d_surface_to_texture (RECT &source_rect, IDirect3DSurface9 *d3d_surface, bool inverted, Texture *result, int view, int z) |
copies source_rect in pD3DSurf to upper left of texture More... | |
static TypeHandle | get_class_type () |
static void | init_type () |
Static Public Member Functions inherited from TextureContext | |
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. More... | |
Friends | |
class | wdxGraphicsBuffer9 |
Additional Inherited Members | |
Public Attributes inherited from BufferContext | |
get_active | |
Returns the active flag associated with this object. More... | |
get_data_size_bytes | |
Returns the number of bytes previously reported for the data object. More... | |
get_modified | |
Returns the UpdateSeq that was recorded the last time mark_loaded() was called. More... | |
get_object | |
Returns the associated object. More... | |
get_resident | |
Returns the resident flag associated with this object. More... | |
Public Attributes inherited from TypedObject | |
get_type | |
Definition at line 24 of file dxTextureContext9.h.
bool DXTextureContext9::create_texture | ( | DXScreenData & | scrn | ) |
Use panda texture's pixelbuffer to create a texture for the specified device.
This code gets the attributes of the texture from the bitmap, creates the texture, and then copies the bitmap into the texture. The return value is true if the texture is successfully created, false otherwise.
Definition at line 101 of file dxTextureContext9.cxx.
References TextureContext::get_texture().
Referenced by DXGraphicsStateGuardian9::upload_texture().
|
static |
copies source_rect in pD3DSurf to upper left of texture
Definition at line 1431 of file dxTextureContext9.cxx.
References Texture::get_num_components.
void DXTextureContext9::delete_texture | ( | ) |
Release the surface used to store the texture.
Definition at line 1173 of file dxTextureContext9.cxx.
Referenced by evict_lru(), and DXGraphicsStateGuardian9::upload_texture().
|
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 75 of file dxTextureContext9.cxx.
References delete_texture(), AdaptiveLruPage::dequeue_lru(), TextureContext::get_texture(), TextureContext::mark_unloaded(), AdaptiveLruPage::mark_used_lru(), and TextureContext::update_data_size_bytes().
bool DXTextureContext9::extract_texture_data | ( | DXScreenData & | screen | ) |
This method will be called in the draw thread to download the texture memory's image into its ram_image value.
It returns true on success, false otherwise.
Definition at line 1192 of file dxTextureContext9.cxx.
References TextureContext::get_texture(), and Texture::get_texture_type.
|
inline |
Returns the Direct3D object that represents the texture, in the case of a 1-d or 2-d texture.
Definition at line 36 of file dxTextureContext9.I.
|
inline |
Returns the Direct3D object that represents the texture, in the case of a cube map texture.
Definition at line 54 of file dxTextureContext9.I.
|
inline |
Returns the Direct3D object that represents the texture, whatever kind of texture it is.
Definition at line 27 of file dxTextureContext9.I.
|
inline |
Returns the Direct3D object that represents the texture, in the case of a 3-d texture.
Definition at line 45 of file dxTextureContext9.I.
|
inline |
Returns true if the texture was created with mipmaps, false otherwise.
Definition at line 18 of file dxTextureContext9.I.