Mesa (main): zink: copy incoming shader image struct after doing updates

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun May 15 19:55:56 UTC 2022


Module: Mesa
Branch: main
Commit: 2df1c061688c14d51ad3eeaab886bb7ae4a6172a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2df1c061688c14d51ad3eeaab886bb7ae4a6172a

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Fri May 13 11:28:08 2022 -0400

zink: copy incoming shader image struct after doing updates

no functional changes

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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index 031b9ada9c6..aae55b5c177 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -1466,7 +1466,6 @@ zink_set_shader_images(struct pipe_context *pctx,
             update_res_bind_count(ctx, res, p_stage == PIPE_SHADER_COMPUTE, false);
          }
          /* no refs */
-         memcpy(&image_view->base, images + i, sizeof(struct pipe_image_view));
          VkAccessFlags access = 0;
          if (images[i].access & PIPE_IMAGE_ACCESS_WRITE) {
             res->write_bind_count[p_stage == PIPE_SHADER_COMPUTE]++;
@@ -1488,6 +1487,7 @@ zink_set_shader_images(struct pipe_context *pctx,
             finalize_image_bind(ctx, res, p_stage == PIPE_SHADER_COMPUTE);
             zink_batch_usage_set(&image_view->surface->batch_uses, ctx->batch.state);
          }
+         memcpy(&image_view->base, images + i, sizeof(struct pipe_image_view));
          zink_batch_resource_usage_set(&ctx->batch, res,
                                        zink_resource_access_is_write(access));
          update = true;



More information about the mesa-commit mailing list