<div dir="ltr">On 1 June 2013 05:38, Marek Olšák <span dir="ltr"><<a href="mailto:maraeo@gmail.com" target="_blank">maraeo@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
 tests/all.tests            |    1 +<br>
 tests/general/read-front.c |   15 ++++++++++++++-<br>
 2 files changed, 15 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/tests/all.tests b/tests/all.tests<br>
index 417ca08..058253d 100644<br>
--- a/tests/all.tests<br>
+++ b/tests/all.tests<br>
@@ -526,6 +526,7 @@ add_concurrent_test(gl11, 'polygon-mode-offset')<br>
 add_concurrent_test(gl11, 'push-pop-texture-state')<br>
 add_concurrent_test(gl11, 'quad-invariance')<br>
 add_plain_test(gl11, 'read-front')<br>
+add_plain_test(gl11, 'read-front clear-front-first')<br>
 add_concurrent_test(gl11, 'readpix-z')<br>
 add_plain_test(gl11, 'roundmode-getintegerv')<br>
 add_plain_test(gl11, 'roundmode-pixelstore')<br>
diff --git a/tests/general/read-front.c b/tests/general/read-front.c<br>
index e6833dc..bce00c6 100644<br>
--- a/tests/general/read-front.c<br>
+++ b/tests/general/read-front.c<br>
@@ -55,7 +55,6 @@ piglit_display(void)<br>
<br>
        piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);<br>
<br>
-       glClearColor(0.0, 0.0, 1.0, 0.0);<br>
        glClear(GL_COLOR_BUFFER_BIT);<br>
        glColor4fv(green);<br>
        piglit_draw_rect(0, piglit_height / 2, piglit_width, piglit_height);<br>
@@ -78,4 +77,18 @@ piglit_display(void)<br>
 void<br>
 piglit_init(int argc, char **argv)<br>
 {<br>
+       int i;<br>
+<br>
+       glClearColor(0.0, 0.0, 1.0, 0.0);<br>
+<br>
+       for (i = 1; i < argc; i++) {<br>
+               if (strcmp(argv[i], "clear-front-first") == 0) {<br>
+                       /* This should allocate the front buffer in the driver<br>
+                        * if it hasn't been allocated already.<br>
+                        */<br>
+                       glDrawBuffer(GL_FRONT);<br>
+                       glClear(GL_COLOR_BUFFER_BIT);<br>
+                       glDrawBuffer(GL_BACK);<br></blockquote><div><br></div><div>In general accessing the front buffer isn't safe to do until after the window has been exposed, and the window isn't guaranteed to have been exposed by the time piglit_init() is called.  I think this clear call should be moved into piglit_display().  Would that still reproduce your bug?<br>
<br>Note that at the moment, piglit_display() also is called before the window is exposed, but I have a patch out on the list to fix that: "util/x11: Wait for expose event in manual mode or with front buffer tests." (<a href="http://lists.freedesktop.org/archives/piglit/2013-May/005880.html">http://lists.freedesktop.org/archives/piglit/2013-May/005880.html</a>)<br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+               }<br>
+       }<br>
 }<br>
<span class=""><font color="#888888">--<br>
1.7.10.4<br>
<br>
_______________________________________________<br>
Piglit mailing list<br>
<a href="mailto:Piglit@lists.freedesktop.org">Piglit@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/piglit" target="_blank">http://lists.freedesktop.org/mailman/listinfo/piglit</a><br>
</font></span></blockquote></div><br></div></div>