[Mesa-dev] [PATCH v2 4/5] intel/blorp_blit: Add option to dump surfaces on blits

Jordan Justen jordan.l.justen at intel.com
Thu Dec 1 03:57:02 UTC 2016


Enabling this option causes the source and destination surfaces to be
dumped out to debug files. The destination is dumped both before and
after the blit operation.

Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
 src/intel/blorp/blorp_blit.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/intel/blorp/blorp_blit.c b/src/intel/blorp/blorp_blit.c
index 69b98c2..d8d022d 100644
--- a/src/intel/blorp/blorp_blit.c
+++ b/src/intel/blorp/blorp_blit.c
@@ -28,6 +28,8 @@
 
 #define FILE_DEBUG_FLAG DEBUG_BLORP
 
+static const bool isl_surface_debug_dump = false;
+
 /**
  * Enum to specify the order of arguments in a sampler message
  */
@@ -1711,6 +1713,11 @@ blorp_blit(struct blorp_batch *batch,
    struct blorp_params params;
    blorp_params_init(&params);
 
+   if (isl_surface_debug_dump) {
+      blorp_surf_dump(batch->blorp, src_surf, "blorp-blit-src");
+      blorp_surf_dump(batch->blorp, dst_surf, "blorp-blit-dst-before");
+   }
+
    brw_blorp_surface_info_init(batch->blorp, &params.src, src_surf, src_level,
                                src_layer, src_format, false);
    brw_blorp_surface_info_init(batch->blorp, &params.dst, dst_surf, dst_level,
@@ -1768,6 +1775,9 @@ blorp_blit(struct blorp_batch *batch,
                  src_x0, src_y0, src_x1, src_y1,
                  dst_x0, dst_y0, dst_x1, dst_y1,
                  mirror_x, mirror_y);
+
+   if (isl_surface_debug_dump)
+      blorp_surf_dump(batch->blorp, dst_surf, "blorp-blit-dst-after");
 }
 
 static enum isl_format
@@ -2007,6 +2017,11 @@ blorp_copy(struct blorp_batch *batch,
    brw_blorp_surface_info_init(batch->blorp, &params.dst, dst_surf, dst_level,
                                dst_layer, ISL_FORMAT_UNSUPPORTED, true);
 
+   if (isl_surface_debug_dump) {
+      blorp_surf_dump(batch->blorp, src_surf, "blorp-copy-src");
+      blorp_surf_dump(batch->blorp, dst_surf, "blorp-copy-dst-before");
+   }
+
    struct brw_blorp_blit_prog_key wm_prog_key = {
       .shader_type = BLORP_SHADER_TYPE_BLIT
    };
@@ -2080,4 +2095,7 @@ blorp_copy(struct blorp_batch *batch,
                  src_x, src_y, src_x + src_width, src_y + src_height,
                  dst_x, dst_y, dst_x + dst_width, dst_y + dst_height,
                  false, false);
+
+   if (isl_surface_debug_dump)
+      blorp_surf_dump(batch->blorp, dst_surf, "blorp-copy-dst-after");
 }
-- 
2.10.2



More information about the mesa-dev mailing list