[Mesa-stable] [Mesa-dev] [PATCH 2/2] anv/cmd_buffer: Remove the 1-D case from the HiZ QPitch calculation

Nanley Chery nanleychery at gmail.com
Tue Nov 29 01:26:38 UTC 2016


On Mon, Nov 28, 2016 at 03:45:42PM -0800, Jason Ekstrand wrote:
> The 1-D special case doesn't actually apply to depth or HiZ.  I discovered
> this while converting BLORP over to genxml and ISL.  The reason is that the
> 1-D special case only applies to the new Sky Lake 1-D layout which is only
> used for LINEAR 1-D images.  For tiled 1-D images, such as depth buffers,
> the old gen4 2-D layout is used and the QPitch should be in rows.
> 
> Cc: Nanley Chery <nanley.g.chery at intel.com>
> Cc: "13.0" <mesa-stable at lists.freedesktop.org>

This rationale seems correct.

Patches 1 and 2 are,
Reviewed-by: Nanley Chery <nanley.g.chery at intel.com>

> ---
>  src/intel/vulkan/genX_cmd_buffer.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c
> index c953b93..cf21a31 100644
> --- a/src/intel/vulkan/genX_cmd_buffer.c
> +++ b/src/intel/vulkan/genX_cmd_buffer.c
> @@ -2177,11 +2177,14 @@ cmd_buffer_emit_depth_stencil(struct anv_cmd_buffer *cmd_buffer)
>            *    - SURFTYPE_1D: distance in pixels between array slices
>            *    - SURFTYPE_2D/CUBE: distance in rows between array slices
>            *    - SURFTYPE_3D: distance in rows between R - slices
> +          *
> +          * Unfortunately, the docs aren't 100% accurate here.  They fail to
> +          * mention that the 1-D rule only applies to linear 1-D images.
> +          * Since depth and HiZ buffers are always tiled, they are treated as
> +          * 2-D images.  Prior to Sky Lake, this field is always in rows.
>            */
>           hdb.SurfaceQPitch =
> -            image->aux_surface.isl.dim == ISL_SURF_DIM_1D ?
> -               isl_surf_get_array_pitch_el(&image->aux_surface.isl) >> 2 :
> -               isl_surf_get_array_pitch_el_rows(&image->aux_surface.isl) >> 2;
> +            isl_surf_get_array_pitch_el_rows(&image->aux_surface.isl) >> 2;
>  #endif
>        }
>     } else {
> -- 
> 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-stable mailing list