intel/blorp: Make color_write_disable const and optional
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 30 Aug 2016 23:55:35 +0000 (16:55 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 13 Sep 2016 02:42:57 +0000 (19:42 -0700)
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/intel/blorp/blorp.h
src/intel/blorp/blorp_clear.c

index 0848d45c80afd3cb04efdd6455eb0264b578cdca..72cac202162f0e09441ec02213867ad575df80b9 100644 (file)
@@ -130,7 +130,7 @@ blorp_clear(struct blorp_batch *batch,
             uint32_t level, uint32_t start_layer, uint32_t num_layers,
             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,
index 384a4cf98776d2ddb7178a449cfdc3042fa0f5e3..d16933cc6fcc2eeef7ba8fbc1d0a7d9d9b1fe2bc 100644 (file)
@@ -245,7 +245,7 @@ blorp_clear(struct blorp_batch *batch,
             uint32_t level, uint32_t start_layer, uint32_t num_layers,
             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);
@@ -276,10 +276,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,