mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 11:28:05 +02:00
intel: Allow src == NULL and *dst != NULL in intel_miptree_reference().
This makes this API consistent with intel_region_reference, and the consumers wanted it this way. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
db3ada6055
commit
32fe506ae1
3 changed files with 11 additions and 10 deletions
|
|
@ -173,9 +173,17 @@ void
|
|||
intel_miptree_reference(struct intel_mipmap_tree **dst,
|
||||
struct intel_mipmap_tree *src)
|
||||
{
|
||||
src->refcount++;
|
||||
if (*dst == src)
|
||||
return;
|
||||
|
||||
intel_miptree_release(dst);
|
||||
|
||||
if (src) {
|
||||
src->refcount++;
|
||||
DBG("%s %p refcount now %d\n", __FUNCTION__, src, src->refcount);
|
||||
}
|
||||
|
||||
*dst = src;
|
||||
DBG("%s %p refcount now %d\n", __FUNCTION__, src, src->refcount);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -370,8 +370,6 @@ intelTexImage(struct gl_context * ctx,
|
|||
}
|
||||
}
|
||||
|
||||
assert(!intelImage->mt);
|
||||
|
||||
if (intelObj->mt &&
|
||||
intel_miptree_match_image(intelObj->mt, &intelImage->base.Base)) {
|
||||
/* Use an existing miptree when possible */
|
||||
|
|
@ -391,10 +389,7 @@ intelTexImage(struct gl_context * ctx,
|
|||
* whole object since our level didn't fit what was there
|
||||
* before, and any lower levels would fit into our miptree.
|
||||
*/
|
||||
if (intelImage->mt) {
|
||||
intel_miptree_release(&intelObj->mt);
|
||||
intel_miptree_reference(&intelObj->mt, intelImage->mt);
|
||||
}
|
||||
intel_miptree_reference(&intelObj->mt, intelImage->mt);
|
||||
}
|
||||
|
||||
/* Attempt to use the blitter for PBO image uploads.
|
||||
|
|
|
|||
|
|
@ -43,8 +43,6 @@ copy_image_data_to_tree(struct intel_context *intel,
|
|||
intelObj->mt,
|
||||
intelImage->base.Base.Face,
|
||||
intelImage->base.Base.Level, intelImage->mt);
|
||||
|
||||
intel_miptree_release(&intelImage->mt);
|
||||
}
|
||||
else {
|
||||
assert(intelImage->base.Base.Data != NULL);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue