Eventually the miptree refcounting interface should be cleaned up.
The assymmetry dramatically increases the probability of bugs like
this. It should be made to like like libdrm refcounting or the
refcounting style used in other parts of Mesa.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=33046
Reviewed-by: Eric Anholt <eric@anholt.net>
* whole object since our level didn't fit what was there
* before, and any lower levels would fit into our miptree.
*/
- if (intelImage->mt)
+ if (intelImage->mt) {
+ intel_miptree_release(intel, &intelObj->mt);
intel_miptree_reference(&intelObj->mt, intelImage->mt);
+ }
}
/* PBO fastpaths: