[Mesa-dev] [PATCH 04/23] i965: Don't try to create aux buffer for non-msrt aux-buffer

Ben Widawsky ben at bwidawsk.net
Tue Feb 9 22:46:59 UTC 2016


On Mon, Feb 08, 2016 at 06:51:24PM +0200, Topi Pohjolainen wrote:
> In addition to simply calling miptree_create() the higher level
> call intel_miptree_create() also considers if the buffer should
> be associated with an auxiliary buffer based on the given format.
> 
> Here we are allocating an auxiliary buffer which in turn has such
> format that would mislead intel_miptree_create_layout() later on
> to try to associate the auxiliary buffer with an auxiliary buffer.
> To prevent this the actual buffer creation logic was split out
> into its own function. Lets invoke that instead.
> 
> Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
> ---
>  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 21 +++++++++++----------
>  1 file changed, 11 insertions(+), 10 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> index d655de8..6c447ba 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> @@ -1550,16 +1550,17 @@ intel_miptree_alloc_non_msrt_mcs(struct brw_context *brw,
>     if (brw->gen >= 8) {
>        layout_flags |= MIPTREE_LAYOUT_FORCE_HALIGN16;
>     }
> -   mt->mcs_mt = intel_miptree_create(brw,
> -                                     mt->target,
> -                                     format,
> -                                     mt->first_level,
> -                                     mt->last_level,
> -                                     mcs_width,
> -                                     mcs_height,
> -                                     mt->logical_depth0,
> -                                     0 /* num_samples */,
> -                                     layout_flags);
> +   mt->mcs_mt = miptree_create(brw,
> +                               mt->target,
> +                               format,
> +                               mt->first_level,
> +                               mt->last_level,
> +                               mcs_width,
> +                               mcs_height,
> +                               mt->logical_depth0,
> +                               0 /* num_samples */,
> +                               INTEL_MSAA_LAYOUT_NONE,
> +                               layout_flags);
>  
>     return mt->mcs_mt;
>  }
> -- 

Same comment as patch 1, I guess - but the logic of it is:
Reviewed-by: Ben Widawsky <benjamin.widawsky at intel.com>

I think with this you can fix the check for num_samples in gen8_surface_state.c
as well. I think it looks a bit better to check the format/layout as opposed to
num_samples in that case. Up to you.


More information about the mesa-dev mailing list