[Mesa-dev] [PATCH 18/33] intel/blorp: Add a swizzle parameter to blorp_clear

Jason Ekstrand jason at jlekstrand.net
Wed Aug 31 21:22:37 UTC 2016


While we're here, we also re-arrange the parameters to better match the
parameter order of blorp_blit.
---
 src/intel/blorp/blorp.h               | 3 ++-
 src/intel/blorp/blorp_clear.c         | 4 +++-
 src/mesa/drivers/dri/i965/brw_blorp.c | 3 ++-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/intel/blorp/blorp.h b/src/intel/blorp/blorp.h
index 6242530..921be85 100644
--- a/src/intel/blorp/blorp.h
+++ b/src/intel/blorp/blorp.h
@@ -127,9 +127,10 @@ blorp_fast_clear(struct blorp_batch *batch,
 void
 blorp_clear(struct blorp_batch *batch,
             const struct blorp_surf *surf,
+            enum isl_format format, struct isl_swizzle swizzle,
             uint32_t level, uint32_t layer,
             uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1,
-            enum isl_format format, union isl_color_value clear_color,
+            union isl_color_value clear_color,
             const bool color_write_disable[4]);
 
 void
diff --git a/src/intel/blorp/blorp_clear.c b/src/intel/blorp/blorp_clear.c
index 2672414..ce9b292 100644
--- a/src/intel/blorp/blorp_clear.c
+++ b/src/intel/blorp/blorp_clear.c
@@ -241,9 +241,10 @@ blorp_fast_clear(struct blorp_batch *batch,
 void
 blorp_clear(struct blorp_batch *batch,
             const struct blorp_surf *surf,
+            enum isl_format format, struct isl_swizzle swizzle,
             uint32_t level, uint32_t layer,
             uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1,
-            enum isl_format format, union isl_color_value clear_color,
+            union isl_color_value clear_color,
             const bool color_write_disable[4])
 {
    struct blorp_params params;
@@ -288,6 +289,7 @@ blorp_clear(struct blorp_batch *batch,
 
    brw_blorp_surface_info_init(batch->blorp, &params.dst, surf, level, layer,
                                format, true);
+   params.dst.view.swizzle = swizzle;
 
    batch->blorp->exec(batch, &params);
 }
diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c b/src/mesa/drivers/dri/i965/brw_blorp.c
index 5539c9c..98b5bae 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.c
+++ b/src/mesa/drivers/dri/i965/brw_blorp.c
@@ -779,8 +779,9 @@ do_single_blorp_clear(struct brw_context *brw, struct gl_framebuffer *fb,
 
       struct blorp_batch batch;
       blorp_batch_init(&brw->blorp, &batch, brw);
-      blorp_clear(&batch, &surf, level, layer, x0, y0, x1, y1,
+      blorp_clear(&batch, &surf,
                   (enum isl_format)brw->render_target_format[format],
+                  ISL_SWIZZLE_IDENTITY, level, layer, x0, y0, x1, y1,
                   clear_color, color_write_disable);
       blorp_batch_finish(&batch);
 
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list