From Ulrich Hertlein, "not sure how severe this is but I believe there's a bug in
Texture.cpp:applyTexImage2D_subload:
<code>
unsigned char* data = = (unsigned char*)image->data();
if (needImageRescale) {
// allocates rescale buffer
data = new unsigned char[newTotalSize];
// calls gluScaleImage into the data buffer
}
const unsigned char* dataPtr = image->data();
// subloads 'dataPtr'
// deletes 'data'
</code>
In effect, the scaled data would never be used.
I've also replaced bits of duplicate code in Texture1D/2D/2DArray/3D/Cubemap/Rectangle
that checks if the texture image can/should be unref'd with common functionality in
Texture.cpp.
"
This commit is contained in:
@@ -259,12 +259,12 @@ void TextureRectangle::apply(State& state) const
|
||||
textureObject->setAllocated(true);
|
||||
}
|
||||
|
||||
if (state.getMaxTexturePoolSize()==0 && _unrefImageDataAfterApply && areAllTextureObjectsLoaded() && _image->getDataVariance()==STATIC)
|
||||
// unref image data?
|
||||
if (isSafeToUnrefImageData(state) && _image->getDataVariance()==STATIC)
|
||||
{
|
||||
TextureRectangle* non_const_this = const_cast<TextureRectangle*>(this);
|
||||
non_const_this->_image = 0;
|
||||
non_const_this->_image = NULL;
|
||||
}
|
||||
|
||||
}
|
||||
else if ( (_textureWidth!=0) && (_textureHeight!=0) && (_internalFormat!=0) )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user