[Mesa-dev] [PATCH] i965/miptree: Return NONE from texture_aux_usage when fully resolved

Kenneth Graunke kenneth at whitecape.org
Fri Aug 18 02:41:32 UTC 2017


On Thursday, August 17, 2017 6:07:18 PM PDT Jason Ekstrand wrote:
> This little optimization improves the performance of SynMark v7
> TexFilterTri by almost 10% on Sky Lake GT4 among other improvements.
> We've been doing it for some time but somehow it got dropped during
> the miptree refactoring.
> 
> Bugzilla: https://bugs.freedesktop.org/102258
> Cc: "17.2" <mesa-stable at lists.freedesktop.org>
> ---
>  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> index 237ab18..f4effc7 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> @@ -2573,7 +2573,20 @@ intel_miptree_texture_aux_usage(struct brw_context *brw,
>  
>     case ISL_AUX_USAGE_CCS_D:
>     case ISL_AUX_USAGE_CCS_E:
> -      if (mt->mcs_buf && can_texture_with_ccs(brw, mt, view_format))
> +      if (!mt->mcs_buf) {
> +         assert(mt->aux_usage == ISL_AUX_USAGE_CCS_D);
> +         return ISL_AUX_USAGE_NONE;
> +      }
> +
> +      /* If we don't have any unresolved color, report an aux usage of
> +       * ISL_AUX_USAGE_NONE.  This way, texturing won't even look at the
> +       * aux surface and we can save some bandwidth.
> +       */
> +      if (!intel_miptree_has_color_unresolved(mt, 0, INTEL_REMAINING_LEVELS,
> +                                              0, INTEL_REMAINING_LEVELS))

This should be: 0, INTEL_REMAINING_LAYERS))

(they're the same so it works either way, but, should use the right name)

With that fixed, this is:
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

> +         return ISL_AUX_USAGE_NONE;
> +
> +      if (can_texture_with_ccs(brw, mt, view_format))
>           return ISL_AUX_USAGE_CCS_E;
>        break;
>  
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170817/da2ecf23/attachment.sig>


More information about the mesa-dev mailing list