[Piglit] [PATCH] DSA: fix error value for *TextureSubImage* when target doesn't match
Fredrik Höglund
fredrik at kde.org
Thu Apr 23 06:16:37 PDT 2015
On Wednesday 22 April 2015, Ilia Mirkin wrote:
> From the ARB_dsa spec:
>
> An INVALID_ENUM error is generated by *TexSubImage* if <target> does
> not match the command, as shown in table 8.subtarg.
>
> An INVALID_OPERATION error is generated by *TextureSubImage* if the
> effective target of <texture> does not match the command, as shown in
> table 8.subtarg.
>
> Probably the source of the confusion? AFAIK a bunch of spec bugs were
> filed about these little inconsistencies... (But I don't know exactly
> what they were, no Khronos access for me.)
I don't see any inconsistency here.
Section 2.3.1 of the OpenGL specification says:
If a command that requires an enumerated value is passed a symbolic con-
stant that is not one of those specified as allowable for that command, an
INVALID_ENUM error is generated.
In the case of TexSubImage, the <target> parameter has a value that is not
allowed for the command, so INVALID_ENUM is the correct error.
In the case of TextureSubImage, it is the <texture> object that is not
valid for the command, so this makes INVALID_OPERATION the correct error.
> On Wed, Apr 22, 2015 at 11:25 AM, Arthur Huillet <arthur.huillet at free.fr> wrote:
> > From: Arthur Huillet <ahuillet at nvidia.com>
> >
> > Section 8.6 of the OpenGL 4.5 compatibility specification states:
> > "An INVALID_OPERATION error is generated by *TextureSubImage* if
> > the effective target of texture does not match the command, as shown in ta-
> > ble 8.23."
> >
> > Piglit was expecting INVALID_ENUM.
> >
> > Signed-off-by: Arthur Huillet <ahuillet at nvidia.com>
> > ---
> > tests/spec/arb_direct_state_access/texture-errors.c | 14 +++++++++-----
> > 1 file changed, 9 insertions(+), 5 deletions(-)
> >
> > diff --git a/tests/spec/arb_direct_state_access/texture-errors.c b/tests/spec/arb_direct_state_access/texture-errors.c
> > index c79fbc4..fa93ee4 100644
> > --- a/tests/spec/arb_direct_state_access/texture-errors.c
> > +++ b/tests/spec/arb_direct_state_access/texture-errors.c
> > @@ -87,18 +87,22 @@ test_pos_and_sizes(void)
> > glCopyTextureSubImage2D(name, 2, 0, 0, 0, 0, 4, 4);
> > pass &= piglit_check_gl_error(GL_INVALID_OPERATION);
> >
> > - /* To test 1D and 3D entry points, let's try using the wrong functions. */
> > + /* To test 1D and 3D entry points, let's try using the wrong functions.
> > + Section 8.6 of the OpenGL 4.5 compatibility specification states:
> > + "An INVALID_OPERATION error is generated by *TextureSubImage* if
> > + the effective target of texture does not match the command, as shown
> > + in table 8.23."*/
> > glTextureSubImage1D(name, 0, 0, 4, GL_RGBA, GL_FLOAT, NULL);
> > - pass &= piglit_check_gl_error(GL_INVALID_ENUM);
> > + pass &= piglit_check_gl_error(GL_INVALID_OPERATION);
> >
> > glTextureSubImage3D(name, 0, 0, 0, 0, 4, 4, 4, GL_RGBA, GL_FLOAT, NULL);
> > - pass &= piglit_check_gl_error(GL_INVALID_ENUM);
> > + pass &= piglit_check_gl_error(GL_INVALID_OPERATION);
> >
> > glCopyTextureSubImage1D(name, 0, 0, 0, 0, 4);
> > - pass &= piglit_check_gl_error(GL_INVALID_ENUM);
> > + pass &= piglit_check_gl_error(GL_INVALID_OPERATION);
> >
> > glCopyTextureSubImage3D(name, 0, 0, 0, 0, 0, 0, 4, 4);
> > - pass &= piglit_check_gl_error(GL_INVALID_ENUM);
> > + pass &= piglit_check_gl_error(GL_INVALID_OPERATION);
> >
> > return pass;
> > }
> > --
> > 2.3.5
> > _______________________________________________
> > Piglit mailing list
> > Piglit at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/piglit
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>
More information about the Piglit
mailing list