<p dir="ltr"></p>
<p dir="ltr">On Aug 23, 2016 10:10 AM, "Ilia Mirkin" <<a href="mailto:imirkin@alum.mit.edu">imirkin@alum.mit.edu</a>> wrote:<br>
><br>
> On Tue, Aug 23, 2016 at 12:34 PM, Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br>
> > On Tue, Aug 23, 2016 at 9:28 AM, Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br>
> > wrote:<br>
> >><br>
> >> This smells like fish... I'm going to have a look.<br>
> ><br>
> ><br>
> > Ok, I looked...<br>
> ><br>
> >><br>
> >> On Tue, Aug 23, 2016 at 8:29 AM, Antia Puentes <<a href="mailto:apuentes@igalia.com">apuentes@igalia.com</a>><br>
> >> wrote:<br>
> >>><br>
> >>> From: Dave Airlie <<a href="mailto:airlied@redhat.com">airlied@redhat.com</a>><br>
> >>><br>
> >>> This fixes one subtest of:<br>
> >>> GL44-CTS.shader_image_size.advanced-nonMS-fs-int<br>
> >>><br>
> >>> I've no idea why this wouldn't be scaled up here,<br>
> >>> and I've no idea what else will break, but I might<br>
> >>> as well open for discussion.<br>
> >>><br>
> >>> v2: Only shift height if the texture is not an 1D_ARRAY,<br>
> >>> it fixes assertion in GL44-CTS.texture_view.gettexparameter<br>
> >>> due to the original patch (Antia).<br>
> >>><br>
> >>> Signed-off-by: Dave Airlie <<a href="mailto:airlied@redhat.com">airlied@redhat.com</a>><br>
> >>> Signed-off-by: Antia Puentes <<a href="mailto:apuentes@igalia.com">apuentes@igalia.com</a>><br>
> >>> ---<br>
> >>><br>
> >>> I have not taken a deep look to the test so take this with a grain of<br>
> >>> salt.<br>
> >>> As I said in a previous email, this patch raises an assertion in<br>
> >>> GL44-CTS.texture_view.gettexparameter:<br>
> >>><br>
> >>> "glcts: intel_mipmap_tree.c:368: intel_miptree_create_layout: Assertion<br>
> >>> `height0 = 1' failed."<br>
> >>><br>
> >>> Looking at the code surrounding the assertion, we have:<br>
> >>><br>
> >>>    if (target == GL_TEXTURE_1D_ARRAY)<br>
> >>>          assert(height0 == 1);<br>
> >>><br>
> >>> which suggests that we should avoid shifting the height at least for<br>
> >>> TEXTURE_1D_ARRAYs. Sending a second version of the patch.<br>
> >>><br>
> >>>  src/mesa/drivers/dri/i965/intel_tex_image.c | 2 +-<br>
> >>>  1 file changed, 1 insertion(+), 1 deletion(-)<br>
> >>><br>
> >>> diff --git a/src/mesa/drivers/dri/i965/intel_tex_image.c<br>
> >>> b/src/mesa/drivers/dri/i965/intel_tex_image.c<br>
> >>> index 958f8bd..120e7e0 100644<br>
> >>> --- a/src/mesa/drivers/dri/i965/intel_tex_image.c<br>
> >>> +++ b/src/mesa/drivers/dri/i965/intel_tex_image.c<br>
> >>> @@ -49,7 +49,7 @@ intel_miptree_create_for_teximage(struct brw_context<br>
> >>> *brw,<br>
> >>>     /* Figure out image dimensions at start level. */<br>
> >>>     for (i = intelImage->base.Base.Level; i > 0; i--) {<br>
> >>>        width <<= 1;<br>
> >>> -      if (height != 1)<br>
> >>> +      if (intelObj->base.Target != GL_TEXTURE_1D_ARRAY)<br>
> >>>           height <<= 1;<br>
> >>>        if (intelObj->base.Target == GL_TEXTURE_3D)<br>
> >>>           depth <<= 1;<br>
> ><br>
> ><br>
> > I think the whole pile of code is bogus and needs to be rewritten.  First<br>
> > off, why are we using a for loop?  Seriously?  Second, I think what we want<br>
> > is more like<br>
> ><br>
> > switch (intelObj->base.Target) {<br>
> > case GL_TEXTURE_3D:<br>
> >    depth <<= intelImage->base.Base.Level;<br>
> >    /* Fall through */<br>
> ><br>
> > case GL_TEXTURE_2D:<br>
> > case GL_TEXTURE_2D_ARRAY:<br>
> > case GL_TEXTURE_RECTANGLE:<br>
><br>
> and cube/cube_array</p>
<p dir="ltr">Yes</p>
<p dir="ltr">> and ms/ms_array</p>
<p dir="ltr">Noish... You can't have multiple levels for multisampled but sure.</p>
<p dir="ltr">> [this is why != 1d_array tends to be attractive]</p>
<p dir="ltr">Sure, but it had better be != 1d &&!= 1d_array.  I'm not married to the switch statement, but we could easily make it exhaustive with an unreachable default case and solve that problem.  That may actually be better than != 1d.  If we did that, we could put an assert(levels ==0)  in the case for multisampled.</p>
<p dir="ltr">In any case, I do think we should kill the loop and be a bit more explicit.</p>
<p dir="ltr">--Jason</p>
<p dir="ltr">> >    height <<= intelImage->base.Base.Level<br>
> >    /* Fall through */<br>
> ><br>
> > default:<br>
> >    width <<= intelImage->base.Base.Level;<br>
> > }<br>
> ><br>
> > I think that would be far more clear and correct.  I don't have a build of<br>
> > the CTS handy so I didn't send it as a 3rd counter-patch.<br>
> ><br>
> > --Jason<br>
> ><br>
> >>><br>
> >>> --<br>
> >>> 2.7.4<br>
> >>><br>
> >>> _______________________________________________<br>
> >>> mesa-dev mailing list<br>
> >>> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> >>> <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
> >><br>
> >><br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > mesa-dev mailing list<br>
> > <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> > <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
> ><br></p>