On Thu, May 03, 2018 at 12:03:58PM -0700, Nanley Chery wrote:
> Reduce code duplication now and prevent it in the following commits.
> ---
>  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(-)

Patches 10 and 11 are:

Reviewed-by: Topi Pohjolainen <topi.pohjolai...@intel.com>

> 
> diff --git a/src/mesa/drivers/dri/i965/brw_clear.c 
> b/src/mesa/drivers/dri/i965/brw_clear.c
> index 3d540d6d905..2f61ea8ef15 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 da5b40df047..07ce2ac2adf 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> @@ -3745,19 +3745,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 de4c3f4183a..9c25051979f 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
> @@ -741,11 +741,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
> -- 
> 2.16.2
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to