i965: Add a brw_blorp_copy_buffers() command.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 28 Aug 2017 22:57:20 +0000 (15:57 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 30 Aug 2017 23:59:21 +0000 (16:59 -0700)
This exposes the new blorp_copy_buffer() functionality to i965.
It should be a drop-in replacement for intel_emit_linear_blit()
(other than the arguments being backwards, for consistency with BLORP).

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/mesa/drivers/dri/i965/brw_blorp.c
src/mesa/drivers/dri/i965/brw_blorp.h

index 277ffda4fd536ffc23eb16e13ab2f0e8631ec8fc..4c6ae3691964987c22031ffe2c31e31c3bded715 100644 (file)
@@ -434,6 +434,27 @@ brw_blorp_copy_miptrees(struct brw_context *brw,
                               dst_aux_usage);
 }
 
+void
+brw_blorp_copy_buffers(struct brw_context *brw,
+                       struct brw_bo *src_bo,
+                       unsigned src_offset,
+                       struct brw_bo *dst_bo,
+                       unsigned dst_offset,
+                       unsigned size)
+{
+   DBG("%s %d bytes from %p[%d] to %p[%d]",
+       __func__, size, src_bo, src_offset, dst_bo, dst_offset);
+
+   struct blorp_batch batch;
+   struct blorp_address src = { .buffer = src_bo, .offset = src_offset };
+   struct blorp_address dst = { .buffer = dst_bo, .offset = dst_offset };
+
+   blorp_batch_init(&brw->blorp, &batch, brw, 0);
+   blorp_buffer_copy(&batch, src, dst, size);
+   blorp_batch_finish(&batch);
+}
+
+
 static struct intel_mipmap_tree *
 find_miptree(GLbitfield buffer_bit, struct intel_renderbuffer *irb)
 {
index c65a68a53d3bdc1643667c96827ec623e392a4e5..cf781ec53cbf465cf99ece4e9451b61bc9acfbfc 100644 (file)
@@ -59,6 +59,14 @@ brw_blorp_copy_miptrees(struct brw_context *brw,
                         unsigned dst_x, unsigned dst_y,
                         unsigned src_width, unsigned src_height);
 
+void
+brw_blorp_copy_buffers(struct brw_context *brw,
+                       struct brw_bo *src_bo,
+                       unsigned src_offset,
+                       struct brw_bo *dst_bo,
+                       unsigned dst_offset,
+                       unsigned size);
+
 void
 brw_blorp_clear_color(struct brw_context *brw, struct gl_framebuffer *fb,
                       GLbitfield mask, bool partial_clear, bool encode_srgb);