prevent immutability resetting when textureobject is taken from orphans
This commit is contained in:
@@ -353,7 +353,7 @@ void Texture2DArray::apply(State& state) const
|
||||
applyTexParameters(GL_TEXTURE_2D_ARRAY, state);
|
||||
|
||||
// First we need to allocate the texture memory
|
||||
if(texStorageSizedInternalFormat!=0)
|
||||
if(texStorageSizedInternalFormat!=0 && !textureObject->_allocated)
|
||||
{
|
||||
extensions->glTexStorage3D(GL_TEXTURE_2D_ARRAY, osg::maximum(_numMipmapLevels,1), texStorageSizedInternalFormat, _textureWidth, _textureHeight, textureDepth);
|
||||
}
|
||||
@@ -452,7 +452,7 @@ void Texture2DArray::apply(State& state) const
|
||||
|
||||
applyTexParameters(GL_TEXTURE_2D_ARRAY,state);
|
||||
|
||||
if (texStorageSizedInternalFormat!=0)
|
||||
if (texStorageSizedInternalFormat!=0 && !textureObject->_allocated)
|
||||
{
|
||||
extensions->glTexStorage3D( GL_TEXTURE_2D_ARRAY, osg::maximum(_numMipmapLevels,1), texStorageSizedInternalFormat, _textureWidth, _textureHeight, _textureDepth);
|
||||
}
|
||||
@@ -463,6 +463,8 @@ void Texture2DArray::apply(State& state) const
|
||||
_sourceFormat ? _sourceFormat : _internalFormat,
|
||||
_sourceType ? _sourceType : GL_UNSIGNED_BYTE,
|
||||
0);
|
||||
|
||||
textureObject->setAllocated(_numMipmapLevels, texStorageSizedInternalFormat!=0 ? texStorageSizedInternalFormat :_internalFormat, _textureWidth, _textureHeight, _textureDepth, 0);
|
||||
}
|
||||
|
||||
// nothing before, so just unbind the texture target
|
||||
|
||||
Reference in New Issue
Block a user