Standardized the glTexStorage*() calls to use osg::maximum(_numMipmapLevels,1) of rnumber of mipmaps to keep the usage consistent.

Fixed the erronous Texture2DArray glTexStorage call so that it used the _numMipmapLevels as above to resolve bug in allocation.
This commit is contained in:
Robert Osfield
2018-09-12 17:45:49 +01:00
parent 66246703bf
commit ca134dca2d
5 changed files with 6 additions and 6 deletions

View File

@@ -239,7 +239,7 @@ void Texture1D::apply(State& state) const
textureObject->bind();
applyTexParameters(GL_TEXTURE_1D, state);
extensions->glTexStorage1D( GL_TEXTURE_1D, (_numMipmapLevels >0)?_numMipmapLevels:1, texStorageSizedInternalFormat, _textureWidth);
extensions->glTexStorage1D( GL_TEXTURE_1D, osg::maximum(_numMipmapLevels,1), texStorageSizedInternalFormat, _textureWidth);
}
else
{