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:
@@ -248,13 +248,11 @@ void Texture2D::apply(State& state) const
|
||||
// update the modified tag to show that it is upto date.
|
||||
getModifiedCount(contextID) = image->getModifiedCount();
|
||||
|
||||
if (state.getMaxTexturePoolSize()==0 &&
|
||||
_unrefImageDataAfterApply &&
|
||||
areAllTextureObjectsLoaded() &&
|
||||
image->getDataVariance()==STATIC)
|
||||
// unref image data?
|
||||
if (isSafeToUnrefImageData(state) && image->getDataVariance()==STATIC)
|
||||
{
|
||||
Texture2D* non_const_this = const_cast<Texture2D*>(this);
|
||||
non_const_this->_image = 0;
|
||||
non_const_this->_image = NULL;
|
||||
}
|
||||
|
||||
// in theory the following line is redundent, but in practice
|
||||
|
||||
Reference in New Issue
Block a user