[Piglit] [PATCH 3/3] copyteximage: verify that GL1.0 legacy formats are rejected

Dylan Baker baker.dylan.c at gmail.com
Thu Dec 17 15:55:58 PST 2015


I've pushed the two patches Ian reviewed.

On Thu, Dec 17, 2015 at 3:35 AM, Erik Faye-Lund <kusmabite at gmail.com> wrote:

> How do I get this series (minus patch 2/3) applied?
>
> On Tue, Aug 25, 2015 at 3:46 PM, Ian Romanick <idr at freedesktop.org> wrote:
> > This patch is
> >
> > Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
> >
> > On 08/24/2015 09:38 PM, Erik Faye-Lund wrote:
> >> The OpenGL 1.0 legacy formats 1, 2, 3 and 4 are not supposed to
> >> be supported for glCopyTexImage. So let's verify that they aren't
> >> accepted.
> >>
> >> Signed-off-by: Erik Faye-Lund <kusmabite at gmail.com>
> >> ---
> >>  tests/texturing/copyteximage.c | 51
> ++++++++++++++++++++++++++++++++++++++++++
> >>  1 file changed, 51 insertions(+)
> >>
> >> diff --git a/tests/texturing/copyteximage.c
> b/tests/texturing/copyteximage.c
> >> index e7e79c7..52a7254 100644
> >> --- a/tests/texturing/copyteximage.c
> >> +++ b/tests/texturing/copyteximage.c
> >> @@ -575,6 +575,7 @@ create_texture(GLenum target)
> >>  enum piglit_result
> >>  piglit_display(void)
> >>  {
> >> +     GLint format;
> >>       GLuint tex;
> >>       GLboolean pass = GL_TRUE;
> >>       const GLfloat *expected;
> >> @@ -614,6 +615,56 @@ piglit_display(void)
> >>                       }
> >>               }
> >>
> >> +             /* Test that internalformats 1, 2, 3 and 4 are not
> accepted
> >> +              * as OpenGL 1.0 backwards-compatible aliases.
> >> +              *
> >> +              * The OpenGL 1.1 spec, section 3.8 ('Texturing') says the
> >> +              * the following about glCopyTexImage2D (and similar for
> >> +              * glCopyTexImage1D):
> >> +              *
> >> +              * Parameters level, internalformat, and border are
> specified
> >> +              * using the same values, with the same meanings, as the
> >> +              * equivalent arguments of TexImage2D, except that
> >> +              * internalformat may not be specified as 1, 2, 3, or 4.
> >> +              */
> >> +             for (format = 1; format <= 4; ++format) {
> >> +                     switch (target[j].target) {
> >> +                     case GL_TEXTURE_1D:
> >> +                     case GL_TEXTURE_1D_ARRAY:
> >> +                             glCopyTexImage1D(target[j].target, 0,
> >> +                                              format,
> >> +                                              0, 0, IMAGE_SIZE, 0);
> >> +                             pass =
> piglit_check_gl_error(GL_INVALID_ENUM) && pass;
> >> +                             break;
> >> +
> >> +                     case GL_TEXTURE_2D:
> >> +                     case GL_TEXTURE_2D_ARRAY:
> >> +                     case GL_TEXTURE_RECTANGLE:
> >> +                             glCopyTexImage2D(target[j].target, 0,
> format,
> >> +                                              0, 0, IMAGE_SIZE,
> IMAGE_SIZE,
> >> +                                              0);
> >> +                             pass =
> piglit_check_gl_error(GL_INVALID_ENUM) && pass;
> >> +                             break;
> >> +
> >> +                     case GL_TEXTURE_CUBE_MAP:
> >> +                             for (i = 0; i < 6; i++) {
> >> +
>  glCopyTexImage2D(cube_face_targets[i],
> >> +                                                      0, format, 0, 0,
> >> +                                                      IMAGE_SIZE,
> >> +                                                      IMAGE_SIZE, 0);
> >> +                                     pass =
> piglit_check_gl_error(GL_INVALID_ENUM) && pass;
> >> +                             }
> >> +                             break;
> >> +
> >> +                     case GL_TEXTURE_3D:
> >> +                             /* There is no glCopyTexImage3D, and
> >> +                              * glCopyTexSubImage3D does not take an
> >> +                              * internalformat argument
> >> +                                 */
> >> +                             continue;
> >> +                     }
> >> +             }
> >> +
> >>               glDeleteTextures(1, &tex);
> >>       }
> >>       if (!piglit_automatic)
> >>
> >
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20151217/13279f52/attachment-0001.html>


More information about the Piglit mailing list