diff options
-rw-r--r-- | tests/all.tests | 1 | ||||
-rw-r--r-- | tests/fbo/fbo-drawbuffers2-colormask.c | 19 |
2 files changed, 18 insertions, 2 deletions
diff --git a/tests/all.tests b/tests/all.tests index 3bdbda3f4..507a64658 100644 --- a/tests/all.tests +++ b/tests/all.tests @@ -2131,6 +2131,7 @@ ext_draw_buffers2 = Group() spec['EXT_draw_buffers2'] = ext_draw_buffers2 add_plain_test(ext_draw_buffers2, 'fbo-drawbuffers2-blend') add_plain_test(ext_draw_buffers2, 'fbo-drawbuffers2-colormask') +add_plain_test(ext_draw_buffers2, 'fbo-drawbuffers2-colormask clear') arb_draw_buffers_blend = Group() spec['ARB_draw_buffers_blend'] = arb_draw_buffers_blend diff --git a/tests/fbo/fbo-drawbuffers2-colormask.c b/tests/fbo/fbo-drawbuffers2-colormask.c index 086c3fb4b..f56cfd7bd 100644 --- a/tests/fbo/fbo-drawbuffers2-colormask.c +++ b/tests/fbo/fbo-drawbuffers2-colormask.c @@ -43,6 +43,8 @@ PIGLIT_GL_TEST_CONFIG_BEGIN PIGLIT_GL_TEST_CONFIG_END +static GLboolean test_clear; + static GLuint attach_texture(int i) { @@ -105,8 +107,13 @@ piglit_display(void) glColorMaskIndexedEXT(0, GL_FALSE, GL_TRUE, GL_FALSE, GL_FALSE); glColorMaskIndexedEXT(1, GL_FALSE, GL_FALSE, GL_TRUE, GL_FALSE); - glColor4fv(white); - piglit_draw_rect(0, 0, piglit_width, piglit_height); + if (test_clear) { + glClearColor(1.0, 1.0, 1.0, 1.0); + glClear(GL_COLOR_BUFFER_BIT); + } else { + glColor4fv(white); + piglit_draw_rect(0, 0, piglit_width, piglit_height); + } glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); @@ -141,6 +148,14 @@ void piglit_init(int argc, char **argv) { GLint num; + int i; + + for (i = 1; i < argc; i++) { + if (strcmp(argv[i], "clear") == 0) { + puts("Testing glClear."); + test_clear = GL_TRUE; + } + } piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE); |