Mesa (master): zink: implement buffer-to-buffer copies

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Nov 12 13:29:47 UTC 2019


Module: Mesa
Branch: master
Commit: e1c87bbb4bcaa9b5946bc88f9f5d7868372d8400
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e1c87bbb4bcaa9b5946bc88f9f5d7868372d8400

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Fri Nov  8 12:53:43 2019 +0100

zink: implement buffer-to-buffer copies

---

 src/gallium/drivers/zink/zink_context.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index 30d19c6ffa2..2be6ce351be 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -1510,6 +1510,18 @@ zink_resource_copy_region(struct pipe_context *pctx,
       vkCmdCopyImage(batch->cmdbuf, src->image, src->layout,
                      dst->image, dst->layout,
                      1, &region);
+   } else if (dst->base.target == PIPE_BUFFER &&
+              src->base.target == PIPE_BUFFER) {
+      VkBufferCopy region;
+      region.srcOffset = src_box->x;
+      region.dstOffset = dstx;
+      region.size = src_box->width;
+
+      struct zink_batch *batch = zink_batch_no_rp(ctx);
+      zink_batch_reference_resoure(batch, src);
+      zink_batch_reference_resoure(batch, dst);
+
+      vkCmdCopyBuffer(batch->cmdbuf, src->buffer, dst->buffer, 1, &region);
    } else
       debug_printf("zink: TODO resource copy\n");
 }




More information about the mesa-commit mailing list