zink: unset resource layout+access when doing storage setup
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Tue, 5 Apr 2022 16:09:02 +0000 (12:09 -0400)
committerMarge Bot <emma+marge@anholt.net>
Wed, 6 Apr 2022 04:49:00 +0000 (04:49 +0000)
the previous access info is transferred to the staging resource for the copy,
and the new image has no access info

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15716>

src/gallium/drivers/zink/zink_resource.c

index 4edec5c..2c16b73 100644 (file)
@@ -1828,6 +1828,10 @@ zink_resource_object_init_storage(struct zink_context *ctx, struct zink_resource
       }
       struct zink_resource staging = *res;
       staging.obj = old_obj;
+      staging.all_binds = 0;
+      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);