zink: do not destroy staging-resource, deref it
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 12 Jun 2019 16:24:30 +0000 (18:24 +0200)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 28 Oct 2019 08:51:44 +0000 (08:51 +0000)
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
src/gallium/drivers/zink/zink_resource.c

index 24dc051513de399d2c0a1f74156e796eb26273e6..34c7ed0e500027b6e76b534aea6ec6e68a9c945b 100644 (file)
@@ -493,8 +493,7 @@ zink_transfer_unmap(struct pipe_context *pctx,
          zink_transfer_copy_bufimage(ctx, res, staging_res, trans, true);
       }
 
-      zink_resource_destroy(pctx->screen, trans->staging_res);
-      trans->staging_res = NULL;
+      pipe_resource_reference(&trans->staging_res, NULL);
    } else
       vkUnmapMemory(screen->dev, res->mem);