OGRE-Next  4.0.0unstable
Object-Oriented Graphics Rendering Engine
Ogre::TextureFilter::FilterBase Class Reference

#include <OgreTextureFilters.h>

+ Inheritance diagram for Ogre::TextureFilter::FilterBase:

Public Member Functions

virtual ~FilterBase ()
 
virtual void _executeSerial (TextureGpu *texture)
 Gets executed after the TextureGpu is fully resident and fully loaded. More...
 
virtual void _executeStreaming (Image2 &image, TextureGpu *texture)
 Gets executed from worker thread, right after the Image was loaded from file and we're done setting the metadata to the Texture. More...
 

Static Public Member Functions

static void createFilters (uint32 filters, FilterBaseArray &outFilters, const TextureGpu *texture, const Image2 &image, bool toSysRam)
 
static void destroyFilters (FilterBaseArray &inOutFilters)
 
static void simulateFiltersForCacheConsistency (uint32 filters, const Image2 &image, const TextureGpuManager *textureGpuManager, uint8 &inOutNumMipmaps, PixelFormatGpu &inOutPixelFormat)
 Simulates as if the given filters were applied, producing the resulting number mipmaps & PixelFormat. More...
 

Constructor & Destructor Documentation

◆ ~FilterBase()

virtual Ogre::TextureFilter::FilterBase::~FilterBase ( )
virtual

Member Function Documentation

◆ _executeSerial()

virtual void Ogre::TextureFilter::FilterBase::_executeSerial ( TextureGpu texture)
inlinevirtual

Gets executed after the TextureGpu is fully resident and fully loaded.

(except for the steps this filter is supposed to do)

Reimplemented in Ogre::TextureFilter::GenerateHwMipmaps.

◆ _executeStreaming()

virtual void Ogre::TextureFilter::FilterBase::_executeStreaming ( Image2 image,
TextureGpu texture 
)
inlinevirtual

Gets executed from worker thread, right after the Image was loaded from file and we're done setting the metadata to the Texture.

Beware the texture may or may not have been transitioned to resident yet (it's likely not resident, but 2nd face and onwards of cubemaps will be resident)

Reimplemented in Ogre::TextureFilter::PremultiplyAlpha, Ogre::TextureFilter::LeaveChannelR, Ogre::TextureFilter::PrepareForNormalMapping, Ogre::TextureFilter::GenerateHwMipmaps, and Ogre::TextureFilter::GenerateSwMipmaps.

◆ createFilters()

static void Ogre::TextureFilter::FilterBase::createFilters ( uint32  filters,
FilterBaseArray outFilters,
const TextureGpu texture,
const Image2 image,
bool  toSysRam 
)
static

◆ destroyFilters()

static void Ogre::TextureFilter::FilterBase::destroyFilters ( FilterBaseArray inOutFilters)
static

◆ simulateFiltersForCacheConsistency()

static void Ogre::TextureFilter::FilterBase::simulateFiltersForCacheConsistency ( uint32  filters,
const Image2 image,
const TextureGpuManager textureGpuManager,
uint8 inOutNumMipmaps,
PixelFormatGpu inOutPixelFormat 
)
static

Simulates as if the given filters were applied, producing the resulting number mipmaps & PixelFormat.

When a TextureGpu transitions OnStorage -> Resident, we use the metadata cache and later compare if the cache was up to date. To check if it's up to date, we need to know the final number of mipmaps and final pixel format. Thus this function is needed in this case.

However then transitioning OnStorage -> OnSystemRam, the cache is not used, because A. the metadata is not needed (it cannot optimize the shader) and B. the number of mipmaps may not match. This can happen because the HW mipmap filter won't be run. This function is not needed in such case.

When transitioning OnSystemRam -> Resident, we already have all the metadata except for the mipmaps, as the HW mipmap filter will be run. Thus we need this function so we can set the number of mipmaps to the final value, immediately transition to Resident, and start loading the image on the background thread without ping-pong.


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