---
 tests/all.tests            |    1 +
 tests/general/read-front.c |   15 ++++++++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/tests/all.tests b/tests/all.tests
index 417ca08..058253d 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -526,6 +526,7 @@ add_concurrent_test(gl11, 'polygon-mode-offset')
 add_concurrent_test(gl11, 'push-pop-texture-state')
 add_concurrent_test(gl11, 'quad-invariance')
 add_plain_test(gl11, 'read-front')
+add_plain_test(gl11, 'read-front clear-front-first')
 add_concurrent_test(gl11, 'readpix-z')
 add_plain_test(gl11, 'roundmode-getintegerv')
 add_plain_test(gl11, 'roundmode-pixelstore')
diff --git a/tests/general/read-front.c b/tests/general/read-front.c
index e6833dc..bce00c6 100644
--- a/tests/general/read-front.c
+++ b/tests/general/read-front.c
@@ -55,7 +55,6 @@ piglit_display(void)
 
        piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
 
-       glClearColor(0.0, 0.0, 1.0, 0.0);
        glClear(GL_COLOR_BUFFER_BIT);
        glColor4fv(green);
        piglit_draw_rect(0, piglit_height / 2, piglit_width, piglit_height);
@@ -78,4 +77,18 @@ piglit_display(void)
 void
 piglit_init(int argc, char **argv)
 {
+       int i;
+
+       glClearColor(0.0, 0.0, 1.0, 0.0);
+
+       for (i = 1; i < argc; i++) {
+               if (strcmp(argv[i], "clear-front-first") == 0) {
+                       /* This should allocate the front buffer in the driver
+                        * if it hasn't been allocated already.
+                        */
+                       glDrawBuffer(GL_FRONT);
+                       glClear(GL_COLOR_BUFFER_BIT);
+                       glDrawBuffer(GL_BACK);
+               }
+       }
 }
-- 
1.7.10.4

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

Reply via email to