[Mesa-dev] [PATCH 3/6] i965: Add a brw_blorp_copy_buffers() command.
Kenneth Graunke
kenneth at whitecape.org
Tue Aug 29 21:28:40 UTC 2017
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).
---
src/mesa/drivers/dri/i965/brw_blorp.c | 18 ++++++++++++++++++
src/mesa/drivers/dri/i965/brw_blorp.h | 8 ++++++++
2 files changed, 26 insertions(+)
diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c b/src/mesa/drivers/dri/i965/brw_blorp.c
index 3ea396d726e..3d8203619f5 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.c
+++ b/src/mesa/drivers/dri/i965/brw_blorp.c
@@ -428,6 +428,24 @@ 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;
+ blorp_batch_init(&brw->blorp, &batch, brw, 0);
+ blorp_buffer_copy(&batch, src_bo, src_offset, dst_bo, dst_offset, size);
+ blorp_batch_finish(&batch);
+}
+
+
static struct intel_mipmap_tree *
find_miptree(GLbitfield buffer_bit, struct intel_renderbuffer *irb)
{
diff --git a/src/mesa/drivers/dri/i965/brw_blorp.h b/src/mesa/drivers/dri/i965/brw_blorp.h
index c65a68a53d3..cf781ec53cb 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.h
+++ b/src/mesa/drivers/dri/i965/brw_blorp.h
@@ -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);
--
2.14.1
More information about the mesa-dev
mailing list