summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2013-01-14 19:40:02 +0100
committerMarek Olšák <maraeo@gmail.com>2013-01-18 16:42:06 +0100
commitbb0422c7e85b3b69a79bcde1cab93a46242f69bc (patch)
tree6857764cd69cb37034c9cd0180bbaae07e592b1d
parent4459ee6664e0162f612399223a283eb67b3598bb (diff)
fbo-drawbuffers2-color: test masked clear
-rw-r--r--tests/all.tests1
-rw-r--r--tests/fbo/fbo-drawbuffers2-colormask.c19
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);