[Mesa-dev] [PATCH 10/12] intel/blorp: Handle clearing compressed surfaces

Lionel Landwerlin lionel.g.landwerlin at intel.com
Tue Sep 19 13:58:08 UTC 2017


Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>

On 15/09/17 17:01, Jason Ekstrand wrote:
> ---
>   src/intel/blorp/blorp_clear.c | 24 +++++++++++++++++-------
>   1 file changed, 17 insertions(+), 7 deletions(-)
>
> diff --git a/src/intel/blorp/blorp_clear.c b/src/intel/blorp/blorp_clear.c
> index 0feebef..e8b1e32 100644
> --- a/src/intel/blorp/blorp_clear.c
> +++ b/src/intel/blorp/blorp_clear.c
> @@ -442,14 +442,24 @@ blorp_clear(struct blorp_batch *batch,
>         if (batch->blorp->isl_dev->info->gen == 4 &&
>             (params.dst.surf.usage & ISL_SURF_USAGE_CUBE_BIT)) {
>            blorp_surf_convert_to_single_slice(batch->blorp->isl_dev, &params.dst);
> +      }
> +
> +      if (isl_format_is_compressed(params.dst.surf.format)) {
> +         blorp_surf_convert_to_uncompressed(batch->blorp->isl_dev, &params.dst,
> +                                            NULL, NULL, NULL, NULL);
> +                                            //&dst_x, &dst_y, &dst_w, &dst_h);
> +      }
>   
> -         if (params.dst.tile_x_sa || params.dst.tile_y_sa) {
> -            /* This is gen4 so there is no multisampling and sa == px. */
> -            params.x0 += params.dst.tile_x_sa;
> -            params.y0 += params.dst.tile_y_sa;
> -            params.x1 += params.dst.tile_x_sa;
> -            params.y1 += params.dst.tile_y_sa;
> -         }
> +      if (params.dst.tile_x_sa || params.dst.tile_y_sa) {
> +         /* Either we're on gen4 where there is no multisampling or the
> +          * surface is compressed which also implies no multisampling.
> +          * Therefore, sa == px and we don't need to do a conversion.
> +          */
> +         assert(params.dst.surf.samples == 1);
> +         params.x0 += params.dst.tile_x_sa;
> +         params.y0 += params.dst.tile_y_sa;
> +         params.x1 += params.dst.tile_x_sa;
> +         params.y1 += params.dst.tile_y_sa;
>         }
>   
>         params.num_samples = params.dst.surf.samples;




More information about the mesa-dev mailing list