Added stats collection to new Texture Pool code, and improved TexturePool implementation.

The Texture Pool can be enabled by setting the env var OSG_TEXTURE_POOL_SIZE=size_in_bytes.
Note, setting a size of 1 will result in the TexturePool allocating the minimum number of
textures it can without having to reuse TextureObjects from within the same frame.
This commit is contained in:
Robert Osfield
2009-09-25 18:05:54 +00:00
parent 6bc9c626f4
commit 4d75729650
5 changed files with 307 additions and 54 deletions

View File

@@ -137,6 +137,10 @@ void Texture2D::apply(State& state) const
// current OpenGL context.
const unsigned int contextID = state.getContextID();
Texture::TextureObjectManager* tom = Texture::getTextureObjectManager(contextID);
ElapsedTime elapsedTime(&(tom->getApplyTime()));
tom->getNumberApplied()++;
// get the texture object for the current contextID.
TextureObject* textureObject = getTextureObject(contextID);