Brian Paul <[email protected]> writes:

> v2: Also test GL_COMPILE_AND_EXECUTE mode.

> diff --git a/tests/spec/gl-1.4/dlist-multidrawarrays.c 
> b/tests/spec/gl-1.4/dlist-multidrawarrays.c
> new file mode 100644
> index 0000000..b5f6343
> --- /dev/null
> +++ b/tests/spec/gl-1.4/dlist-multidrawarrays.c

> +static bool
> +test_list(GLuint list, GLenum dlmode, const char *func)
> +{
> +     bool pass = true;
> +     const float *exp_color;
> +
> +     assert(dlmode == GL_COMPILE || dlmode == GL_COMPILE_AND_EXECUTE);
> +
> +     if (dlmode == GL_COMPILE_AND_EXECUTE) {
> +             /* the polygon should have been drawn during display
> +              * list construction.
> +              */
> +             exp_color = white;
> +     }
> +     else {
> +             /* the polygon should not have been drawn yet */
> +             exp_color = black;
> +     }
> +     pass = piglit_probe_rect_rgb(0, 0, piglit_width, piglit_height,
> +                                  exp_color);
> +     if (!pass) {
> +             fprintf(stderr,
> +                     "Compiling %s in display list failed for %s mode\n",
> +                     func, piglit_get_gl_enum_name(dlmode));
> +             glDeleteLists(list, 1);
> +             return pass;
> +     }
> +
> +     /* Now, call the list and make sure the polygon is rendered */
> +     glClear(GL_COLOR_BUFFER_BIT);
> +     glCallList(list);
> +
> +     pass = piglit_probe_rect_rgb(0, 0, piglit_width, piglit_height, white);
> +
> +     piglit_present_results();
> +
> +     glDeleteLists(list, 1);
> +
> +     if (!pass) {
> +             fprintf(stderr,
> +                     "Calling %s in display list failed for %s mode\n",
> +                     func, piglit_get_gl_enum_name(dlmode));
> +     }
> +
> +     return pass;
> +}

> +enum piglit_result
> +piglit_display(void)
> +{
> +     bool pass = true;
> +
> +     pass = test_MultiDrawArrays(GL_COMPILE) && pass;
> +     pass = test_MultiDrawArrays(GL_COMPILE_AND_EXECUTE) && pass;
> +     pass = test_MultiDrawElements(GL_COMPILE) && pass;
> +     pass = test_MultiDrawElements(GL_COMPILE_AND_EXECUTE) && pass;
> +     if (piglit_is_extension_supported("GL_IBM_multimode_draw_arrays")) {
> +             pass = test_MultiModeDrawArraysIBM(GL_COMPILE) && pass;
> +             pass = test_MultiModeDrawArraysIBM(GL_COMPILE_AND_EXECUTE)
> +                     && pass;
> +             pass = test_MultiModeDrawElementsIBM(GL_COMPILE) && pass;
> +             pass = test_MultiModeDrawElementsIBM(GL_COMPILE_AND_EXECUTE)
> +                     && pass;
> +     }
> +
> +     piglit_present_results();

Either this piglit_present_results() or the one in test_list should
probably go, since the backbuffer is undefined after the last
present_results.

Other than that, the only thing I saw was that it would have been nice
to test drawcount > 1.  But it covered the bug, so:

Reviewed-by: Eric Anholt <[email protected]>

Attachment: pgp2KcpziW3G1.pgp
Description: PGP signature

_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to