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:
@@ -363,15 +363,15 @@ void Texture2DArray::apply(State& state) const
|
||||
|
||||
textureObject->setAllocated(_numMipmapLevels,_internalFormat,_textureWidth,_textureHeight,_textureDepth,0);
|
||||
|
||||
// no idea what this for ;-)
|
||||
if (state.getMaxTexturePoolSize()==0 && _unrefImageDataAfterApply && areAllTextureObjectsLoaded())
|
||||
// unref image data?
|
||||
if (isSafeToUnrefImageData(state))
|
||||
{
|
||||
Texture2DArray* non_const_this = const_cast<Texture2DArray*>(this);
|
||||
for (int n=0; n<_textureDepth; n++)
|
||||
{
|
||||
if (_images[n].valid() && _images[n]->getDataVariance()==STATIC)
|
||||
{
|
||||
non_const_this->_images[n] = 0;
|
||||
non_const_this->_images[n] = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user