[Mesa-dev] [PATCH 10/14] i965/blorp: Enable glsl-based fbo blits

Topi Pohjolainen topi.pohjolainen at intel.com
Thu Apr 23 11:18:24 PDT 2015


Use meta-path instead of blorp for 2D-blits.

Reduces cpu-overhead increasing the performance of meta-path. On
IVB (blorp disabled and hence meta path enabled) a microbenchmark
found in mesa-demos (copypixrate -blit -back):

x  62   10665.83   13388.95   11357.77   11467.463   574.57333
+  62   19933.73   21140.67   20780.81   20757.792   184.91425
Difference at 95.0% confidence
        9290.33 +/- 150.247
        81.0147% +/- 1.3102%

Compared to default blorp meta is now on par (1-2% faster).

On BDW (where blorp isn't available) the same benchmark:

x 137     9055.4   14551.12   12020.87   12011.815   762.67232
+ 137   13963.49   18281.85   17031.56   16985.443   712.08714
Difference at 95.0% confidence
        4973.63 +/- 174.726
        41.4061% +/- 1.45462%

No visible changes in public benchmarks. No piglit regressions.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
 src/mesa/drivers/dri/i965/brw_context.h | 10 ++++++++++
 src/mesa/drivers/dri/i965/intel_fbo.c   | 11 +++++++++++
 2 files changed, 21 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index ae28955..a22f627 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -1752,6 +1752,16 @@ brw_blorp_framebuffer(struct brw_context *brw,
                       GLbitfield mask, GLenum filter);
 
 bool
+brw_meta_fbo_color_blit(struct brw_context *brw,
+                        struct gl_framebuffer *read_fb,
+                        struct gl_framebuffer *draw_fb,
+                        float src_x0, float src_y0,
+                        float src_x1, float src_y1,
+                        float dst_x0, float dst_y0,
+                        float dst_x1, float dst_y1,
+                        GLenum filter);
+
+bool
 brw_blorp_copytexsubimage(struct brw_context *brw,
                           struct gl_renderbuffer *src_rb,
                           struct gl_texture_image *dst_image,
diff --git a/src/mesa/drivers/dri/i965/intel_fbo.c b/src/mesa/drivers/dri/i965/intel_fbo.c
index aebed72..077eb8b 100644
--- a/src/mesa/drivers/dri/i965/intel_fbo.c
+++ b/src/mesa/drivers/dri/i965/intel_fbo.c
@@ -878,6 +878,17 @@ intel_blit_framebuffer(struct gl_context *ctx,
    if (!_mesa_check_conditional_render(ctx))
       return;
 
+   if (brw->gen >= 6 && (mask & GL_COLOR_BUFFER_BIT)) {
+      if (brw_meta_fbo_color_blit(brw, readFb, drawFb,
+                                  srcX0, srcY0, srcX1, srcY1,
+                                  dstX0, dstY0, dstX1, dstY1,
+                                  filter)) {
+         mask &= ~GL_COLOR_BUFFER_BIT;
+         if (mask == 0x0)
+            return;
+      }
+   }
+
    mask = brw_blorp_framebuffer(brw, readFb, drawFb,
                                 srcX0, srcY0, srcX1, srcY1,
                                 dstX0, dstY0, dstX1, dstY1,
-- 
1.9.3



More information about the mesa-dev mailing list