Mesa (main): zink: remove refs from shader images
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Sun May 15 19:55:56 UTC 2022
Module: Mesa
Branch: main
Commit: d0df4889707e94a7bae6a9f6b4092b00f1b42b2a
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d0df4889707e94a7bae6a9f6b4092b00f1b42b2a
Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date: Fri May 13 11:18:17 2022 -0400
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 at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16508>
---
src/gallium/drivers/zink/zink_context.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index 5285748e45a..a1e5c453c49 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -1372,7 +1372,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;
}
@@ -1466,7 +1465,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]++;
More information about the mesa-commit
mailing list