Mesa (master): i965: Use set_clear_color for depth miptrees

Nanley Chery nchery at kemper.freedesktop.org
Thu May 17 14:06:57 UTC 2018


Module: Mesa
Branch: master
Commit: 6f609ca609f3011b756bb920a7b06946a8a8c0b7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6f609ca609f3011b756bb920a7b06946a8a8c0b7

Author: Nanley Chery <nanley.g.chery at intel.com>
Date:   Thu Apr 26 18:49:19 2018 -0700

i965: Use set_clear_color for depth miptrees

Reduce code duplication now and prevent it in the following commits.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

---

 src/mesa/drivers/dri/i965/brw_clear.c         |  3 ++-
 src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 13 -------------
 src/mesa/drivers/dri/i965/intel_mipmap_tree.h |  5 -----
 3 files changed, 2 insertions(+), 19 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_clear.c b/src/mesa/drivers/dri/i965/brw_clear.c
index 3d540d6d90..2f61ea8ef1 100644
--- a/src/mesa/drivers/dri/i965/brw_clear.c
+++ b/src/mesa/drivers/dri/i965/brw_clear.c
@@ -213,7 +213,8 @@ brw_fast_clear_depth(struct gl_context *ctx)
          }
       }
 
-      intel_miptree_set_depth_clear_value(brw, mt, clear_value);
+      const union isl_color_value clear_color = { .f32 = {clear_value, } };
+      intel_miptree_set_clear_color(brw, mt, clear_color);
       same_clear_value = false;
    }
 
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 506cf73e62..88db0fc80b 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -3734,19 +3734,6 @@ intel_miptree_set_clear_color(struct brw_context *brw,
    return false;
 }
 
-bool
-intel_miptree_set_depth_clear_value(struct brw_context *brw,
-                                    struct intel_mipmap_tree *mt,
-                                    float clear_value)
-{
-   if (mt->fast_clear_color.f32[0] != clear_value) {
-      mt->fast_clear_color.f32[0] = clear_value;
-      brw->ctx.NewDriverState |= BRW_NEW_AUX_STATE;
-      return true;
-   }
-   return false;
-}
-
 union isl_color_value
 intel_miptree_get_clear_color(const struct gen_device_info *devinfo,
                               const struct intel_mipmap_tree *mt,
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
index 2d827afa53..42f73ba1f9 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
@@ -716,11 +716,6 @@ intel_miptree_get_clear_color(const struct gen_device_info *devinfo,
                               struct brw_bo **clear_color_bo,
                               uint32_t *clear_color_offset);
 
-bool
-intel_miptree_set_depth_clear_value(struct brw_context *brw,
-                                    struct intel_mipmap_tree *mt,
-                                    float clear_value);
-
 #ifdef __cplusplus
 }
 #endif




More information about the mesa-commit mailing list