In
2900f82e191 I mistakenly used tc_set_resource_reference in both
tc_transfer_unmap and tc_call_transfer_unmap.
This causes a leak because tc_call_transfer_unmap clears dst before
acquiring a reference, so it must only be used when initializing
tc_payloads.
This fixes the perf drop reported by Marek in MR 7098.
Fixes: 2900f82e191 ("gallium/u_threaded: fix staging and non-staging conflicts")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8035>
/* Nothing to do except keeping track of staging uploads */
assert(tres->pending_staging_uploads > 0);
p_atomic_dec(&tres->pending_staging_uploads);
- tc_set_resource_reference(&p->resource, NULL);
+ pipe_resource_reference(&p->resource, NULL);
return;
}
pipe->transfer_unmap(pipe, p->transfer);