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

Anuj Phogat anuj.phogat at gmail.com
Tue Mar 15 17:47:18 UTC 2016


On Sat, Mar 12, 2016 at 3:08 PM, Jason Ekstrand <jason at jlekstrand.net>
wrote:

>
> 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.
>
In a quick look at GL spec I couldn't find any special rules for 1-D array
compressed textures. But, looking at the description of
glGetCompressedTextureSubImage() in OpenGL 4.5 specification:

"An INVALID_VALUE error is generated if xoffset, yoffset or zoffset is not
a multiple of the compressed block width, height or depth respectively."

In above statement there are no restrictions on the texture target. So, it
looks like we can completely drop the if statement checking for 1D targets.

>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160315/83ff5ffe/attachment.html>


More information about the mesa-dev mailing list