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:
@@ -278,16 +278,16 @@ void Texture2DArray::apply(State& state) const
|
||||
// bind texture object
|
||||
textureObject->bind();
|
||||
|
||||
// if texture parameters changed, then reset them
|
||||
if (getTextureParameterDirty(state.getContextID())) applyTexParameters(GL_TEXTURE_2D_ARRAY_EXT,state);
|
||||
|
||||
// if subload is specified, then use it to subload the images to GPU memory
|
||||
if (_subloadCallback.valid())
|
||||
{
|
||||
applyTexParameters(GL_TEXTURE_2D_ARRAY_EXT,state);
|
||||
|
||||
_subloadCallback->subload(*this,state);
|
||||
}
|
||||
else
|
||||
{
|
||||
bool applyParameters = true;
|
||||
GLsizei n = 0;
|
||||
for(Images::const_iterator itr = _images.begin();
|
||||
itr != _images.end();
|
||||
@@ -299,13 +299,23 @@ void Texture2DArray::apply(State& state) const
|
||||
if (getModifiedCount(n,contextID) != image->getModifiedCount())
|
||||
{
|
||||
getModifiedCount(n,contextID) = image->getModifiedCount();
|
||||
|
||||
if (applyParameters)
|
||||
{
|
||||
applyTexParameters(GL_TEXTURE_2D_ARRAY_EXT,state);
|
||||
applyParameters = false;
|
||||
}
|
||||
|
||||
applyTexImage2DArray_subload(state, image, n, _textureWidth, _textureHeight, image->r(), _internalFormat, _numMipmapLevels);
|
||||
}
|
||||
n += image->r();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if texture parameters changed, then reset them
|
||||
if (getTextureParameterDirty(state.getContextID()))
|
||||
applyTexParameters(GL_TEXTURE_2D_ARRAY_EXT,state);
|
||||
}
|
||||
|
||||
// there is no texture object, but exists a subload callback, so use it to upload images
|
||||
|
||||
Reference in New Issue
Block a user