[Mesa-dev] [PATCH 05/30] i965/miptree: Clean up the depth resolve helpers a little

Pohjolainen, Topi topi.pohjolainen at gmail.com
Tue May 30 07:34:02 UTC 2017


On Fri, May 26, 2017 at 04:30:09PM -0700, Jason Ekstrand wrote:
> ---
>  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 70 ++++++++++++---------------
>  1 file changed, 30 insertions(+), 40 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> index 2701201..3a4fd89 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> @@ -1978,23 +1978,30 @@ intel_miptree_set_all_slices_need_depth_resolve(struct intel_mipmap_tree *mt,
>  }
>  
>  static bool
> -intel_miptree_slice_resolve(struct brw_context *brw,
> -			    struct intel_mipmap_tree *mt,
> -			    uint32_t level,
> -			    uint32_t layer,
> -			    enum blorp_hiz_op need)
> +intel_miptree_depth_hiz_resolve(struct brw_context *brw,
> +                                struct intel_mipmap_tree *mt,
> +                                uint32_t start_level, uint32_t num_levels,
> +                                uint32_t start_layer, uint32_t num_layers,
> +                                enum blorp_hiz_op need)
>  {
> -   intel_miptree_check_level_layer(mt, level, layer);
> +   bool did_resolve = false;
>  
> -   struct intel_resolve_map *item =
> -	 intel_resolve_map_get(&mt->hiz_map, level, layer);
> +   foreach_list_typed_safe(struct intel_resolve_map, map, link, &mt->hiz_map) {
> +      if (map->level < start_level ||
> +          map->level >= (start_level + num_levels) ||
> +          map->layer < start_layer ||
> +          map->layer >= (start_layer + num_layers))
> +         continue;
>  
> -   if (!item || item->need != need)
> -      return false;
> +      if (map->need != need)
> +	 continue;

Indentation looks a little odd here.

>  
> -   intel_hiz_exec(brw, mt, level, layer, need);
> -   intel_resolve_map_remove(item);
> -   return true;
> +      intel_hiz_exec(brw, mt, map->level, map->layer, need);
> +      intel_resolve_map_remove(map);
> +      did_resolve = true;
> +   }
> +
> +   return did_resolve;
>  }
>  
>  bool
> @@ -2003,8 +2010,8 @@ intel_miptree_slice_resolve_hiz(struct brw_context *brw,
>  				uint32_t level,
>  				uint32_t layer)
>  {
> -   return intel_miptree_slice_resolve(brw, mt, level, layer,
> -				      BLORP_HIZ_OP_HIZ_RESOLVE);
> +   return intel_miptree_depth_hiz_resolve(brw, mt, level, 1, layer, 1,
> +                                          BLORP_HIZ_OP_HIZ_RESOLVE);
>  }
>  
>  bool
> @@ -2013,43 +2020,26 @@ intel_miptree_slice_resolve_depth(struct brw_context *brw,
>  				  uint32_t level,
>  				  uint32_t layer)
>  {
> -   return intel_miptree_slice_resolve(brw, mt, level, layer,
> -				      BLORP_HIZ_OP_DEPTH_RESOLVE);
> -}
> -
> -static bool
> -intel_miptree_all_slices_resolve(struct brw_context *brw,
> -				 struct intel_mipmap_tree *mt,
> -				 enum blorp_hiz_op need)
> -{
> -   bool did_resolve = false;
> -
> -   foreach_list_typed_safe(struct intel_resolve_map, map, link, &mt->hiz_map) {
> -      if (map->need != need)
> -	 continue;
> -
> -      intel_hiz_exec(brw, mt, map->level, map->layer, need);
> -      intel_resolve_map_remove(map);
> -      did_resolve = true;
> -   }
> -
> -   return did_resolve;
> +   return intel_miptree_depth_hiz_resolve(brw, mt, level, 1, layer, 1,
> +                                          BLORP_HIZ_OP_DEPTH_RESOLVE);
>  }
>  
>  bool
>  intel_miptree_all_slices_resolve_hiz(struct brw_context *brw,
>  				     struct intel_mipmap_tree *mt)
>  {
> -   return intel_miptree_all_slices_resolve(brw, mt,
> -					   BLORP_HIZ_OP_HIZ_RESOLVE);
> +   return intel_miptree_depth_hiz_resolve(brw, mt,
> +                                          0, UINT32_MAX, 0, UINT32_MAX,
> +                                          BLORP_HIZ_OP_HIZ_RESOLVE);
>  }
>  
>  bool
>  intel_miptree_all_slices_resolve_depth(struct brw_context *brw,
>  				       struct intel_mipmap_tree *mt)
>  {
> -   return intel_miptree_all_slices_resolve(brw, mt,
> -					   BLORP_HIZ_OP_DEPTH_RESOLVE);
> +   return intel_miptree_depth_hiz_resolve(brw, mt,
> +                                          0, UINT32_MAX, 0, UINT32_MAX,
> +                                          BLORP_HIZ_OP_DEPTH_RESOLVE);
>  }
>  
>  enum intel_fast_clear_state
> -- 
> 2.5.0.400.gff86faf
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list