zink: remove refs from shader images

these have implicit refs from the surface/bufferview that gets created,
so adding a ref here is redundant and less performant

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16508>
(cherry picked from commit d0df488970)
This commit is contained in:
Mike Blumenkrantz 2022-05-13 11:18:17 -04:00 committed by Dylan Baker
parent a73d7b14a9
commit 722686d729
2 changed files with 3 additions and 3 deletions

View file

@ -516,7 +516,7 @@
"description": "zink: remove refs from shader images",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"because_sha": null
},
{

View file

@ -1316,7 +1316,6 @@ unbind_shader_image(struct zink_context *ctx, enum pipe_shader_type stage, unsig
zink_batch_reference_surface(&ctx->batch, image_view->surface);
zink_surface_reference(zink_screen(ctx->base.screen), &image_view->surface, NULL);
}
pipe_resource_reference(&image_view->base.resource, NULL);
image_view->base.resource = NULL;
image_view->surface = NULL;
}
@ -1391,7 +1390,8 @@ zink_set_shader_images(struct pipe_context *pctx,
}
update_res_bind_count(ctx, res, p_stage == PIPE_SHADER_COMPUTE, false);
}
util_copy_image_view(&image_view->base, images + i);
/* no refs */
memcpy(&image_view->base, images + i, sizeof(struct pipe_image_view));
VkAccessFlags access = 0;
if (image_view->base.access & PIPE_IMAGE_ACCESS_WRITE) {
zink_resource(image_view->base.resource)->write_bind_count[p_stage == PIPE_SHADER_COMPUTE]++;