[Mesa-dev] [PATCH] mesa: Fix error condition for 1d array texture

Jason Ekstrand jason at jlekstrand.net
Sat Mar 12 23:08:24 UTC 2016


On Mar 11, 2016 12:33 PM, "Alejandro PiƱeiro" <apinheiro at igalia.com> wrote:
>
> On 11/03/16 20:15, Anuj Phogat wrote:
> > yoffset is also applicable to 1d array textures.
> >
> > Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
> > ---
> > I don't know if it fixes any test, but it looked incorrect to me.
>
> No one fixed doing a piglit all.py run (also no regression). Didn't test
> with a deqp run.

There are very few tests for glGetTexImage.  Not hitting one doesn't mean
much.

> In any case, I also agree that the change seems to make sense.
>
> >
> >  src/mesa/main/texgetimage.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
> > index 06bc8f1..dc21551 100644
> > --- a/src/mesa/main/texgetimage.c
> > +++ b/src/mesa/main/texgetimage.c
> > @@ -1046,7 +1046,7 @@ dimensions_error_check(struct gl_context *ctx,
> >                          "%s(xoffset = %d)", caller, xoffset);
> >              return true;
> >           }
> > -         if (target != GL_TEXTURE_1D && target != GL_TEXTURE_1D_ARRAY)
{
> > +         if (target != GL_TEXTURE_1D) {
> >              if (yoffset % bh != 0) {
> >                 _mesa_error(ctx, GL_INVALID_VALUE,
> >                             "%s(yoffset = %d)", caller, yoffset);

I don't think this is correct.  The check is for compressed textures to
ensure that the texture coordinates are a multiple of the block size of the
texture.  I'm not sure what the rules are for 1-D array compressed textures
(if they even exist) bit I'm pretty sure the compression doesn't cross
slices.  If anything, we probably want to take the check below that looks
at height and pull it into the if too.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160312/373a118a/attachment.html>


More information about the mesa-dev mailing list