[Piglit] [PATCH 5/5] textureSize: Add support for running with core GL.

Chris Forbes chrisf at ijw.co.nz
Fri Nov 23 12:58:53 PST 2012


I think something is off with the piglit-waffle compatibility semantics.

The test declares that it works with core >=3.1 and legacy >=1.0. Surely if
your driver can't do core 3.1, the test should be at least trying a legacy
context?

-- Chris


On Sat, Nov 24, 2012 at 7:30 AM, Marek Olšák <maraeo at gmail.com> wrote:

> Hi Eric,
>
> this patch breaks textureSize on drivers which fail to create a 3.1
> core context.
>
> The test fails with the GLXBadFBConfig error. I'm using waffle.
>
> Marek
>
> On Thu, Nov 1, 2012 at 7:36 PM, Eric Anholt <eric at anholt.net> wrote:
> > This lets the textureSize tests for TBOs run on i965.
> > ---
> >  tests/spec/arb_texture_buffer_object/formats.c |    1 +
> >  tests/texturing/shaders/textureSize.c          |   18 ++++++++++++++++--
> >  2 files changed, 17 insertions(+), 2 deletions(-)
> >
> > diff --git a/tests/spec/arb_texture_buffer_object/formats.c
> b/tests/spec/arb_texture_buffer_object/formats.c
> > index d1ff57d..05a6e2c 100644
> > --- a/tests/spec/arb_texture_buffer_object/formats.c
> > +++ b/tests/spec/arb_texture_buffer_object/formats.c
> > @@ -538,6 +538,7 @@ piglit_display(void)
> >         glGenBuffers(1, &vbo);
> >         glBindBuffer(GL_ARRAY_BUFFER_ARB, vbo);
> >         if (piglit_get_gl_version() >= 31) {
> > +               GLuint vao;
> >                 glGenVertexArrays(1, &vao);
> >                 glBindVertexArray(vao);
> >         }
> > diff --git a/tests/texturing/shaders/textureSize.c
> b/tests/texturing/shaders/textureSize.c
> > index 98191b8..9168458 100644
> > --- a/tests/texturing/shaders/textureSize.c
> > +++ b/tests/texturing/shaders/textureSize.c
> > @@ -49,6 +49,7 @@
> >  PIGLIT_GL_TEST_CONFIG_BEGIN
> >
> >         config.supports_gl_compat_version = 10;
> > +       config.supports_gl_core_version = 31;
> >
> >         config.window_width = 150;
> >         config.window_height = 30;
> > @@ -98,11 +99,25 @@ piglit_display()
> >                  1,  1,
> >                  1, -1,
> >         };
> > +       GLuint vbo;
> >
> >         glClearColor(0.5, 0.5, 0.5, 1.0);
> >         glClear(GL_COLOR_BUFFER_BIT);
> >
> > -       glVertexAttribPointer(vertex_location, 2, GL_FLOAT, GL_FALSE, 0,
> verts);
> > +       /* For GL core, we need to have a vertex array object bound.
> > +        * Otherwise, we don't particularly have to.  Always use a
> > +        * vertex buffer object, though.
> > +        */
> > +       if (piglit_get_gl_version() >= 31) {
> > +               GLuint vao;
> > +               glGenVertexArrays(1, &vao);
> > +               glBindVertexArray(vao);
> > +       }
> > +       glGenBuffers(1, &vbo);
> > +       glBindBuffer(GL_ARRAY_BUFFER, vbo);
> > +       glBufferData(GL_ARRAY_BUFFER, sizeof(verts), verts,
> GL_STREAM_DRAW);
> > +
> > +       glVertexAttribPointer(vertex_location, 2, GL_FLOAT, GL_FALSE, 0,
> 0);
> >         glEnableVertexAttribArray(vertex_location);
> >
> >         /* Draw consecutive squares for each mipmap level */
> > @@ -130,7 +145,6 @@ piglit_display()
> >         }
> >
> >         glDisableVertexAttribArray(vertex_location);
> > -
> >         piglit_present_results();
> >
> >         return pass ? PIGLIT_PASS : PIGLIT_FAIL;
> > --
> > 1.7.10.4
> >
> > _______________________________________________
> > 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20121124/36f6fd5e/attachment-0001.html>


More information about the Piglit mailing list