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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user