aboutsummaryrefslogtreecommitdiff
path: root/tests/fbo
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 /tests/fbo
parent4459ee6664e0162f612399223a283eb67b3598bb (diff)
fbo-drawbuffers2-color: test masked clear
Diffstat (limited to 'tests/fbo')
-rw-r--r--tests/fbo/fbo-drawbuffers2-colormask.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/tests/fbo/fbo-drawbuffers2-colormask.c b/tests/fbo/fbo-drawbuffers2-colormask.c
index 086c3fb4..f56cfd7b 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);