Restructured the way that applyTexParameters() is applied to address issues with Intel drivers not handling mipmap generations unless the tex parameters are reapplied on new upload of data.

This commit is contained in:
Robert Osfield
2018-02-27 17:35:13 +00:00
parent 39881b5576
commit 7b6eedbdf4
5 changed files with 45 additions and 13 deletions

View File

@@ -193,11 +193,10 @@ void Texture2D::apply(State& state) const
{
textureObject->bind();
if (getTextureParameterDirty(state.getContextID()))
applyTexParameters(GL_TEXTURE_2D,state);
if (_subloadCallback.valid())
{
applyTexParameters(GL_TEXTURE_2D,state);
_subloadCallback->subload(*this,state);
}
else if (_image.valid() && getModifiedCount(contextID) != _image->getModifiedCount())
@@ -205,6 +204,8 @@ void Texture2D::apply(State& state) const
// update the modified tag to show that it is up to date.
getModifiedCount(contextID) = _image->getModifiedCount();
applyTexParameters(GL_TEXTURE_2D,state);
applyTexImage2D_subload(state,GL_TEXTURE_2D,_image.get(),
_textureWidth, _textureHeight, _internalFormat, _numMipmapLevels);
}
@@ -213,6 +214,9 @@ void Texture2D::apply(State& state) const
_readPBuffer->bindPBufferToTexture(GL_FRONT);
}
if (getTextureParameterDirty(state.getContextID()))
applyTexParameters(GL_TEXTURE_2D,state);
}
else if (_subloadCallback.valid())
{