[Piglit] [PATCH 1/5] clearbuffer-display-lists: Fix initial clear color test.

Eric Anholt eric at anholt.net
Thu Nov 1 11:36:53 PDT 2012


The test claimed that the default value was 0,0,0,1, but the GL 3.0
spec page 263 disagrees.  The test saw 0,0,0,1 when it was written
because a visual with no alpha happened to be chosen, but there's no
guarantee that you don't have alpha, so fix the test, and ask for
alpha in the test so that we can reliably check those bits.
---
 tests/spec/gl-3.0/api/clearbuffer-common.c        |    2 +-
 tests/spec/gl-3.0/api/clearbuffer-display-lists.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/spec/gl-3.0/api/clearbuffer-common.c b/tests/spec/gl-3.0/api/clearbuffer-common.c
index dec9faf..d225a8a 100644
--- a/tests/spec/gl-3.0/api/clearbuffer-common.c
+++ b/tests/spec/gl-3.0/api/clearbuffer-common.c
@@ -36,7 +36,7 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.window_width = 100;
 	config.window_height = 100;
-	config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;
+	config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_ALPHA | PIGLIT_GL_VISUAL_DOUBLE;
 
 PIGLIT_GL_TEST_CONFIG_END
 
diff --git a/tests/spec/gl-3.0/api/clearbuffer-display-lists.c b/tests/spec/gl-3.0/api/clearbuffer-display-lists.c
index 621fd81..4d9bda2 100644
--- a/tests/spec/gl-3.0/api/clearbuffer-display-lists.c
+++ b/tests/spec/gl-3.0/api/clearbuffer-display-lists.c
@@ -36,7 +36,7 @@
 
 void piglit_init(int argc, char **argv)
 {
-	static const float initial_color[4]  = { 0.0, 0.0, 0.0, 1.0 };
+	static const float initial_color[4]  = { 0.0, 0.0, 0.0, 0.0 };
 	static const float first[4]  = { 0.5, 0.4, 0.3, 1.0 };
 	static const float second[4] = { 0.8, 0.0, 0.8, 1.0 };
 	static const float third[4] = { 1.0, 0.3, 0.7, 1.0 };
@@ -47,7 +47,7 @@ void piglit_init(int argc, char **argv)
 	glClear(GL_COLOR_BUFFER_BIT);
 
 	/* Probe the color buffer before creating display list. Default clear
-	 * color is (0.0, 0.0, 0.0, 1.0)
+	 * color is (0.0, 0.0, 0.0, 0.0)
 	 */
 	pass = piglit_probe_rect_rgba(0, 0,
 				      piglit_width, piglit_height,
-- 
1.7.10.4



More information about the Piglit mailing list