Mesa (master): i965: Add function brw_blorp_blit_miptrees

Chad Versace chadversary at kemper.freedesktop.org
Tue Aug 7 16:31:17 UTC 2012


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

Author: Chad Versace <chad.versace at linux.intel.com>
Date:   Mon Aug  6 16:10:50 2012 -0700

i965: Add function brw_blorp_blit_miptrees

Define a function, brw_blorp_blit_miptrees, that simply wraps
brw_blorp_blit_params + brw_blorp_exec with C calling conventions. This
enables intel_miptree.c, in a following commit, to perform blits with
blorp for the purpose of downsampling multisample miptrees.

Reviewed-by: Eric Anholt <eric at anholt.net>
Signed-off-by: Chad Versace <chad.versace at linux.intel.com>

---

 src/mesa/drivers/dri/i965/brw_blorp.h        |   17 +++++++++++++++++
 src/mesa/drivers/dri/i965/brw_blorp_blit.cpp |   24 ++++++++++++++++++++----
 2 files changed, 37 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_blorp.h b/src/mesa/drivers/dri/i965/brw_blorp.h
index 9af492d..8d05543 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.h
+++ b/src/mesa/drivers/dri/i965/brw_blorp.h
@@ -30,6 +30,21 @@
 
 struct brw_context;
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void
+brw_blorp_blit_miptrees(struct intel_context *intel,
+                        struct intel_mipmap_tree *src_mt,
+                        struct intel_mipmap_tree *dst_mt,
+                        int src_x0, int src_y0,
+                        int dst_x0, int dst_y0,
+                        int dst_x1, int dst_y1,
+                        bool mirror_x, bool mirror_y);
+
+#ifdef __cplusplus
+} /* end extern "C" */
 
 /**
  * Binding table indices used by BLORP.
@@ -340,3 +355,5 @@ void
 gen6_blorp_emit_drawing_rectangle(struct brw_context *brw,
                                   const brw_blorp_params *params);
 /** \} */
+
+#endif /* __cplusplus */
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
index 1206237..700b0cf 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
@@ -121,6 +121,23 @@ find_miptree(GLbitfield buffer_bit, struct gl_renderbuffer *rb)
    return mt;
 }
 
+void
+brw_blorp_blit_miptrees(struct intel_context *intel,
+                        struct intel_mipmap_tree *src_mt,
+                        struct intel_mipmap_tree *dst_mt,
+                        int src_x0, int src_y0,
+                        int dst_x0, int dst_y0,
+                        int dst_x1, int dst_y1,
+                        bool mirror_x, bool mirror_y)
+{
+   brw_blorp_blit_params params(brw_context(&intel->ctx),
+                                src_mt, dst_mt,
+                                src_x0, src_y0,
+                                dst_x0, dst_y0,
+                                dst_x1, dst_y1,
+                                mirror_x, mirror_y);
+   brw_blorp_exec(intel, &params);
+}
 
 static void
 do_blorp_blit(struct intel_context *intel, GLbitfield buffer_bit,
@@ -142,10 +159,9 @@ do_blorp_blit(struct intel_context *intel, GLbitfield buffer_bit,
    intel_renderbuffer_resolve_depth(intel, intel_renderbuffer(dst_rb));
 
    /* Do the blit */
-   brw_blorp_blit_params params(brw_context(ctx), src_mt, dst_mt,
-                                srcX0, srcY0, dstX0, dstY0, dstX1, dstY1,
-                                mirror_x, mirror_y);
-   brw_blorp_exec(intel, &params);
+   brw_blorp_blit_miptrees(intel, src_mt, dst_mt,
+                           srcX0, srcY0, dstX0, dstY0, dstX1, dstY1,
+                           mirror_x, mirror_y);
 
    /* Mark the dst buffer as needing a HiZ resolve if necessary. */
    intel_renderbuffer_set_needs_hiz_resolve(intel_renderbuffer(dst_rb));




More information about the mesa-commit mailing list