On 1 June 2013 05:38, Marek Olšák <[email protected]> wrote: > --- > 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); >
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? 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." ( http://lists.freedesktop.org/archives/piglit/2013-May/005880.html) > + } > + } > } > -- > 1.7.10.4 > > _______________________________________________ > Piglit mailing list > [email protected] > http://lists.freedesktop.org/mailman/listinfo/piglit >
_______________________________________________ Piglit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/piglit
