[Mesa-dev] [PATCH 17/33] intel/blorp: Make color_write_disable const and optional

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


---
 src/intel/blorp/blorp.h       |  2 +-
 src/intel/blorp/blorp_clear.c | 12 +++++++-----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/intel/blorp/blorp.h b/src/intel/blorp/blorp.h
index 6574124..6242530 100644
--- a/src/intel/blorp/blorp.h
+++ b/src/intel/blorp/blorp.h
@@ -130,7 +130,7 @@ blorp_clear(struct blorp_batch *batch,
             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,
-            bool color_write_disable[4]);
+            const bool color_write_disable[4]);
 
 void
 blorp_ccs_resolve(struct blorp_batch *batch,
diff --git a/src/intel/blorp/blorp_clear.c b/src/intel/blorp/blorp_clear.c
index b0be50b..2672414 100644
--- a/src/intel/blorp/blorp_clear.c
+++ b/src/intel/blorp/blorp_clear.c
@@ -244,7 +244,7 @@ blorp_clear(struct blorp_batch *batch,
             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,
-            bool color_write_disable[4])
+            const bool color_write_disable[4])
 {
    struct blorp_params params;
    blorp_params_init(&params);
@@ -275,10 +275,12 @@ blorp_clear(struct blorp_batch *batch,
    /* Constant color writes ignore everyting in blend and color calculator
     * state.  This is not documented.
     */
-   for (unsigned i = 0; i < 4; i++) {
-      params.color_write_disable[i] = color_write_disable[i];
-      if (color_write_disable[i])
-         use_simd16_replicated_data = false;
+   if (color_write_disable) {
+      for (unsigned i = 0; i < 4; i++) {
+         params.color_write_disable[i] = color_write_disable[i];
+         if (color_write_disable[i])
+            use_simd16_replicated_data = false;
+      }
    }
 
    blorp_params_get_clear_kernel(batch->blorp, &params,
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list