mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 08:50:09 +01:00
zink: always unref old images when adding new binds
at some point this was correct, but refactoring has since occurred, and this ends up leaking storage image objects cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20867>
This commit is contained in:
parent
dd733034aa
commit
d745e3b0ab
1 changed files with 1 additions and 7 deletions
|
|
@ -1314,11 +1314,6 @@ add_resource_bind(struct zink_context *ctx, struct zink_resource *res, unsigned
|
|||
res->layout = VK_IMAGE_LAYOUT_UNDEFINED;
|
||||
res->obj->access = 0;
|
||||
res->obj->access_stage = 0;
|
||||
bool needs_unref = true;
|
||||
if (zink_resource_has_usage(res)) {
|
||||
zink_batch_reference_resource_move(&ctx->batch, res);
|
||||
needs_unref = false;
|
||||
}
|
||||
res->obj = new_obj;
|
||||
for (unsigned i = 0; i <= res->base.b.last_level; i++) {
|
||||
struct pipe_box box = {0, 0, 0,
|
||||
|
|
@ -1327,8 +1322,7 @@ add_resource_bind(struct zink_context *ctx, struct zink_resource *res, unsigned
|
|||
box.depth = util_num_layers(&res->base.b, i);
|
||||
ctx->base.resource_copy_region(&ctx->base, &res->base.b, i, 0, 0, 0, &staging.base.b, i, &box);
|
||||
}
|
||||
if (needs_unref)
|
||||
zink_resource_object_reference(screen, &old_obj, NULL);
|
||||
zink_resource_object_reference(screen, &old_obj, NULL);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue