Moved the assignment of the ModifiedCount to before GL texture calls.

This commit is contained in:
Robert Osfield
2017-10-19 20:57:25 +01:00
parent 8965c9369e
commit 24c2a0ca60
7 changed files with 28 additions and 27 deletions

View File

@@ -249,12 +249,12 @@ void Texture3D::apply(State& state) const
}
else if (_image.get() && getModifiedCount(contextID) != _image->getModifiedCount())
{
computeRequiredTextureDimensions(state,*_image,_textureWidth, _textureHeight, _textureDepth,_numMipmapLevels);
applyTexImage3D(GL_TEXTURE_3D,_image.get(),state, _textureWidth, _textureHeight, _textureDepth,_numMipmapLevels);
// update the modified count to show that it is up to date.
getModifiedCount(contextID) = _image->getModifiedCount();
computeRequiredTextureDimensions(state,*_image,_textureWidth, _textureHeight, _textureDepth,_numMipmapLevels);
applyTexImage3D(GL_TEXTURE_3D,_image.get(),state, _textureWidth, _textureHeight, _textureDepth,_numMipmapLevels);
}
}
@@ -291,6 +291,8 @@ void Texture3D::apply(State& state) const
textureObject->bind();
// update the modified count to show that it is up to date.
getModifiedCount(contextID) = _image->getModifiedCount();
applyTexParameters(GL_TEXTURE_3D,state);
@@ -298,9 +300,6 @@ void Texture3D::apply(State& state) const
textureObject->setAllocated(_numMipmapLevels,_internalFormat,_textureWidth,_textureHeight,_textureDepth,0);
// update the modified count to show that it is up to date.
getModifiedCount(contextID) = _image->getModifiedCount();
// unref image data?
if (isSafeToUnrefImageData(state) && _image->getDataVariance()==STATIC)
{