OGRE-Next  3.0.0unstable
Object-Oriented Graphics Rendering Engine
Ogre::TextureGpuManagerListener Class Referenceabstract

#include <OgreTextureGpuManagerListener.h>

+ Inheritance diagram for Ogre::TextureGpuManagerListener:

Public Member Functions

 ~TextureGpuManagerListener () override
 
virtual uint32 getFiltersFor (const String &name, const String &aliasName, uint32 filters) const =0
 getFiltersFor Gets a chance to alter the filters needed for the given texture to load More...
 
virtual size_t getNumSlicesFor (TextureGpu *texture, TextureGpuManager *textureManager)=0
 Ogre normally puts Textures into pools (a Type2DArray texture) for efficient rendering Note that only textures of the same resolution and format can be put together in the same pool. More...
 
- Public Member Functions inherited from Ogre::TextureGpuListener
virtual ~TextureGpuListener ()
 
virtual void notifyTextureChanged (TextureGpu *texture, TextureGpuListener::Reason reason, void *extraData)=0
 Called when a TextureGpu changed in a way that affects how it is displayed: More...
 
virtual bool shouldStayLoaded (TextureGpu *texture)
 Return true if this TextureGpu should likely stay loaded or else graphical changes could occur. More...
 

Additional Inherited Members

- Public Types inherited from Ogre::TextureGpuListener
enum  Reason {
  Unknown , FromStorageToSysRam , FromSysRamToStorage , GainedResidency ,
  LostResidency , PoolTextureSlotChanged , ResidentToSysRamSync , MetadataCacheOutOfDate ,
  ExceptionThrown , FsaaSettingAlteredByApi , ReadyForRendering , Deleted
}
 

Constructor & Destructor Documentation

◆ ~TextureGpuManagerListener()

Ogre::TextureGpuManagerListener::~TextureGpuManagerListener ( )
override

Member Function Documentation

◆ getFiltersFor()

virtual uint32 Ogre::TextureGpuManagerListener::getFiltersFor ( const String name,
const String aliasName,
uint32  filters 
) const
pure virtual

getFiltersFor Gets a chance to alter the filters needed for the given texture to load

Parameters
nameName of the texture
aliasNameAlias name of the texture
filtersCurrent filters that are to be applied
Returns
Actual filters to apply, if the listener modifies them

Implemented in Ogre::DefaultTextureGpuManagerListener.

◆ getNumSlicesFor()

virtual size_t Ogre::TextureGpuManagerListener::getNumSlicesFor ( TextureGpu texture,
TextureGpuManager textureManager 
)
pure virtual

Ogre normally puts Textures into pools (a Type2DArray texture) for efficient rendering Note that only textures of the same resolution and format can be put together in the same pool.

This creates two issues:

  • Unless it is known in advance, we do not know how large the array should be. if we create a pool that can hold 64 entries but only 1 texture is actually needed, then we waste a lot of GPU memory.
  • Large textures, such as 4096x4096 RGBA8 occupy a lot of memory 64MB. These pools should not contain a large number of entries. For example creating a pool of 8 entries of these textures means we'd be asking the OS for 512MB of contiguous memory. Due to memory fragmentation, such request is likely to fail and cause Out of Memory conditions.
    Parameters
    textureThe first texture to which will be creating a pool based on its parameters
    textureManagerThe manager, in case you need more info.
    Returns
    How many entries the pool should be able to hold.

Implemented in Ogre::DefaultTextureGpuManagerListener.


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