[Mesa-dev] [PATCH 2/2] intel/isl: Divide QPitch by 2 for 3-D stencil textures on SKL+

Jason Ekstrand jason at jlekstrand.net
Tue Sep 13 17:49:07 UTC 2016


On Tue, Sep 13, 2016 at 10:46 AM, Chad Versace <chadversary at chromium.org>
wrote:

> On Thu 08 Sep 2016, Jason Ekstrand wrote:
> > ---
> >  src/intel/isl/isl_surface_state.c | 15 ++++++++++++++-
> >  1 file changed, 14 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/intel/isl/isl_surface_state.c
> b/src/intel/isl/isl_surface_state.c
> > index f8ea122..22fef3d 100644
> > --- a/src/intel/isl/isl_surface_state.c
> > +++ b/src/intel/isl/isl_surface_state.c
> > @@ -173,7 +173,20 @@ get_qpitch(const struct isl_surf *surf)
> >        unreachable("Bad isl_surf_dim");
> >     case ISL_DIM_LAYOUT_GEN4_2D:
> >        if (GEN_GEN >= 9) {
> > -         return isl_surf_get_array_pitch_el_rows(surf);
> > +         if (surf->dim == ISL_SURF_DIM_3D && surf->tiling ==
> ISL_TILING_W) {
> > +            /* This is rather annoying and completely undocumented.  It
> > +             * appears that the hardware has a bug (or undocumented
> feature)
> > +             * regarding stencil buffers most likely related to the way
> > +             * W-tiling is handled as modified Y-tiling.  If you bind a
> 3-D or
> > +             * 2-D array stencil buffer normally, and use texelFetch on
> it,
> > +             * the z or array index will get implicitly multiplied by 2
> for no
> > +             * obvious reason.  The fix appears to be to divide qpitch
> by 2
> > +             * for W-tiled surfaces.
> > +             */
>
> Have you confirmed that this fix is not needed on other gens? Or have
> you only confirmed that it's needed on SKL, and are deferring the
> workaround on the other gens until you had a chance to test it on them?
>

I'm not sure about KBL or later hardware.  However, it's not needed pre-SKL
because they use the GEN4_3D layout whereas SKL uses GEN4_2D for 3D
textures.


> Either way, the patch is sound. And the workaround doesn't surprise me.
> Reviewed-by: Chad Versace <chadversary at chromium.org>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160913/c197343b/attachment-0001.html>


More information about the mesa-dev mailing list