<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 13, 2016 at 10:46 AM, Chad Versace <span dir="ltr"><<a href="mailto:chadversary@chromium.org" target="_blank">chadversary@chromium.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Thu 08 Sep 2016, Jason Ekstrand wrote:<br>
> ---<br>
> src/intel/isl/isl_surface_<wbr>state.c | 15 ++++++++++++++-<br>
> 1 file changed, 14 insertions(+), 1 deletion(-)<br>
><br>
> diff --git a/src/intel/isl/isl_surface_<wbr>state.c b/src/intel/isl/isl_surface_<wbr>state.c<br>
> index f8ea122..22fef3d 100644<br>
> --- a/src/intel/isl/isl_surface_<wbr>state.c<br>
> +++ b/src/intel/isl/isl_surface_<wbr>state.c<br>
> @@ -173,7 +173,20 @@ get_qpitch(const struct isl_surf *surf)<br>
> unreachable("Bad isl_surf_dim");<br>
> case ISL_DIM_LAYOUT_GEN4_2D:<br>
> if (GEN_GEN >= 9) {<br>
> - return isl_surf_get_array_pitch_el_<wbr>rows(surf);<br>
> + if (surf->dim == ISL_SURF_DIM_3D && surf->tiling == ISL_TILING_W) {<br>
> + /* This is rather annoying and completely undocumented. It<br>
> + * appears that the hardware has a bug (or undocumented feature)<br>
> + * regarding stencil buffers most likely related to the way<br>
> + * W-tiling is handled as modified Y-tiling. If you bind a 3-D or<br>
> + * 2-D array stencil buffer normally, and use texelFetch on it,<br>
> + * the z or array index will get implicitly multiplied by 2 for no<br>
> + * obvious reason. The fix appears to be to divide qpitch by 2<br>
> + * for W-tiled surfaces.<br>
> + */<br>
<br>
</span>Have you confirmed that this fix is not needed on other gens? Or have<br>
you only confirmed that it's needed on SKL, and are deferring the<br>
workaround on the other gens until you had a chance to test it on them?<br></blockquote><div><br></div><div>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.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Either way, the patch is sound. And the workaround doesn't surprise me.<br>
Reviewed-by: Chad Versace <<a href="mailto:chadversary@chromium.org">chadversary@chromium.org</a>><br>
</blockquote></div><br></div></div>