i965: Add function brw_blorp_blit_miptrees
authorChad Versace <chad.versace@linux.intel.com>
Mon, 6 Aug 2012 23:10:50 +0000 (16:10 -0700)
committerChad Versace <chad.versace@linux.intel.com>
Tue, 7 Aug 2012 16:30:33 +0000 (09:30 -0700)
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@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
src/mesa/drivers/dri/i965/brw_blorp.h
src/mesa/drivers/dri/i965/brw_blorp_blit.cpp

index 9af492d..8d05543 100644 (file)
 
 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 */
index 1206237..700b0cf 100644 (file)
@@ -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));