Added status collection to full range of texture classes

This commit is contained in:
Robert Osfield
2009-09-27 14:38:38 +00:00
parent 9a1cd7072f
commit e59f654290
5 changed files with 23 additions and 5 deletions

View File

@@ -124,6 +124,10 @@ void Texture1D::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);

View File

@@ -208,6 +208,11 @@ void Texture2DArray::apply(State& state) const
// get the contextID (user defined ID of 0 upwards) for the
// current OpenGL context.
const unsigned int contextID = state.getContextID();
Texture::TextureObjectManager* tom = Texture::getTextureObjectManager(contextID);
ElapsedTime elapsedTime(&(tom->getApplyTime()));
tom->getNumberApplied()++;
const Extensions* extensions = getExtensions(contextID,true);
// if not supported, then return

View File

@@ -195,7 +195,11 @@ void Texture3D::apply(State& state) const
// get the contextID (user defined ID of 0 upwards) for the
// current OpenGL context.
const unsigned int contextID = state.getContextID();
Texture::TextureObjectManager* tom = Texture::getTextureObjectManager(contextID);
ElapsedTime elapsedTime(&(tom->getApplyTime()));
tom->getNumberApplied()++;
const Extensions* extensions = getExtensions(contextID,true);
if (!extensions->isTexture3DSupported())

View File

@@ -196,6 +196,11 @@ void TextureCubeMap::apply(State& state) const
// get the contextID (user defined ID of 0 upwards) for the
// current OpenGL context.
const unsigned int contextID = state.getContextID();
Texture::TextureObjectManager* tom = Texture::getTextureObjectManager(contextID);
ElapsedTime elapsedTime(&(tom->getApplyTime()));
tom->getNumberApplied()++;
const Extensions* extensions = getExtensions(contextID,true);
if (!extensions->isCubeMapSupported())

View File

@@ -161,8 +161,10 @@ void TextureRectangle::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()++;
static OpenThreads::Mutex s_mutex;
// get the texture object for the current contextID.
TextureObject* textureObject = getTextureObject(contextID);
@@ -209,9 +211,7 @@ void TextureRectangle::apply(State& state) const
else if (_image.valid() && _image->data())
{
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(s_mutex);
// we don't have a applyTexImage1D_subload yet so can't reuse.. so just generate a new texture object.
// we don't have a applyTexImage1D_subload yet so can't reuse.. so just generate a new texture object.
textureObject = generateTextureObject(this, contextID,GL_TEXTURE_RECTANGLE);
textureObject->bind();