[Piglit] [PATCH 12/20] Move fdo23670-depth_test from bugs to spec dir.

Fabian Bieler fabianbieler at fastmail.fm
Sat Dec 16 19:21:12 UTC 2017


Now it's called "drawpixels-depth-test".

Moved from opengl 1.1 to opengl 1.0 profile in all.py.
---
 tests/all.py                              |  2 +-
 tests/bugs/CMakeLists.gl.txt              |  1 -
 tests/bugs/fdo23670-depth_test.c          | 88 ----------------------------
 tests/spec/gl-1.0/CMakeLists.gl.txt       |  1 +
 tests/spec/gl-1.0/drawpixels-depth-test.c | 96 +++++++++++++++++++++++++++++++
 5 files changed, 98 insertions(+), 90 deletions(-)
 delete mode 100644 tests/bugs/fdo23670-depth_test.c
 create mode 100644 tests/spec/gl-1.0/drawpixels-depth-test.c

diff --git a/tests/all.py b/tests/all.py
index 18a8f05..f5327b5 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -719,6 +719,7 @@ with profile.test_list.group_manager(
     g(['gl-1.0-dlist-bitmap'])
     g(['gl-1.0-dlist-shademodel'])
     g(['gl-1.0-drawpixels-color-index'])
+    g(['gl-1.0-drawpixels-depth-test'])
     g(['gl-1.0-drawbuffer-modes'], run_concurrent=False)
     g(['gl-1.0-edgeflag'])
     g(['gl-1.0-edgeflag-const'])
@@ -762,7 +763,6 @@ with profile.test_list.group_manager(
     g(['copyteximage', '1D'])
     g(['copyteximage', '2D'])
     g(['gl-1.1-read-pixels-after-display-list'])
-    g(['fdo23670-depth_test'])
     g(['fdo23670-drawpix_stencil'])
     g(['tri-tex-crash'])
     g(['vbo-buffer-unmap'])
diff --git a/tests/bugs/CMakeLists.gl.txt b/tests/bugs/CMakeLists.gl.txt
index c9e2cbf..265d405 100644
--- a/tests/bugs/CMakeLists.gl.txt
+++ b/tests/bugs/CMakeLists.gl.txt
@@ -10,7 +10,6 @@ link_libraries (
 	${OPENGL_gl_LIBRARY}
 )
 
-piglit_add_executable (fdo23670-depth_test fdo23670-depth_test.c)
 piglit_add_executable (fdo23670-drawpix_stencil fdo23670-drawpix_stencil.c)
 piglit_add_executable (fdo24066 fdo24066.c)
 piglit_add_executable (fdo25614-genmipmap fdo25614-genmipmap.c)
diff --git a/tests/bugs/fdo23670-depth_test.c b/tests/bugs/fdo23670-depth_test.c
deleted file mode 100644
index 3e9dfad..0000000
--- a/tests/bugs/fdo23670-depth_test.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright © 2009 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>
- */
-
-#include "piglit-util-gl.h"
-
-PIGLIT_GL_TEST_CONFIG_BEGIN
-
-	config.supports_gl_compat_version = 10;
-
-	config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DEPTH | PIGLIT_GL_VISUAL_STENCIL;
-	config.khr_no_error_support = PIGLIT_NO_ERRORS;
-
-PIGLIT_GL_TEST_CONFIG_END
-
-void
-piglit_init(int argc, char **argv)
-{
-	(void) argc;
-	(void) argv;
-
-	/* Don't use piglit_ortho_projection!  This uses a non-default
-	 * depth range!
-	 */
-	glMatrixMode(GL_PROJECTION);
-	glPushMatrix();
-	glLoadIdentity();
-	glOrtho(0, piglit_width, 0, piglit_height, 2, -2);
-
-	glMatrixMode(GL_MODELVIEW);
-	glPushMatrix();
-	glLoadIdentity();
-}
-
-enum piglit_result
-piglit_display(void)
-{
-	static float white[] = {1.0, 1.0, 1.0, 0.0};
-	static float red[] = {1.0, 0.0, 0.0, 0.0};
-	static float blue[] = {0.0, 0.0, 1.0, 0.0};
-	GLboolean pass = GL_TRUE;
-
-	glClearColor(1.0, 1.0, 1.0, 1.0);
-	glDisable(GL_DITHER);
-	glEnable(GL_DEPTH_TEST);
-
-	glClear(GL_COLOR_BUFFER_BIT);
-	glDepthFunc(GL_ALWAYS);
-	glRasterPos3f(0.0, 0.0, 0.5);
-	glDrawPixels(1, 1, GL_RGBA, GL_FLOAT, white);
-	glRasterPos3f(2.0, 0.0, 0.5);
-	glDrawPixels(1, 1, GL_RGBA, GL_FLOAT, white);
-
-	glDepthFunc(GL_LESS);
-	glRasterPos3f(0.0, 0.0, 0.0);
-	glDrawPixels(1, 1, GL_RGBA, GL_FLOAT, red);
-	glRasterPos3f(2.0, 0.0, 1.0);
-	glDrawPixels(1, 1, GL_RGBA, GL_FLOAT, blue);
-
-	pass &= piglit_probe_pixel_rgb(0, 0, red);
-	pass &= piglit_probe_pixel_rgb(2, 0, white);
-
-	piglit_present_results();
-
-	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
-}
diff --git a/tests/spec/gl-1.0/CMakeLists.gl.txt b/tests/spec/gl-1.0/CMakeLists.gl.txt
index ca924e0..0166657 100644
--- a/tests/spec/gl-1.0/CMakeLists.gl.txt
+++ b/tests/spec/gl-1.0/CMakeLists.gl.txt
@@ -15,6 +15,7 @@ piglit_add_executable (gl-1.0-dlist-bitmap dlist-bitmap.c)
 piglit_add_executable (gl-1.0-dlist-shademodel dlist-shademodel.c)
 piglit_add_executable (gl-1.0-drawbuffer-modes drawbuffer-modes.c)
 piglit_add_executable (gl-1.0-drawpixels-color-index drawpixels-color-index.c)
+piglit_add_executable (gl-1.0-drawpixels-depth-test drawpixels-depth-test.c)
 piglit_add_executable (gl-1.0-edgeflag edgeflag.c)
 piglit_add_executable (gl-1.0-edgeflag-const edgeflag-const.c)
 piglit_add_executable (gl-1.0-edgeflag-quads edgeflag-quads.c)
diff --git a/tests/spec/gl-1.0/drawpixels-depth-test.c b/tests/spec/gl-1.0/drawpixels-depth-test.c
new file mode 100644
index 0000000..b213279
--- /dev/null
+++ b/tests/spec/gl-1.0/drawpixels-depth-test.c
@@ -0,0 +1,96 @@
+/*
+ * Copyright © 2009 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>
+ *
+ * Use glDrawPixels with GL_DEPTH_TEST.
+ *
+ * https://bugs.freedesktop.org/show_bug.cgi?id=23670
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+	config.supports_gl_compat_version = 10;
+
+	config.window_visual = PIGLIT_GL_VISUAL_DOUBLE |
+			       PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DEPTH |
+			       PIGLIT_GL_VISUAL_STENCIL;
+	config.khr_no_error_support = PIGLIT_NO_ERRORS;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+void
+piglit_init(int argc, char **argv)
+{
+	(void) argc;
+	(void) argv;
+
+	/* Don't use piglit_ortho_projection!  This uses a non-default
+	 * depth range!
+	 */
+	glMatrixMode(GL_PROJECTION);
+	glPushMatrix();
+	glLoadIdentity();
+	glOrtho(0, piglit_width, 0, piglit_height, 2, -2);
+
+	glMatrixMode(GL_MODELVIEW);
+	glPushMatrix();
+	glLoadIdentity();
+}
+
+enum piglit_result
+piglit_display(void)
+{
+	static float white[] = {1.0, 1.0, 1.0, 0.0};
+	static float red[] = {1.0, 0.0, 0.0, 0.0};
+	static float blue[] = {0.0, 0.0, 1.0, 0.0};
+	GLboolean pass = GL_TRUE;
+
+	glClearColor(1.0, 1.0, 1.0, 1.0);
+	glDisable(GL_DITHER);
+	glEnable(GL_DEPTH_TEST);
+
+	glClear(GL_COLOR_BUFFER_BIT);
+	glDepthFunc(GL_ALWAYS);
+	glRasterPos3f(0.0, 0.0, 0.5);
+	glDrawPixels(1, 1, GL_RGBA, GL_FLOAT, white);
+	glRasterPos3f(2.0, 0.0, 0.5);
+	glDrawPixels(1, 1, GL_RGBA, GL_FLOAT, white);
+
+	glDepthFunc(GL_LESS);
+	glRasterPos3f(0.0, 0.0, 0.0);
+	glDrawPixels(1, 1, GL_RGBA, GL_FLOAT, red);
+	glRasterPos3f(2.0, 0.0, 1.0);
+	glDrawPixels(1, 1, GL_RGBA, GL_FLOAT, blue);
+
+	pass &= piglit_probe_pixel_rgb(0, 0, red);
+	pass &= piglit_probe_pixel_rgb(2, 0, white);
+
+	piglit_present_results();
+
+	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
+}
-- 
2.7.4



More information about the Piglit mailing list