i965: Use set_clear_color for depth miptrees
authorNanley Chery <nanley.g.chery@intel.com>
Fri, 27 Apr 2018 01:49:19 +0000 (18:49 -0700)
committerNanley Chery <nanley.g.chery@intel.com>
Thu, 17 May 2018 14:06:41 +0000 (07:06 -0700)
Reduce code duplication now and prevent it in the following commits.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/mesa/drivers/dri/i965/brw_clear.c
src/mesa/drivers/dri/i965/intel_mipmap_tree.c
src/mesa/drivers/dri/i965/intel_mipmap_tree.h

index 3d540d6d905814085796840ffa638a9731267ddf..2f61ea8ef15695a7b4fa5f2a53110e480d0ce41f 100644 (file)
@@ -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;
    }
 
index 506cf73e62cd8dcd26fe77f419138ba89786f7be..88db0fc80b73b2d7e238ac2433931885924197c0 100644 (file)
@@ -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,
index 2d827afa534ac61fd89757b9bfb6f2b30827c7bd..42f73ba1f96affdf1736c38c2cc7768ebaf99a4f 100644 (file)
@@ -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