[Piglit] =?y?q?=5BPATCH=5D=20clear-accum=3A=20New=20test=20for=20i965=20driver=20bug?=

Shuang He shuang.he at intel.com
Wed Jan 4 23:55:55 PST 2012


v4: Fix probing only half of rendering result (Thanks for Brian Paul)
v3: Add test case to all.tests
v2: Verify result of clearing accum buffer (Brian Paul's suggestion)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43783
Signed-off-by: Shuang He <shuang.he at intel.com>
---
 tests/all.tests                 |    1 +
 tests/general/CMakeLists.gl.txt |    1 +
 tests/general/clear-accum.c     |   60 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 62 insertions(+), 0 deletions(-)
 create mode 100644 tests/general/clear-accum.c

diff --git a/tests/all.tests b/tests/all.tests
index 8dab27b..f3a301b 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -312,6 +312,7 @@ add_plain_test(general, 'vbo-map-remap')
 add_plain_test(general, 'vbo-subdata-sync')
 add_plain_test(general, 'vbo-subdata-zero')
 add_plain_test(general, 'windowoverlap')
+add_plain_test(general, 'clear-accum')
 add_fbo_depthstencil_tests(general, 'default_fb')
 
 shaders = Group()
diff --git a/tests/general/CMakeLists.gl.txt b/tests/general/CMakeLists.gl.txt
index f8c5ddf..90711c6 100644
--- a/tests/general/CMakeLists.gl.txt
+++ b/tests/general/CMakeLists.gl.txt
@@ -124,5 +124,6 @@ add_executable (object_purgeable-api-vbo object_purgeable-api-vbo.c object_purge
 add_executable (occlusion_query occlusion_query.c)
 add_executable (occlusion-query-discard occlusion-query-discard.c)
 add_executable (quad-invariance quad-invariance.c)
+add_executable (clear-accum clear-accum.c)
 
 # vim: ft=cmake:
diff --git a/tests/general/clear-accum.c b/tests/general/clear-accum.c
new file mode 100644
index 0000000..b50579d
--- /dev/null
+++ b/tests/general/clear-accum.c
@@ -0,0 +1,60 @@
+/*
+ * Copyright © 2011 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Authors:
+ *    Shuang He <shuang.he at intel.com>
+ *
+ */
+
+/** @file clear_accum.c
+ *
+ * Tests that clear accum buffer
+ */
+
+#include "piglit-util.h"
+
+int piglit_width = 400;
+int piglit_height = 200;
+int piglit_window_mode = GLUT_RGB | GLUT_DOUBLE | GLUT_ACCUM;
+
+enum piglit_result
+piglit_display(void)
+{
+	return PIGLIT_PASS;
+}
+
+void
+piglit_init(int argc, char **argv)
+{
+	GLboolean pass = GL_TRUE;
+	static float green[] = {0.0, 1.0, 0.0, 0.0};
+
+	glClearAccum(0, 1, 0, 0);
+	glClear(GL_ACCUM_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
+	glAccum(GL_RETURN, 1.0);
+	pass &= piglit_probe_rect_rgb(0, 0, piglit_width, piglit_height, green);
+
+	if (pass)
+		piglit_report_result(PIGLIT_PASS);
+	else
+		piglit_report_result(PIGLIT_FAIL);
+}
-- 
1.7.4.rc2.21.g8671.dirty



More information about the Piglit mailing list