Moved the _textureObjectBuffer assignment to after the imagery has been download to avoid crashes under multi-threaded compile of texture objects (was causing a crash with 3D Textures, but is something that would happen with other Texture types as well.)

This commit is contained in:
Robert Osfield
2008-07-16 13:23:58 +00:00
parent ccf22f6a15
commit 850034ab75
6 changed files with 17 additions and 6 deletions

View File

@@ -242,7 +242,7 @@ void Texture2DArray::apply(State& state) const
computeRequiredTextureDimensions(state,*_images[0],_textureWidth, _textureHeight, _numMipmapLevels);
// create texture object
_textureObjectBuffer[contextID] = textureObject = generateTextureObject(
textureObject = generateTextureObject(
contextID,GL_TEXTURE_2D_ARRAY_EXT,_numMipmapLevels,_internalFormat,_textureWidth,_textureHeight,_textureDepth,0);
// bind texture
@@ -271,6 +271,8 @@ void Texture2DArray::apply(State& state) const
}
textureObject->setAllocated(_numMipmapLevels,_internalFormat,_textureWidth,_textureHeight,_textureDepth,0);
_textureObjectBuffer[contextID] = textureObject;
// no idea what this for ;-)
if (_unrefImageDataAfterApply && areAllTextureObjectsLoaded())
{