[Piglit] [PATCH] Porting basic GL rendering paths test to piglit

Ilia Mirkin imirkin at alum.mit.edu
Fri Aug 28 02:37:34 PDT 2015


On Fri, Aug 28, 2015 at 4:48 AM, Juliet Fru <julietfru at gmail.com> wrote:
> Hello Ilia,
>
>
>
>> > +       }
>> > +
>> > +       /* test always-pass paths */
>> > +       for (i = 0; i < num_paths; i++) {
>> > +               glClear(GL_COLOR_BUFFER_BIT);
>> > +
>> > +               set_path_state(paths[i], ALWAYS_PASS);
>> > +
>> > +               /* draw polygon */
>> > +               piglit_draw_rect(-1,-1,1,1);
>> > +
>> > +               set_path_state(paths[i], DISABLE);
>> > +
>> > +               /* test buffer */
>> > +               GLfloat pixel[3];
>> > +                glReadPixels(4, 4, 1, 1, GL_RGB, GL_FLOAT, pixel);
>> > +                if (pixel[0] != 1.0 || pixel[1] != 1.0 || pixel[2] !=
>> > 1.0) {
>> > +                        printf("\nFAIL: %s, should have had no effect"
>> > +                               " (1, 1, 1) but actually modified the
>> > fragment"
>> > +                               " ( %f, %f, %f)\n", path_name(paths[i]),
>> > pixel[0], pixel[1], pixel[2]);
>> > +                       return PIGLIT_FAIL;
>>
>> You request a double-buffered visual but you never call
>> piglit_present_results... afaik that'll end up with an unfilled window
>> when you run without -fbo -auto... Please double-check that case.
>>
> I think I will have to replace the test buffer section with
> piglit_probe_rect_rgb(), but you could please give a sample correction in
> this case?

Just add a call to piglit_present_results() before you return from the function.

  -ilia


More information about the Piglit mailing list